[libav-api] Opening and Decoding UDP MpegTS

Evgeny Yakimov john.yakimov at gmail.com
Tue Nov 1 21:07:49 CET 2011


Hello

I'm trying to open a UDP mpegts stream, and decode it using libavcodec and
ultimately encode it using my own application which uses x264/faac to
encode it directly. I've managed to get this working by reading raw frames
and the encoding part of my application works fine, however whenever I try
to open libav I get seg faults. I've uploaded my code to:

http://pastebin.com/rkFQKMWB

Please let me know if I'm openning the stream incorrectly, note that for my
test case the options pairs are:
'f' => "mpegts"
'u' => "udp://:1500",
ignore the 'l' for now

I'm using avconv to generate the UDP mpegts.

The problem is that the segfault actually occurs in the thread that does
the x264 encoding, I "think" that due to the way I'm using libav, that its
corrupting some of the memory used by the x264 encoding thread.

I have also tried doing this,  by commenting out both the : avcodec_open2 ,
and the avcodec_decode_audio3 , avcodec_decode_video2 and sending my
application blank dummy blank frames / samples. So basically I receive the
blank packets without decoding them and substituted them with blank
"payloads" when I do this I no longer get the seg faults, which suggests
that I'm missusing one of these calls.

Regards,
Evgeny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-api/attachments/20111101/f65ae4af/attachment.html>


More information about the libav-api mailing list