Opened 6 years ago

Last modified 6 years ago

#4912 new defect

While decoding an flv video av_codec_decode_video2 fails to decode the 2nd frame at first but succeeds after seeking.

Reported by: tr3wory Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: flv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I have a bunch of flv videos recorded with our wowza server with the same problem:
When I try to decode the frames from beginnig to end, the avcodec_decode_video2 skips the 2nd frame (and only that).
But if I seek back to the beginnig it will decode the second frame properly.

How to reproduce:
Attached a simple example code and sample video demonstrating the problem.
See the asserts in line 78 and 96.

Used version:
ffmpeg version N-75147-g9d742d2 Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --prefix='~/BUILD/ffmpeg'
libavutil 55. 1.100 / 55. 1.100
libavcodec 57. 1.100 / 57. 1.100
libavformat 57. 0.100 / 57. 0.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 1.100 / 6. 1.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100

Attachments (3)

cant_read_2nd_frame.flv (1.5 MB ) - added by tr3wory 6 years ago.
minimal_test.c (3.3 KB ) - added by tr3wory 6 years ago.
Sample code describing the problem.
cant_read_2nd_frame_with_sound.flv (1.6 MB ) - added by tr3wory 6 years ago.
Original sample file (won't work with the example code)

Change History (7)

by tr3wory, 6 years ago

Attachment: cant_read_2nd_frame.flv added

by tr3wory, 6 years ago

Attachment: minimal_test.c added

Sample code describing the problem.

comment:1 by Carl Eugen Hoyos, 6 years ago

Component: avcodecundetermined
Keywords: flv added

How was the input sample made?

comment:2 by tr3wory, 6 years ago

It was recorded with Wowza:
we record the user's webcam from flash, and stream it to the server.
(I removed the audio stream later with ffmpeg, but the original has the same problem
if I properly skip the audio packets)

It is entirely possible that the file format is not conforming, but since ffmpeg can decode the frames properly after seeking, it looks like there is some problem on the ffmpeg side too.

And I have hundreds of videos like this, so it's a one-off problem.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 6 years ago

Replying to tr3wory:

(I removed the audio stream later with ffmpeg, but the original has the same problem
if I properly skip the audio packets)

Please also provide the original file.

by tr3wory, 6 years ago

Original sample file (won't work with the example code)

comment:4 by tr3wory, 6 years ago

I uploaded the original file. Keep in mind that the sample code won't work with this file because it does not skip the audio packets.

Note: See TracTickets for help on using tickets.