<div dir="ltr">Hi All,<div>I am trying to restream a incoming live stream using libav.</div><div>equivalent of following command - </div><div>







<p class="">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</p><p class="">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. </p><p class=""><b>Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 424x240, 24.42 fps, 24 tbr, 1k tbn, 48 tbc</b></p><p class=""><b>    Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp</b></p><p class="">









</p><p class=""><b>    Stream #0:2: Data: none</b></p><p class=""><b><br></b></p><p class="">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 -</p><p class="">







</p><p class=""><b>Data codec 'none' for stream 2 is not compatible with FLV</b></p><p class="">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-</p><p class=""><b>Duration: 00:00:00.00, start: 0.000000, bitrate: N/A</b></p><p class=""><b>  Stream #0:0: Video: h264 (High), yuv420p, 424x240, 400 kb/s, 50 fps, 24 tbr, 1k tbn, 96 tbc</b></p><p class="">









</p><p class=""><b>  Stream #0:1: Data: none</b></p><p class="">So i want to know what should i do with the 3rd stream(TYPE_DATA)  in input container.  </p><p class="">attached is my code. </p>







<p class="">







</p><p class=""><br></p><p class=""><b><br></b></p><p class=""><br></p></div><div><br></div></div>