Conversion of vob (dvd et al(video only)) file to ogm


This post is a follow up on:
Conversions.

I am bit of on a deadline now! So come back later for a more detailed explanation.

#!/bin/bash
# Modified: Today by E.l.f
#
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2 of the License, or (at your option) any later
## version.
#
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
## details.
#
## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc., 51
## Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## http://www.gnu.org/copyleft/gpl.html
#
## Script-name - vob2ogm.sh
#
## Source (inspired on): http://ffmpeg.org/ffmpeg-doc.html
## And: http://ubuntuforums.org/showthread.php?t=1037517
## If colors are not defined in .bashrc, then uncomment the next three lines.
#YELLOW="\033[1;33m"
#RED="\033[0;31m"
#ENDCOLOR="\033[0m"
## Root check / Sanity check.  You decide.  >-)
## Just in case someone calls this script with sudo -s,
## or has cd'ed into his/her path.
if [ $USER = root ]; then
  echo -e $RED"Are you Insane!"
  echo -e $RED"Error: In order to use this script, one must NOT be $USER"
  echo -e $YELLOW"Exiting..."$ENDCOLOR
  exit 0
else
  echo ""
  echo "$USER may proceed."  
  echo "May peace be with you."  
fi
ls *.vob
echo -n "Enter filename: "
read INPUT
INPUT=$INPUT
if [ ! -f $INPUT ]; then
  echo ""
  echo -e $RED"Error: File doesn't exist!"
  echo -e $YELLOW"Exiting..."$ENDCOLOR
  echo ""
  exit 0
fi
OUTPUT=${INPUT%.*b}
TITLE=${INPUT%.*b}
OUTPUT+=".ogm"
OPTIONS=$(echo "--nosound --copyright "$COPYRIGHT" --title "$TITLE" --artist "$ARTIST" --location "$LOCATION" --date "$DATE" --contact "$CONTACT" --organization "$ORGANIZATION" -v 7 -o")
ffmpeg2theora $INPUT $OPTIONS $OUTPUT
exit 0
# find -iname '*.ext' -exec someScript "{}" \;
# Depends on sudo apt-get install libdvdcss2 k9copy ffmpeg2theora mkvtoolnix-gui avidemux mencoder ffmpeg

As for the metatags:

## JUST IN CASE
## Append a newline to this file 
## to make sure we won't be surprised when we open a new terminal.
## I.e. APPEND, APPEND, APPEND instead of REPENT.  >-)
echo "" >> $HOME/.bashrc 
echo "# Video encoding tags" >> $HOME/.bashrc
echo "export ARTIST=$USER" >> $HOME/.bashrc
echo "export LOCATION=WhatEver" >> $HOME/.bashrc
echo "export DATE=$(date +"%F")" >> $HOME/.bashrc
echo "export COPYRIGHT=$(echo "FairUseForAll")" >> $HOME/.bashrc
echo "export CONTACT=$(echo "you@secret-service.com")" >> $HOME/.bashrc
echo "export ORGANIZATION=$(echo "AnnonyMoose")" >> $HOME/.bashrc
# Change the variables to suit your needs.
#+ Edited today (6/11/10)
#+ Reason: I forgot the echo command *frowns and laughs*

PS: These new posts of mine will be in line with the notes I post on facebook.com. 😉 Though the formatting won’t be garbled this time. *Say demoronize* >-)

One thought on “Conversion of vob (dvd et al(video only)) file to ogm

  1. Pingback: Batch processing by means of using any script of your choosing. « Bohemian Wildebeest's Blog

Comments are closed.