Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting artifacts when trying to read video stream from YouTube
    primarykey
    data
    text
    <p>I'm trying to read the video frames from the RTSP stream that I get from YouTube. Here is the link for my test video:</p> <blockquote> <p>rtsp://v8.cache5.c.youtube.com/CiILENy73wIaGQkJlrXMiAG8BxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp</p> </blockquote> <p>If I'm reading frames from the local file - everything is fine, but when read them from a stream I get nothing but lots of artifacts. I've googled around and found out that there might be a problem with UDP packets and switching to TCP may help but I really can't find where it is possible to change this.</p> <p>Here is the function for reading a frame:</p> <pre><code>bool nextFrame(AVFormatContext *pFormatCtx, AVCodecContext *pCodecCtx, int videoStream, AVFrame *pFrame) { AVPacket packet; int frameFinished = 0; while( !frameFinished &amp;&amp; av_read_frame(pFormatCtx, &amp;packet) &gt;= 0 ) { // Is this a packet from the video stream? if( packet.stream_index == videoStream ) { // Decode video frame avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished, &amp;packet); } // Free the packet that was allocated by av_read_frame av_free_packet(&amp;packet); } return frameFinished!=0; } </code></pre> <p>I'm also getting lots of error messages in my log:</p> <pre><code>[h263 @ 0x7804c00] warning: first frame is no keyframe [h263 @ 0x7804c00] illegal ac vlc code at 6x1 [h263 @ 0x7804c00] Error at MB: 18 [h263 @ 0x7804c00] concealing 99 DC, 99 AC, 99 MV errors [h263 @ 0x7804c00] I cbpy damaged at 10 4 [h263 @ 0x7804c00] Error at MB: 58 [h263 @ 0x7804c00] concealing 99 DC, 99 AC, 99 MV errors [h263 @ 0x7804c00] I cbpy damaged at 6 6 [h263 @ 0x7804c00] Error at MB: 78 [h263 @ 0x7804c00] concealing 76 DC, 76 AC, 76 MV errors [h263 @ 0x7804c00] I cbpy damaged at 5 5 [h263 @ 0x7804c00] Error at MB: 65 [h263 @ 0x7804c00] concealing 88 DC, 88 AC, 88 MV errors [h263 @ 0x7804c00] illegal ac vlc code at 7x5 [h263 @ 0x7804c00] Error at MB: 67 [h263 @ 0x7804c00] concealing 86 DC, 86 AC, 86 MV errors </code></pre> <p>...and so on</p> <p>edit: this is 99.9% a UDP-TCP problem. I've found this link:</p> <blockquote> <p>rtsp://195.200.199.8/mpeg4/media.amp</p> </blockquote> <p>This is some test camera available online. It streams with artifacts. However if it has get parameter 'tcp' and if I use this </p> <blockquote> <p>rtsp://195.200.199.8/mpeg4/media.amp?tcp</p> </blockquote> <p>everything works without artifacts.</p> <p>So to correct my question: is there any way to force YouTube or ffmpeg to use TCP ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload