How to Author an SVCD with menus and stills Under GNU/Linux
The SVCD produced in this guide will be of NTSC format with still and motion menus, 3 videos, 2 audio items and a slideshow of 5 still images.
-------------
Tools used (version numbers are merely for reference)
-------------
VCDImager (0.7.23)
cdrdao (1.2.3)
FFMPEG
mjpegtools (1.9.0-r1)
MPlayer/MEncoder
The GIMP
ImageMagick
Prepare the media. Note: Media (not including MPEG stills) must be at least 4 seconds in length.
Encode media to SVCD-compliant format:
Video:
Audio-only content:Code:ffmpeg -i video.avi -target ntsc-svcd video.mpg
The mp2 must then be multiplexed into an mpg stream:Code:ffmpeg -i in.mp3 -ar 44100 -acodec mp2 out.mp2
To extract audio from a video and encode it to SVCD-compliant mp2 of acceptable quality:Code:mplex -f4 -v2 -o audio.mpg audio.mp2
Code:ffmpeg -i infile.avi -ar 44100 -acodec mp2 -ab 128k outfile.mp2
To make a still image/menu, do the following:
1. Create a JPEG image of the appropriate resolution for SVCD stills in your region (704x480 for high-quality stills in NTSC format) with 72 dpi.
For the menu(s): Add selection items (thumbnails of video clips, etc.) and number them so the viewer of your SVCD knows what number(s) to press on the remote in order to select the desired content.
2a. Convert the JPEG to an MPEG still stream:
Substitute FRAMERATE with the intended framerate. I used 29.97 (for NTSC). Non-NTSC readers: Have a look at the BUGS section of jpeg2yuv's man page.Code:jpeg2yuv -f FRAMERATE -I p -v2 -j image.jpg | mpeg2enc -f7 -v2 -a2 -o stillimage.m2v
2b.
Or if you want to merge audio (of the proper format; mp2) with your still:Code:mplex -f7 -v2 -o still.mpg stillimage.m2v
Don't be alarmed if the stills don't play in mplayer.Code:mplex -f7 -v2 -o still.mpg stillimage.m2v audio.mp2
For an animated/motion menu, do the following:
1. Ready the desired frames.
I will use a 17-second video snippet as my animated menu. In order to have my selectable content/"buttons" displayed on the menu, I must export the frames from the video:
2. Open one of the frames in the GIMP; add a new, transparent layer and put the menu items (and their selection numbers) on it. Hide the menu/background layer and save the transparent layer as png. For this guide, the file is named menuitems.pngCode:mplayer -vo png:outdir=frames/ -ss 16 -endpos 17 videofile.mpg
3. Merge the menu-items image to all frames:
4. Merge the now-overlaid frames [back] into a video sequence:Code:for i in frames/*.png; do composite menuitems.png $i $i.png; done
-ofps is to be the appropriate value (framerate) for the television system in your region (NTSC, PAL...)Code:mencoder mf://png/*.png.png -mf type=png -ofps 30000/1001 -o animenu.avi -vf harddup -ovc lavc -lavcopts vcodec=mjpeg
If audio is desired with the animated menu, run the resultant video through mencoder like so:
5. Encode the video with the ffmpeg command in section 'Encode media...'.Code:mencoder -ovc copy -oac copy -audiofile youraudiofile -o animenuwithsound.avi animenu.avi
If only stills and/or audio is desired on your SVCD, you're out of luck. There must be at least one sequence item (video) on the SVCD. (The VCDImager documentation states it obscurely so it is easy to overlook. See the third entry in section 'XML file tips' below.) If you have an animated/motion (video) menu, you may be able to get by with putting it in the <sequence-items> section of the XML file that will be created later.
Instead of putting a random video onto my SVCD, I opted for creating a video of credits. It's simply a few images (frames) encoded into video sequences and merged into one. Here is how to do it:
1. Create PNG (or JPEG) images of resolution proper for SVCD video in your region (480x480 for NTSC), add text and save the images.
2. Convert the PNGs to videos:
Tip: Encode the images/frames individually if you want them to be of differing lengths. "-fps 1/11" translates to "1 frame per/for 11 seconds"; the resulting video created from this frame will be approximately 11 seconds in length.Code:mencoder mf://credits01.png -mf type=png -fps 1/11 -ofps 30000/1001 -o cred01.avi -vf harddup -ovc lavc -lavcopts vcodec=mjpeg
3. Merge the videos:
mencoder -ovc copy -o mergedavis.avi cred01.avi cred02.avi cred03.avi
If audio is desired in the video, run the resultant video through mencoder:
4. Encode it to SVCD-compliancy (see 'Encode media...' above).Code:mencoder -ovc copy -oac copy -audiofile youraudiofile -o withsound.avi mergedavis.avi
Now that the files are ready, it's time to create the XML file. You may want to have the VCDImager documentation handy; access it by running:
Tip: For convenience, put all SVCD-ready files into the same location with the XML file.Code:info VCDImager
The layout of the SVCD produced in this guide will have a main menu with 4 items to choose from (3 of them lead to other menus). The menus' type and desired functions are in parentheses:
Main Menu (a still with audio; audio does not loop)
|-->1. Audio
| |-->Audio Menu (animated; no sound, does not loop)
| |-->2 Audio items
|-->2. Video
| |-->Video Menu (animated; no sound, loops infinitely)
| |-->2 Video items
|-->3. Stills
| |-->Stills Menu (animated; sound, loops infinitely)
| |-->5 Still items
|-->4. Credits (video)
This is the XML file that activates the layout:
<?xml version="1.0"?>
<!DOCTYPE videocd PUBLIC "-//GNU//DTD VIDECD//EN" "http://www.gnu.org/software/vcdimager/videocd.dtd">
<videocd class="svcd" version="1.0" xmlns="http://www.gnu.org/software/vcdimager/1.0/">
<info>
<album-id>VOCALOID_SVCD</album-id>
<volume-count>1</volume-count>
</info>
<pvd>
<volume-id>VOCALOID_EXPERIMENT_SVCD</volume-id>
<publisher-id>KHEY</publisher-id>
</pvd>
<segment-items>
<segment-item id="mmenu" src="mainmenu.mpg"/>
<segment-item id="amenu" src="audiomenu.mpg"/>
<segment-item id="nebu" src="nebula.mpg"/>
<segment-item id="innc" src="Innocence.mpg"/>
<segment-item id="vmenu" src="vidmenu.mpg"/>
<segment-item id="smenu" src="stillmenu.mpg"/>
<segment-item id="st1" src="still01.jpg.jpg.m2v.mpg"/>
<segment-item id="st2" src="still02.jpg.jpg.m2v.mpg"/>
<segment-item id="st3" src="still03.jpg.jpg.m2v.mpg"/>
<segment-item id="st4" src="still04.jpg.jpg.m2v.mpg"/>
<segment-item id="st5" src="still05.jpg.jpg.m2v.mpg"/>
</segment-items>
<sequence-items>
<sequence-item id="popi" src="popipo.mpg"/>
<sequence-item id="ievp" src="ievanpolkka.mpg"/>
<sequence-item id="creds" src="credits.mpg"/>
</sequence-items>
<pbc>
<selection id="main">
<bsn>1</bsn>
<wait>-1</wait>
<loop jump-timing="immediate">1</loop>
<play-item ref="mmenu"/>
<select ref="aumenu"/>
<select ref="vidmenu"/>
<select ref="stillmenu"/>
<select ref="credits"/>
</selection>
<selection id="aumenu">
<bsn>1</bsn>
<prev ref="main"/>
<return ref="main"/>
<wait>-1</wait>
<play-item ref="amenu"/>
<select ref="nebula"/>
<select ref="innocence"/>
<select ref="main"/>
</selection>
<selection id="vidmenu">
<bsn>1</bsn>
<prev ref="main"/>
<return ref="main"/>
<wait>3</wait>
<loop jump-timing="immediate">0</loop>
<play-item ref="vmenu"/>
<select ref="popipo"/>
<select ref="ievpol"/>
<select ref="main"/>
</selection>
<selection id="stillmenu">
<bsn>1</bsn>
<prev ref="main"/>
<return ref="main"/>
<wait>3</wait>
<loop jump-timing="immediate">0</loop>
<play-item ref="smenu"/>
<select ref="st_1"/>
<select ref="st_2"/>
<select ref="st_3"/>
<select ref="st_4"/>
<select ref="st_5"/>
<select ref="main"/>
</selection>
<playlist id="nebula">
<prev ref="aumenu"/>
<next ref="aumenu"/>
<return ref="aumenu"/>
<wait>3</wait>
<play-item ref="nebu"/>
</playlist>
<playlist id="innocence">
<prev ref="aumenu"/>
<next ref="aumenu"/>
<return ref="aumenu"/>
<wait>3</wait>
<play-item ref="innc"/>
</playlist>
<playlist id="popipo">
<prev ref="vidmenu"/>
<next ref="vidmenu"/>
<return ref="vidmenu"/>
<wait>3</wait>
<play-item ref="popi"/>
</playlist>
<playlist id="ievpol">
<prev ref="vidmenu"/>
<next ref="vidmenu"/>
<return ref="vidmenu"/>
<wait>3</wait>
<play-item ref="ievp"/>
</playlist>
<playlist id="st_1">
<prev ref="stillmenu"/>
<next ref="st_2"/>
<return ref="stillmenu"/>
<wait>-1</wait>
<play-item ref="st1"/>
</playlist>
<playlist id="st_2">
<prev ref="st_1"/>
<next ref="st_3"/>
<return ref="stillmenu"/>
<wait>-1</wait>
<play-item ref="st2"/>
</playlist>
<playlist id="st_3">
<prev ref="st_2"/>
<next ref="st_4"/>
<return ref="stillmenu"/>
<wait>-1</wait>
<play-item ref="st3"/>
</playlist>
<playlist id="st_4">
<prev ref="st_3"/>
<next ref="st_5"/>
<return ref="stillmenu"/>
<wait>-1</wait>
<play-item ref="st4"/>
</playlist>
<playlist id="st_5">
<prev ref="st_4"/>
<next ref="stillmenu"/>
<return ref="stillmenu"/>
<wait>-1</wait>
<play-item ref="st5"/>
</playlist>
<playlist id="credits">
<prev ref="main"/>
<next ref="main"/>
<return ref="main"/>
<wait>5</wait>
<play-item ref="creds"/>
</playlist>
</pbc>
</videocd>
XML file tips:
* If you want to be returned to a menu after a video or audio clip plays, refer to it in the <next> portion of the audio/video's playlist item.
* It seems the items/tags in the XML file are to be specified in the order that they appear in the VCDImager documentation (example: <prev> must be before <next>).
* To see which items are required in the XML file, see section 3.2 of the VCDImager documentation titled "DTD Notation Reference" by issuing:
* If there are no segment items on your SVCD, VCDImager won't create the SEGMENT folder. Add the folder to maintain optimum compatibility. Source: https://forum.videohelp.com/threads/2187-Tip-VCDImager-and-SVCD-compatibility and the VCDImager documentation:Code:info VCDImager 'Video CD XML Description' 'Common Rules'. Also see the tags and their options in chapter 3.4.
* If selecting menu items with the click of a mouse is desired, have a look at the 'Buttons' section of this page: http://replay.waybackmachine.org/20091026221728/http://geocities.com/mikk999/VCDStills.htm and this part of the VCDImager documentation:Code:info VCDImager 'Tips and Hints' 'SVCD Player Compatibility'
(section titled 'Hot-spots')Code:info VCDImager 'Video CD Concepts' 'Playback Control' 'PBC Lists' 'Selection List'
When the XML file is finished, it's time to build the SVCD's image:
vcdxbuild tips:Code:vcdxbuild yourvcdxml.xml
* vcdxbuild can complain about many errors resulting from a single typo (or unnecessary '/>') within the XML file, so don't worry too much when searching for the source(s) of errors if vcdxbuild tells you there are a ton of things wrong.
* If you see the message "++WARN: mpeg stream contained no scan information (user) data" and you have any mpeg stills and/or short audio/video clips, I don't think you need to worry. According to the VCDImager documentation ( --- info VCDImager 'Video CD Concepts' 'Constraints on MPEG streams' 'Super Video CD' 'Scan Information Data'), the message pertains to the fast-forward and rewind functions. vcdxbuild may be reporting the warning on the stills and short media clips. Such content is too short to need those functions.
Once the SVCD's image is built, burn it to disc. (I recommend burning to CD-RW for testing.)
Tip: If the message "Error: Expecting only one toc-file" occurs, check the command; there may be a typo or misused option.Code:cdrdao write --device /dev/cdrom videocd.cue
SVCD Playback tips:
* If some of the endings of the audio and/or video clips are cut off during playback of the SVCD, try adding a <wait> tag and value to the item in the XML file (instead of adding length to the media files).
* I tested my SVCDs with Cyberlink PowerDVD (version 5.5.1423, under Windows) which works fine. I've found playback with MPlayer, VLC and xine to be very inadequate.
* If you want to try mounting your .cue/.bin files, have a look at cdemu and bchunk.
Many thanks to the writers of the software and documentation used to make this possible!
Some resources:
https://www.videohelp.com/svcd
https://forum.videohelp.com/threads/82078-High-Resolution-VCD-SVCD-Stills-on-the-UNIX-Command-Line
http://download.videohelp.com/vitualis/multimenu_vcd.html
http://download.videohelp.com/vitualis/general_xml_structure.html
http://www.linux.com/archive/feature/39960
http://www.mir.com/DMG/stills.html
http://en.wikipedia.org/wiki/SVCD
http://en.wikipedia.org/wiki/VCD
http://replay.waybackmachine.org/20091026221730/http://geocities.com/mikk999/StillsWithAudio.htm
http://www.digital-digest.com/dvd/articles/vcd_audio.pdf
http://lipas.uwasa.fi/~f76998/video/svcd/authoring/designer/
https://www.ip.philips.com/view_attachment/2450/sl00812.pdf - "A Technical Explanation, Super Video Compact Disc"
Most (if not all) of the info needed regarding (S)VCD is in the VCDImager documentation; access it by running:
kheyCode:info VCDImager
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 2 of 2
Thread
-
Last edited by khey; 13th Jul 2011 at 17:43.
Gentoo Linux -
Must...... Fight........ Satan's....... Urges.........
Similar Threads
-
author features from 2 discs w/ menus intact
By lockonx in forum Authoring (DVD)Replies: 2Last Post: 7th Jul 2011, 12:16 -
2 mpg stills: same encode options, vast quality difference ??? (linux)
By jungle5150 in forum Video ConversionReplies: 7Last Post: 26th Jul 2009, 10:14 -
Creating DVD menus with DVDAuthor(linux)
By sumit_pankaj in forum Authoring (DVD)Replies: 1Last Post: 11th Jun 2009, 11:00 -
SVCD 704x480 mpg stills with audio?
By jungle5150 in forum Authoring (VCD/SVCD)Replies: 21Last Post: 29th Jul 2008, 16:28 -
Tmpgenc dvd author 3 menus
By forare in forum Authoring (DVD)Replies: 1Last Post: 17th Apr 2008, 06:08