|
Jensemann's Homepage - [SVCD] |
| Home News Download Yamakawa MPEG SVCD MP3 Links Contact My DVD's | |
|
You have an AVI / ASF / PVA / MOV / MPEG-1/2/4 video and prefer to view it on your sofa in front of your TV instead of sitting here at your PC !? Great ! Follow my tips to create a working SVCD with good quality.. Why SVCD and not VCD, XVCD or miniDVD ? In comparison to SVCD or DVD the picture is to "soft" / blur and by far not as crisp as a DVD/SVCD because the resolution of a VCD is 352x288. Biggest advantage would be that you can store longer videos with a VCD since the bitrate is only 1150 kbits (constant bitrate, CBR). But let's say you have recorded a movie with a duration of 100min; in this case you need to use 2 VCD's anyhow.. and this is also amount of playtime you can squeeze onto 2 SVCD's in quite a good quality! Another drawback is that VCD use CBR instead of VBR (variable bitrate), so even if a scene would not require the full bitrate bandwidth the MPEG encoder would use the fix bitrate of 1150 kbits for it ! Such a waste of space.. Note: There is a big difference between a comercial VCD produced (with an expensive high-end hardware encoder) and a VCD you have created with your own tools at home. I've never seen a VCD that looks close to the quality of a comercial VCD. So, XVCD would be an option.. I've heard of much experiences with XVCD, there are several problems with synchronous audio and video, the resolution you can play on your DVD player may will not play on the player of your friend and so on.. the resolution is higher (352x576) but there a more topics what can went wrong. miniDVD will not play on the home DVD player because the DVD player will detect the CD but try to play it as a DVD, so it uses the wrong laser and therefore can't read the CD. Game over.. I decided to give SVCD a try. SVCD is 480x576 (for PAL and 480x480 for NTSC); bitrates up to 2.6MBit's are allowed and this is a standard that is currently defined by the IEC, so the future for SVCD looks good and there will be more players that can handle this chinese video cd format. If you create an SVCD that fits the requirements shown in the table below than it will be most likely that other SVCD-capable players will playback your SVCD, too. Another nice effect: A+V are always in sync; wether you seek forward or back. This is not always the case and only a few (10..20) milliseconds delay between A+V and you can notice it! What can you find here ? I will desribe how I create my own SVCD's.. there a different ways what can be the source of an SVCD (old VHS tape's, AVI videos, ASF-Videos, PVA- Files or Apple Quicktime videos, different types of MPEG-videos). The question is how to convert all this type of video formats into an SVCD-compilant MPEG-2 stream that can be played with a standalone DVD player? Well, I hope some of my tips are useful so you can create your own "home-made" SVCD's ! Ok, let's go into details. Let me add some words for DVB captured MPEG streams. As i mentioned the SVCD resolution is 480x576. The nice thing is that some TV channels already broadcast at this resolution ! So the only thing that is left is to transcode for a smaller bitrate, we save the resizing step and therefore some time. It is even reported that some taiwan players can playback the original PVA if just converted to PS MPEG (even at higher bitrate than 2.6mbits).
Super Video CD (SVCD), Super VCD or Chaoji VCD is an enhancement to
the Video CD developed by a Chinese government-backed committee of manufacturers
and researchers. The final SVCD specification was announced in September
1998. SVCD has support for subtitling (overlaid on the top of the video)
and karaoke lyrics color highlighting, 16:9 (anamorphic wide screen) image
aspect ratio, Multi-Channel 5.1 surround audio, 2 stereo or 4 mono MPEG-2
audio streams, HTML style hyperlinks, still images (480x576 or 704x576
for PAL, 480x480 or 704x480 for NTSC), playlists / slideshows, multi-level
hierarchical menus and chapters (indexing). Note: If you create an 'SVCD'
disc with any other resolution than 480×480 or 480×576, you have created
a non-standard variation, not an SVCD and you may get problems when trying
to play-back the cd in different players. The same is true for higher
bitrates or different framesizes; it just depends on your DVD player if
you can watch the video later on (I'm talking about home DVD players;
PC DVD drives are more flexible in this point).
(Parts of this text from Jukka Aho's Super Video CD Overview, read more about the history of SVD there if you like. Another detailed story can be found at TapeDiscBusiness). A word to Multi-Channel 5.1 surround audio.. ok, it should be possible, but i've heard of no success stories creating an SVCD with Multi-Channel 5.1 surround audio, so this is a task to figure out. If somebody has a hint how to do it - let me know ! As I mentioned earlier, the source for an SVCD can be different; one
very interesting way is to capture videos from a TV card (I've done this
several times with a Hauppauge WinTV Radio) and convert it later on into
an MPEG2 video. I ike to start now the description for this process...
What you need: Step 1) Capture the video "But how is the quality I can reach with such a cheap TV card?" you might ask.. I've saved an SVCD MPEG-2 PS file for you to test how a captured video will look, grab it here: testvid.mpg(30s, 8.5MB). To make a SVCD simply burn it using Ahead Nero 5.x. This short video was recorded with my Hauppauge WinTV Radio card under NT4 SP5, CPU: Intel Cel. 300A, 128MB RAM, Pegasus MJPEG Codec (qual. at 3), fast IBM SCSI UW HD. Note: My preferred Operating System is Windows NT because we do not have the file size limitations known from Win 95/98 or ME. Windows 200 would be ok, too if you manage to run all drivers and SW under it. If you don't have the possibility to use NT than you may need to use the spill system from Avery Lee's Virtual Dub to split the captured video into smaller parts (while you record) to be able to open the AVI file later! You also need 4-5GB of free disk space to be able to capture and process the video. Uncompressed video uses a *huge* amount of space to store it, therefore we need to compress the video while it comes in from the TV card either using a M-JPEG codec or a lossless codec (like HufYUF). Note: M-JPEG is not equal to MPEG ! M-JPEG is a framebased jpeg compression while MPEG is GOP-oriented (group of pictures). A group consists of I, B and P frames. Dependent on your machine you have several options how this can be done.. No Option: Realtime MPEG Encoding The first software-base solutions are available to encode even MPEG2 in realtime; but in my opinion the quality is completly inacceptable and therefore I would recommed one of the following options: Option 1: Use the Pegasus MJPEG Codec Option2: Use the HuffYUF Lossless Codec
Select the preferred codec and click "Configure"..a codec-specific dialog will pop up where you can adjust the compression, start with 3 (see picture). My old Celeron-300A with fast SCSI-HD's could capture at about 3 with 480x576, a new Celeron566@850 can run at full quality and frame size. I've also detected that it depends on the capture driver you are using for the TV card. It's worth to check the TV card manufacturer's homepage to see if a newer version of the capture driver exists. Let's take a look now how to prepare VirtualDub to capture Videos for us. Start the application and select "File" / Capture AVI". Go to "Video" / "Source" and select your TV-card as the preferred capture device. You should see the current video now (e.g. tv channel or you vcr). Note: If you can't activate the capture driver inside VirtualDub or if you don't get sound even if you have checked that the line-in volume is up and the input is selected than you can try to start your tv-application to initialize the hardware (I need to do it for my Hauppauge WinTV Radio). Ok, so at this point you should be in VirtualDub's capture mode with video and audio present. Let's go on... Option 1: Try framesize 720x576 @ 25 fps(fast machine + fast HD required) Option 2: Framesize 480x576 @ 25 fps Now you should have found a combination that works for your machine. Make the settings permanent under "Capture" / "Preferences" (F10), check all checkboxes and close the dialog. Next time you like to record something VirtualDub will remember your settings.
Capturing from a VCR is a little special, I detected that even if the machine is fast enough we got some dropped frames.. I guess it's because the VCR signal is not as good as received TV station signal (in terms of speed, signal quality, sync..). You also will notice that the captured video is much more noisy than other captured videos. Try to activate the build-in noise reduction under "Video" / "Noise Reduction" and play a little with the treshold (i put it at about 25%).
Now you are ready to capture your video ! Select "Capture" / "Capture video with internal system".
Reasons Solutions To let VirtualDub fix it for you select this 3rd radio button ("change so audio and video durations match (24.994 fps)", "process all frames". Close the dialog box. Open the "Audio" menu and check "full processing mode", because VirtualDub will resynchronize video and audio for us now. Another option would be to export the audio stream as PCM uncompressed 44.1kHz Stereo 16 bits wavefile, adjust the playingtime of the audiostream to the video playback time and reopen the adjusted file with "Audio / WAV Audio". One of the tools to do this is CoolEdit Pro.
So the first (bad) workaround was to deinterlace the video before sending it to the mpeg encoder using VirtualDub: Open "Video", "Filters.." and you will see an empty box. This is one of the features I like very much in VirtualDub. Here we can resize the frame, deinterlace it, remove some noise afterwards... something more you like to do !? Ok, what we need now is deinterlacing, so press "Add.." and select a deinterlace filter (Note: There are more filters available (from Donald Graft, Gunnar Thalin, Steven Don..), just check the link page for details). Another idea would be to swap fields in VirtualDub, I haven't tried it till now. Avery Lee's comment on filters: "Video filters are one of VirtualDub’s most powerful features. You can chain multiple video operations together in a sequence and have VirtualDub apply them to every frame in the movie sequence automatically. Many of VirtualDub’s filters are designed for speed; most filters will run at several frames per second, and some filters will even run in real time on a reasonably fast Pentium system. Other filters are designed for quality; for instance, the resize filter rivals some image processing programs for quality." Keep in mind: The more filters you use the slower the process will be. The order how you add the filters *is important* ! Never start with the denoise filter before you apply the deinterlacing. Try to work like this: - deinterlace video Be carefull with dynamic noise reduction filters (like the one from Steven Don), a to heavy filtering will cause parts of the frame look kind of "static" or blocky, this means you see a bigger part of an image in the same/similar color, moving around as a block (similar to compression artifacts). It's because the filter has filtered too much content and the image looses information. Just try it, than you will know what I mean. Choose a scene with a static background and for example a face infront and wathc the face while you have set the dyn. NR too high (>16). Anyhow, *this* is one of the best filters i know to improve the image quality of VHS captured files ! I can only highly recommend it. If you have defined all fitlers you like to apply to your video than save the combination with "File / Save processing settings" for future use.
Finally I found out why the field change refused to work: If you use the Ligos MPEG2-filters than (for some strange reason) you will not be able to toggle the setting ! The only solution to this is: Use a different MPEG decoder filter ! I can recommend Elecard as a very good choice. They are know for better quality and they cost ~20$, so it's worth to try it (there is a demo version available, shows a small logo during playback). As you have seen it it important to know what filters are in use. But how can I find this out !? If you like to know who is in charge of MPEG2 decoding open Media Player, go to the File\Properties\Advanced tab: As you can see the Elecard MPEG2 Video Decoder is listed there. Another (more advanced) method is to use Microsoft GraphEdit. Opening the video file will plot you the way of the video and audio stream through all filters. This is a very big help if something went wrong, I can only recommend it ! You can even create a new filter graph with GraphEdit. Ok, this is how it would like for my sample (click to enlarge): Of course this nice tool will work for AVI video's, too. Just try it.
The process of encoding is more or less the same for all sources; the MPEG page will show you the final step !
The resolution is dependent on the sender and can be 480x576, 720x576 (or some other size in between). Also the used bitrate will vary; i've seen streams from 2.8 MBit/s up to 5MBit/s. A DVD has 8 MBit's, so video in D1 resolution broadcasted with 5 MBit/s looks quite nice, but for a SVCD - guess what ? - the bitrate is too high and the framesize may not match our needs. So same game again, we need to transcode the video stream to a more handy bitrate + framesize. Recording the PVA A+V Resynchronization, PTS At this point you have managed to record something as a PVA file ? Great ! Let's convert it to a more handy format now. If you think it's that easy.. I must tell you that there are a few things we need to know before we will get a perfect SVCD where audio and video are lipsync. If a video is send out to your DVB HW it's possible that some packets get lost; to be able to reconstruct the stream video and audio get PTS stamps but often MPEG2 tools (multiplexers, editing software) drop the PTS from the ES or the MPEG2 PS - this can lead to severe audio/video de-synchronisation, and lost is the chance to resynchronize audio and video.
Thanks to a tool called PVAStrumento it's a little bit easier to get a workin MPEG-2 program stream: "PVAstrumento is a small tool aiding in the conversion from PVA-files to MPEG2. PVAstrumento can do "normal" de-multiplexing, throwing away PTS and storing the raw elementary stream (ES). When doing this, it gives information about the audio/video-offset, for input in multiplexer programs. Letting PVAstrumento "fix" audio/video offset during de-multiplexing usually results in audio and video ES with a time delay small enough that they may be directly multiplexed. In "fixing-mode" demultiplexing PVAstrumento Download PVAstrumento also handles video and audio continuity errors, which may occur due to a bad reception of the digital signals, bringing audio and video back in sync. The GUI-Version of PVAStrumento can also generate an MPEG2 Program Stream, that can directly fed to tools like FlaskMPEG. The ES inside the MPEG2 PS are also "fixed", so that the PS may safely be demuxed/remuxed. PVAstrumento is freeware and may be freely downloaded, used and distributed." (Source: http://www.force5.de, home of PVAStrumento from Wiljo) Use PVAStrumento to Demultiplex / Fix the PVA Stream Fix broken PVA streams the hard way These are the steps which worked for me: - get Michael Tirtasana's PVACut
from http://viswiz.gmd.de/~mic.
(the DVB card and the Technotrend drivers are required) Ok, maybe few fractions of a second will get lost (or even more) but I prefer to get a working movie with 2 missing seconds instead of no movie at all !
If you are done with this part than you need to transcode the videostream (and maybe also the audiostream) to get the right size + bitrate (as mentioned earlier it might work without any changes (if the bitrate is low enough), but this depends on your DVD player!). I can recommend the following ways for transcoding: Trancode using FlaskDVB (preferred) Currently you can only process the video stream; so don't worry if you get a warning while you try to open the PVA. Open Options\Output format and check if Avisynth is listed there ("Link to Avisynth"). if not, make sure you have placed the premiere plugin from avisynth in the FlaskDVB folder and renamed the two files "IM-Avisynth.cm" to "IM-Avisynth.cm.flask" and "CM-Avisynth.cm" to "CM-Avisynth.cm.flask". "Open Options\Global Project Options (Export Movie Settings)", and set 480x576 as the frame size, 25 fps, leave the deinterlace checkbox empty go on with the other property pages. Under "Files" you can specify a filename for the output, but this file will never hit the drive. Avisynth will use the name instead. When you think you are done than start the export at "Run\Start Coversion". A bigger dialog will pop up and a small little window from Avisynth should appear now:
Flask will show you the parameters of the input file, the parameters of the output file and the small Avisynth Message shows you that Avisynth is ready to serve the video to an application of your choice - great, isn't it ? Create a new textfile, copy/paste the line shown in the message box and save the textfile under <filename>.avs. This avs file can be opend in TMPGEnc, CinemaCraft Encoder, Panasonic Encoder, Media Player, VirtualDub.. whatever you like! (NOTE: Using AviSynth will not allow multipass encoding). Transode using TMPGEnc (or CCE) and Avisynth _______________________________ vid = DirectShowSource("e:\PVA\test_file.mpg") #ResampleAudio(vid,44100) Now open the avs in TMPGEnc as source for video and audio, load the SVCD template and encode (it's more a transcode..) the video. The same way works for CCE and Panasonic MPEG1 Encoder; you can also open the avs file in VirtualDub, apply some more processing steps and export the result using the VirtualDub frameserver (dynamic noise reduction..) . But as you might guess this will have a big impact on the processing speed. This was a small example using Avisynth to covert a MPEG file; of course you can use the same way to convert AVI's / DivX Movies: AVISource("d:\test.avi") # or whatever the actual pathname
is
Open the ASF with VirtualDub (you need version 1.3 because Avery Lee was forced to remove the code to read ASF files). Apply filters for framesize, adjust framerate, check if A+V are in sync. If you are done than start the frame server and step on with MPEG encoding (load SVCD profile..).
Simply open the Apple Quicktime file directly in TMPGEnc (you get the idea why I prefer this encoder !?), go on with the normal encoding process (load SVCD profile..).
Open the AVI file directly in TMPGEnc (you get the idea why I prefer this encoder !?). Go on with the normal encoding process (load SVCD profile..). Note: DivX videos are not interlaced, so deselect this settings in TMPGEnc and do not apply any deinterlace filters. Note: I've had some bad experiences with files where A+V are unsynchronized after encoded into MPEG. What you can try is this: Make sure you have checked that audio and video duration match (select "Video" / "Frame Rate"). Export the audio stream using VirtualDub, choose PCM uncompressed WAV as format. Feed both streams into TMPGEnc and try again.
|