Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use byte seeking when time to seek is given in percentage #77

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 6 comments
Open

Comments

@GoogleCodeExporter
Copy link

The default seeking method in ffmpegthumbnailer-2.0.6 (linked against 
ffmpeg-0.6) is always failing with my MPEG2-TS files and the first frame is 
used instead:

> ffmpegthumbnailer -t 30 -i video.ts -o thumb.jpg
[mpeg2video @ 0x822d8f0]mpeg_decode_postinit() failure
[mpegts @ 0x82292a0]max_analyze_duration reached
[NULL @ 0x822e890]start time is not set in av_estimate_timings_from_pts
[NULL @ 0x822f060]start time is not set in av_estimate_timings_from_pts
Seeking in video failed, will use first frame
[mpeg2video @ 0x822d8f0]mpeg_decode_postinit() failure
[mpegts @ 0x8229250]max_analyze_duration reached
[NULL @ 0x822cc70]start time is not set in av_estimate_timings_from_pts
[NULL @ 0x822f250]start time is not set in av_estimate_timings_from_pts

However, thumbnailing works nicely if seeking is done directly with byte 
offsets (AVSEEK_FLAG_BYTE) as implemented in the attached patch.

Original issue reported on code.google.com by rahre...@gmail.com on 10 Jan 2011 at 12:05

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for the effort, can you provide me with a file that fails so I can have 
a look at it?

Original comment by dirk.vdb on 14 Jan 2011 at 10:03

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

You can use for example this one with a command-line option "-t 50":
http://samples.mplayerhq.hu/MPEG2/res_change_ffmpeg_aspect.ts

Without byte seeking a first frame is always used with all streaming containers 
that don't contain any duration information (i.e. MPEG2-TS). However, it might 
be convenient to add a new command-line option for the byte seeking as 50% of 
duration isn't exactly in the middle of the file (especially if VBR is used), 
but it's usually close enough.

Original comment by rahre...@gmail.com on 19 Jan 2011 at 1:45

@GoogleCodeExporter
Copy link
Author

I applied the patch to ffmpegthumbnailer-2.0.2 because 2.0.6 is not working on 
Linux Debian Lenny because of too old version libavcodec51.

It works fine on MPEG2-TS files in SD resolution (720x576) but there's a 
problem on TS files in HD resolution (1920×1080). There are plenty of errors 
like:

[h264 @ 0x7f3ed8d03760]non existing PPS referenced
[h264 @ 0x7f3ed8d03760]decode_slice_header error
[h264 @ 0x7f3ed8d03760]no frame!
[h264 @ 0x7f3ed8d03760]B picture before any references, skip
[h264 @ 0x7f3ed8d03760]decode_slice_header error
[h264 @ 0x7f3ed8d03760]no frame!

Is this a known issue?

Thanks

Original comment by notr...@net-eclipse.net on 16 Jun 2011 at 4:28

@GoogleCodeExporter
Copy link
Author

Updated the patch for recent ffmpeg library versions.

Original comment by rahre...@gmail.com on 12 Aug 2013 at 1:06

Attachments:

@sarnobat
Copy link

Has this been integrated into the main release, or do we still need the patch? I experience this issue on verson 2.0.7

@dirkvdb
Copy link
Owner

dirkvdb commented Jul 18, 2015

I tried the patch but I see issues on other file formats. It needs some more investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants