Stutters, drop-outs and delays on RPi

Issue:
Stutters, drop-outs and delays when playing some videos.
Many other videos work flawlessly.

Most of the time they are downloaded from youtube, using youtube-dl.
Formats are .webm, .flv, .mkv.
The distortions apply to image and sound.
Image becomes low-res (quadratic blocks) or even completely dark.
Sound interrupts and comes back after some seconds.

What I was doing:
The video is stored on the SD-Card in ~osmc/Movies.
I play the video using either my mobile (KORE) or a USB keyboard plugged into the RPi.

How to replicate: (video picked as an example)
Use youtube-dl to download https://www.youtube.com/watch?v=aF5FMXHGsjA
Copy the file to the RPi.
Play it on the TV screen.
Regarding a visit to St.Petersburg contact me :wink:

My device is a RaspberryPi (RPi) 3B+.
Attached to it are a (dumb) TV by HDMI cable.
I am using the original RaspberryPi power supply.
Sometimes - especially for searching - I attach a USB keyboard as mentioned above.

I am not aware that this issue is related to a new version of OSMC.
I cannot recall a time where this problem was not present.
Google did not yield a lot of hits on my problem.

Try to play the same video on the RPi using the Kodi Youtube-Addon.
The differences should be obvious: There the problem does not exist.

My videos are stored together with OSMC on a 200GB SanDisk, which shows class “C10” as well as “U1”.

I have tried (without any special parameters) to recode the file as a .mkv and as a .mp4
This did not change anything in the display, only the files were considerably smaller.

The output of mediainfo has been posted to the osmc upload bin [#361256].

Additional question:
Could it be that I have a better playback when the video is streamed over a local network?

If you download the file like that you get a VP9 encoded file that the RPi can only play in software decode where it has not enough power to do that.

So for those files you would either need a Vero4k that can decode it in hardware or you would need to choose different format when downloading.

Would not change a thing as long as the file is VP9 encoded

Thank you for the quick reply.
I have tried immediately to add a parameter "–recode-video=mp4 " to the download.
This gives me a video encoded in AVC (code avc1).
Playing it, the stutter is remarkably reduced, but not entirely gone.
Could you recommend a different codec that would further reduce the decoding load on the RPi - without losing too much information?
Where can I learn more about it?

Thanks again,
Wolfgang

I just downloaded with youtube-dl -f 137+bestaudio aF5FMXHGsjA
That plays fine on the Pi3.

Thanks a lot.
Downloading like you wrote does not work for me.
However, reading around a bit helped me to find ffmpeg parameters to recode the file.
I am down from 121.6MiB to 20.3 MiB on the file size and the bitrate down from 8000/sec to 1800/sec.

Somewhere on Wikipedia I found the RPi3 can handle 1080p resolution - which is fine for me.
Downscaling correspondingly gave me the result mentioned.
Without even having tried, I think this solves the issue.

Why doesn’t it work? Don’t have the latest version of youtube-dl?
Yes, Pi3 can play 1080 with AVC1 (H.264) encoding.
My filesize is 52MiB

I get the following:

WARNING: unable to extract player URL; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

My version is 2021.02.10.

I have treid it on the RPi now.
The version that works best, has 28,3 MiB. Quality reduction visible, but not essential for me.
I got it by running:
‘ffmpeg -i Proskalov_Isaakskathedrale_2min7.webm -vf scale=1280:-1 -c:v libx264 Proskalov_Isaakskathedrale_2min7_out.mp4’, where the .webm file was downloaded using no parameters.

I also tried ‘scale=1080’, but the result was optically worse without playing better.

What is the output of youtube-dl -F aF5FMXHGsjA maybe you get different formats being offered.

Same error as above.
Maybe this is a Germany-specific restriction by youtube; maybe the developers may be able to overcome this.
I will certainly try from time to time.

I just tried via German VPN also working.
You need youtube-dl version 2021.04.07

RPI does not play avc well unless you buy licence code for the codec. Do you have that? If not try to buy and enter licence code and restart and try again.

This video is H.264 for which no licence is needed