gkreidl
Posts: 6282
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: RPi4 video performance

Wed Apr 01, 2020 2:48 am

emma1997 wrote:
Tue Mar 31, 2020 9:01 pm
gkreidl wrote:
Sat Mar 28, 2020 5:26 am
"MMAL x11 splitter for Raspberry Pi" is one of the video output modes of VLC (on the RPi). If you would ever have tried to configure VLC, you woukd have seen it (Settings, Video)
Well I did finally try that (IDK why not before with only about 4.5 trillion setting combinations). Mpeg2 not smooth and MTS still unwatchable. Full or minimized no difference. They play perfectly in Cyberlink and Nero Showtime on PC and in several different ATSC players. Maybe due to dedicated playback hardware in which case my concerns about hardware vs software unfortunately starting to look justified. IDK

I did go through your MMAL thread again and, surprise-surprise, made a little more sense 2nd time through. At my rate 5 or 6 more times and things may start to sink in. lol

Probably unreasonable expectations are my biggest problem. I should stop comparing $35 SBC with 4 gigahertz PC that draws 10x more power and cost hundreds. Still amazing and there's that OS flexibility and GPIO access which is virtually impossible in Wintel World. So can't complain too much.
MPEG2 can mean both a container format and a codec, so I'm not sure what you are trying. On the RPi 4 there is no MPEG2 hardware codec any more and so decoding is done by software. The RPi 4B is fast enough to do this.
I suppose "MTS" means MPEG2 Transport stream, which are usually recorded TV streams. They can use different codecs, often MPEG2 for SD streams and H264 for HD streams. I've got lots of them (my own TV recordings) and all play fine with VLC. I can also play all my live TV streams (from my DVB-S USB receiver) without any problems.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Wed Apr 01, 2020 10:19 pm

Mpeg2 meaning, as in my 1st post, DVD. No difference between reauthored files or actual disk in a player. Watchable but jerky on the Pi4, specially when slow panning. Better on Pi3 which is maybe hardware decode but still smoother even without the paid codec so IDK.

MTS as in most common format produced by ATSC tuner set top boxes. Actual slide show, no exaggeration. OK on original and several other brand STBs that I've tried. I don't suppose you can post or link an example .mts file that works for you?

This is with new & updated Buster image less than a week old. I suspect not the case on your end. Probably there are several more secret handshakes missing in my setup or some major difference in media files. In any case thanks for having taken some time here. Appreciated.

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Wed Apr 01, 2020 10:52 pm

.mts / .m2ts are MPEG 2 Transport Streams. 188-byte packets of data, including a variable-length header, that's surprisingly easy to parse. It's more or less as close to a raw bitstream as it's possible to get whilst still interleaving multiple audio and video streams together. It contains some trivial missing packet detection -- a four-bit per-PID continuity counter -- but no checksum; integrity is assumed to be taken care of at higher levels (FEC or the like when broadcast).

If *that*'s causing trouble, I'll be very surprised. You can unpack it in a couple of hundred lines of C, being very careful of the edge cases you'll probably never see in the wild.

Repack something troublesome with ffmpeg, using -codec copy (so it's just repacking, not transcoding), and try again. If it isn't still troublesome, I'll a: be very surprised, and b: put it down to the TS format being misdetected as a raw bitstream or the like.

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Wed Apr 01, 2020 11:26 pm

It's not failing completely, just 1hz slide show. My known Mpeg2 (DVD) play much better so it's a surprise they behave so differently. Also surprised they are the same format because AFAIK max resolution for Mpeg2 is 720 whereas the MTS are described as HD/1080.

I've used ffmpeg before for ripping and playing but definitely not an expert. Might be worth a try but can't afford another few hours getting it to work again. Is it just "ffmpeg -codec copy infile outfile" or more involved? IE what codec etc?

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Thu Apr 02, 2020 12:07 am

Code: Select all

ffmpeg -i infile -codec copy outfile.mkv
or similar.

Transport streams are containers. They can hold various codecs at whatever profiles and levels[0] you want. DVDs are limited to MPEG 2 at SD resolutions, but broadcast can take MPEG 2 and / or H.264 and / or H.265 (HEVC) at whatever levels and profiles depending on the systems that are expected to decode and display them.

All a transport stream does is interleave zero or more video streams with zero or more audio streams and zero or more subtitle streams, and embed some useful descriptor tables to tie it all together to produce a system. My point is that there is no way that a transport stream should be at all to blame for turning a video into a slideshow. It sounds to me that it's only decoding the I-frames, and the container shouldn't cause that, unless the unpacker has misidentified it.


[0] I can never remember which is which, but one describes the complexity of the bitstream, and the other details the constrains of the fomat. So one will limit the number of I- and B- frames, and the other the number of macroblocks, bitrate and the size of the frame; it all gets a bit complex at this point, but see Wikipedia if you're bored.

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Thu Apr 02, 2020 1:52 am

I did spend an hour or two lately with Wikipedia but already learned more from these threads. Maybe TMI syndrome. Thanks for the ffmpeg hint. It's worth a try as soon a I get back to my Pi setup.

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Mon Apr 06, 2020 6:04 pm

So I played with headers and it didn't make any difference. I did learn a few things though. MTS files recorded off primary (HD) channels are slide show whereas those recorded off secondary (SD) channels are almost watchable. I did find other players (BluRay, other STB, some PCs, etc) with same problem apparently because they lack dedicated decoder hardware.

Starting to look like Pi just runs out of software decode poop. Strange because these are not 4k or particularly hi res.

A have learned MPEG2 is a lot more formats than I thought and some go way beyond 720. Also that MTS is an MP2 too.

Looks like for now I'll have to use Pi4 for MP4 which play perfect (not surprising since biggest audience is netheads and streamers) and DVD which is almost there. What records in KOQIT stays in KOQIT. At least until Pi VLC guy finds a way to play high res MTS by some miracle

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Mon Apr 06, 2020 6:09 pm

If you drop to a console -- not X -- and use omxplayer, does it work?

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Mon Apr 06, 2020 6:34 pm

From a desktop terminal .MP4 play fine but for .MTS and .VOB just comes back with 'Have a Nice Day ;)' so I guess don't recognize the format. I'm still using the MMAL setting and just typing 'OMXPLAYER filename' so don't know if that matters.

Also VLC runs MTS from CLI but still slide show and hundreds of complaints about 'main filter error: failed to create video converter' and 'too high level of recursion (3)'.

I wonder if overclocking the Pi helps. I've never tried that before but maybe now have a reason?

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Mon Apr 06, 2020 6:54 pm

It'll be saying 'Have a nice day' because you haven't got an MPEG 2 licence.

It sounds to me that something is software-decoding. The hardware blobs certainly are capable of H.264 at 1080p30 playback, so if that's not working, something is wrong. 'Slideshow'-style performance isn't what you should be seeing.

emma1997
Posts: 718
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Mon Apr 06, 2020 6:58 pm

DVD/VOB and lo res MTS are mp2 too but play almost perfect so looks like Pi4 runs out of steam with the higher res versions. Odd because still not even close to 4k.

I do have a couple of those paid keys for 3b+ Stretch setups. Didn't really use them back then because soft decode was great but should probably give them a try with this MTS stuff.

I did go back to using those old models recently because of nasty Mousepad and other issues. Maybe one more reason to shelve Pi4 for now.

gkreidl
Posts: 6282
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: RPi4 video performance

Mon Apr 06, 2020 8:49 pm

emma1997 wrote:
Mon Apr 06, 2020 6:34 pm
From a desktop terminal .MP4 play fine but for .MTS and .VOB just comes back with 'Have a Nice Day ;)' so I guess don't recognize the format. I'm still using the MMAL setting and just typing 'OMXPLAYER filename' so don't know if that matters.

Also VLC runs MTS from CLI but still slide show and hundreds of complaints about 'main filter error: failed to create video converter' and 'too high level of recursion (3)'.

I wonder if overclocking the Pi helps. I've never tried that before but maybe now have a reason?
In the US (ATSC) the MPEG2 codec is also used for any kind of TV HD videos, while in Europe (and most other parts of the world) H264 ot even H265 is used for HD formats. If omxplayer doesn't play them, it must be using the MPEG2 codec. It might work fine on older RPis if you buy the additional codec (MPEG2).
I still prefer my older RPis (2B, 3B, 3B+) as media players. I always bought the additional codecs and can play everything (except H265, which I don't need).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Mon Apr 06, 2020 9:29 pm

ATSC mandates MPEG 2 for HD? How backward...

That'll do it, though.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: RPi4 video performance

Wed Apr 08, 2020 9:32 am

The Pi4 is a performance beast, and should operate as a media centre without lifting a finger.

About 6 months ago my ageing Topfield PVR was replaced with a Pi2 media centre running OSMC/Kodi. The results have been excellent and performance fine, even with a Pi2. It does live TV/Recording/Youtube/Netflix/Amazon Prime etc. I can also watch TV/Recordings on any tablet/phone in the house and even remotely.

Sorry for advertising my own blog, but the setup is documented here:
http://unixetc.co.uk/2019/11/22/how-to- ... pberry-pi/

Regarding the Pi4, I tested it and the user interface absolutely flew, almost to quick to use. The Pi4 isn't officially supported by OSMC yet, but they are working on it.

Jim
Unix engineer since 1989

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8501
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi4 video performance

Wed Apr 08, 2020 10:39 am

dickon wrote:
Mon Apr 06, 2020 9:29 pm
ATSC mandates MPEG 2 for HD? How backward...

That'll do it, though.
What's the betting it'll be mandating 1080i MPEG2 as well. Throwing any significant deinterlace filter in there may well start maxing out parts of the system. The decode it should take in it's stride.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Wed Apr 08, 2020 10:44 am

Very high. With a 1.001 framerate divisor in there, to keep ~200,000 1950s black and white CRT TVs happy, too.

Insane.

User avatar
dickon
Posts: 1266
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: RPi4 video performance

Wed Apr 08, 2020 10:49 am

cpc464 wrote:
Wed Apr 08, 2020 9:32 am
The Pi4 is a performance beast, and should operate as a media centre without lifting a finger.
It won't handle 4k H.264 at all well.

Return to “General discussion”