(Modified 2009 Oct 24)
Video players
really-quiet=yes
Video editors
ffmpeg
The console commands have the basic syntax:
ffmpeg -i input.mp4 [options] output.mpg
I'll write the new parameters in bold. To convert to EGA (320x240), the command would be:
ffmpeg -i input.mp4 -s ega output.mpg
Here are some formats that I noted. I believe either the name or the dimensions can be understood.
My camcorder has a wide-angle aspect ratio, and the ratio may be explicitly required:
ffmpeg -i input.mp4 -s ega -aspect 16:9 output.mpg
The default bitrates (especially for video) are low, particularly bad for large video formats, meaning the videos will look very blocky using default settings. The flag for video bitrate is -b and for audio, -ab:
ffmpeg -i input.mp4 -s ega -aspect 16:9 -b 1400k -ab 128k output.mpg
The default video bitrate was 200k, much different than what I would prefer. The default audio bitrate is 64k, not so different than what I specified.
Next, I specified MPEG-2 output. The default is MPEG-1. I needed to install the following software:
The syntax is:
ffmpeg -i input.mp4 -s ega -aspect 16:9 -b 1400k -ab 128k -vcodec mpeg2video output.mpg
MPEG-2 looked better to my eye, and supposedly it is better then MPEG-1 at high bitrate.
One last trick that I didn't find very useful was two-pass recording. Still, it was hard to find simple directions, so I'll show how here. The keys are the -pass {1,2} flag and the -passlogfile flag. The passlogfile must be the same from the first pass to the second.
ffmpeg -i input.mp4 -s ega -aspect 16:9 -b 1400k -ab 128k -vcodec mpeg2video -pass 1 -passlogfile logfile output1.mpg ffmpeg -i input.mp4 -s ega -aspect 16:9 -b 1400k -ab 128k -vcodec mpeg2video -pass 2 -passlogfile logfile output2.mpg
It was unclear before I tried that each pass is done separately, and that you need to know before the first pass that you'll do a second.
To trim a video, the -ss flag marks the beginning of the clip, and the -t flag marks the duration. For both flags, either hh:mm:ss notation or just plain seconds works, e.g.:
ffmpeg -i input.mp4 -ss 00:01:42 -t 62 -s ega -aspect 16:9 -b 1400k -ab 128k -vcodec mpeg2video output.mpg
However, when I use a non-zero start time, the audio and video are no longer synchronized. I found an inelegant solution between KKoncepts and howto-pages.org, using the -itsoffset flag. First, the magnitude of the delay must be determined empirically, such as using mplayer, using the +/- keys. Second, we must give ffmpeg separate inputs for the video and audio streams. The -itsoffset flag will precede the delayed stream. The -map flag will tell ffmpeg from which input which stream is derived, e.g.:
ffmpeg -ss 00:01:42 -i input.mp4 -itsoffset 1.5 -ss 00:01:42 -i HDV_0135.MP4 -map 1:0 -map 0:1 -t 62 -s ega -aspect 16:9 -b 1400k -ab 128k -vcodec mpeg2video output.mpg
To understand the -map flag, note that ffmpeg numbers things starting from zero.
The first -map 1:0 flag takes from the second input file ("1"), the first stream ("0") as the video source.
The second -map 0:1 flag takes from the first input file ("0"), the second stream ("1") as the audio source.
Note that we had to repeat the delay using the -ss flag for the second stream.
This page is Lynx-enhanced