Conversão de Formatos Vídeos e extras

De MochilaWiki
Revisão de 02h07min de 23 de julho de 2011 por Banto Palmarino (discussão | contribs)
Ir para navegaçãoIr para pesquisar

>> usando ffmpeg para converter arquivos de videos

$ ffmpeg -formats - para obter formatos suportados

mais usados:

  • mpeg2video mjpeg indeo3 theora dvvideo mpge1video
  • dvvideo DV video format
  • mjpeg MJPEG video
  • mpeg MPEG1 System format
  • mpeg1video MPEG video
  • mpeg2video MPEG2 video
  • rawvideo raw video format
  • theora Theora Video

sintaxes

  • - i arquivo nome do arquivo de entrada
  • - s tamanho tamanho do quadro (WxH, ex: 320x240)
  • - vcodec codec vide video codec
  • -sameq usar mesma qualidade do video original
  • -acodec codec audio codec
  • -an desabilite a conversar de áudio

mais informações em "man ffmpeg"

exemplos

um arquivo mov para o tamanho 320x240 com a mesma qualidade do original em no formato avi sem altera o som

$ ffmpeg -i acaodireta.mov -s 320x240 -sameq -vcodec mjpeg -an acaodireita-mjpeg.avi

arquivo (mp4,wmv,mov,mpg,ogg) para avi:

$ ffmpeg -i democratizacao.mpg -vcodec mjpeg democratizacao.avi

de avi para outros formatos

$ ffmpeg -i ocupacao.avi -vcodec dvvideo ocupacao.dv
$ ffmpeg -i ocupacao.avi -vcodec theora ocupacao.ogg
$ ffmpeg -i ocupacao.avi -vcodec mpeg2video ocupacao.mpg

projeto para dvd/vcd/pal-vcd/dv/svcd/ntsc-svcd

$ ffmpeg -i batemam.avi -target vcd batemam.mpg

ripando dvd com mencoder

com a saída no formato mpeg4

$ mencoder dvd:// -vf scale -zoom -xy 512 -o title2.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4

com a sáida no formato mpeg2

$ mencoder dvd:// -vf scale -zoom -xy 512 -o title2.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg2video
$ mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vhq -o orappa.avi orappa.mov
$ mencoder -ovc lavc -lavcopts vcodec=mpeg2video -oac mp3lame clipegil.avi -o gclipe.avi
$ mencoder -ovc lavc -lavcopts vcodec=mpeg2video -oac copy clipegil.avi -o gclipe.avi/
$ mencoder -ovc copy -oac copy clipegil.avi -o gclipe.avi

transcode - de mov para dv com

$ transcode -i eita.mov -y dvraw -o eita.dv
$ transcode -i eita.avi -y mov -o eita.mov

Android Conversions

Device Screen Resolution Command
Nexus One 800×480
Input Video Size > 800×480
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -s 800x480 -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Input Video Size <= 800×480
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Dream / G1 480×320
Input Video Size > 480×320
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -s 480x320 -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Input Video Size <= 480×320
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Droid 854×480
Input Video Size > 854×480
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -s 854x480 -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Input Video Size <= 854×480
ffmpeg -i INPUT -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Magic / myTouch 480×320 same as G1
Eris / Desire 480×320 same as G1
Hero 480×320 same as G1
Cliq / DEXT 480×320 same as G1
Behold II 480×320 same as G1


Apple Format Conversions

Device Screen Resolution Command
iPhone / iPod Touch / iPod Nano / iPod Classic 320×480 ffmpeg -i INPUT-acodec aac -ac 2 -ab 160k -s 480x320 -vcodec libx264 -vpre slow -vpre iPod640 -b 1200k -f mp4 -threads 0 OUTPUT
iPhone 4 / iPod Touch 4 640×480 ffmpeg -i INPUT-acodec aac -ac 2 -ab 160k -s 640x480 -vcodec libx264 -vpre slow -vpre iPod640 -b 1200k -f mp4 -threads 0 OUTPUT
iPad 1024×768 ffmpeg -i INPUT-acodec aac -ac 2 -ab 160k -s 1024x768 -vcodec libx264 -vpre slow -vpre iPod640 -b 1200k -f mp4 -threads 0 OUTPUT
Apple Universal 1280×720 ffmpeg -i INPUT-acodec aac -ac 2 -ab 160k -s 1080x720 -vcodec libx264 -vpre slow -vpre iPod640 -b 1200k -f mp4 -threads 0 OUTPUT

PSP

Device Screen Resolution Command
PSP 320×480 ffmpeg -i INPUT -s 320x240 -b 512000 -ar 24000 -ab 64000 -f psp -r 29.97 OUTPUT


Output Formats

Format Command
Theora see http://github.com/8planes/mirovideoconverter/blob/master/MSWindows/Windows/ConversionFormats/TheoraVideoFormat.cs
MP4 ffmpeg -i INPUT -acodec aac -ac 2 -ab 160k -vcodec libx264 -vpre slow -f mp4 -crf 22 OUTPUT
MP3 (audio only) ffmpeg -i INPUT' -f mp3 -y OUTPUT
WebM ffmpeg_static -y -i INPUT -f webm -vcodec libvpx_vp8 -acodec libvorbis -ab 160000 -crf 22 OUTPUT


see TheoraTestMatrix

Current conversion Commands in Miro 3.5.1

Name Executable Extension Parameters Media Type
Android Devices ffmpeg mp4 -i {input} -y -acodec aac -ab 160k -s {ssize} -vcodec libx264 -vpre slow -vpre iPod640 -b 1500k -f mp4 -threads 0 {output} video
Apple Devices ffmpeg mp4 -i {input} -acodec aac -ab 160k -s {ssize} -vcodec libx264 -vpre slow -vpre iPod640 -b 1200k -f mp4 -threads 0 {output} video
Playstation Portable (PSP) ffmpeg mp4 -i {input} -s 320x240 -b 512000 -ar 24000 -ab 64000 -f psp -r 29.97 {output} video
MP4 ffmpeg mp4 -i {input} -acodec aac -ab 96k -vcodec libx264 -vpre slow -f mp4 -crf 22 {output} video
MP3 ffmpeg mp3 -i {input} -f mp3 -y {output} audio
Ogg Theora ffmpeg2theora ogv --videoquality 8 --audioquality 6 --frontend -o {output} {input} video
Ogg Vorbis ffmpeg ogg -i {input} -f ogg -vn -acodec vorbis -aq 60 {output} audio