Video playback freezing after a few seconds

What is your Pi connected to? Does it support more than two PCM channels (many TV’s and and audio devices don’t). If your passing through a TV that only supports two PCM channels but the TV is connected to a surround sound system you may want to, in addition to changing the channels setting to “2” also enable passthrough, AC3 passthrough, and AC3 transcoding, which will allow you to get surround sound despite the limitation.

I tried reproducing this using both RPi 4 (test build)>Toshiba TV>Stereo soundbar and a RPi 3B (stable)>different Toshiba TV playing the same file as in your logs. The file played normally regardless of if I had my audio channels set to 2.0 or 5.1 so if there is a bug here I’d think there is an additional condition at play as well. Maybe @grahamh has an idea of what could be going on.

It’s connected to a Samsung QE50Q80TTATXXH TV, I don’t how many PCM channels the TV support.

The TV is further connected with a TOSLINK to a 5.1 surround system amplifier. I had test the setup and connections with a test video, one that was playing sequential all channels (“front left”, “center”, “front right”), verified everything was working OK.
Now I will have to do some new experiments with your suggestions.

Regardless of how many PCM channels the TV supports that optical TOSLINK connection only supports two so your audio settings should be channels 2, passthrough enabled for AC3, DTS (if your AVR supports it), and enable AC3 Transcode to allow your AVR to get surround over the TOSLINK connection. You can find further information about proper configuration in the following thread…