Opened 6 years ago

Closed 6 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 6 years ago.
Report from ffmpeg
ffmpeg-20130805-152646.log (132.0 KB) - added by Marcin 6 years ago.
Report from ffmpeg

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by Marcin

Report from ffmpeg

Changed 6 years ago by Marcin

Report from ffmpeg

comment:1 Changed 6 years ago by Marcin

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

comment:2 Changed 6 years ago by cehoyos

  • 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 Changed 6 years ago by Marcin

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 Changed 6 years ago by cehoyos

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 Changed 6 years ago by Marcin

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 Changed 6 years ago by michael

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 Changed 6 years ago by cehoyos

  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

Regression since a64b028.

comment:8 Changed 6 years ago by michael

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.