Opened 11 years ago

Closed 11 years ago

#2836 closed defect (fixed)

Lost video frames when decoding h264 stream

Reported by: Marcin Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: h264 mpegts regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

I'm trying to transcode h264 stream (DVB-T). It happens that properties of the input stream changes on the fly. Decoder automatically reinitializes context "[h264 @ 0xa29fae0] Reinit context to 720x576, pix_fmt: 0", but avcodec_decode_video2 starts loosing frames. First it looses significant number (around 40) of frames and than repeatedly returns one frame and skips three frames.

Problem is related to the avcodec it can be observed in ffmpeg, ffplay and custom applications.

Full report from ffmpeg and two examples of input (stream copy) are in the attachments.

How to reproduce:

% ffmpeg -i video_decoder-lost_frames_in_dvbt-example2.ts -acodec mp3 -vcodec mpeg4  -b 15000000 out2.mp4
Verified versions: 2.0, master, 1.2
Built on Ubuntu 12.04

Attachments (2)

ffmpeg-20130805-151434.log (132.0 KB ) - added by Marcin 11 years ago.
Report from ffmpeg
ffmpeg-20130805-152646.log (132.0 KB ) - added by Marcin 11 years ago.
Report from ffmpeg

Download all attachments as: .zip

Change History (10)

by Marcin, 11 years ago

Attachment: ffmpeg-20130805-151434.log added

Report from ffmpeg

by Marcin, 11 years ago

Attachment: ffmpeg-20130805-152646.log added

Report from ffmpeg

comment:1 by Marcin, 11 years ago

Media files uploaded to ftp server:
video_decoder-lost_frames_in_dvbt-example1.ts
video_decoder-lost_frames_in_dvbt-example2.ts

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: mpegts regression added; lost frame removed

How did you record the samples?
(Could you confirm that recording with cat /dev/dvb/adapter0/dvr0 >recording.ts allows to reproduce the problem?)

comment:3 by Marcin, 11 years ago

The dvb-t stream is broadcasted (by AVerCaster Pro RS3421) in the local network. There is no transcoding before broadcasting.
The samples are recorded as a stream dump with simple command:
ffmpeg -i udp://xxx.xxx.xxx.xxx:1234 -acodec copy -vcodec copy outfile.ts

comment:4 by Carl Eugen Hoyos, 11 years ago

Isn't there a command to save the udp stream into a file (without using FFmpeg)?
Do you have the possibility to save the stream instead of broadcasting it via udp?

comment:5 by Marcin, 11 years ago

We tried to save/dump the stream with mplayer:
mplayer -dumpstream -dumpfile ... but the result is the same as in ffmpeg case.

We have some dvb-t cards, so we'll try to record the stream directly from the cards.

comment:6 by Michael Niedermayer, 11 years ago

ffplay 0.8.14 plays video_decoder-lost_frames_in_dvbt-example1.ts better than master.
someone should bisect to find out which revission introduced the problems

comment:7 by Carl Eugen Hoyos, 11 years ago

Priority: normalimportant
Reproduced by developer: set
Status: newopen

Regression since a64b028.

comment:8 by Michael Niedermayer, 11 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.