[FFmpeg-devel] [PATCH] libavformat/aviobuf.c: don't treat 0 from read_packet as EOF

Daniel Kučera daniel.kucera at gmail.com
Sun Jun 4 00:11:00 EEST 2017


2017-06-03 23:04 GMT+02:00 James Almer <jamrial at gmail.com>:
> On 6/3/2017 5:31 PM, Daniel Kučera wrote:
>> 2017-06-03 21:54 GMT+02:00 Michael Niedermayer <michael at niedermayer.cc>:
>>> On Sat, Jun 03, 2017 at 10:16:59AM +0200, Daniel Kucera wrote:
>>>> Signed-off-by: Daniel Kucera <daniel.kucera at gmail.com>
>>>> ---
>>>>  libavformat/avio.c    |  2 +-
>>>>  libavformat/aviobuf.c | 18 ++++++++++--------
>>>>  libavformat/cache.c   |  2 +-
>>>>  libavformat/file.c    |  2 ++
>>>>  libavformat/subfile.c |  2 +-
>>>>  libavformat/wtvdec.c  |  4 ++--
>>>>  6 files changed, 17 insertions(+), 13 deletions(-)
>>>
>>> looses Duration in output in:
>>> cat ~/videos/matrixbench_mpeg2.mpg | ./ffprobe -read_ahead_limit -1 cache:pipe:0
>>>
>>
>> I fixed that RTP issue, I'll send updated patch. What does it mean
>> "looses Duration" ?
>
> The reported duration (and bitrate it seems) for the input file is lost,
> and N/A is shown instead.
>
> Without your patch:
>
> [cache @ 0000000000ecac40] Inner protocol failed to seekback end : -40
> [mpeg @ 00000000024f3740] start time for stream 0 is not set in
> estimate_timings_from_pts
> [cache @ 0000000000ecac40] Inner protocol failed to seekback end : -40
>     Last message repeated 2 times
> Input #0, mpeg, from 'cache:pipe:0':
>   Duration: 00:03:07.66, start: 0.220000, bitrate: 5633 kb/s
>     Stream #0:0[0x1bf]: Data: dvd_nav_packet
>     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
> bt470bg/bt470m/bt470m, bottom first), 720x576 [SAR 16:15 DAR 4:3], 25
> fps, 25 tbr, 90k tbn, 50 tbc
>     Stream #0:2[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
> Unsupported codec with id 100357 for input stream 0
> [cache @ 0000000000ecac40] Statistics, cache hits:16 cache misses:4033
>
>
> With it:
>
> [cache @ 00000000010aac40] Inner protocol failed to seekback end : -40
>     Last message repeated 1 times
> Input #0, mpeg, from 'cache:pipe:0':
>   Duration: N/A, start: 0.220000, bitrate: N/A
>     Stream #0:0[0x1bf]: Data: dvd_nav_packet
>     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
> bt470bg/bt470m/bt470m, bottom first), 720x576 [SAR 16:15 DAR 4:3], 25
> fps, 25 tbr, 90k tbn, 50 tbc
>     Stream #0:2[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
> Unsupported codec with id 100357 for input stream 0
> [cache @ 00000000010aac40] Statistics, cache hits:0 cache misses:4033
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Is it with the latest version I sent half an hour ago?

It seems to be working for me. Can you please provide your testing
file and command?

 cat fate-suite/mpeg2/matrixbench_mpeg2.lq1.mpg | ./ffprobe
-read_ahead_limit -1 cache:pipe:0
ffprobe version N-86331-gae37d3a1c4 Copyright (c) 2007-2017 the FFmpeg
developers
  built with gcc 6.3.0 (Ubuntu 6.3.0-12ubuntu2) 20170406
  configuration: --enable-debug=3 --enable-gpl --enable-libx264
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 90.100 /  6. 90.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[cache @ 0x55e680107560] Inner protocol failed to seekback end : -38
    Last message repeated 3 times
Input #0, mpeg, from 'cache:pipe:0':
  Duration: 00:00:00.96, start: 0.540000, bitrate: 1757 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 716x236 [SAR 1:1 DAR 179:59], 25 fps, 25 tbr, 90k tbn,
50 tbc
[cache @ 0x55e680107560] Statistics, cache hits:10 cache misses:7


-- 

S pozdravom / Best regards
Daniel Kucera.


More information about the ffmpeg-devel mailing list