Opened 12 years ago

Last modified 12 years ago

#1751 new defect

FFmpeg keeps streaming but stream is blank/offline

Reported by: Taqveer Doha Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello. I'm creator of FFsplit project (http://www.ffsplit.com). We have been using ffmpeg on windows to encode and stream videos to CDNs. One of the most annoying issues that popped up was that the stream would suddenly stop but ffmpeg would keep going as if nothing wrong happened. I basically solved this inside FFsplit by reading and detecting improper packet from byte arrays that are sent to it and looking for the incorrect/incomplete packet. But recently I was able to solve this issue inside FFmpeg source code. Here's what I did:

In libavformat/rtmpproto.c, I changed:

if (size < 11) {
   av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
   return 0;
}

to

if (size < 11 && !rt->flv_off) { // <--- Added "&& !rt->flv_off"
   av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
   return 0;
}

(Source: http://broadcast.oreilly.com/2011/11/flash-media-serverffmpeg-annoy-1.html)

From what I understand, the FLV packet size was bigger than RTMP and this solves it. Checking it inside FFsplit, the improper byte arrays dont show up anymore. I hope someone sees this and incorporates it inside FFmpeg. Thank you!

Change History (2)

comment:1 by llogan, 12 years ago

I am not qualified to review your change, but please consider submitting a patch to the ffmpeg-devel mailing list. It will get more attention there.

comment:2 by Carl Eugen Hoyos, 12 years ago

Keywords: ffmpeg stream random stop removed

If you want a change committed to ffmpeg, please send your patch made with git format-patch to ffmpeg-devel - consider reading http://ffmpeg.org/developer.html

Note: See TracTickets for help on using tickets.