Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian) Risorse italiane (documentazione e tools)
  • Search

[TIP] Masterizzare un SVCD con gentoo

Forum riservato alla documentazione in italiano.

Moderator: ago

Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
Author
Message
Ginko
Guru
Guru
User avatar
Posts: 371
Joined: Wed May 01, 2002 9:03 am
Location: nearby my linux laptop
Contact:
Contact Ginko
Website

[TIP] Masterizzare un SVCD con gentoo

  • Quote

Post by Ginko » Wed Oct 22, 2003 12:47 pm

Ciao,

come da oggetto. Avete bisogno di
  • media-video/transcode
    media-video/mjpegtools
    media-video/vcdimager
    app-cdr/cdrdao
    media-video/mplayer
Lo script per rendere l'operazione piu' semplice e' :

Code: Select all

#!/bin/sh
#
######################################################################
#
#       __  ___      __            ______    ____________
#      /  |/  /___ _/ /_____      / ___/ |  / / ____/ __ \
#     / /|_/ / __ `/ //_/ _ \     \__ \| | / / /   / / / /
#    / /  / / /_/ / ,< /  __/    ___/ /| |/ / /___/ /_/ /
#   /_/  /_/\__,_/_/|_|\___/____/____/ |___/\____/_____/
#                         /_____/
#
#  Created on:   Thu Oct 16 22:32:16
#  Author:       Gianluca rotoni, Software Engineer
#
#  Copyright (C) 2003 Gianluca Rotoni <gianluca@rotoni.com>
#
#  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., 59 Temple Place - Suite 330,
#  Boston, MA  02111-1307, USA.
#
######################################################################
#
# Create, burn and play an SVCD out of a mpeg file

#
# Binaries locations
#
ECHO=/bin/echo
RM=/bin/rm
MKDIR=/bin/mkdir

#
# Print header
#
$ECHO "Make_SVCD (c) Rotoni Gianluca"
$ECHO "A GPL script to create, burn and play SVCD"
$ECHO

#
# Check whether all required software is installed
#
err=0
for bin in transcode mplex vcdimager cdrdao mplayer mpeg2enc; do
  type $bin >/dev/null 2>&1
  if [ $? -ne 0 ]; then
    err=1
    $ECHO "$bin not found"
  fi
done

if [ $err -eq 1 ]; then
  $ECHO "Missing vital software, please install before continuing"
  exit 1
fi

#
# Read autoconfig, if exist
#
if [ ! -z $HOME -a -f $HOME/.makesvcdrc ]; then
  source $HOME/.makesvcdrc
fi

#
# Read user settings
#
$ECHO -n "Enter location of source movie file [$src_prev]: "
read src

if [ -z $src ]; then
  src=$src_prev
fi

if [ -z $src ]; then
  $ECHO "Must specify a source file"
  exit 1
fi

if [ ! -f $src ]; then
  $ECHO "$src no such file or directory"
  exit 1
fi

$ECHO -n "Enter destination directory [$destdir_prev]: "
read destdir

if [ -z $destdir ]; then
  destdir=$destdir_prev
fi

if [ -z $destdir ]; then
  destdir=.
fi

if [ ! -d $destdir ]; then
  $ECHO -n "$destdir not found, creating... "
  $MKDIR $destdir 2>/dev/null
  if [ $? -ne 0 ]; then
    $ECHO "nok!"
    exit 1
  else
    $ECHO "done!"
  fi
fi

$ECHO -n "Enter output base filename [$filename_prev]: "
read filename

if [ -z $filename ]; then
  filename=$filename_prev
fi

if [ -z $filename ]; then
  $ECHO "Must specify a file name!"
  exit 1
fi

$ECHO -n "Enter movie title [$filename] : "
read title

if [ -z "$title" ]; then
  title=$filename
fi

$ECHO -n "Shall I delete all working files after the creation process (y/N)? "
read delete

if [ -z $delete ]; then
  delete="N"
fi

$ECHO -n "Shall I burn the SVCD right after the creation process (y/N)? "
read burn

if [ -z $burn ]; then
  burn="N"
else
  if [ $burn == "y" -o $burn == "Y" ]; then
    $ECHO "Remember to put a fresh CD-R into the CD writer before proceeding"
    $ECHO
    $ECHO -n "Enter burning device [$device_prev] : "
    read device

    if [ -z $device ]; then
      device=$device_prev
    fi

    if [ -z $device ]; then
      $ECHO "Device $device not found"
      exit 1
    fi

    if [ ! -r $device ]; then
      $ECHO "Device $device not found"
      exit 1
    fi

    $ECHO -n "Shall I play the SVCD right after the burning process (y/N)? "
    read play
    if  [ -z $play ]; then
      play="N"
    fi
  fi
fi

#
# Write the autoconfig file
#
if [ ! -z $HOME ]; then
  $ECHO "src_prev=$src; export src_prev" > $HOME/.makesvcdrc
  $ECHO "destdir_prev=$destdir; export destdir_prev" >> $HOME/.makesvcdrc
  $ECHO "filename_prev=$filename; export filename_prev" >> $HOME/.makesvcdrc
  $ECHO "device_prev=$device; export device_prev" >> $HOME/.makesvcdrc
fi

#
# Transform the MPEG file into SVCD format, extract audio onto MPA file
#
transcode -N 0x50 -V -i $src -y mpeg2enc,mp2enc -F 5 -E 44100 -b 224 -o $destdir/$filename

#
# Merge audio and video files
#
if [ -f $destdir/$filename.m2v -a $destdir/$filename.mpa ]; then
  mplex -V -f 5 -o $destdir/$filename.mpg  $destdir/$filename.m2v $destdir/$filename.mpa
else
  $ECHO "transcode didn't produce expected output, exiting"
  exit 1
fi

#
# Produce a SVCD file set (cue + bin files)
#
if [ -f $destdir/$filename.mpg ]; then
  vcdimager -t svcd -l "$title" -c $destdir/$filename.cue -b $destdir/$filename.bin $destdir/$filename.mpg
else
  $ECHO "mplex didn't produce expected output, exiting"
  exit 1
fi

#
# Brun SVCD if required
#
if [ -f $destdir/$filename.cue -a $destdir/$filename.bin ]; then
  if [ $burn == "y" -o $burn == "Y" ]; then
    cdrdao write --device $device $destdir/$filename.cue

    #
    # Play SVCD if required
    #
    if [ $play == "y" -o $play == "Y" ]; then
      mplayer vcd://2 -cdrom-device $device
    fi
  fi
else
  $ECHO "vcdimager didn't produce expected output, exiting"
  exit 1
fi

#
# Deletes working files if required
#
if [ $delete == "y" -o $delete == "Y" ]; then
  $RM -f $destdir/$filename.m2v
  $RM -f $destdir/$filename.mpa
  $RM -f $destdir/$filename.mpg
fi
Saluti
--Gianluca
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Thu Oct 23, 2003 10:57 am

Sei troppo un grande. Ci vediamo presto :wink: .
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Risorse italiane (documentazione e tools)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic