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:

  • GNU Video CD Image Maker: vcdimager
  • DVDR Help
  • dv2jpeg project
  • Doom9

Super Video CD resolutions and limits (from above):

  • 480 x 480 @ 29.97 Hz, NTSC
  • Video MPEG-2, maximum 2.6 Mbit/sec
  • Audio must be MPEG-1 Layer 2, bit rate 32-384 Kbit/sec.

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