MP4 and MKV video filetypes
Andrew Rawnsley (492) 1445 posts |
MP4 and MKV are two of the most common video formats, but haven’t previously been allocated RISC OS filetypes or filer_run actions in applications (chicken/egg). So, I took the bull by the horns and put in an allocation request for them, as I’m tired of having to fudge things by using AVI etc filetype. These types are intended for public use, not R-Comp/RISC OS Dev, which is why I’ve started a topic here. The allocated types are &A63 for MKV and &A64 for MP4. I have updated !Mplayer’s !Boot file as follows: | !Boot file for MPlayer Set MPlayer$Dir <Obey$Dir> IfThere <Mplayer$Dir>.!Sprites Then Iconsprites <MPlayer$Dir>.!Sprites Set Alias$mencoder Run <MPlayer$Dir>.mencoder %%*0 Set Alias$mplayer Run <MPlayer$Dir>.mplayer %%*0 Set File$Type_FB2 "AVI" Set Alias$@RunType_FB2 Run <MPlayer$Dir>.!Run %%*0 Set File$Type_A63 "MKV" Set Alias$@RunType_A63 Run <MPlayer$Dir>.!Run %%*0 Set File$Type_A64 "MP4" Set Alias$@RunType_A64 Run <MPlayer$Dir>.!Run %%*0 Also, MIMEMap entries… video/mp4 MP4 a64 .mp4 video/x-matroska MKV a63 .mkv I made a couple of sprites too (not great), but I don’t really see how to post them. If someone would like to contact me on the usual R-Comp address, I’d be happy to pass them through (perhaps for !Mplayer). !FFmpeg may also handle these types, but I haven’t yet tested. |
Rick Murray (539) 13839 posts |
Just to point out, those filetypes are video containers. I have numerous mkv (because embedded subtitles). The older ones are XviD/H.263 and MP3. Newer ones are H.264/AAC. Some are HEVC. Totally different video formats. Same file format. ;-) But, yes, thanks. It’s good to have proper types for common files. |
Andrew Rawnsley (492) 1445 posts |
Yes, Rick, good point/spot. Indeed, I used the word “container” in my ROOL allocation submission. In my post above, I liken it to AVI which was an older container format. You’re also absolutely right that MKV handles subtitles far better than MP4, and that is probably why MKV has taken off in such a big way. On the flip side, consumer media devices have a habit of being better at handling MP4 containers than MKV, but even then they are very fussy about what types of data they will play within the containers. Mind you, I have been surprised at how well Mplayer has behaved in brief testing. The main issue seems to be in handling files >2GB. RISC OS/filecore has had changes to handle up to 4GB, but I’m not sure that apps/LanManFS etc have followed suit. |
Raik (463) 2061 posts |
… but ffmpeg, ffplay, mplayer not need a filetype to play. ;-) |
Andrew Rawnsley (492) 1445 posts |
Raik, not sure if you’re serious or just having fun. IIRC the only two existing video file types understood by Mplayer etc are AVI and MPEG. I think RISC OS also has a Replay video type, and I’m struggling to recall any other. So, you’d have to set the MP4/MKV files to AVI to play them by double-clicking (the purpose of filetypes – if we were all working at commandline, filetypes would be much less necessary!). Yes, that does work. But then all the MP4 / MKVs appear as AVIs! To be honest, the main purpose of this was for the MIMEMap entries. When downloading or using LanManFS etc to access video content, your files will be left as “data” without suitable entries in the MimeMap database. I was tired of this! With properly allocated types, we can have proper entries in MimeMap, and things can just, you know, work… Well, except for the 2GB limit. I was a bit puzzled to find that although the file limit on RISC OS was raised to 4GB some time ago, attempting to play anything larger than 2GB seems to result in a lockup. Not sure if this is the fault of !Mplayer, LanManFS or some other thing, though. |
Raik (463) 2061 posts |
Andrew, I’m serious and have fun, anytimes. ;-) At this time I’m busy with “real life”. So I not have the time to read all the posts in detail and may be my answers are a bit confused. Sorry. For me, I map vob, mpg, mpeg to MPEG and the rest of knowing video types to AVI. I have it in my mimemap and I use DOSMap. Generally mplayer and ffplay are playing 4GB files from HDD. Thats the reason why I use partman on ARMX6 to use the complete 500GB SSD. Have play around with “netplay” from NAS any times ago. It works more or less but not all the time with all files. |
David Feugey (2125) 2709 posts |
I do too! And Thanks Andrew for your excellent talk yesterday :) |
Herbert Doerfler (8783) 5 posts |
I remember when I was working on a video project at home, and those formats just gave me a headache. I mean, it felt like I was trying to crack some secret code! I spent hours just trying to make sense of it all, you know? The frustration was real. There I was, tinkering with settings, reading up forums, and watching endless tutorials, but it felt like I was getting nowhere. Then I stumbled upon this website: https://www.movavi.com/learning-portal/imovie-alternatives.html. It was like a lightbulb moment! They had these alternative editing software options that were so much more user-friendly than what I was wrestling with. Saved me a ton of time and sanity, to be honest. |
Chris Hall (132) 3554 posts |
It also helps if you are attaching them to e-mails – if RISC OS doesn’t recognise the file type the e-mail is received as gibberish. |
Rick Murray (539) 13839 posts |
What kind of sadist sends video files by email? As for dealing with video files, just need to find editing software that handles various types (so discount RISC OS!). I use an app on my phone for editing, as my phone can easily outperform my ancient PC. It will happily insert one video into another as a splice point, overlay, whatever. The video format of the two and/or framerate aren’t relevant. “It just works”. Unless you’re actually trying to create software to handle video files, it’s long gone the time when one needs to know anything more than “it’s a video file”. If in doubt, feed it to ffmpeg and see what happens. |