<div dir="ltr">Hi All,<div>Now i am able to stream the video to my media server. But its playable only using ffplay. Flash players or vlc are not able to play the stream. I am assuming there is some problem with my encoding code which ffplay is able to correct but other players are unable to do. in ffplay output i am seeing couple of lines like </div><div>







<p class="">[h264 @ 0x7fc6ac80c000] <span class="">no picture</span></p><p class=""><span class="">which i do not see when i play a video encoded using flash or some other tool.  Any ideas what might be wrong here ? following is complete output of ffplay.</span></p><p class="">ffplay version N-66851-gd58fa94 Copyright (c) 2003-2014 the FFmpeg developers</p><p class="">  built on Oct 22 2014 14:42:52 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)</p><p class="">  configuration: --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-nonfree --enable-static --disable-shared</p><p class="">  libavutil      54. 10.100 / 54. 10.100</p><p class="">  libavcodec     56.  5.100 / 56.  5.100</p><p class="">  libavformat    56.  9.100 / 56.  9.100</p><p class="">  libavdevice    56.  1.100 / 56.  1.100</p><p class="">  libavfilter     5.  1.105 /  5.  1.105</p><p class="">  libswscale      3.  1.101 /  3.  1.101</p><p class="">  libswresample   1.  1.100 /  1.  1.100</p><p class="">  libpostproc    53.  3.100 / 53.  3.100</p><p class="">[rtmp @ 0x7fc6ab709fe0] Handshaking... vq=    0KB sq=    0B f=0/0   </p><p class="">[rtmp @ 0x7fc6ab709fe0] Type answer 3</p><p class="">[rtmp @ 0x7fc6ab709fe0] Server version 3.0.1.1</p><p class="">[rtmp @ 0x7fc6ab709fe0] Proto = rtmp, path = /live/myStream, app = live, fname = myStream</p><p class="">[rtmp @ 0x7fc6ab709fe0] Server bandwidth = 2500000</p><p class="">[rtmp @ 0x7fc6ab709fe0] Client bandwidth = 2500000</p><p class="">[rtmp @ 0x7fc6ab709fe0] New incoming chunk size = 4096</p><p class="">[rtmp @ 0x7fc6ab709fe0] Creating stream...</p><p class="">[rtmp @ 0x7fc6ab709fe0] Sending play command for 'myStream'</p><p class="">[flv @ 0x7fc6ad008800] Format flv probed with size=2048 and score=100</p><p class="">[flv @ 0x7fc6ad008800] Before avformat_find_stream_info() pos: 13 bytes read:16536 seeks:0</p><p class="">[flv @ 0x7fc6ad008800] Stream discovered after head already parsed</p><p class=""><b>[h264 @ 0x7fc6ab823000] no picture</b> </p><p class="">[flv @ 0x7fc6ad008800] Negative cts, previous timestamps might be wrong.</p><p class="">[flv @ 0x7fc6ad008800] Invalid timestamps stream=0, pts=-71, dts=0, size=267</p><p class="">[flv @ 0x7fc6ad008800] Invalid timestamps stream=0, pts=-113, dts=0, size=164</p><p class="">[flv @ 0x7fc6ad008800] Non-increasing DTS in stream 0: packet 2 with DTS 0, packet 3 with DTS 0</p><p class="">[flv @ 0x7fc6ad008800] Invalid timestamps stream=0, pts=-29, dts=0, size=162</p><p class="">[flv @ 0x7fc6ad008800] Non-increasing DTS in stream 0: packet 3 with DTS 0, packet 4 with DTS 0</p><p class="">[flv @ 0x7fc6ad008800] Non-increasing DTS in stream 0: packet 4 with DTS 0, packet 5 with DTS 0</p><p class="">[flv @ 0x7fc6ad008800] Stream discovered after head already parsed</p><p class="">[flv @ 0x7fc6ad008800] All info found</p><p class="">rfps: 23.750000 0.014474</p><p class="">rfps: 23.833333 0.006451</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 23.916667 0.001640</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 24.000000 0.000043</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 24.083333 0.001659</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 24.166667 0.006488</p><p class="">rfps: 24.250000 0.014530</p><p class="">rfps: 47.750000 0.014576</p><p class="">rfps: 47.833333 0.006561</p><p class="">rfps: 47.916667 0.001761</p><p class="">rfps: 48.000000 0.000173</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 48.083333 0.001798</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 48.166667 0.006636</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 48.250000 0.014687</p><p class="">rfps: 23.976024 0.000173</p><p class="">    Last message repeated 1 times</p><p class="">rfps: 47.952048 0.000694</p><p class="">[flv @ 0x7fc6ad008800] After avformat_find_stream_info() pos: 111114 bytes read:111114 seeks:0 frames:125</p><p class="">Input #0, flv, from 'rtmp://localhost:1935/live/myStream':</p><p class="">  Metadata:</p><p class="">    encoder         : Lavf55.48.100</p><p class="">  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A</p><p class="">    Stream #0:0, 46, 1/1000: Video: h264 (High), yuv420p(left), 424x240 (432x240), 1/96, 400 kb/s, 50 fps, 24 tbr, 1k tbn, 96 tbc</p><p class="">    Stream #0:1, 2, 1/1000: Data: none, 0/1</p><p class="">    Stream #0:2, 77, 1/1000: Audio: aac, 44100 Hz, stereo, fltp</p><p class="">detected 4 logical cores</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] Setting 'sample_rate' to value '44100'</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] Setting 'sample_fmt' to value 'fltp'</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] Setting 'channels' to value '2'</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] Setting 'time_base' to value '1/44100'</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] Setting 'channel_layout' to value '0x3'</p><p class="">[ffplay_abuffer @ 0x7fc6ab62ba80] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3</p><p class="">[ffplay_abuffersink @ 0x7fc6ab62bc40] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'</p><p class="">[AVFilterGraph @ 0x7fc6ab62b8e0] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed</p><p class="">[auto-inserted resampler 0 @ 0x7fc6ab62c200] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz</p><p class=""><b>[h264 @ 0x7fc6ac80c000] no picture </b></p><p class=""><b>[h264 @ 0x7fc6ac852600] no picture </b></p><p class="">Video frame changed from size:0x0 format:none serial:-1 to size:424x240 format:yuv420p serial:1</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] Setting 'video_size' to value '424x240'</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] Setting 'pix_fmt' to value '0'</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] Setting 'time_base' to value '1/1000'</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] Setting 'pixel_aspect' to value '0/1'</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] Setting 'frame_rate' to value '24/1'</p><p class="">[ffplay_buffer @ 0x7fc6ab7144a0] w:424 h:240 pixfmt:yuv420p tb:1/1000 fr:24/1 sar:0/1 sws_param:</p><p class="">[ffplay_crop @ 0x7fc6ab7167e0] Setting 'out_w' to value 'floor(in_w/2)*2'</p><p class="">[ffplay_crop @ 0x7fc6ab7167e0] Setting 'out_h' to value 'floor(in_h/2)*2'</p><p class="">[AVFilterGraph @ 0x7fc6ab63c760] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed</p><p class="">[ffplay_crop @ 0x7fc6ab7167e0] w:424 h:240 sar:0/1 -> w:424 h:240 sar:0/1</p><p class="">Audio frame changed from rate:44100 ch:2 fmt:fltp layout:stereo serial:-1 to rate:44100 ch:2 fmt:fltp layout:stereo serial:1</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] Setting 'sample_rate' to value '44100'</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] Setting 'sample_fmt' to value 'fltp'</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] Setting 'channels' to value '2'</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] Setting 'time_base' to value '1/44100'</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] Setting 'channel_layout' to value '0x3'</p><p class="">[ffplay_abuffer @ 0x7fc6ab449e20] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3</p><p class="">[ffplay_abuffersink @ 0x7fc6ab449ec0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'</p><p class="">[AVFilterGraph @ 0x7fc6ab449c80] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed</p><p class=""><span class=""></span></p><p class="">[auto-inserted resampler 0 @ 0x7fc6ab44a400] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz</p></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 3:59 PM, gaurav mishra <span dir="ltr"><<a href="mailto:gauravmishra.itbhu@gmail.com" target="_blank">gauravmishra.itbhu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>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>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><b>Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 424x240, 24.42 fps, 24 tbr, 1k tbn, 48 tbc</b></p><p><b>    Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp</b></p><p>









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







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









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







<p>







</p><p><br></p><p><b><br></b></p><p><br></p></div><div><br></div></div>
</blockquote></div><br></div>