Posted At : December 29, 2010 5:13 AM
5 Comments
Initial attempts using ffmpeg were making it re-encode the entire video which would take ages and result in a larger file or worse quality.
A bit of googling and reading the man pages later I discovered
This tells ffmpeg to copy the video and audio without re-encoding.
So insted of this
This worked a treat for all except one file - which gave the following error.
By using the "-an" and "-vn" flags to skip the video and audio encoding in turn I narrowed it down to a problem in the audio codec timestream.
To try to get ffmpeg to fix the problem I got it to reencode the audio but copy the video codec with the following:
Worked a treat. I love ffmpeg :-)
Final code to fix it using aac with audio quality quite high 200 (range is 0-255)
5 Comments
check out handbrakeCLI (ffmpeg + lots more via the command line). http://handbrake.fr/downloads2.php
I presented about video at cfobjective anz this yr, here are my slides:-
http://slidesix.com/view/Embracing-Media-in-your-C...
Hi Rob, Good to hear from you. Yep, I use handbrake quite a bit - but prefer to it with the low level tools as much as I can :-) Is it possible to make handbrake not re-encode?
Cheers,
Mark
Incredibly helpful post: Thank you! What was taking around half my recording time, is now running at over 100 x real time!
Thanks for the writeup.
How would you write this to process all the .flv files in a certain directory? - perhaps recursively as well...
@Blayne:
for file in `ls *.flv`; do ffmpeg .... ; done
this will work in your current directory... you could also do:
find ./ -type f -name *.flv -exec ffmpeg ... {} \;
just test them out with simple echo's instead of ffmpeg so you can familiarize yourself with the build in commands.