[Libav-user] Live Streaming using libav

gaurav mishra gauravmishra.itbhu at gmail.com
Mon Oct 27 11:29:25 CET 2014

Hi All,
I am trying to restream a incoming live stream using libav.
equivalent of following command -

ffmpeg -i rtmp://localhost:1935/vod/sample.mp4 -c:a aac -strict -2 -ar
44100 -c:v libx264 -f flv rtmp://localhost:1935/live/myStream

I started with transcoding.c present in docs/examples .  The issue i am
facing is i dont know how to handle stream which is of type
AVMEDIA_TYPE_DATA.  The incoming live stream has 3 streams in it.
 following is av_dump_format of incoming stream.

*Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 424x240, 24.42
fps, 24 tbr, 1k tbn, 48 tbc*

*    Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp*

*    Stream #0:2: Data: none*

when creating output streams i create video and audio streams according to
my requirements but for 3rd stream when i am using avcodec_copy_context() ,
i am getting a error -

*Data codec 'none' for stream 2 is not compatible with FLV*

when i tried to skip the third stream (ie create a output container with
just audio and video stream) i am able to stream data to my media server.
but flash players are not able to play the stream. ffplay was able to play
the stream but it could not find audio stream. following is output of
ffplay for my resultant stream-

*Duration: 00:00:00.00, start: 0.000000, bitrate: N/A*

*  Stream #0:0: Video: h264 (High), yuv420p, 424x240, 400 kb/s, 50 fps, 24
tbr, 1k tbn, 96 tbc*

*  Stream #0:1: Data: none*

So i want to know what should i do with the 3rd stream(TYPE_DATA)  in input

attached is my code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20141027/0724b29c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transcoding.c
Type: text/x-csrc
Size: 21762 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20141027/0724b29c/attachment.bin>

More information about the Libav-user mailing list