Ffmpeg video converter
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 -g 1 -deinterlace 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
VAN FLA (CS5) timeline naar .MOV naar .AVI
* Ga in menubalk naar bestand / file * Ga naar exporteren. * Ga naar film exporteren * In dialoogvenster kies "Save as Type:" Quick Time (*.mov) * Klik save * Klik "QuickTime-instellingen" * Zorg dat video is aangevinkt * Klik op settings * Kies "compression type:" "Animation" * Kies framerate: xx fps(aantal frames per seconden van je flash) * Every xx frames * evt. Compressor Depth: Millions of colors+ * evt. Quality best * Klik op 'OK' * Klik op size * Dimensions: 'Custom' breedte x hoogte (afmetingen van je fla) * Klik 'OK * Evt uitvinken "Prepare for internet Sharing) * Klik 'OK' De film word nu gerenderd. FF wachten dus.. In je command Prompt kan je de .mov met FFMPEG omzetten met de command: ffmpeg -i filmpje.mov -sameq -g 1 filmpje.avi Mocht de playback choppy zijn: Framerate heeeel laag zetten (bijv. 5 fps) en exporteren als mov (zie boven, met 5 fps).In Adobe premiere de mov importeren en selecteren en bij clip - speed/duration (ctrl R) de snelheid op 600% zetten (als je 30fps wilt hebben) en voila, hij is soepel. Deze exporteren als avi / mpeg2 (want met avi heb je soms kleurverlies) en dat mpegje gebruiken in het volgende project.