SilverWav's Journal

The best is yet to come…

Posts Tagged ‘avi

Avidemux vob to avi, lightning fast

leave a comment »

Avidemux is a fantastic piece of kit.

Transcoding takes a lot of time and CPU, whereas this application moves the content from one container (vob) to another (avi) instead.


select vob
e.g. VTS_01_1.VOB
name the file
e.g. file.avi


Written by SilverWav

April 19, 2010 at 1:12 am

Posted in Feature

Tagged with , , , , ,

Note: Remuxing mkv to avi for the Xbox 360

with 2 comments

Thanks to Zeroshade, details here.

Packages Needed:

mkvmerge, mkvextract (package mkvtoolnix), bbe, mplayer, normalize-audio, neroAacEnc, and mp4creator

Install command:

sudo apt-get update && sudo apt-get install mkvtoolnix bbe mplayer normalize-audio mpeg4ip-server

Get neroAacEnc here.

Manual Install:

cd linux
sudo mv neroAacEnc /usr/bin
sudo chmod +x /usr/bin/neroAacEnc here.

Example Usage:

./ file1.mkv

# zeroshade's script for remuxing mkv to mp4


## remuxer to remux AVC mkv videos to mp4's that can be sent to xbox 360.
#  requires: mkvmerge, mkvextract (package mkvtoolnix), bbe, mplayer, normalize-audio
#            neroAacEnc (
#            mp4creator (package mpeg4ip-server)

if [ -z "$MKV" ]; then
   echo "Usage: `basename $0` <MKV>";
   exit 5
# using a tmp file allows for extensibility
# if desired, the script can be extended using the audio track
# and codec by uncommenting the lines below
mkvmerge -i "$MKV" > /tmp/info.$$.txt
VID=`grep "Track ID .: video" /tmp/info.$$.txt | awk '{ print sprintf("%d",$3) }'`
#AUDINF=`grep "Track ID .: audio"`/tmp/info.$$.txt`
#AUD=`echo $AUDINF | awk '{ print sprintf("%d",$3) }'`
#AEXT=`echo $AUDINF | awk '{ print $5 }' | sed 's/(A_\|)//g' | awk '{ print tolower($1) }'`
FPS=`mplayer -identify "$MKV" -vc null -ao null -vo null -frames 0 2>/dev/null | grep ^ID_VIDEO_FPS | sed -e 's/^.*=//'`

rm /tmp/info.$$.txt

echo "------Zeroshade's remux script. MKV to mp4 V.$VERSION"

if [ -z "$VID" ]; then
    echo "Error getting video track from mkvmerge."
    exit 5

if [ -z "$FPS" ]; then
    echo "Error getting framerate from mplayer"
    exit 5

BASE=`echo $MKV | sed 's/\.mkv//'`
echo "------Extracting video track-----------"
mkvextract tracks "$MKV" "$VID:$BASE.h264"

echo "------Changing Profile-----------------"
bbe -e "r 7 \41" --output="$BASE.tmp.h264" "$BASE.h264"
rm "$BASE.h264"

echo "------Extracting audio track-----------"
mplayer "$MKV" -novideo -vc null -vo null -ao pcm:fast:file="$BASE.wav" -channels 2

echo "------Normalizing audio----------------"
normalize-audio "$BASE.wav"

echo "------Encoding audio to m4a------------"
neroAacEnc -lc -ignorelength -q 0.50 -if "$BASE.wav" -of "$BASE.m4a"

echo "------Removing origingal audio dump----"
rm "$BASE.wav"

echo "------Converting m4a to aac"
mp4creator --extract=1 "$BASE.m4a" "$BASE.aac"

echo "------Cleaning up m4a------------------"
rm "$BASE.m4a"

echo "------Creating mp4 video---------------"
mp4creator --create="$BASE.tmp.h264" -rate=$FPS "$BASE.mp4"

echo "------Adding audio to the video--------"
mp4creator --create="$BASE.aac" -rate=$FPS "$BASE.mp4"

echo "------Removing h264 and aac------------"
rm "$BASE.tmp.h264" "$BASE.aac"

echo "------Done! Enjoy your video! =)-------"


*Ignore this*
Working example of WordPress sourcecode:

Written by SilverWav

April 18, 2010 at 10:40 pm

Posted in Notes

Tagged with , , , , , , ,