[FFmpeg-devel] Fix FFM-based audio streaming from FFmpeg to FFserver

Ronald S. Bultje rsbultje
Mon Mar 15 23:42:06 CET 2010


Hi,

see attached. Currently (SVN HEAD), video works but audio is badly
distorted. A quick look reveals that this is b/c we set the sample_fmt
to 0 (=U8) in the FFM-descriptor that FFmpeg reads from FFserver to
see what formats to stream in. While removing the memset(ctx, 0); from
ffserver.c, I found that pix_fmt/sample_fmt were now no longer filled
in with random values, but are always unset, leading to problems later
on in ac_encode(). The rest of the patch therefore fixes the
pix_fmt/sample_fmt setting when reading a config from FFserver, and
also fixes a bug when copying codeccontexts. I'm suspecting that the
reason that video encoding worked is purely coincidental, e.g. yuv420p
being pix_fmt=0 and most encoders accepting that.

Some of this stuff could probably be cleaned up (e.g. splitting the
pix_fmt/sample_fmt setting into a new function), let me know if you
want that.

With this patch, streaming works again (both video + audio).

Also, this bug reveals a deeper bug in that setting pix_fmt /
sample_fmt to random values doesn't error out, we just generate random
garbage. Maybe avcodec_open() should check the filled-in values?

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ffserver-ffm-streaming.patch
Type: text/x-patch
Size: 4002 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100315/703f49e6/attachment.bin>



More information about the ffmpeg-devel mailing list