cmd:VCDImager 

Source 

http://www.vcdimager.org/

http://freshmeat.net/projects/vcdimager/

Stable 0.6.2 15-May-2001 Development 0.7.20 20-Feb-2004

Supplied Tools 

The following command-line tools are provided with this package:

`vcdimager'

Simple front-end, allowing for easy command-line controlled generation of basic VCD and SVCD disc images without an intermediate XML description.

`vcd-info'

Selectively shows detailed information about the structure a Video CD. See *Note Introduction: (vcd-info)Top.

`vcdxgen'

XML VCD-description generator, with a command-line interface similar to the classic `vcdimager' front-end.

This tool works almost like the `vcdimager' tool, except that it
creates an intermediate XML description, instead of directly building
the disc image. This XML can be used as a starting point for
customization.
The XML file can then be fed to `vcdxbuild' for building the actual
image file(s).
`vcdxbuild'

Builds a VCD/SVCD according to a supplied XML description and files containing the MPEG program streams referred to in the XML description. See *Note vcdxbuild::.

`vcdxrip'

Disassembles a given VCD or SVCD disc into a XML description and the contained MPEG program streams. See *Note vcdxrip::.

`vcdxminfo'

This is a debugging tool for displaying some MPEG properties, as conceived by internal library `libvcd' and `libvcdinfo'. See *Note vcdxminfo::.

`cdxa2mpeg'

A program to strip the RIFF header on CD-XA-format tracks. See *Note cdxa2mpeg::.

Help 

Support 

The support forum http://savannah.gnu.org/support/?group=vcdimager

To post a message to the Help-VCDImager m-list, send email to help-vcdimager@gnu.org.

To contact the author directly: <hvr@hvrlab.org>.

Simple Multitrack Example 

Taken from 'info vcdimager'.

In the following example session, the files `track1.mpg', `track2.mpg' and `track3.mpg' are mastered into the default output files `videocd.cue' and `videocd.bin'. The volume label is set to `My Test VCD'.

$ vcdimager --iso-volume-label="MY_TEST_VCD" track1.mpg track2 track3.mpg
   INFO: scanning mpeg sequence item #0 for scanpoints...
   INFO: scanning mpeg sequence item #1 for scanpoints...
   INFO: scanning mpeg sequence item #2 for scanpoints...
   INFO: writing track 1 (ISO-9660)...
   INFO: writing track 2, MPEG1, NTSC SIF (352x240/29.97fps), 1 audio stream...
   INFO: writing track 3, MPEG1, PAL SIF (352x288/25fps), 1 audio stream...
   INFO: writing track 4, MPEG1, NTSC SIF (352x240/29.97fps), 1 audio stream...
finished ok, image created with 13626 sectors [03:01.51]
The same with XML based tools:
$ vcdxgen --iso-volume-label="MY_TEST_VCD" track1.mpg track2 track3.mpg
(Super) VideoCD xml description created successfully as `videocd.xml'
$ vcdxbuild videocd.xml
   INFO: scanning mpeg sequence item #0 for scanpoints...
   INFO: scanning mpeg sequence item #1 for scanpoints...
   INFO: scanning mpeg sequence item #2 for scanpoints...
   INFO: writing track 1 (ISO-9660)...
   INFO: writing track 2, MPEG1, NTSC SIF (352x240/29.97fps), 1 audio stream...
   INFO: writing track 3, MPEG1, PAL SIF (352x288/25fps), 1 audio stream...
   INFO: writing track 4, MPEG1, MPEG1, NTSC SIF (352x240/29.97fps), 1 audio stream...
finished ok, image created with 13626 sectors [03:01.51]
$

Adding Files to the Video CD 

Files can be added to the ISO file-system, that is the first track of the Video CD, by making use of the command-line options `—add-file=FILE,ISO_FILENAME' and `—add-file-2336=FILE,ISO_FILENAME'. The latter option allows you to include files containing the complete user data of mode 2 CD-ROM sectors (10).

The path name given as ISO_FILENAME determines where to link the file in the file-system of the Video CD. The given path name must be a valid ISO9660 file name with the following restrictions:

If the parent directory for a file entry does not exist it will be created automatically on demand.

For example, if you happen to have a CD-i application consisting of the files `cdi_imag.rtf', `cdi_text.fnt', `cdi_vcd.app' and `cdi_vcd.cfg', with `cdi_vcd.app' being the main application executable, you could add the following lines to your `~/.popt' popt(12) aliasing file(13)

vcdimager alias --cdi \
   --iso-application-id "CDI/CDI_VCD.APP;1" \
   --add-file-2336 /usr/share/cdi/cdi_imag.rtf,CDI/CDI_IMAG.RTF \
   --add-file      /usr/share/cdi/cdi_text.fnt,CDI/CDI_TEXT.FNT \
   --add-file      /usr/share/cdi/cdi_vcd.app,CDI/CDI_VCD.APP \
   --add-file      /usr/share/cdi/cdi_vcd.cfg,CDI/CDI_VCD.CFG

SVCD Player Compatibility 

If you have problems with your playing device failing to _detect_ a created SVCD, you can may the following things (some of the advices below apply to VCDs as well):

  1. Take warnings serious! If there were warnings issued during the image building process, chances are the problems are related to them.

  2. Make sure the SVCD is physically OK (e.g., analyze the disc with `vcddebug' or try it on some other playing device).

  3. Try creating the SVCD by enabling the `svcd vcd30 mpegav' and `svcd vcd30 entrysvd' options.

  4. Add an empty `/SEGMENT' directory, if it isn't created due to inclusion of SPIs.

    --add-dir=ISO_DIRNAME
           add empty dir to ISO fs
  5. If you have confusing time readings for discs with more than one video track, you might need to use the `svcd vcd30 tracksvd' option.

Test run 

2<<, >>

mfilm=test1.mpg
$ gmplayer -dr -vo x11 -vm "$mfilm"; xset +dpms
VIDEO:  MPEG1  352x240  (aspect 12)  29.970 fps  1149.6 kbps (143.7 kbyte/s)
$ vcdimager -l "label as Testing" "$mfilm"
finished ok, image created with 3175 sectors [00:42.25] (7467600 bytes)
$ dir -gG videocd*
-rw-rw----  1 7467600 Aug 20 18:37 videocd.bin
-rw-rw----  1     172 Aug 20 18:37 videocd.cue
Ref:
test1.mpg:     5802852
videocd.bin:   7467600
ToBurn=videocd
mfilm="$ToBurn.bin"; gmplayer -dr -vo x11 -vm "$mfilm"; xset +dpms

1<<, >>

$ vcdimager -l Test -c Test-1.cue -b Test-1.bin 'Test-1.mpg'
   INFO: scanning mpeg sequence item #0 for scanpoints...
++ WARN: string 'Test' fails d-character constraint (pos = 1)
   INFO: writing track 1 (ISO9660)...
   INFO: writing track 2, MPEG1, NTSC SIF (352x240/29.97fps), audio[0]: l2/44.1kHz/224kbps/stereo ...
finished ok, image created with 229960 sectors [51:06.10] (540865920 bytes)
$ mplayer Test-1.bin
Playing Test-1.bin
MPEG-PS file format detected.
VIDEO:  MPEG1  352x240  (aspect 2)  29.97 fps  1100.0 kbps (137.5 kbyte/s)
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 28000->176400 (224.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)

Version v0.7.20-2 

% debfoster vcdimager
The following extra packages will be installed:
  libcdio0 libiso9660-0 libvcdinfo0
The following NEW packages will be installed:
  libcdio0 libiso9660-0 libvcdinfo0 vcdimager
0 upgraded, 4 newly installed, 0 to remove
Need to get 740kB of archives.
After unpacking 1552kB of additional disk space will be used.

documented on: 2004.08.20

Version v0.7.12 (Linux) 

http://packman.links2linux.org/index.php4?action=251

Description 

GNU VCDImager is a full-featured mastering suite for authoring, disassembling and analyzing Video CD's and Super Video CD's.

The core functionality consists of directly making Video CD BIN/CUE-style CD images from mpeg files, which (after being written to CDR(W) media) can be played on standalone VCD players or DVD players and on computers running GNU/Linux, MacOS, Win32 or any other OS capable of accessing VCD's. BIN/CUE images can be burned with [cdrdao] (please use a recent version, since older ones do not support BIN/CUE-style cuesheets) under GNU/Linux (and other supported platforms by cdrdao, e.g. freeBSD, Irix, Solaris and even win32)

vcd-info    display (selectively) the contents of a Video CD or CD image
vcdimager   generates simple pbc-less VCD and SVCD disc images directly
vcdxgen     XML VCD-description generator
vcdxbuild   Builds a VCD/SVCD according to a supplied XML control file.
vcdxrip     Reverses the process for a given VCD or SVCD disc.
vcdxminfo   Debugging tool for displaying MPEG stream properties.
cdxa2mpeg   Simple tool for converting RIFF CDXA file to plain mpeg.

Authors:

Herbert Valerio Riedel <hvr@gnu.org>
Rocky Bernstein <rocky@panix.com>
Homepage: http://www.vcdimager.org/[]

Last Update: 04-05-02 02:31 AM

SuSE 9.1, SuSE 8.2: Version 0.7.20 RedHat 9: Version 0.7.17

Changes 

Changes from VCDImager v0.7.11 (Linux) to VCDImager v0.7.12 (Linux)

Download 

http://www.dawnload.net/alternative_platforms/linux_software/vcdimager_linux.cfm

VCDImager is a little program which allows direct making of VideoCD or SVCD BIN/CUE CD images from MPEG-1 files, which can be played on standalone VCD players or DVD players and on computers running Linux, MacOS, Win32 or any other OS capable of accessing VCDs.

The program is a commandline based, so step back if you hate tools without GUI.

VCDImager is the tool for you if you're looking for a completely free VCD/SVCD solution. It works without problems with VCD and SVCD files created using the TMPGEnc MPEG encoder.

cmd:vcdxrip 

Basic Info 

Usage 

vcdxrip -v -p --bin-file "$ToBurn.bin"
vcdxrip -v -p --cue-file "$ToBurn.cue"
vcdxrip -v -p --cdrom-device
vcdxrip -v -p -C /dev/cdrom

Help 

Quick Help 

$ vcdxrip --help
Usage: vcdxrip [OPTION...]
 -o, --output-file=FILE          specify xml file for output (default:
                                 'videocd.xml')
-b, --bin-file[=FILE]           set image file as source (default:
                                'videocd.bin')
-c, --cue-file[=FILE]           set "cue" CD-ROM disk image file as source
--sector-2336                   use 2336 byte sector mode for image file
-C, --cdrom-device[=DEVICE]     set CDROM device as source
-i, --input[=FILE]              set source and determine if "bin" image or
                                device
-N, --nrg-file[=FILE]           set Nero CD-ROM disk image image file as
                                source
--no-ext-psd                    ignore /EXT/PSD_X.VCD
--no-command-comment            Don't include command name as a comment
--norip                         only extract XML structure
--nofiles                       don't extract files
--nosequences                   don't extract sequences
--nosegments                    don't extract segment play items
-p, --progress                  show progress
-t, --track=INT                 rip only this track
--filename-encoding=STRING      use given charset encoding for filenames
                                instead of UTF8
-v, --verbose                   be verbose
-q, --quiet                     show only critical messages
--gui                           enable GUI mode
-V, --version                   display version and copyright information
                                and exit

Detail Help 

Success Example 
vcdxrip -p --cdrom-device
$ diront
-rw-rw----  1     92572 Sep  8 15:27 _cdi_vcd_back.dyv
-rw-rw----  1     80702 Sep  8 15:27 _cdi_cdi_appl.vcd
-rw-rw----  1     93719 Sep  8 15:27 _cdi_vcd_btn.c8
-rw-rw----  1      1487 Sep  8 15:27 videocd.xml
-rw-rw----  1  40161044 Sep  8 15:27 avseq01.mpg
mfilm=avseq01.mpg
gmplayer -dr -vo x11 -vm "$mfilm"; xset +dpms
$ cdrecord -toc
first: 1 last 6
track:   1 lba:         0 (        0) 00:02:00 adr: 1 control: 4 mode: 2
track:   2 lba:      1050 (     4200) 00:16:00 adr: 1 control: 4 mode: 2
track:   3 lba:      2874 (    11496) 00:40:24 adr: 1 control: 4 mode: 2
track:   4 lba:      3769 (    15076) 00:52:19 adr: 1 control: 4 mode: 2
track:   5 lba:      4437 (    17748) 01:01:12 adr: 1 control: 4 mode: 2
track:   6 lba:      4986 (    19944) 01:08:36 adr: 1 control: 4 mode: 2
track:lout lba:    217803 (   871212) 48:26:03 adr: 1 control: 4 mode: -1
$ vcdxrip -p --no-ext-psd --track=5 --cdrom-device
++ WARN: Entry offsets inside sequence-items may incorrect...
++ WARN: and auto-pause locations might not be checked.
#extract[avseq05.mpg]: 11523/217803 ( 5%)
Protected Example 
$ vcdxrip -p --cdrom-device -T 1
**ERROR: Why are you giving me non-option arguments? -- try --help
$ vcdxrip -p --cdrom-device
ioctl(): Input/output error
ioctl(): Input/output error
ioctl(): Input/output error
++ WARN: encountered non-form2 sector -- leaving loop
$ vcdxrip -p --no-ext-psd --cdrom-device
ioctl(): Input/output error
ioctl(): Input/output error
ioctl(): Input/output error
++ WARN: encountered non-form2 sector -- leaving loop
export CDR_DEVICE=0,0,0
$ cdrecord -toc
first: 1 last 2
track:   1 lba:         0 (        0) 00:02:00 adr: 1 control: 4 mode: 2
track:   2 lba:       452 (     1808) 00:08:02 adr: 1 control: 4 mode: -1
track:lout lba:    243060 (   972240) 54:02:60 adr: 1 control: 6 mode: -1
$ vcdxrip -p --no-ext-psd --track=3 --cdrom-device
++ WARN: Entry offsets inside sequence-items may incorrect...
++ WARN: and auto-pause locations might not be checked.
$ vcdxrip -p --no-ext-psd --track=2 --cdrom-device
++ WARN: Entry offsets inside sequence-items may incorrect...
++ WARN: and auto-pause locations might not be checked.

documented on: 2004.09.08

vcdxrip: Skip invalid mpg stream 

http://savannah.gnu.org/support/?func=detailitem&item_id=103931

I'm wondering if it is possible for vcdxrip to skip invalid mpg stream during ripping.

I've experienced many time that the downloaded .bin file has invalid mpg stream segment, so the burned CD will freeze my DVD player. vcdxrip will abort at the same place as where the DVD freeze.

It would be really great for vcdxrip to skip the invalid segments. I don't care those several seconds missing, as long as I can see the whole movie.

cmd:VCDGear 

Basic Info 

Usage 

Info 

VCDGear is a program designed to allow a user to extract MPEG streams from CD images, convert VCD files to MPEG, and correct MPEG errors in a single step. It is available for most commonly used operating systems. People requiring transportation of their video materials will find VCDGear useful in getting the video to play on their computer or Video CD player.

Source 

http://www.vcdgear.com/

http://www.vcdgear.com/download.html

http://freshmeat.net/projects/vcdgear2/

Help 

Support 

message board http://www.vcdgear.com/forum

message board on vcdquality http://www.vcdquality.com/forum/forumdisplay.php?forumid=31 http://forum.vcdq.com/forumdisplay.php?forumid=31 Not well used

Quick Help 

VCDGear 1.76 final build 040415 coded by Dracore (vcdgear@hotmail.com) Testing and quality control by MACKerMD

 Usage:  vcdgear [options] {@file.lst} inputfile outputfile
Extract/fix MPEG streams and create VCD/SVCD images.
Example: vcdgear -cue2mpg thisvideo.cue videostreams.mpg

Options:

-cue2raw       -cif2mpg       -mpg2bin       -bin2mpg
-cue2dat       -mpg2mpg       -cif2bin       -toc2mpg
-cue2mpg       -nrg2mpg       -nrg2bin       -mpg2toc
-raw2dat       -mpg2dat       -sfd2mpg
-raw2mpg       -dat2mpg
@file.lst            (optional) contains list of MPEGs to process
/v:"vol name"        a 32-char volume label for cd image output
-cfg cfg_file.cfg    specify an alternate configuration file
-track##             extract only track ## from a multitrack image
-r####               force read of ####-byte sectors
-w####               force write of ####-byte sectors
-nobumper            removes CD-i MPEG sequence bumper
-fix                 fix broken MPEG blocks during .mpg output
-noinit              don't add initial sequence during fix
-split               split/separate MPEG files based on GOP timecode
-nopad               don't pad MPEGs with non-2324 sectors
-passive             process a file but do not write output
-toast               generate Toast compatible MPEG files

VideoCD Imaging Options:

-philips             enable Philips SVCD compliant format
-pause###            sets track pause time in seconds.  Default is 5
-pauseINF            sets track pause time to infinite

Detail Help 

Faq 

What is Track 0? What is a CD-i bumper? What does the Remove CD-i Bumper option (-nobumper) option do? How does a DAT differ from MPEG?

How do I get the best MPEG with the least number of errors possible? 

Use -fix

What do I use the Fix MPEG Errors (-fix) option for? 

The -fix option makes sure that your output MPEG file won't have broken blocks. Usually players can handle files with broken(missing) MPEG blocks but I don't know how this will affect the sync timings. I have been told that this option fixes the "slider problem" in the Microsoft Media Player. This may also fix up some areas where screen artifacts, or a sudden display of coloured blocks appear on the screen for no reason.

Note This will NOT fix corrupt data in your MPEG stream. (Usually causes the playback software to lock-up or crash). Please use a separate program such as IFilmEdit or M1-Edit MPEG Repair to remove the areas with problems.

What are those little garbled blocks that appear every once in while on the video? 

Corrupted data within the MPEG stream usually cause garbled blocks to appear. Sometimes these can be corrected by enabling the Fix MPEG Errors (-fix). If you already have the file in .MPG format, you can try reprocessing it using the MPG-to-MPG option.

Installation 

Installation 

tar -C / -xvzf /linux/linux_bin/tgzs/vcdgear-1.76-i486-1zeb.tgz

The contents 

vcdgear176-040415_linux:

vcdgear/vcdgear
vcdgear/CDI/
vcdgear/CDI/CDI_IMAG.RTF
vcdgear/CDI/CDI_TEXT.FNT
vcdgear/CDI/CDI_VCD.APP
vcdgear/CDI/CDI_VCD.CFG
vcdgear/lang/
vcdgear/lang/dutch.lng
vcdgear/lang/english.lng
vcdgear/Changelog
vcdgear/Credits
vcdgear/vcdgear.cfg

vcdgear-1.76-i486-1zeb:

drwxr-xr-x root/root         0 2004-07-28 14:25:53 etc/
-rw-r--r-- root/root       549 2004-07-28 14:25:42 etc/vcdgear.cfg
drwxr-xr-x root/root         0 2004-07-28 14:21:31 usr/
drwxr-xr-x root/bin          0 2004-07-28 14:23:41 usr/bin/
-rwxr-xr-x root/bin     180580 2004-04-17 17:35:12 usr/bin/vcdgear
drwxr-xr-x root/root         0 2004-07-28 14:21:05 usr/doc/
drwxr-xr-x root/root         0 2004-07-28 14:23:26 usr/doc/vcdgear-1.76/
-rw-r--r-- root/root      3233 2004-04-17 17:46:11 usr/doc/vcdgear-1.76/Credits
-rw-r--r-- root/root      2251 2004-04-17 17:38:39 usr/doc/vcdgear-1.76/Changelog
drwxr-xr-x root/root         0 2004-07-28 14:22:47 usr/share/
drwxr-xr-x root/root         0 2004-07-28 14:22:52 usr/share/vcdgear-1.76/
drwxr-xr-x root/root         0 2004-07-28 14:22:52 usr/share/vcdgear-1.76/CDI/
drwxr-xr-x root/root         0 2004-07-28 14:22:52 usr/share/vcdgear-1.76/lang/
-rw-r--r-- root/root     13260 2004-02-14 20:36:07 usr/share/vcdgear-1.76/lang/dutch.lng
-rw-r--r-- root/root     12399 2004-02-14 20:36:13 usr/share/vcdgear-1.76/lang/english.lng
drwxr-xr-x root/root         0 2004-07-28 14:30:40 install/
-rw-r--r-- root/root       646 2004-07-28 14:30:19 install/slack-desc

Versions 

http://www.vcdgear.com/history.html

v1.76 January 1, 2004 

VCDGear is now used in SVCD2DVD to extract streams from images. SVCD2DVD is written by badger to automate the conversion of VCD and SVCD movies to DVD.

Jimmy Chang has also provided a Chinese language set. Thanks Jimmy! You can download it here.

VCDImager structure sizes 

http://article.gmane.org/gmane.comp.gnu.vcdimager.bugs/82

Newsgroups: gmane.comp.gnu.vcdimager.bugs
Date: 2003-01-13 18:21:39

First, my apologies if this is posted to the wrong list. My questions aren't related to bugs per se, but to certain low-level implementation details of VCDImager that aren't documented anywhere that I'm aware of. Since debugging requires intimate knowledge of the underlying code, this seemed to be the best place to ask.

I'm writing a bitrate calculator for SVCD. I'm trying to figure out how many sectors are occupied by 'invisible' structures that must be accounted for in order to determine the number of free sectors available for program content.

1. Disc Structure - Sector Overhead 

Based on my study of the VCDImager manual, I *think* this is how the disc is laid out — let me describe it in mixed XML/BNF notation:

<svcd>
  <lead-in>
  <pre-gap>
  <iso>
    <stuff>
    <segment item>+
    <user data file>*
  </iso>
  <sequence item>*
  <post-gap>
  <lead-out>
</svcd>
<lead-in>, <lead-out> := ? sectors
<pre-gap>, <post-gap> := 150 sectors
<segment item> := <150 form 2 sectors>+
<user data file> := <form 1 sector>+
<sequence item> := <pre-gap> <form 2 sector>+
<stuff>
  <PVD, directory, pointers etc.> := 75 sectors
  <karaoke> := 75 sectors
  <video cd info> := ? sectors
</stuff>

Assumptions:

  1. A segment item is "granular" to 150 form 2 sectors, or 350400 bytes

  2. A sequence item is granular to 1 form 2 sector, or 2336 bytes

  3. A user data file is granular to 1 form 1 sector, or 2048 bytes

If my understanding is correct (please explain if/where I'm wrong about this), the only thing I'm missing is the number of sectors consumed by <lead-in>, <lead-out> and <video cd info>, which I assume are 75 sectors in length, respectively, for a total of 675 sectors minimum overhead per disc.

2. Disc Structure - Mode 2 Form 2 Sector Size 

To the best of my understanding, CD-ROM XA mode 2 form 2 sectors have a payload of 2324 bytes, i.e.

2352 (sector size)
less 12 (sync)
less 4 (header)
less 8 (subheader)
less 4 (EDC)
= 2324 (payload)

But VCDImager writes sectors with a payload of 2336 bytes, i.e.

2352 (sector size)
less 12 (sync)
less 4 (EDC)
= 2336 (payload)

The difference is slight, but the fact it exists at all is curious: is mode 2 form 2 sector size variable between different authoring programs, or is VCDImager unique in this regard?

3. OGT bandwidth 

Extremely little documentation about OGT streams can be found on the web at large. Does anyone happen to know the bandwidth consumed by an OGT channel in kbps? Without knowing the maximum size of the largest bitmap per channel, how much space per channel would you reserve from the maximum bitrate to accomodate them?

3. OGT bandwidth 

NB, that's the only post in thread, i.e., no reply as of 2005.04.11.

documented on: 2005.04.11

Copy Video CD 

http://www.togaware.com/linux/survivor/Copy_Video.shtml

To copy a Video CD (these use audio CD disks—the common CD-R) the following should do the trick:

$ cdrdao read-cd --paranoia-mode 2 --read-raw data.toc

There are other tools including readvcd, vcdimager, and vcdgear. (NB, no found any more as of 2004.11.07)

Copyright (c) 1995-2004 Graham Williams

Help 
--paranoia-mode mode
       Sets the correction mode for digital  audio  extraction.  0:  No
       checking,  data  is  copied  directly from the drive. 1: Perform
       overlapped reading to avoid jitter. 2: Like  1  but  with  addi-
       tional  checks  of the read audio data. 3: Like 2 but with addi-
       tional scratch detection and repair.
The extraction speed reduces from 0 to 3.
Default is the full paranoia mode (3).

VCD & SVCD Creation - How To 

http://www.satlug.org/~bigjnsa/vcd-linux.htm

Creating Video CD's 

There are some limitations on VCD's Like bitrate for video 1152kBit and for audio 224kBit.

For audio use:

lav2wav stream.avi | mp2enc -V -o sound.mpg

-V force VCD compatible output (same as: -b 224 -r 44100 -s) For hardware players, you should stick to 44.1 224kBps Stereo layer 2 Audio.

For the video use:

lav2yuv stream.avi | yuvscaler -O VCD | mpeg2enc -s -r 16 -o video.mpg

For an VCD compatibel output the -s (Generate a sequence header for every GOP) is needed. Never try for VCD -m or -b It seems that many VCD players (Avex for example) are not able to play MPEG streams that are encoded with an search radius greater than 16. But -r 16 workes fine.

Mplex with:

mplex -f 1 sound.mpg video.mpg -o vcd_out.mpg

The -f 1 option turns on a lot of weird stuff that otherwise has no place in a respectable multiplexer!

Creating the CD:

The multiplexed stream has to be converted to an VCD combatible. This ist done by vcdimager (Aviable from freshmeat)

Example

vcdimager testvideo.mpg

Creates an videocd.bin, the data file, an a videocd.cue which is used as controllfile for cdcdao.

In Linux you can use cdrdao to burn the image. Aviable at: http://cdrdao.sourceforge.net/index.html

For MPEG-1 encoding a typical (45 minute running time) show or 90 odd minute movie from an analog broadcast a constant bit-rate of around 1800 to be ideal. The resulting files are around 700M for 45 minutes which fits nicely as a raw XA MODE2 data track on a CD-R. For pure digital sources (DTV or DVD streams and similar) VCD 1152 works fine.

Storing MPEG's. 

If you record the data as XA mode 2 tracks you can fit appreciably more on a CD (at the expense of error correction/detection). You can use vcdimager to do this and readvcd to extract the resulting files.

For better Quality there are SVCD and XVCD and DVD.

Currently only SVCD is fully supported with a pre-set format in mplex and tools to create disks. MPEG streams that can be played by DVD player hardware and software can readily produced using mpeg2enc/mplex but there is currently no means to make a properly structured disk image.

If your player doesn't support SVCD however, you may well find it can handle VCD streams that have much higher than standard bit-rates.Often as much as 2500kBit/sec is possible. With higher bit-rates and good quality source material it is worth trying mpeg2enc's -h flag which produce a stream that is as sharp as the limits of the VCD standard permits. The -h flag seems to help also if there is a low quality stream, the video does not look that sharp using the flag, but there are not that much gitches as without it.

However, if your player supports it and you have the patience for the much longer encoding times SVCD is a much better alternative. Using a more efficient MPEG format SVCD more than doubles VCD's resolution whilst typically producing files that are rather less than twice as big.

Creating SVCD's 

Record at full TV resolution (means: -d 1 for PAL this ist 720x568) Convert the sound with:

lav2wav stream.avi | mp2enc -V -o sound.mp2

Convert the video with:

lav2yuv -s 2 stream.avi | yuvscaler -O SVCD| mpeg2enc -m 2 -F 3 -s -b 2500 -V 400 -o video.m2v

-s 2 is vital. This reduces the 720 squares pixels in a standard TV image to the peculiar 480 rectangular format that SVCD expects.

-F 3 tell mpeg2enc to assume that the original signal is field interlaced video where the odd rows of pixels are sampled a half frame interval after the even ones in each frame. The -F 0 (progressive output (no field pictures)) option will also for PAL.

-F 1 and -F 2 will work but are currently handicapped by rather dumb code to choose the type of motion compensation.

You can use lower bitrates, but the SVCD standard limits total bit-rate (audio and video) to 2788800 Bit/sec. So with 224Kbps audio and overheads 2550 may already be marginally too tight.

An other possibility for movies in PAL (European style 25 frames/50 fields per sec) video is:

lav2yuv -s 2 stream.avi | yuvscaler -O SVCD | mpeg2enc -m 2 -F 0 -s -b 2500 -V 400 -o video.m2v

Movies are shot on film at 24 frames/sec. For PAL broadcast the film is simply shown slightly "too fast" at 25 frame/sec (much to the pain of people with an absolute pitch sense of pitch). The -F 0 flag turns off the tedious calculations needed to compensate for field interlacing giving much faster encoding.

Unfortunately, movies broadcast in NTSC (US style 30 frames/60 fields sec) video this will produce very poor compression. The "pulldown" sampling used to produce 60 fields a second from a 24 frame a second movie means half the frames in an NTSC *are* field interlaced.

Multiplex with:

mplex -f 3 sound.mp2 video.m2v -o vcd_out.mpg

Creating the CD:

Example:

vcdimager -t svcd testvideo.mpg

Creates an videocd.bin, the data file, an a videocd.cue which is used as controllfile for cdcdao.

In Linux use cdrdao to burn the image.

Note: If you want to build "custom" VCD/SVCD you should try the mplex -f 2 and -f 5 switches.

Note: The VCD SVCD stuff may work on your HW player or not. There are many reports that it works quite well. Don't be woried if it does not work. Nor am I responsible for unusable CDs.

Big J

Linux Notes: Video Editing 

http://users.dslextreme.com/~craig.lawson/linux_notes/video.html

Last modified: 05/17/2004

Media Comparison 

Media  Resolution (NTSC)
VCD    352x240
SVCD   480x480
DVD    720x480
DV (Digital Video)     720x480

Set the the video editor to match the output dimensions early in the editing process. Otherwise, the output may be clipped unexpectedly if the dimensions are changed later, or are altered with transcode in batch mode.

Video CDs (VCD) and Super Video CDs (SVCD) 

Super Video CDs have better resolution and capacity than VCDs (thanks to better compression). See:

Super Video CD resolutions and limits (from above):

Usefulness of SVCDs: Not too. Although Linux knows how to play them, Windows and Macs do not have built-in SVCD support. SVCDs are not a genericly supported distribution medium. DVDs are much more widely supported.

Procedure for SVCD production 

  1. Edit movie in Cinelerra with resolution set to:

    Audio Sample Rate: 44100
    Channels: 2
    Frame Rate: 29.97
    Width: 480
    Height: 480
    W Ratio: 1
    H Ratio: 1
    Color model: YUVA-8 bit
    Aspect Ratio: 1:1
  2. Quicktime for Linux with:

    Audio: Two's compliment
    Video: Motion JPEG-A, high quality (75)
  3. Convert to SVCD-compatible MPEG-2 with mjpegtools:

    lav2yuv quicktime.mov | mpeg2enc -f 4 -q 7 -I 1 -V 200 -M 2 -o video.m2v
    Notes:
      -f 4    Sets format to standard SVCD
      -q 7    Sets quantization to 7 (decent)
      -I 1    Specifies interlaced source material. True if it comes from a consumer
                video camera and was not deinterlaced in Cinelerra.
      -V 200  Specifies target video decoder buffer size as 400 Kb
      -M 2    Indicates dual processor system
  4. Skip if rendering to Quicktime. Render audio as MPEG-1, Layer

  5. Sampling rate should be 44.1KHz. (Two exports are necessary because transcode is currently broken on my system.)

  6. Extract audio and convert to MPEG-1 Layer 2 with mjpegtools:

    lav2wav quicktime.mov | mp2enc -V -o audio.mp2
  7. Merge video and audio streams together with mplex:

    mplex -f 4 -b 300 -r 2750 audio.mpeg video.mpeg -o svcd_out.mpeg
    mplex will fail if the combined bitrate of the video and audio streams is significantly greater than 2.75 Mbit/sec.
    Hey! The MJPEG Tools documentation is inconsistent! In one place it says to use "-f 4" and in another place says to use "-f 3".
  8. Verify merged output with xine.

  9. Create an ISO image with vcdimager:

    vcdimager --type=svcd --iso-volume-label="MY_TEST_CD" scvd_out.mpeg
  10. Fix warnings ("no scan information" warnings may be safely ignored). Verify output with vcddebug:

    vcddebug --bin-file=videocd.bin
  11. Burn a CD with cdrdao:

    cdrdao write --device 0,0,0 --speed 16 videocd.cue

documented on: 2004.10.25

How do I play VCD's in my linux box? 

> we use smpeg to play .mpg's
> and a .dat to .mpg converter to play .dat's
> i forgot the program's name though :),

It's called "readvcd", available from the "VideoCD / MPEG Resources" link at "The Linux VCD Mastering Project" site: http://vcdmaster.sourceforge.net

Michael J. Maravillo

cmd:readvcd 

Version 0.3 

Usage 

The program sends the MPEGs to stdout so it's more than likely that you will pipe it to some MPEG player or to the file.

It should find and play the MPEG stream. If you turn on the verbose mode it will also display TOC informations and position where it plays.

If you compile it with ncurses (default) you will be able to skip forward and backward by pressing 'b' and 'f' keys ('B' and 'F' will make longer jumps). If you press 'space' it will display MSF address of the actual sector. After pressing 'q' it will terminate. Now you can also skip to the next or previous track by pressing 'p' and 'n'.

You can chose which track(s) should be played. Usually the 1st track holds some kind of info and copyright informations. The 2nd (and following) are the MPEG streams to be played. You can also start with any sector of the disk with -a option. It's useful when you want to continue after the interruption. You only have to know the latest MSF address.

Options 

-v              verbose mode
-a M:S.F        address of the starting sector in MSF format
track           plays from this track to the end
track-track     plays the area of the tracks

Examples 

readvcd -v -a 00:50.00 | mtv -

It will turn on verbose mode and it will read from sector 00:50.00 and pipe data into mtv.

readvcd 2-2 > track2.mpg

It should write data from track 2 into file.

readvcd -v 3 | mtv -e -

It will display TOC info and play from the 3rd track to the end.

documented on: 2004.11.07

Examples 

http://www.mpegtv.com/faq.html

There are programs that can read the VCD tracks and pipe them into mtv's standard input (use "<program> | mtv -" to pipe the standard output of <program> to the standard input of mtv). However, now that VCD support is included in the Player, there is no reason for using this method.

Copies (e.g., readvcd-0.3.tgz) can be found at:

http://ftp.cc.ntut.edu.tw/cgi-bin/file-j.pl?path=%2FOS%2FLinux%2Fpackages%2FX%2Fviewers%2Freadvcd

documented on: 2005.04.15

VCDGrab 

http://vcdgrab.sourceforge.net/

VCDGrab is a VCDGear (http://www.vcdgear.com/) clone. Right now, it is capable of extracting MPEGs from bin/cue images.

!!! Note: read http://www.vomjom.org/projects for an update. The requested URL could not be retrieved

10/28/00 - Updated to version 0.1, added support for upper or lowercase filenames and made use of automake + autoconf.

Can't copy files in *.dat form VCD 

> Curiously within Linux,these files cannot be copied off CD.But,once in
> Windows,you can copy them and store them.Both Xine and Mplayer play them
> now once they are stored like this. And that's how VCDs are kept on the
> harddisk by all my friends here.
>
> This is curious. Could anybody shed more light?

This discussion has been had before. A .DAT file on a VCD is not simply a renamed MPG file, but very similar.

The VCD format has less check summing bits on the CD than a standard data CD, as an error on the disk is less likely to cause serious problems, and you can actually fit more data on a VCD than a regular one. Not significant amounts, but a little more.

If you're going to store .DAT files on your hard drive like that to play them, you're wasting space. I suggest stripping the extra overhead of the DAT and leave yourself with an mpeg instead.

Search google on how to do it. I've done it before - there's not much to it.

Can't copy files in *.dat form VCD 

> If you're going to store .DAT files on your hard drive like that to play
> them, you're wasting space. I suggest stripping the extra overhead of
> the DAT and leave yourself with an mpeg instead.

Well, I dont' know about stripping out the dat to get a mpg but I do know how to copy/rip out the DAT files.

You need the CDFS package. (google)

Mount a cdrom with something like

mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

ISO images will show up as "sessions1_?.iso" or "session-?.iso", HFS images as "apple.hfs", boot images as "boot.image", VideoCD tracks as "videocd-?.mpeg" and audio tracks as "track-?.wav". ISO, HFS and boot images can be mounted loopback.

You can specify the uid, gid and mode that should be used for the files. E.g

mount -t cdfs -o ro,uid=0,mode=600 /dev/cdrom /mnt/cdfs

Mpg - Dat 

http://www.videohelp.com/forum/archive/t50457.html

> can anyone tell me if there is any way to convert mpg -> dat files?

VCDGear can convert MPEG-1 (as long it is compliant) to "DAT".

Note: there is absolute NO reason for you to do this. If Nero doesn't like your files or won't burn, there is either a problem with your MPEG-1 or your copy of Nero.

Converting to DAT doesn't help you in any way as you can't just burn DAT files onto a CD-ROM. This IS NOT a VCD and will not work on almost all players.

Mpg - Dat 

You asked for MPG==>DAT conversion.

MPG==>DAT can be done with VCDGear, and is uneccessary (the most common use for VCDGear, if I understand correctly, is exactly the opposite: DAT==>MPG).

What VCDImager can do, is prepare a BIN file - which is a CD image - that includes everything; - it's a CD image, in this case - a VCD image.

VCDImager is a full-featured VCD authoring program. That means, you prepare everything in it - it can be a simple VCD which will not take long to Author, or it can be a complex VCD with nested menus, backgrounds and all sort of razzle-dazzle tweakings (which, eventually, will take some time to prepare, and learn how to do it). After it's authored, VCDImager outputs the CD Image in BIN format, alongside with a CUE file.

Then, you take the BIN file (which is the CD image) and the CUE file (which is the track layout for the CD image] and burn it with whatever software you like that supports these formats - it can be CDRWin, it can be Fireburner, it can be Nero.

Once it's in BIN/CUE format, it's totally irrelevant what's your source and what's in it - MPG files, Nero track layout, VHS capture, Squiddly-diddly drawings from Paintbrush - it's a CD image. It holds whatever the program that produced the BIN put in it, and it is burned 'as-is'. No conversions, and no software cares what sort of files it holds. It doesnt' matter if it's a Data CD, a VCD, Audio CD, Photo CD, Mixed-Mode CD or LCD. A CD image is a CD image is a CD image.

All 'track' layout is done before the CD Image is created - hence, in our case, in VCDImager.

All proper files - in this case, MPG files - are to be prepared before going to VCDImager (same as it should be prepared before going to produce a VCD in Nero).

What the BIN/CUE format can give you (aside from the pluses and minuses of authoring a VCD in VCDImager, which are currently discussed in several other threads) is bypassing any problem you may have with Nero dealing with MPG files.

The short answer (will there ever be such a thing from me?) to what you just asked, is that if you want to use other file types (AVI, DIVX, Quicktime, etc.) as your source, you'll first need to convert them with another program. Check the Convert section for tutorials about how to convert from such types to others.

PigOnWing

Mpg - Dat 

> > there is no reason for doing t his..
>
> yes.there is..
> because, i can move the files onto the tracks and burn..
> nero shouldnt start conversion then?

Nope, you can't move files 'straight to tracks'. What nero expects, when you 'move file to track', is a proper MPG file, and it does the 'conversion' itself.

<technical bit> - feel free to skip. There are several kinds of 'sectors' on a CD, as far as the user is concernerned (actually, there is only one kind, but for the sake of explanation).

What is called 'Data', which is what we use when we store files one a CD, are sectors that hold 2048 bytes. With that, we get 650 MB per 74 min CD.

'Raw' sectors, use 2352 bytes per sectors. Mixed-mode sectors use 2336 bytes. In that way, we get what's called '700 MB' on a cd.

There are the same amount of sectors in all cases.

As far as the CD is concerned, all sectors use 2336 bytes. The difference (between 2038/2352 and 2336) is used for error-correction - sort of 'checksum' in order to compensate for any reading errors which may occur.

What seems to us as a .DAT file on VCD, is actually a reference to the second track, which is written in RAW (Or Mixed-?) mode. It includes the checksums.

</technical bit>

Hence, by 'converting' an MPG to DAT, you add to it the information which should only reside on the CD. If you treat it as an ISO (i.e., normal) file, and don't tell your burning software to treat it specifically as an 'already-prepared for CD' file, then it will get re-checksummed, and yet more data may be added to it, wasting space at best, rendering it unuseful at worst.

Yes, Nero might deal with it, and do the re-checksumig properly, hence creating a new DAT file. But if it has problems doign it with a proper MPG, it will probably have the same problems with a DAT.

Answer to the point, eventually Yes, what you ask can be done, either by VCDGear (which will output a DAT file) or VCDImager (which will output a BIN file, which is a complete-CD image) along with a CUE file. The CUE file actually tells the burning-software, to treat the tracks which hold the 'DAT' information, as RAW (or Mixed? don't remember off hand) data. Yes, Nero can recognize CUE/BIN files, yes, it burns them properly.

With that option you actually bypass all of Nero's special features and special bugs regarding VCDs (or any other kind of CD, for that matter) - it doesn't convert anything, it doesn't add anything, it doesn't do anything. It acts as a mere typist, not as a Word-processor. :smile:

(People, does anyone know how many claories per hour are being burned per hour of typing? As long as I blabber, I want to know what use I make of it…)

PigOnWing

Coping Dat Files 

http://www.linuxforum.com/forums/index.php?showtopic=86789&st=0&#entry372693

> Why can't I copy dat files from vcd to my hard disk?
> I encounter this error :
> cp: reading `/media/cdrom/mpegav/avseq01.dat': Input/output error
Your options are:
vcdxrip - to rip the VCD tracks to mpeg
cdrdao - to create a bin cd image
mencoder - to convert VCD to divx

x86processor Posted: Aug 2 2004

Coping Dat Files 

> so you mean in Linux we can't copy dat files and we should convert them to
> other formats?

VCD is a multi-session disc and hence you need to convert it to other format before copying them to hard disk (although you will be able to play them directly from the drive),

x86processor Posted: Aug 2 2004

vcd, .dat files and isofs problem 

I have problems reading the .dat files from VCD, here is the kernel logs. I think it is an fs issue, since I am not the only one having the same problem. In user space, read returns I/O error but I think it is an fs issue or a cd-rom driver issue, I have tested with xine vcd player, the vcd can be played by directly accessing the block device but not through the fs. I tested the VCD under MS Windows using the same machine and disc and .dat files can be correctly read, even I use vcdgear win32 to convert the .dat file to .mpg it is still fine. So it is sure it is not the CD or hardware problem.

Many VCD's are tested and result is the same. It is likely to be an fs specific problem. I am running 2.4.17 and lsmod shows isofs is in use. Here is my log messages.

kernel: hdd: command error: error=0x55
kernel: end_request: I/O error, dev 16:40 (hdd), sector 32300
[...]

vcd, .dat files and isofs problem 

> same problem. In user space, read returns I/O error but I think it is an
> fs issue or a cd-rom

VCD .dat files are not normal "files". They are encoded in a different mode to get more bytes/sector at the cost of lower error resistance (mpeg is error resistant in itself…)

Alan

vcd, .dat files and isofs problem 

> same problem. In user space, read returns I/O error but I think it is an
> fs issue or a cd-rom

Have a look at cdfs: http://www.elis.rug.ac.be/~ronsse/cdfs/

It will allow you to read those files. Of course, there are also userland utilities for that. Just search freshmeat for vcd.

cdfs-src - shows the tracks on a CD as normal files
vcdtools - Creates Video CD (VCD) filesystem images