Mittwoch, 6. Mai 2015

Get the extension of a filename

Every now and then, one needs to decide upon a file its extension what to do.

This is what i've added as tui-str-extension:
out=""
FN=$( echo "$1" | sed s," ","",g)    # Remove any spaces and make it a single string
for chance in $(echo "$FN"|sed s,"\."," ",g)    # Use dots as string seperators
do    out="$chance"
done
if [ "$out" = "$FN" ]
then    echo ""
else     echo "${out%\ /}"     # Remove any tailing or single space
fi
Hope you like it :)

Mittwoch, 22. April 2015

My Change from F21 to F22-Beta

Oh well, how life just is, it happens all at once...

For the last 3 weeks i've been writing a script to build ffmpeg with some more features built in, such as x265 and libcd{io,db}.

During some testruns, i always do on my live machine - bad idea - dont do that! :p , i passed accidently passed no PREFIX, to the build script, with the result of several libs beeing linked ..now... to /usr/local/lib{64}, and me then deleted those files.

One would not assume, but somehow that inflicted pythons usage when i wanted to update the repositry for the vhs and tui updates.
The command 'createrepo' failed because of some error by python.

I then reinstalled python, and all other packages that might have some inflictation. So everything the was available from the fedora repositries but not the actual audio or video codecs.

Just happen to be in the IRC, seeing an announcement of the Beta release, and figured i've always had good experiences with the beta release, so i would skip the error search/troubleshoot and just install one of the betas.

As my moms tryout device (an old Dell Inspirion 510m) had no OS at the time, its now running XFCE F22 32bit just fine.

Also, since Fedora catched with with the LoveLock release of F15, figured it might be time to give it another try after 6 releases.

Quite more comfortable and fitting desktop usage than initialy.
And my laptop feels a bit cooler by temperature now too (compared to earlier G3 tryouts).
Though, for its currently building an AwesomeWM F22 based iso, its still quite cool.
I will have to compare when my livespin is installed.
And then share the used iso if the installation succeeded.

So as a final closure, once again the switch to the new release at its beta stage just so happened by coincidence with a part-break of my production system, and leads to an updated livecd iso.

As the pacmanfm-qt version just started to work properly on my system, i hope to be finaly able to solve the hotlink issue within the next few isos uploaded.

Happy living!

Dienstag, 7. April 2015

Building FFMPEG

Been on in all easter days, it pulls in so many different applications, codecs, drivers and whatnot.
Just imagine, the temporary build path contains more than 500mb of data, compared to the final binary of ffmpeg, which is not even 500kb in size when done.

Yesterday evening i was finaly able to build the (my) first ffmpeg.
Today when i wanted to redo it, starting with 0, figured many of the build steps got accidently optimized for rerunning, which means, some of the parameters for the first 'contact' got removed and have to be readded.

Eventhouth its a smaller script, about 700 lines of code, not beeing familiar with the building process of that many applications is not a small challenge.

But i just encoded my first x265 video last night, and i have to say, the quality is great, eveb more when comparing to the filesize.

That was a good motivator, to keep me going for the still missing (failing) things, such as, but not limited to:
  • vorbis
  • webp
  • v4l
  • ass
  • srt
  • rtmp
  • speex
  • wav
  • dc1394
Once it does what i want, this script will be part of VHS, as its a handler for ffmpeg it makes sense to let it build the tools it depends on.

I'll keep you posted :)

Samstag, 4. April 2015

Lan- & Global IP

As you probably know, a computer has at least 2 different IPs, at least when its connected to the internet.

Getting the internal (lan) IP adress, is no issue, we simply invoke ifconf and search the broadcast lines providing an IP adress.

For the external IP adress, one needs to parse a website which provides this information.
In this example i'm using this page: http://www.unix.com/what-is-my-ip.php

As first we load the page into a DATA variable, and prepare some of the html tags, as php will be interpreted and transformed to html.
How to get the actual value, depends upon the html you parse, and the hoster.

#!/usr/bin/env bash
# File:     myip.sh
# Description:    Simply prints internal and external IP using http://www.unix.com/what-is-my-ip.php
# GNU General Public License (GPL) 2015 by Simon Arjuna Erat (sea) (erat.simon@gmail.com)
# ------------------------------------------------------
#
#    Variables
#
    URL=http://www.unix.com/what-is-my-ip.php
    DATA=$(curl -s $URL) > /dev/zero
    str="DNS Lookup For"
#
#    Action & Display
#
    printf "%s\t%s\n" \
        "Internal" \
        "$(ifconfig | \
            grep -i broadcast | grep ^[[:space:]] | \
            awk '{ print $2}')"
    printf "%s\t%s\n" \
        "External" \
        "$(echo "$DATA" | \
            sed s,"$str","\n\n$str",g | sed s,"<"," ",g | \
            grep "$str" | awk '{print $4}')"

Samstag, 28. März 2015

Boosting VHS

Just had a creativity boot and VHS now supports streaming webradios and video streams.
It even stores them and lets you use them for later selection.



Currently finalizing and fixing the handle between video and audio only stream, and the encoding display during video streaming.

Once that is accomplished, i can quikly adapt that solution to the screen, webcam and guide recording.

Cant wait for that :)
Have a great weekend!

Freitag, 13. März 2015

AwesomeWM-Spin 3.18.8-201

The new LiveImage is available.

Sadly, QEMU wont load the iso, even after 20 minutes of waiting...
Just last weekend i've figured there was an issue with the Anaconda installer on 3.18.7-200.
Took me until today to figured out the build error i suddenly was getting.

64 Bit already on sourceforge, 32 bit shortly will be.
Going to install the 32 bit on my testing device on saturday.

Donnerstag, 12. März 2015

VHS - DvD Encoding

Yay, just got 'my third' feedback regarding VHS.

Actualy it was a bug report, but for some reason the user didnt reckognize as such.
Actualy it was not even a real bug, i was working on the functionality of encoding DVD's, but for some reason lost track of it and forgot to continue.

The 'core' solution was quickly found, but the updated fine tuning, as i was previously working on it - there were some 'preparations' not completed yet.

So i needed to do some testing.

Now having some 'options' if the default copy mode of vobcopy should be different.
This may help to solve copy issues...


Please acknowledge that the output directory is $XDG_VIDEOS_DIR (defaults to $HOME/Videos).

But there are DVDs of which i cannot get vobcopy to work properly, as the drive stops spinning. This can occour with any mode, most-chapters, longest-play or specific title.

All of these arguments can be exectued directly, and reused as long the temp data is not removed and the disc is inserted.
Obviously, you would need to know in advance which audio stream is on which id when you want to use "-I ID".

vhs -Dq dvd -z 1:00-1:59:16 -I "4 2"
This will encode the dvd  to 'dvd' quality while keeping aspect ratio of original videostream, starting at minute 1 of playtime of the copied  vobfile, and lasting to 1 hour 59 minutes and 16 seconds of original playtime, using audio streams #4 as default-  and #2 as second audio stream.

vhs -DQ fhd -tl jpn
Will encode the disc to a full hd size, using subtitles and include streams which are japanese - if both your default languages are found for audio and subttile, you'll end up having 3 audio streams and 3 subtitle streams.

vhs -D
Will save the dvd without compression.