Difference between revisions of "Video conversion"

From Linuxintro
imported>ThorstenStaerk
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
= convert dv video to avi =
 
= convert dv video to avi =
 
dv videos come e.g. from a [[camcorder]].
 
dv videos come e.g. from a [[camcorder]].
  [[mencoder]] ''test.dv'' -o ''test.avi'' -vf yadif,harddup <html><acronym title="output audio codec comes from libavcodec">-oac lavc</acronym></html> <html><acronym title="output video codec comes from libavcodec">-ovc lavc</acronym></html>
+
  [[mencoder]] test.dv -o test.avi -vf pp=ci <html><acronym title="Output audio codec comes from libavcodec. To list all available audio codes, call mencoder -oac help.">-oac pcm</acronym> <acronym title="Output video codec comes from libavcodec. To list all available codecs, call mencoder -ovc help.">-ovc x264</acronym></html>
{| class="wikitable sortable" border=1
+
 
! key !! possible values
+
OR
|-
+
 
| '''-vf''' || '''yadif,harddup''' (deinterlace using yadiff, eliminate duplicate frames); '''pp=ci''' (cubic interpolation)
+
/usr/bin/ffmpeg -threads 2 -f dv -i capture003.dv -vcodec h264 -g 30 -deinterlace -b 900k -s 640x360 -aspect 4:3 -acodec mp3 -ab 64k output.avi
|-
 
| '''-oac''' (output audio codec) || '''lavc''' (libavcodec); '''libmp3lame'''; '''x264'''
 
|-
 
|}
 
  
 
= convert video to 3gp =
 
= convert video to 3gp =
Line 15: Line 11:
 
  mencoder ''INPUTFILE'' -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o movie.avi -ofps 12
 
  mencoder ''INPUTFILE'' -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o movie.avi -ofps 12
  
  [[mplayer]] -vo null -ao pcm -af resample=8000,volume=+4db:sc ''INPUTFILE''
+
  mplayer -vo null -ao pcm -af resample=8000,volume=+4db:sc ''INPUTFILE''
  
 
  [[ffmpeg]] -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 ''OUTPUTFILE''
 
  [[ffmpeg]] -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 ''OUTPUTFILE''
Line 32: Line 28:
 
= Convert a DVD to a file =
 
= Convert a DVD to a file =
 
  mencoder dvd://1 -oac mp3lame -lameopts br=192 -ovc lavc -lavcopts vcodec=mpeg4:vhq -o output.avi
 
  mencoder dvd://1 -oac mp3lame -lameopts br=192 -ovc lavc -lavcopts vcodec=mpeg4:vhq -o output.avi
 +
 +
Webmaster, I am the admin at .  We profile SEO Plugins for WordPress blogs for on-site and off-site SEO.  I'd like to viinte you to check out our recent profile for a pretty amazing plugin which can double or triple traffic for a Worpdress blog.  You can delete this comment, I didn't want to comment on your blog, just wanted to drop you a personal message.  Thanks,  Rich
  
 
= TroubleShooting =
 
= TroubleShooting =
Line 39: Line 37:
 
* the converter
 
* the converter
  
For example I got when starting mplayer
+
For example using mencoder made a video with sound out of sync. Using -oac pcm resolved this problem.
Requested audio codec family [mpg123] (afm=mpg123) not available.
 
Enable it at compilation.
 
 
 
  
 
= See also =
 
= See also =
Line 49: Line 44:
 
* [[video conversion software]]
 
* [[video conversion software]]
 
* http://wiki.linuxquestions.org/wiki/Video_conversiOn
 
* http://wiki.linuxquestions.org/wiki/Video_conversiOn
 +
* http://en.linuxreviews.org/HOWTO_Convert_video_files

Latest revision as of 10:26, 1 March 2020

convert dv video to avi

dv videos come e.g. from a camcorder.

mencoder test.dv -o test.avi -vf pp=ci <html><acronym title="Output audio codec comes from libavcodec. To list all available audio codes, call mencoder -oac help.">-oac pcm</acronym> <acronym title="Output video codec comes from libavcodec. To list all available codecs, call mencoder -ovc help.">-ovc x264</acronym></html>

OR

/usr/bin/ffmpeg -threads 2 -f dv -i capture003.dv -vcodec h264 -g 30 -deinterlace -b 900k -s 640x360 -aspect 4:3 -acodec mp3 -ab 64k output.avi

convert video to 3gp

3gp videos come e.g. from a mobile phone.

mencoder INPUTFILE -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o movie.avi -ofps 12
mplayer -vo null -ao pcm -af resample=8000,volume=+4db:sc INPUTFILE
ffmpeg -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 OUTPUTFILE

convert 3gp-Video to DivX

mencoder -ovc divx4 vid.3gp -o vid.avi

convert video for Palm

mencoder source.mpg -ofps 15 -srate 24000 -oac mp3lame -lameopts cbr:br=32:vol=5:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=96:vhq: \
keyint=300 -vop scale=480:320 -o target.avi

or

mencoder source.mpg -srate 24000 -oac mp3lame -lameopts cbr:br=32:vol5:mode=3\
-fps 30 -ofps 30 -ovc lavc -vop scale=320:240 -o target.avi

Convert a DVD to a file

mencoder dvd://1 -oac mp3lame -lameopts br=192 -ovc lavc -lavcopts vcodec=mpeg4:vhq -o output.avi

Webmaster, I am the admin at . We profile SEO Plugins for WordPress blogs for on-site and off-site SEO. I'd like to viinte you to check out our recent profile for a pretty amazing plugin which can double or triple traffic for a Worpdress blog. You can delete this comment, I didn't want to comment on your blog, just wanted to drop you a personal message. Thanks, Rich

TroubleShooting

Sound is out of sync

If you convert a video and sound is out of sync after the conversion, you need to look at

  • the video player
  • the converter

For example using mencoder made a video with sound out of sync. Using -oac pcm resolved this problem.

See also