google-code-export / ffmpegthumbnailer

Automatically exported from code.google.com/p/ffmpegthumbnailer
GNU General Public License v2.0
1 stars 1 forks source link

Seek does not always work #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Seek didn't work for me on a movie file (movie.avi) whose length was
greater than 40 minutes, anything past -t 78 resulted in the first frame
being outputted instead of the desired one.

What steps will reproduce the problem?
ffmpegthumbnailer -i movie.avi -t 95 -o screen.jpg

What version of the product are you using? On what operating system?
Version 1.2.5 on Gentoo

Please provide any additional information below.
From looking at the source it appears the problem originates on this line

(moviedecorder.cpp:178)
int64_t timestamp = (::int64_t) ( AV_TIME_BASE * timeInSeconds);

if timeInSeconds is large enough integer overflow (the inner parenthesis
use integer multiplication because timeInSeconds is an int) will occur
resulting in a negative number (which gets translated to 0 later on)

changing that line to

int64_t timestamp = (::int64_t) ( AV_TIME_BASE * (int64_t) timeInSeconds);

resulted in the correct output.

I'll attach a patch

Very nice program by the way, I tried using straight ffmpeg to generate
thumbnails but it proved to be very CPU intensive.

Original issue reported on code.google.com by AWate...@gmail.com on 29 Jun 2008 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
Great job finding the cause of the issue!
I will apply the patch this evening, and make a bug-fix release.

Original comment by dirk.vdb on 30 Jun 2008 at 9:53

GoogleCodeExporter commented 9 years ago
A new release has been created.
Thanks again

Original comment by dirk.vdb on 30 Jun 2008 at 5:15