msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

05 Dec 09 Fun with FFMPEG

Since I’ve seen nothing which addresses the processing delays that I noticed in ffmpeg when generating thumbnail images, I figured I should share some important optimizations. I used to specify this command line when generating the images from a movie source (f4v in this case):

ffmpeg -y -i mymovie.f4v -an -ss 00:05:00 -t 00:00:00.01 -sameq -r 1 -vframes 1 -deinterlace -f mjpeg mythumbnail.jpg

This will take about one minute to generate the image of the video frame which is five seconds into the clip. This seems really extreme and is even worse when you try to increase the start location; for instance 45 seconds in, takes about an hour.
So, I knew there had to be a better way and I monkeyed around with the options:

ffmpeg -y -ss 00:05:00 -i mymovie.f4v -an -t 00:00:00.01 -sameq -r 1 -vframes 1 -deinterlace -f mjpeg mythumbnail.jpg

There is only one change between these lines, the placement of the “ss” option. This change causes the command to complete in less than a second, no matter what our start time is. Quite an increase in processing for something so simple! I hope this helps a few of you out there.



Tags: , , ,



Reader's Comments

  1. |

    This seems to be a bug in ffmpeg. Conventionally, the order of command line switches should never have any effect of the result. Did you report the bug to the ffmpeg team?

  2. |

    Hi Paul, I have a big problem with ur custom object methods. Everything is working fine but when I’m sending an serialized array, it works but I got nothing in my datagrid, (results works, I can see them with toString() ) I think I cant access to private properties ( in my remoteclass / as3 class ) for my colums with datafield.

    What can I do ?

    Thank u !

  3. |

    @Jonas, why not ask your question somewhere it’s relevant, rather than on this blog post about FFMPEG? Sorry if I seem insensitive, but come on!

    http://groups.google.com/group/red5interest/

    Try asking there!

  4. |

    Awesome :) thx for the tricks !

  5. |

    you saved my day!, thx for the trick.



Leave a Comment


Fatal error: Call to undefined function akismet_counter() in C:\xampp\htdocs\paulgregoireblog\wp-content\themes\googlechrome\footer.php on line 9