To convert mkv format to dvd format:
ffmpeg -i myfile.mkv -target dvd -copyts -aspect 16:9 myfile.mpg
To convert mp4 video to avi:
mencoder video.mp4 -ovc lavc -vf scale=352:288 -oac lavc -o video.avi
To convert avi to mpeg video:
ffmpeg -i video.avi -target pal-vcd video.mpg
or
ffmpeg -i video.avi -target pal-vcd -s 352x192 -padtop 32 -padbottom 32 video.mpg
Note: -target pal-vcd is for PAL. For NTSC, use -target ntsc-vcd. -padtop 32 and -padbottom 32 will add black padding at the top and bottom.
In certain cases, if you have problem with de-sync audio for the resulted mpeg, try using mencoder like this for PAL format VCD:
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25 \
-o movie.mpg movie.avi
More options can be found here.
To convert avi to SVCD format:
ffmpeg -i video.avi -target pal-svcd video.mpg
Note: -target pal-svcd is for PAL. For NTSC, use -target ntsc-svcd.
Burn to CDs
This command will cut the mpeg video files into 3 to fit 3 CDs.
mpgtx -3 video.mpg -b m
The resulting file will be m-1.mpg, m-2.mpg and m-3.mpg. These files can be burnt to one CD each. The argument -b means basename.
or you can also use avisplit to split AVI movie:
avisplit -s 700 -i video.avi
Where to get the tools?
If you use Fedora, you can install all of the tools with yum. For other distro, please consult the manual for it. avisplit is part of transcode package.
Fixing desynched audio
This does not work with AVIs that use VBR/ABR MP3s. This step uses
avisync
which is part of the transcode package.
avisync
is easy to use: just provide an input file (-i name.avi
), an output file (-o newname.avi
) and the synchronization offset in frames (-n count
). From avisync
's help: count>0: audio starts with frame 'count'. count>0: prepend 'count' padding audio frames
.
An example:avisync -i ally-not-synched.avi -o ally-synched.avi -n -2
Splitting AVIs
avisplit
is easy to use: just provide an input file (-i name.avi
) and when it should split. You can split after a fixed size (-s size_in_megs
), after a number of frames (-f f1-f2
) or after a number of seconds (-t s1-s2
). An example: avisplit -i ally-big-file.avi -o ally -s 700
This will produce files named ally-0000.avi, ally-0001.avi
etc. that are each 100megs big at most.
Extracting audio from VOBs/MPEGs/AVIs
MPlayer can be used easily to extract sound. The-vo null
options tells MPlayer not to show the video. - VOB -> AC3:
mplayer -vo null -nogui -alang de -dumpaudio -dumpfile lang-de.ac3 *vob
This will extract the German audio to a file calledlang-de.ac3
. - VOB -> WAV:
mplayer -vo null -nogui -aid 128 -ao pcm -aofile lang-de.wav *vob
This will extract audio track no. 128, downmix the AC3 sound to PCM and write the results tolang-de.wav
. - MPG -> MP2:
mplayer -vo null -nogui -dumpaudio -dumpfile audio.mp2 myvideo.mpg
This will extract the audio to a file calledaudio.mp2
. - AVI -> WAV:
mplayer -vo null -nogui -ao pcm -aofile audio.wav myvideo.avi
This will extract the audio, convert it to PCM and write the resulting .WAV toaudio.wav
.
I'm not listing all possible options. Generally use
-dumpaudio -dumpfile newaudio.extension
if you want to extract the audio without processing and -ao pcm -aofile newaudio.wav
if you want the WAV itself.Using separate audio files
Sometimes you want to play another audio file along with your video. MPlayer makes this rather easy:mplayer -audiofile anotherlang.mp3 myvideo.avi
plays video from myvideo.avi
and audio from anotherlang.mp3
. A lot of Windows media players support external audio files, too. This way you can provide several language versions as separate audio files. A combination often used is to have the AVI include the English audio track and to provide additional audio tracks in separate files.A visual AVI editor: avidemux
If you've done video editing with Windows before you probably know the excellent OpenSource editor VirtualDub. An OpenSource utility for Linux that aims at providing the user with a similar set of features is avidemux. You can use it in order to easily cut specific parts from a movie, to apply filters, to reencode movies and to do a lot more. I suggest you take a look at it even if using the command line is as natural to you as it is for me.
Credit to :
moritz@bunkus.org (http://www.bunkus.org)
Gentoo Wiki (http://gentoo-wiki.com/HOWTO_Create_a_VCD_or_SVCD)
MPlayer Doc (http://www.mplayerhq.hu/DOCS/HTML/en/index.html)
Credit to :
moritz@bunkus.org (http://www.bunkus.org)
Gentoo Wiki (http://gentoo-wiki.com/HOWTO_Create_a_VCD_or_SVCD)
MPlayer Doc (http://www.mplayerhq.hu/DOCS/HTML/en/index.html)
6 comments:
nice tips. yeah, for me, i using ffmpeg to convert my avi files.
thank you for sharing this.
vob to avi
"MPlayer can be used easily to extract sound. The -vo null options tells MPlayer not to show the video." http://www.convert-avitomp4.com/product.html
I have tried FFMPEG many times but it never produces a satisfied video for me. Eventually I gave up it and found a great video converter program.
Hmmm. But it doesnt support Linux.
In fact, I always use this video converter to converter any videos to the format which I want. And you know it never fail.
Good to know that. Tam Ring.
Post a Comment