You are not logged in.
Pages: 1
Hi!
I am making a video from png images. I found a script on Mplayer page that does this:
mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc lavc \
-lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi
I have 2 questions, because I am new to all under the hood stuff for video making:
-Is my script making the video in best possible quality (when the output file is not tooo huge)?
-How can I add an audiofile.mp3 to the video?
Last edited by skazhy (2010-07-06 09:52:29)
Offline
Maybe try adding -audiofile music.mp3 prior to -oac, sth like this:
mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc lavc \
-lavcopts vcodec=mpeg4:mbd=2:trell -audiofile music.mp3 -oac copy -o output.avi
Also check this page, maybe you'll get helped.
Offline
There is no "best". It's all compromises and depends on what you want to achieve. Also, what codec do you wish to use. If it's MPEG4 ASP, then Xvid is better than the libavcodec ASP encoder. But both pale in comparison to x264, which is a MPEG4 AVC/h264 encoder.
In your command-line, you don't even specify bitrate, so I have no idea what will be the result. To help you further, you need to answer these: Who is the target audience of the video, where will they play it (computer or standalone player), and what kind of video is it (animation, computer game, CGI, live action...)? Knowing that, we'll decide between xvid or x264 and the appropriate options.
Offline
If this helps:
the video is composed from many png images (a time-lapse video). It is for playing on PCs and it will be uploaded to vimeo or youtube.
The images are from webcam, so they are not in very high quality.
Offline
You could give h264enc (AUR) a try. That's a shell script which includes many many quality presets etc.
Offline
Youtube (and probably vimeo too) will re-encode the video, and you say the pics are not very high quality. So in order for the end result to not look like a total mess, we'll provide youtube with the highest quality possible - which means we're going with x264:
mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc x264 -x264encopts preset=slow:tune=film:crf=20 -of rawvideo -o video.264
If you have a fast processor (dual or quad core), you can use slower or veryslow for the preset to squeeze out even more quality. crf is constant ratefactor, also called constant quality, and with it x264 will use as much bits as necessary to achieve the specified ratefactor. 20 is a ballpark figure that I've found provides good quality with not-too-large filesizes. Lower crf means bigger file with better quality, higher crf means smaller file with worse quality.
Once you have the video, install mkvtoolnix to combine video and audio:
mkvmerge -o yourvideo.mkv --default-duration 0:25fps -d 0 video.264 -a 0 audiofile.mp3
Offline
Thank you very much, Gusar, for your help
Offline
Pages: 1