My thoughts on Slackware, life and everything

Tag: mp4

KTOWN: live ISO with Plasma6 Alpha. Also, chromium now supports HEVC/AC3 playback

I have uploaded a 5 GB ISO file containing a new KTOWN variant of Slackware Live. This is the KDE Plasma6 Alpha release. Play around with it and perhaps you will be able to contribute to an improved Beta by finding and reporting the bugs you encounter.

Get the ISO from my NL or my US server (US ISO still uploading at the moment). There’s also an MD5 checksum and a GPG signature file in those same locations if you want to validate the download.

A lot of packages did not compile yet for various reasons. I am not too concerned about that, next update hopefully will be more complete. A lot of work still needs to be done however (by the KDE developers) to port the remainder of KDE Gear (formerly called Applications or Software Collection) to Qt6.
Not ported to Qt6 as of yet are: artikulate cantor cervisia juk kamoso kde-dev-utils kdenlive kdesdk-thumbnailers kdev-php kdev-python kdevelop kget kgpg kig kio-gdrive kipi-plugins kiten kmix konversation kqtquickcharts krfb ktorrent ktouch kwave libkipi lokalize marble okular parley poxml rocs umbrello.

Still, I was impressed with the fully working and stable Plasma6 Wayland session when I tested an unreleased KTOWN Live ISO a week ago. Of course, as things go, I seem to have broken the Wayland session in this public release of the KTOWN Live.
The version of SDDM graphical session manager should also be Wayland-capable but I will test that in a future ISO.

Let me know in the comments section below what you think of this Alpha release.

News about my chromium package (also its ungoogled sibling).

I was finally able to get the HEVC video and AC3 audio codec support working. There’s a patch set on github, maintained by StaZhu but I did not like the complexity and I am not really interested in GPU hardware-only support. The browser’s internal ffmpeg libraries playback HEVC just fine, taxing your CPU a bit more than in the case of a supported GPU.
Now, the Thorium Browser is also Chromium based and its developer Alex313031 used StaZhu’s patches and wrote some of his own to add not just HEVC video but also AC3 playback support.
Again, I did not like the complexity of his solution (documented on github) but could not get around using some of the patches provided by both. I simplified some of the others into a bunch of ‘sed’ commands. And that made it work for me.

The browser will now playback HEVC and AC3 media formats, as long as the container file is a MP4. I have not found how I can convince Chromium to also support MKV containers.
The chromium-119.0.6045.123 package is already available in my repository, and chromium-ungoogled is still compiling (the ungoogled patch kit only became available earlier today).

You can test the new HEVC playback capability here: https://test-videos.co.uk/ if you select any MP4/HEVC sample (none of those have sound) or Thorium browser test page: https://thorium.rocks/misc/h265-tester.html (those have AC3 audio).

Have fun!

New handbrake and mkvtoolnix packages for Slackware 14.2 and -current

handbrake_logoI was a couple of releases behind on the Handbrake video transcoding software. I am always a bit hesitant with upgrading Handbrake. It has a history of being hard to compile on the stable Slackware releases.

Most notably it is the GTK+3 based GUI for which our Slackware libraries are often too old. And indeed, with the latest 1.3.0 release I found that this would not compile on Slackware 14.2 despite the hack I already used for the previous package (1.2..2) which I created earlier in 2019. It took me a day to come up with a second patch that allows Handbrake 1.3.0 to compile against our gtk+3 3.18.9 while in fact the program’s GUI component wants gtk+3 3.20.0 or higher.
So, Slackware 14.2 users – please tell me if you find that some functionality of the GUI is not working… it should all work properly but you never know.
In addition, I had to add a patch to make the new dav1d AV1 decoder compile on Slackware 14.2 but luckily I could just re-implement what I had already done for VLC.

The package for Slackware-current built without any glitches. Yay.

Note that my ‘handbrake‘ package does not have any external dependencies – unlike the slackbuilds.org version.
Install and run, it’s that simple. Everything you need is compiled statically into the package. The ‘HandBrakeCLI‘ program is the command-line variant, whereas ‘ghb‘ is the GUI variant of HandBrake, also found in the “Multimedia” menu of your desktop environment.

Packages for Slackware 14.2 and -current with AAC audio encoding support can be obtained from my “restricted” repository:

The variant which does not support AAC audio encoding and therefore does not violate the stupid US software patents can be downloaded from the regular repository:

 

I also have neglected my mkvtoolnix package for a while. You may be aware already that MKVToolNix is a set of tools to create, alter and inspect Matroska files (most widely known as the MKV video container format).

When working on the handbrake packages, I decided to check out the latest mkvtoolnix as well. And what do you know… the latest release won’t compile on Slackware 14.2!
I went back through the releases of 2019 and found that 38.0.0 is the most recent version which still compiles using the gcc compiler of Slackware 14.2 against the boost libraries of Slackware 14.2. Anything newer will not compile. End of the line for mkvtoolnix releases on the stable Slackware then.
These issues are absent on Slackware-current. I could compile mkvtoolnix 41.0.0 (the most recent release) easily.

Note the dependencies for mkvtoolnix:
Since its GUI and multimedia support is based on Qt5, you’ll have to install libxkbcommon and qt5 from my repository. And the qt5 dependencies as well: OpenAL and SDL_sound. On Slackware 14.2 two more even: libinput and libwacom.
Starting with mkvtoolnix 20.0.0 there’s another, new, dependency: cmark. Like with all the other dependencies I mentioned, cmark can be downloaded from my repository or any of its mirrors.
Get all the packages here:

Enjoy! Eric

Re-encoding video for Android

So I bought myself a nice Android phone in april. It’s a HTC Desire, a real “tweakers’ phone”. It runs Android 2.1 – and before the end of the year, HTC should have an update to Android 2.2 available.

It is an impressive piece of work, and when I compare it to the iPhone or Windows Mobile based phones some of my friends/collegues carry with them, it clearly gives me a lot of freedom – I do not have any desire to “root” or “jailbreak” my phone in order to make it do what I want. I dream of putting Slackware on it, sometimes, but then I usually wake up fast… It’s a real Linux phone (with a SSH and a VNC client installed from the Android Market!), and the HTC Sense interface makes it just perfect and enjoyable as it is.

It goes without saying that I took a flat-fee Internet subscription; this kind of phone is not fully functional unless it is always online. I have been running a bandwidth metering app which told me that I transfered 440 MB in my first month. That would result in a pretty heavy bill if I did not have unlimited traffic.

I may write some more about my experiences with the Desire in future posts (so may exciting things to tell!), but for this one I want to talk about video playback on Android. Android has decent multimedia support out of the box, and audio as well as video players can make use of the standard codec libraries that the Android platform offers.

The “native format” I think you may call it that, for the Android seems to be H.264 video and AAC audio in a MP4 container. There are some limitations however, as people found out when trying unsuccessfully to play MP4  video files on their Android device that would not have had playback issues on a normal PC or mediabox.

Android only supports the H.264 baseline profile, meaning that some of the fancy encoding tricks that give you great video quality at lower bitrates (but require more processing power on playback) can not be used for videos you want to play on your Android device.

And rest assured, you do want to watch videos on the 800 x 480 pixel WVGA screen of the Desire! The AMOLED display has fantastic vibrant colours.

So, in order to create a video file that fits the display dimensions perfectly (without the scaling/resizing which would result in an ugly picture) and contains fully compatible MP4 video, I once again turned to my faithful companion… ffmpeg.

Here is a ffmpeg command line for you. This will take a video file (any supported format will work as input) and produce an Android-compliant MP4 file with WVGA dimensions (800 by 480 pixels). The input file will be transcoded in a two-pass process in order to achieve the best possible results. The transcoding will take a long time, so find something else to do in the meantime.

$ ffmpeg -i [inputfile] -threads 0 -vcodec libx264 \
    -vpre slow_firstpass -vpre baseline -b 480k -r 13 \
    -acodec aac -ab 128k -sameq \
    -pass 1 -f rawvideo -an -y /dev/null && \
    ffmpeg -i [inputfile] -threads 0 -vcodec libx264 \
    -vpre slow -vpre baseline -b 480k -r 13 \
    -acodec aac -ab 128k -ac 2 -sameq -pass 2 [outputfile].mp4

If you are on Slackware, then you get lucky. My ffmpeg packages (the variant that supports AAC audio encoding) are right here: http://slackware.org.uk/people/alien/restricted_slackbuilds/ffmpeg/

Have fun experimenting!

Eric

Youtube HD mp4 download

*** This post was updated with new JavaScript code on 27-oct-2009 ***

Sure, you can install Video Downloadhelper for Firefox if you want an easy way to download your favourite YouTube videos.

However, these will be downloaded in “FLV” format (Flash video). Nowadays, many videos on YouTube are available in High-Definition (HD) format and you may want to retrieve the higher quality (MP4) movies instead.

Here is a bit of JavaScript which checks if the movie you selected is available as HD 720p. If a HD format is available it will be the preferred download type (fmt24) instead of the usual “high” (fmt18) or
“regular”quality.

I got the javascript code from this page, which I found after my original javascript code stopped working (I guess Google removed the javascript functions to block folks like us):  http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html . The new code is a lot uglier than the initial javascript, but it works. That page also has the same code available, nicely reformatted, as a GreaseMonkey script if you have that firefox extension already installed.

Define the following text as a bookmark and you are only a click away from downloading HD YouTube videos (in Firefox, right-click the link below and select “bookmark this link“):

javascript:var%20video_id=null;var%20video_hash=null;var%20video_player=document.getElementById(‘movie_player’);if(video_player){var%20flash_variables=video_player.attributes.getNamedItem(‘flashvars’);if(flash_variables){var%20flash_values=flash_variables.value;if(flash_values){var%20video_id_match=flash_values.match(/[^a-z]video_id=([^(\&|$)]*)/);if(video_id_match!=null)video_id=video_id_match[1];var%20video_hash_match=flash_values.match(/[^a-z]t=([^(\&|$)]*)/);if(video_hash_match!=null)video_hash=video_hash_match[1]}}}if(video_id==null||video_hash==null){var%20args=null;try{args=yt.getConfig(‘SWF_ARGS’)}catch(e){}if(args){video_id=args[‘video_id’];video_hash=args[‘t’]}}if(video_id!=null&&video_hash!=null){var%20fmt=’18’;try{if(yt.getConfig(‘IS_HD_AVAILABLE’))fmt=’22’}catch(e){}if(!document.getElementById(‘download-youtube-video’)){var%20yt_mp4_path=’http://www.youtube.com/get_video?fmt=’+fmt+’&video_id=’+video_id+’&t=’+video_hash;var%20div_embed=document.getElementById(‘watch-embed-div’);if(div_embed){var%20div_download=document.createElement(‘div’);div_download.innerHTML=’%3Cbr%20/%3E%20%3Cspan%20id=\’download-youtube-video\’%3E%20%3Ca%20href=\”+yt_mp4_path+’\’%20onclick=\’blur(this);\’%3EDownload%20as%20MP4%3C/a%3E%3C/span%3E’;div_embed.appendChild(div_download);}if(navigator.appName!=’Microsoft%20Internet%20Explorer’){document.location.href=’http://www.youtube.com/get_video?fmt=’+fmt+’&video_id=’+video_id+’&t=’+video_hash}}}void(0);

Note: this was the old code which now will no longer work:

javascript:if(document.location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){document.location.href=’http://www.youtube.com/get_video?fmt=’+(isHDAvailable?’22’:’18’)+’&video_id=’+swfArgs[‘video_id’]+’&t=’+swfArgs[‘t’]}

The proof of the pudding is in the eating. Select a YouTube video, click on “pause” if you do not want to play it in the embedded video frame. Then, click on the bookmark you created and the video will start downloading. It will (always) be saved with the name “video.mp4” so you will have to rename it after the download finishes.

Have fun! Eric

© 2024 Alien Pastures

Theme by Anders NorenUp ↑