Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
raspberry pi dts to stereo decoding
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 944
Location: USA

PostPosted: Mon Feb 18, 2013 5:20 pm    Post subject: raspberry pi dts to stereo decoding Reply with quote

My raspberry pi is running debian, but all my movies/tv stuff sits on my gentoo fileserver. We have the raspberry pi setup upstairs in our bedroom and have only some cheap stereo speakers connected to it. The problem is that the raspberry pi cannot decode DTS via the hardware.

I wrote a script, which I run against the mkv file. The script decodes the DTS stereo into mp3 192 audio. A 1080 dts decoded mkv to 1080 mp3 mkv takes 1/20th of the time of the movie. Your mileage may vary...
Code:
#!/bin/bash

OUTPUT=`basename "$1"`
FILENAME=`echo "$OUTPUT"| tr '[A-Z]' '[a-z]' | sed s/dts/STEREO/g | rev | cut -b5- | rev`
EXTENSION=`echo "$OUTPUT" | rev | cut -c1-4 | rev`
DESTINATION="/home/cr0t/Files/usenet/UpStairs/"

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for line in $@
do
   ffmpeg -i "$1" -c:v copy -c:a libmp3lame -strict experimental -b:a 192 -ab 192k -ar 48000 -ac 2 -threads 0 -scodec copy $DESTINATION"$FILENAME"\_\_UpStairs$EXTENSION
done

IFS=$SAVEIFS

I call the script UpStairs.sh. You can run it like "UpStairs.sh file.mkv" or "UpStairs file1.mkv file2.mkv".
_________________
cya
    ©®0t
Back to top
View user's profile Send private message
YourNameInHere
n00b
n00b


Joined: 28 Mar 2007
Posts: 8

PostPosted: Wed Feb 20, 2013 10:39 am    Post subject: Reply with quote

@Cr0t
thx for sharing this.

I don't know if you already know the following:

https://github.com/JakeWharton/mkvdts2ac3

it's a bash-script (found a python-version also) like yours. It converts dts to ac3:
Code:
mkvdts2ac3 is a bash script which can be used for converting the DTS in Matroska (MKV) files to AC3. It provides you with a healthy set of options for controlling the resulting file.

(Source: README.md from mkvdts2ac3)

YourNameInHere
Back to top
View user's profile Send private message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 944
Location: USA

PostPosted: Thu Feb 21, 2013 1:56 am    Post subject: Reply with quote

YourNameInHere wrote:
@Cr0t
thx for sharing this.

I don't know if you already know the following:

https://github.com/JakeWharton/mkvdts2ac3

it's a bash-script (found a python-version also) like yours. It converts dts to ac3:
Code:
mkvdts2ac3 is a bash script which can be used for converting the DTS in Matroska (MKV) files to AC3. It provides you with a healthy set of options for controlling the resulting file.

(Source: README.md from mkvdts2ac3)

YourNameInHere
my one replaces the soundtrack with an mp3 layer, which works great with omxplayer. The script you posted adds a track.

Great as well.
_________________
cya
    ©®0t
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum