Could not play youtube video smoothly.
Posted: 22 Apr 2023 21:15
Hi,
I have used libvlc to make youtube playing app on Linux. Some youtube videos(For example https://www.youtube.com/watch?v=El1kgCqD7Xk) play smoothly. But some of youtube videos(for example, https://www.youtube.com/watch?v=pIgZ7gMze7A) freeze intermittently(stops and play stops and play...). I don't know what makes them different.
I have tried many options. --network-caching=999999 could work but I had to wait to long(more than a minute) to start video. So I set a reasonable number --network-caching=3000. but this results in not smooth play. Is there any options I can get around this choppy play?
Could it be something to do with video resolution? I thought I may change the preferred resolution by setting --preferred-resolution=240(low quality) but there were no changes on resolution. Can I edit youtube.lua to set youtube-resolution to 240?
Here is the debug message I got.
I have used libvlc to make youtube playing app on Linux. Some youtube videos(For example https://www.youtube.com/watch?v=El1kgCqD7Xk) play smoothly. But some of youtube videos(for example, https://www.youtube.com/watch?v=pIgZ7gMze7A) freeze intermittently(stops and play stops and play...). I don't know what makes them different.
I have tried many options. --network-caching=999999 could work but I had to wait to long(more than a minute) to start video. So I set a reasonable number --network-caching=3000. but this results in not smooth play. Is there any options I can get around this choppy play?
Could it be something to do with video resolution? I thought I may change the preferred resolution by setting --preferred-resolution=240(low quality) but there were no changes on resolution. Can I edit youtube.lua to set youtube-resolution to 240?
Here is the debug message I got.
Code: Select all
[00007f4bb40069e0] main input debug: Buffering 69%
[00007f4bb40069e0] main input debug: Buffering 76%
[00007f4bb40069e0] main input debug: Buffering 83%
[00007f4bb40069e0] main input debug: Buffering 90%
[00007f4bb40069e0] main input debug: Buffering 97%
[00007f4bb40069e0] main input debug: Stream buffering done (3750 ms in 6431 ms)
[00007f4bb40069e0] main input debug: Decoder wait done in 0 ms
[0000000001d65380] main audio output warning: buffer too late (-47558028 us): dropped
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 47518 ms)
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 100 (vdpau)
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 119 (cuda)
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 46 (vaapi_vld)
[00007f4bac96c440] avcodec decoder debug: available software decoder output format 0 (yuv420p)
[00007f4bac96c440] avcodec decoder debug: reusing decoder output format 0
[h264 @ 0x7f4bac76ff40] Reinit context to 464x368, pix_fmt: yuv420p
[00007f4bac81e0b0] main decoder debug: end of audio preroll
[0000000001d65380] alsa audio output error: cannot estimate delay: Input/output error
[00007f4bac96c440] main decoder debug: end of video preroll
[00007f4bb0048200] main video output debug: picture might be displayed late (missing 3 ms)
[00007f4bb40069e0] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 2401 ms)
[00007f4bb40069e0] main input debug: ES_OUT_RESET_PCR called
[00007f4bac96c440] main decoder debug: Received first picture
[00007f4bac96c440] main decoder error: Timestamp conversion failed for 50120001: no reference clock
[00007f4bac96c440] main decoder error: Could not convert timestamp 0 for FFmpeg
[00007f4bb40069e0] main input debug: Buffering 0%
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 100 (vdpau)
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 119 (cuda)
[00007f4bac96c440] avcodec decoder debug: available hardware decoder output format 46 (vaapi_vld)
[00007f4bac96c440] avcodec decoder debug: available software decoder output format 0 (yuv420p)
[00007f4bac96c440] avcodec decoder debug: reusing decoder output format 0
[h264 @ 0x7f4bac76ff40] Reinit context to 464x368, pix_fmt: yuv420p
[h264 @ 0x7f4bac76ff40] co located POCs unavailable
[00007f4bb40069e0] main input debug: Buffering 10%
[00007f4bb40069e0] main input debug: Buffering 20%
[00007f4bb40069e0] main input debug: Buffering 31%
[00007f4bb40069e0] main input debug: Buffering 41%
[00007f4bb40069e0] main input debug: Buffering 52%
[00007f4bb40069e0] main input debug: Buffering 62%
[00007f4bb40069e0] main input debug: Buffering 72%
[00007f4bb40069e0] main input debug: Buffering 83%
[00007f4bb40069e0] main input debug: Buffering 93%
[00007f4bb40069e0] main input debug: Stream buffering done (2500 ms in 3953 ms)
[00007f4bb40069e0] main input debug: Decoder wait done in 0 ms
[0000000001d65380] main audio output warning: buffer too late (-300355 us): dropped
[0000000001d65380] alsa audio output error: cannot estimate delay: Input/output error
[0000000001d65380] main audio output warning: playback way too early (-156361): playing silence
[0000000001d65380] main audio output debug: inserting 6895 zeroes
[0000000001d65380] main audio output warning: buffer too late (-235997 us): dropped
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 79 ms)
[0000000001d65380] main audio output warning: buffer too late (-212886 us): dropped
[0000000001d65380] main audio output warning: buffer too late (-189734 us): dropped
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 39 ms)
[0000000001d65380] main audio output warning: buffer too late (-166575 us): dropped
[0000000001d65380] main audio output warning: buffer too late (-143414 us): dropped
[0000000001d65380] main audio output warning: buffer too late (-120255 us): dropped
[0000000001d65380] main audio output warning: buffer too late (-97154 us): dropped
[0000000001d65380] main audio output warning: buffer too late (-73993 us): dropped
[0000000001d65380] main audio output debug: playback too late (57887): flushing buffers
[0000000001d65380] alsa audio output error: cannot estimate delay: Input/output error
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 241 ms)
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 201 ms)
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 161 ms)
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 126 ms)
[00007f4bb0048200] main video output warning: picture is too late to be displayed (missing 87 ms)
[00007f4bb40069e0] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 2681 ms)