H's Blog A good shell is the best user interface.

1Feb/113

UPnP for VDR’s Live Streams

I recently realized, that I just have to announce streams by UPnP to access them using my Asus O!Play.

Since my VDR installation provides URLs like http://MyVDRHostname:3000/EXT/ChannelNo access to the live channels, I started using MediaTomb to publish the URLs by UPnP.

7Sep/107

Asus O!Play Release

I upgrade my O!Play media box to the newest Release 1.30P on Sunday and CIFS really improved.
Before that upgrade I had to open the Network folder twice to get my Samba server into the list, now it will detect that immediately.

You can download the new release at the Asus Support Download Site. Please choose product Multimedia, series Digital Media Player and model O!Play HDP-R1.
A popup will ask for the operating system, select Linux and you will find a list of downloadable files.
The item Firmware contains the archives with latest firmware releases. Please choose the file properly, and follow the comments about NTSC resp. PAL. In the moment the version number contains a suffix P or N accordingly.
Conduct the upgrade on your OWN RISK by extracting the archive on an USB stick. This will provide a HowTo for the installation.

7Sep/102

Merge/Join MP4 Videos

Using cat on the command line to simply merge multiple MPEG4 files into one, will just not work. VLC will stop after the first part.
But this is not really surprising, the header is originating from the first file and still contains the information about the single file.
I am now using a mencoder wrapper script to merge multiple MPEG4 files into a new MPEG4 container named complete.mp4:

#!/bin/bash

if [ -s "complete.mp4" ]; then
    echo "$0: complete.mp4 exists... bailing out."
    exit 1
fi
exec mencoder "$@" -ovc copy -oac copy -of lavf -lavfopts format=mp4 -o complete.mp4

This script will deny to overwrite an existing non-empty complete.mp4. So drop a pre-existing file of that name first.

15Aug/101

Fix VDR Recordings (MPEG-PS)

I currently use the following script to copy a VDR recording into a MPEG-PS container using a very robust input decoder, so any error in the recording is fixed:

#!/bin/bash

for f in "$@"; do
    [ -r "$f" ] || continue
    g="$(basename "$f" .vdr).mps"
    [ -e "$g" ] && continue
    mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy "$f" -o "$g"
done

Since audio/video is just copied to the destination, this step should be fairly loss-less and fast.

Tagged as: , , 1 Comment
24Jul/100

Shrink VDR Recordings (MP4)

I currently use the following ffmpeg script to convert the recordings of my VDR 1.6 to more handy MPEG4 files:

#!/bin/bash

profile="-vpre hq"
quality="-crf 26"   # constant quality
prefix="nice"         # "nice ionice -c3"

for i in "$@"; do
    [ -r "$i" ] || continue
    output="$(basename "$i" | cut -f 1 -d .).$profile.mp4"
    [ -e "$output" ] && continue

    $nice ffmpeg -i "$i" -acodec copy -scodec copy -threads 0 \
        -vcodec libx264 $profile $quality "$output"
done

But I am still testing the ffmpeg parameters and I use additional calls to avidemux to merge parts and establish audio audio/video sync.
Sometimes I have to save the stream with -700ms shift after the ffmpeg conversion.
I got the x264 presets at the ffmpeg repository and downloaded them to $HOME/.ffmpeg, so the vpre option will not complain.
Of course the quality setting is subject to your personal constraints to file size and video quality.