Ffmpeg video converter: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
ffmpeg -i input.mp4 -b:v 583000 -ar 44100 -qscale 2 output.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 )  
(-b:v = video bitrate, -ar = audio bitrate, has to be one of a few possible values - you get these values from ffmpeg -i inputfile )
 
http://forum.doom9.org/archive/index.php/t-131369.html


== Omzetten naar .TP ==
== Omzetten naar .TP ==

Revision as of 16:19, 26 March 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 )

http://forum.doom9.org/archive/index.php/t-131369.html

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

it turns out that ffmpeg refers to keyframes as GOP or group of pictures. You can set the keyframe encoding rate simply by using the command line switch -g. So in order to convert an uncompressed .mov file into a flv of the same quality with a keyframe at every frame, I used the following command:

  ffmpeg -i UncompressedMov.mov -sameq -g 1 OutputFile.flv 

-force_key_frames time[,time...]


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

Settings that worked best for flv:

Resolution: 1024 x 600

ffmpeg -i inputfile -s 1024x600 -sameq -ar 44100 output.flv

What should work but doesn't:

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

also see Media:Encondigperf.pdf

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.

Knippen / Cut

ffmpeg -sameq -ss [start_seconds] -t [duration_seconds] -i [input_file] [outputfile]

Foutmeldingen

ffmpeg encoding 6 channel(s) is not allowed in mp2:

Try to put -ac 2 after -i inputfile, to set 2 audio channels on the output file or -an to cut out the audio