My appetite for media consumption has gone up several notches during the whole pandemic WFH (work from home) phase that has been happening for a long time since March of 2020. Video content to be more exact. All the more so when there was an ongoing lock-down/quarantine/curfew and pretty much all that one can do outside the house was to go buy something at the grocery store. How exciting to see other people in the flesh!
YouTube and Netflix certainly helped contribute a lot to mitigate the boredom of staying at home, alone. And while I did start reading an actual, physical book last year, I have not been able to finish it quite yet.
This was also the time when I started digging up old media content that I have saved up in my external disk drive for a rainy day. Things that I’ve watched before and were interesting enough for me to put it in that backup disk for a chance to re-watch it later on. And that I did. Spent dozens of hours re-watching old movies and fairly recent ones too.
These all came in different video formats. Most of the time I would cast it to the TV screen. I have this 2nd generation Google Chromecast that makes it possible. Don’t need a Smart TV. It is also portable and very easy to setup. Can link Spotify too, or cast a computer’s screen through it albeit some milliseconds lag (I noticed). But I digress.
While most, if not all, can be played on my desktop’s default movie player (I use SMPlayer with MPV backend by the way), I noticed that some failed to play on Chromecast. I thought this was a player issue. If it failed to play after repeated attempts, I would fall back on my secondary monitor for viewing.
After a number failed to cast to my TV screen, a started to wonder if the issue was something else. Maybe it wasn’t SMPlayer’s inability to cast it via Chromecast after all. So I did some research. I found out later on that it is a limitation of Google Chromecast.
The video format where I had trouble casting to the TV is usually those that were encoded as MKV (Matroska Multimedia Container).
The underlying short reason is that if the given content is in H.265 video codec and DTS/AC3 audio codec it cannot be streamed by Chromecast. However, those with H.264 and AAC codecs, respectively, are supported. The newer Google Chromecast version might be different. I recall that there is a 3G version that came out in 2018, and a Chromecast with Google TV in 2020.
Workarounds for this limitation go as far as renaming the file with a .mp4 extension, but this normally does not work. At least in my experience. Again, I suppose it all depends on what codecs were used when the file was packaged. Then another more promising workaround is to re-encode the file to something supported by Chromecast. The latter one requires a bit more work and time but works.
Naturally, I went for the 2nd option. I searched for a video transcoder application for Ubuntu Linux and found out about HandBrake. Yeah a weird name, I say, but does its job quite well. It is free, multi-platform (available on Linux, MacOS and Windows) and has lots of features too.
There are enough configurable options that come with HandBrake for those wanting to give it a more customized touch. Yet, it is easy enough to use for the many who just want to skip all the tinkering but go straight to the conversion part. The built-in presets and defaults help a lot. Just open the file and hit start. Queuing is also possible which is a bonus for when transcoding multiple files (like for a series).
How long it takes to transcode files depends on the source size and settings to be used for that desired output. My experience is that for a 1080p/60-minute length conversion from MKV to MPEG-4 took about half an hour. This was using the default Fast 1080p30 preset. Your mileage may vary.
This is a CPU-intensive task too. The newer versions of HandBrake has the capability to use your computer’s GPU to encode. This will allow for faster conversions. That ability will come out in the Video Encoder options under the Video tab if it detects a GPU it can work with. My ASUS laptop has a 7G Intel Core i7 CPU. The Nvidia GPU it came with is not enabled on this Ubuntu, unfortunately. I didn’t bother to from the start. I can try it out and see the difference by rebooting to Windows 10 and transcoding the same files. If only to see how much time I could have saved by pushing most of the work to the GPU. Some day perhaps.
- > GRUB2 Issues With Ubuntu 12.04 Installation May 2, 2012
- > Elementary OS Freya February 19, 2015
- > Celebrate Ubuntu – YouTube Channel June 3, 2011
- > the alternative OS July 16, 2006
- > Neverware CloudReady Alternative to ChromeOS Does Not Work on VM April 19, 2020