Kodi + cheap computers or Raspberry Pi + ripped Blu Rays


(If anyone feels like this is too far off the main topics of Bad Voltage, then nuke the thread or ask me to do it.)

I would like to be able to watch any of our DVDs and Blu Rays from any PC or television in the house. I used HandBrake to rip all of the DVDs to MP4, and I can stream them anywhere with Kodi. Hooray.

I would also like to do the same with our Blu Ray films. I used MakeMKV, which as you can guess rips the Blu Rays to MKV format. It works fine, and the resulting files have the H.264 video codec or VC-1 video codec. I re-encoded all of the VC-1 films to H.264. The average bitrate is 28 Mb/s. I can stream the films to any PC or laptop in the house. Playback on Android or a Raspberry Pi stutters and hangs. I even bought an Nvidia Shield and tried to play one of the MKV files from a USB flash drive, and still had the same stuttering problem.

I read on some forums that Kodi on Android has problems with the MKV media container format. I thought about re-encoding all of the MKV files to MP4. The problem there is that I can’t figure out how to translate the subtitles. I found a Handbrake option to burn the MKV subtitles right into the MP4 video stream. I tried it, and it had the subtitle timing off by about 4 seconds.

Any suggestions? I’d really prefer to stick with free software options here. If I can’t come up with anything better, I might look for a used laptop with sufficient graphics horsepower to do the job and work that way. But I hate the thought of using a bulky $350 device that draws 25 watts of power when the right software will let me get the job done with a Raspberry Pi 3.


…but not Kodi on the PI, right? Does that also not work?


It plays them, but it isn’t as efficient. So a DVD ripped to MKV will play fine, but a Blu Ray ripped to MKV stutters like mad.

I think subtitles are what are killing me. I really like using them. I play my movies with the volume relatively low because the occasional shout or explosion annoys me. But then I can’t hear the quieter dialogue. So I always use subtitles. And I’m not aware of any Linux program that converts the subtitles from Blu Rays in MKV to the MP4 style.

Maybe I should just use something on Windows to rip the Blu Rays to MP4 with subtitles.


http://superuser.com/questions/932730/ffmpeg-mkv-to-mp4-conversion-loses-subtitles seems relevant here, although you may have read it (and ffmpeg is a command-line thing and so less friendly than Handbrake).


Thanks for the link. Unfortunately it doesn’t work. The problem is that blu ray subtitles are stored as image files, hdmv_pgs_subtitle - and MP4 requires subtitles in text format. So I would have to extract the subtitles, run them through OCR, and then use ffmpeg to do MKV - hdmv_pgs_subtitle + OCR’d subtitle > MP4.

…and then people wonder why piracy is so popular. I’m sure someone else has done all of the work for me if I checked the Pirate Bay. But I pay for all the content I watch.

I ripped without subtitles and tried streaming anyway, and it still stuttered. I think I’m just going to bite the bullet and put together a proper x86_64 media PC in the room with the television.


Why not simply download the subtitles themselves from another site?


A relative of mine was actually one of those people threatened with a lawsuit for movie downloads. That’s made me more nervous than most about visiting any site with that kind of content.

Anyway, as I said even in MP4 without subtitles I can’t stream 28 Mb/s content to a Raspberry Pi. I tried streaming to Kodi on my phone, a Moto X Pure, and it still stuttered. So I’m just going to throw money at the problem - a little home theater PC or maybe a used relatively small laptop should work.


I was meaning a site dealing exclusively in subtitles.

Also 28 Mbit seems rather excessive for the majority of 1080p content. I would have thought 5 - 10 Mbit would have been more than sufficient for virtually all content in H.264.

Animated content on the other hand is quite happy at 625 kbps with the right tweaks (not directly relevant but I’m rather pleased with how small I can make episodes of things like Bob’s Burgers).


Interesting. I was just using the default output from the MakeMKV ripper software. My HandBrakeCLI DVD rips are about 2.5 Mbit, so I figured that if Blu Ray has maybe six times as many pixels per screen, then to get the same picture quality I would need at least 15 Mbit for my Blu Ray rips.

I’ll do some research on that.


Depending on the content a low bitrate can be fine. Something with a lot of granular detail (footage of leaves on trees, for example) needs a higher bitrate but lots of the stuff we watch is fairly compressible. I have a rip of Fury Road that has a bitrate of about 4.75 Mbit and I haven’t noticed any artifacting even when watching it on a high DPI laptop screen.

I’m not sure which settings were used to encode it but when I was putting together settings for animated content I used this as a reference:

The settings aren’t specific to Avidemux - I used them in Handbrake.

Something worth remembering is that more pixels means more patterns. The annoying side effect is that low resolution footage isn’t as compressible as high res stuff!

My HD animated content in H.264 is marginally smaller than my SD stuff in Xvid!


I had exactly the same problem before (using LibreElec, therefore Kodi, on a Raspberry Pi 3). I suggest you have a look at this article that explains some options you may want to explore in order to fix this issue.

Also, I believe recent versions of Kodi have dedicated options to boost the frequency band used by dialogs by a few dB so that you can hear them clearly while not freaking out your neighbours when something explodes in the film :slight_smile:


Pierre, thanks for that link. It’s very helpful. I don’t consider myself an audiophile so I’ve never invested in anything past the cheapest sound options. But in fact my wife and I are going television shopping soon - I’ll consider getting at least a 5.1 system and making sure the television can do the right downsampling.


Here is a screenshot from the Settings screen on my Raspberry Pi 3 runing LibreElec 7.0.3:

As you can see, there is an option called “Boost centre channel when downmixing” and the help at the bottom explicitely mentions it’s to make the dialogues more clear. I set it to 3 dB but you can put a bit more if needed. It helped a lot for me!

(I still need the subtitles because I’m not a native speakers and British or American actors mumbling in English… hmmm, not that easy to understand anyway! :))

P.S.: Please note this option might be only available in Expert mode (see bottom left on the screenshot).


Thank you. I will use that option!

English is my native language, but I got into the habit of using subtitles when my children were younger. I could watch the film while trying to rock a baby to sleep. I kept the habit partly because of the wide variety in volume levels that I complained about. But I also kept the habit because there are still many scenes in many films where lines are mumbled and I can only understand the dialogue through subtitles.


Are you using CBR or VBR? I have a few rips with massively detailed scenes chewing upwards of 40-50Mbps, but it scales back down to <1Mbps for things like sparse opening titles. Making sure you’re not just picking a single bitrate for the entire encode will help with size and playback.


Thanks. I was actually using MakeMKV for the rips, and it just decrypts the H.264 files on the Blu Ray disk and copies them to disk. So most of them are VBR with an average bit rate in the high 20 Mb/s range.


I’m reencoding my Blu Rays with ffmpeg -i HARRY_POTTER_1_AND_THE_SORCERORS_STONE.mkv -c:a aac -strict -2 -c:s copy -c:v libx264 -crf 18 -preset slow HARRY_POTTER_1_AND_THE_SORCERORS_STONE_REDONE.mkv (for example) and I’m seeing file sizes drop 50% to 80% and I can’t see any difference in image quality. So maybe that’s the secret I’ve been missing the whole time.


It works! I’ve made four changes, and some combination of them works.

  1. I had been using powerline networking to get connectivity from the room with my ISP connection to the room with the television. I ran ethernet through conduit instead.
  2. I replaced my Amazon Fire TV Stick with a $60 (US) Khadas Vim Android single board computer. It’s got Android 6.0 and Kodi 17.0, quad core 2.0Ghz Cortex A-53, Gigabit ethernet, Mali 450, 2GB of RAM.
  3. I’ve re-encoded a number of Blu Rays. The original rips from MakeMKV were about 20-25GB, the re-encoded ones are as high as 15GB but as low as 8GB and I can’t see any difference in video quality.
  4. In the re-encoding process I also switched the audio codec from the ultra high quality ones in Blu Ray to aac. I’m sure an audiophile can tell the difference, but I can’t.

I paired the Amazon Fire TV remote with the Khadas gadget. Now Kodi shows all my films and all of them play nicely. (Well, not all - the re-encoding process takes a long time. It will be a month before all of my ripped Blu Rays are done.)


Moving off topic- saw a pop-up menu & it says the i-web is 50FPS

what does this mean @neuro & are there any books around on this subject ?


I don’t know, because I don’t know what you’re referring to :frowning:

Please respect our code of conduct which is simple: don't be a dick.