Ffmpeg video converter: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 57: Line 57:
ffmpeg.exe -i "input.avi" -vcodec libx264 -b 6000k -g 200 -y "output.mp4"
ffmpeg.exe -i "input.avi" -vcodec libx264 -b 6000k -g 200 -y "output.mp4"
</pre>
</pre>
== Galaxy Tab 10.1 ==
Encoder: H.264 / flv
Resolution: 1280 x 720
Frame Rate: 30 FPS
Video Bitrate: 2500 kbps
ffmpeg -i inputfile -s 1280x720 -q:v 2 -b:v 2500000 -ar 44100 output.flv
ffmpeg -i inputfile -s 1280x720 -q:v 2 -b:v 2500000 -codec libx264 output.mp4


== Roteren ==
== Roteren ==


The MAN page for ffmpeg states the following use
The MAN page for ffmpeg states the following use

Revision as of 14:34, 21 February 2012

To find out the video bitrate of a movie, do ffmpeg -i inputfile

Then you can use -b bitrate option to set the output bitrate in order to not lose quality. The -qscale 3 option also ensures a highter quality (nb if possible use -qscale 2 though)

Command lines

ffmpeg -y -i cb_d3_6.mpg -vcodec h264 -me_method full -b 700k -rc_max_rate 768 -an test.mp4

ffmpeg -y -i hoogenboom/reclame_golf.avi -vcodec libx264 -me_method full -b 700k -an test.mp4

ffmpeg -y -i hoogenboom/reclame_golf.avi -vcodec libx264 -me_method full -qscale 2 -s 1280x576 -aspect 20:9 -an reclame_golf.mp4

ffmpeg -y -i hoogenboom/reclame_onderhoud.avi -vcodec libx264 -me_method full -qscale 2 -s 1280x576 -aspect 20:9 -an reclame_onderhoud.mp4

ffmpeg -y -i hoogenboom/reclame_onderhoud.avi -vcodec msmpeg4 -vtag MP43 -qscale 2 -s 1280x576 -aspect 20:9 -an reclame_onderhoud.wmv

Output naar flash / flv

ffmpeg -i input.mp4 -b:v 583000 -ar 44100 -qscale 2 output.flv

(-b:v = video bitrate, -ar = audio bitrate, has to be one of a few possible values - you get these values from ffmpeg -i inputfile )

Omzetten naar .TP

ffmpeg -i inputfile -vcodec copy -acodec copy output.ts

rename .ts -> .tp

Meerdere video's

Bij omzetten van meerdere video's is het zetten van een batch variabele handig:

set params= -an -vcodec rawvideo -y  -s 1920x1080
ffmpeg.exe -i "G:\Cheil\20110804 Gateway video\aangeleverd\Hub_SmartTV_nl.mp4" %params% "G:\Cheil\20110804 Gateway 


Veelgebruikte regels

Samsung WMV 2 ( voor schone XP installaties zonder codecs:)

set params= -vcodec wmv2 -qscale 2 -an -y 


Omzetten naar raw video 1080p voor gebruik in editor (levert grote bestanden op!)

-vcodec rawvideo -y -s 1920x1080


High quality h264 mp4 bestanden

ffmpeg.exe -i "input.avi" -vcodec libx264 -b 6000k -g 200 -y "output.mp4"

Galaxy Tab 10.1

Encoder: H.264 / flv Resolution: 1280 x 720 Frame Rate: 30 FPS Video Bitrate: 2500 kbps

ffmpeg -i inputfile -s 1280x720 -q:v 2 -b:v 2500000 -ar 44100 output.flv

ffmpeg -i inputfile -s 1280x720 -q:v 2 -b:v 2500000 -codec libx264 output.mp4


Roteren

The MAN page for ffmpeg states the following use ffmpeg -i inputfile.mpg -vf "transpose=1" outputfile.mpg


The key being that you are not to use a degree variable, but a predefined setting variable from the MAN page.


0=90CounterCLockwise and Vertical Flip (default)

1=90Clockwise

2=90CounterClockwise

3=90Clockwise and Vertical Flip


Scalen

ffmpeg -i yoursourcefile -s 640x480 youroutputfile


Croppen

ffmpeg -i inputfile -vf crop=1280:752 -qscale 2 outputfile

Waar crop=1280:752 het gewenste outputformaat is en qscale de qualiteit behoudt. Zo werkt het croppen van het midden.