Mar 7, 2006

This guy has the scoop on this.. I used Mac OS9 tools
to deal with this (back when I had to)

Looks like MPEG Streamclip is the ticket

You should already
have the QuickTime MPEG-2 Playback
Component installed. We did that here from
what I remember.




http://www.sjoki.uta.fi/%7Eshmhav/SVCD_on_a_Macintosh.html#edit_convert_MPEG

How can I retrieve MPEG2 from a SVCD [back to Contents]

Q: OK, I have now successfully burned SVCDs. But how can I retrieve the MPEG2s back from the SVCDs if I want to use them later in other projects?

- Ripping is fast and easy with Toast Titanium: insert the (XS)VCD and choose Recorder/Disc Info... A list of tracks will appear. Select the Video track and save the MPEG from there.

If you want to burn DVD-compatible XSVCD to a DVD, you must demultiplex and author the ripped MPEG and remultiplex it with DVD specs. Toast does all this and also authoring automatically.

To re-burn as DVD in Toast: select Video/DVD-Video (or SVCD or VCD), add the ripped MPEG and burn it to a DVD. If Toast sees that the MPEG conforms to the DVD spec it doesn't re-encode it (the re-multiplexing and authoring phases are fast) so there is no quality loss. Toast may sometimes unnecessarily start to slowly re-encode valid DVD or (S)VCD MPEGs -- demultiplexing the MPEG to .m2v and .m1a (a.k.a. .mp2) may fix this.

- VCD Copy X (donationware) can rip the tracks off of a VCD or SVCD as *.dat files, which can AFAIK just be renamed as *.mpg and re-burned as SVCDs. (Compared to the original *.mpg the *.dat file contains some additional navigation information the SVCD needs).

- Another alternative for ripping is MissingMediaBurner. MissingMediaBurner has to compete with the Finder for access to the CDR(W) so put a blank CDR(W) to the CD-burner but leave the drive tray still open. In MissingMediaBurner choose Device: CD-R/RW, Driver: generic-mmc-raw (you may have to experiment with your setup). Choose the Output Folder in the RIP DISK panel, check Raw mode, press the Rip-button and immediately close the CD-burner's tray. You get something like mycd.bin as an output file. Launch GNU vcdtoolsX and use its vcdXrip to open mycd.bin and generate *.mpg files that you can author and re-burn as SVCDs with VCD Builder and Toast.

- Here is another way to rip via Toast (the other Toast method is faster because here the MPEG must be demultiplexed so Toast doesn't try to re-encode it): select CD/DVD Copy (and the desired CDRW) in Toast and File/Save as Disc Image... Rename the saved disc image *.toast to *.bin and use vcdXrip in GNU vcdtoolsX to extract the MPEGs from it.

- If necessary, you can demultiplex the *.dat or *.mpg files with MPEG Streamclip, MPEG2 Works, ffmpegX or MoreMissingTools' MPG DEMUX, and remultiplex and reuse them as *.mpg files.

MPEG is a distribution format, not an editing format, but occasionally you may want to edit MPEG files or import them to iMovie. I'd suggest you try MPEG Streamclip first and see if it does the job for you.

- MPEG Streamclip ($0) converts MPEG files (including transport streams) into muxed, demuxed, DV, QuickTime, AVI, MP4 or H.264 video or TIFF still frames, so you can easily import them in iMovie, Final Cut Pro, DVD Studio Pro and Toast Titanium. MPEG2 conversions require the $20 Apple's QuickTime MPEG-2 Playback Component (you can buy it online from Apple, but you already have it if you use either Final Cut Pro 4/HD or DVD Studio Pro). MPEG Streamclip also includes a player to set In and Out points, and perform a partial conversion. It does not read encrypted VOB files. It can open and convert also DV, MOV, AVI, MP4, H.264, DivX or WMV files (DivX and WMV need 3rd party add-ons).

To convert a DVD or MPEG to DV with MPEG Streamclip (v1.5.1 or later): Open a desired .VOB on a DVD (DVD/VIDEO_TS/VTS_01_1.VOB, for example) or a MPEG file. Select the In/Out points if you want to extract just a portion of the video. Choose "File/Export to DV.../Compression: DV (DV25)". Choose "Split DV stream in Segments" if the content is more than 9 minutes 27 seconds because iMovie 1-4 can't reliably handle longer clip files and it might be a good idea to limit the converted .dv file's size anyway (segmented clips play seamlessly in iMovie). MPEG Streamclip can optionally resample audio to 48 kHz which DV (and DVD) use (use this option when converting (S)VCD 44.1 kHz audio for DV). You can import the converted .dv to iMovie or save it directly into iMovie project's Media folder to save time and HD space (iMovie prompts you what to do with the clip when the project is opened. Notice that iMovie HD 5 now stores its project folder as a package -- MPEG Streamclip can save straight into the package's /Media folder!). As a nice touch MPEG Streamclip correctly adds 8+8 black pixels to the sides when converting PAL/NTSC 352x576/480 half D1 or 704x576/480 MPEG to 720x576/480 DV.

MPEG Streamclip can join similar MPEG files: The joined files must have the same PIDs, the same start codes, and the same audio/video properties (that is, they must come from the same source or channel). Using "Convert to MPEG" before joining the files can be helpful, because it changes PIDs and start codes to a default value. The preferred method to join streams is to Copy one stream in MPEG Streamclip, open another stream and Paste it there. This method checks that the joined streams indeed are compatible. Another method is to put the MPEGs in the same folder, and rename them so that they sort as desired in list view. Then select them via MPEG Streamclip's "File/Open Files..." dialog box (Shift- or Command-click to select multiple MPEGs). Then choose "Edit/Fix Timecode Breaks". After this MPEG Streamclip should report the combined length of all MPEGs (check the Log Window if you want to know whether any timecode breaks were found). Then choose "File/Convert to MPEG... or /Save As..." to save them in a single file. If the video transition between two files looks bad, you can use the Cut command to improve it. You can join very different and incompatible MPEGs with this latter method so the end result is not guaranteed to work.

MPEG Streamclip can also edit MPEG files. Just set In/Out points (with I/O keys), Cut unwanted material off and choose "File/Convert to MPEG...". You can also Cut/Copy selections to other parts of the same stream or open another compatible stream and Paste it there. Shift-dragging the playhead can also be used to define a selection. Option + arrow keys jump to the beginning/end or In/Out points. You can use the Trim-command to more closely see a part of the video before cutting, then choose Revert Trimming to see all material. JKL-keys can be used to enable fast forward or reverse playing. The scroll wheel works also; with the Option key it scrolls 1 second per click. See the manual for more details on how to jump in single frame, GOP, 1 second, 10 second or 1 minute chunks when searching a specific spot in the video.

Editing and trimming can be accurate only if In and Out are both on keyframes because MPEG Streamclip edits to the GOP, not to the frame. For DVD and (XS)VCD the maximum GOP size is PAL 15 and NTSC 18 frames, so the editing accuracy can be up to about 0.6 seconds. You can advance to the previous or next keyframe (i.e. I-frame, the beginning of each GOP or Group Of Pictures) with the Up/Down arrow keys -- you can also use the Edit/Go to Keyframe command to see where the In and Out points really are when editing (the In point is included in the selection, the Out point is not included). Shift + Up/Down arrow keys allow fine-tuning the selection to the GOP.

Among other things, MPEG Streamclip can demultiplex VOB or MPEG into .m2v video and .aiff, .ac3 or .m1a (a.k.a .mp2) components. It can also easily be used to multiplex video and audio files together: just place similarily named .m2v and .aiff, .ac3 or .m1a files in the same folder, drop the .m2v file on MPEG Streamclip, and convert them to MPEG with PCM, .ac3 or .m1a audio. If necessary, MPEG Streamclip can encode new .m1a audio at 192-384 kb/s. Notice that MPEG Streamclip doesn't multiplex VOB-compatible files for performance reasons, so the DVD authoring app has to re-multiplex them.

MPEG Streamclip can also change the aspect ratio, scale, center, letterbox, un-letterbox, crop, add borders, deinterlace, change field dominance, adjust brightness, contrast, saturation and volume of the converted video.

MPEG Streamclip 1.5.1 is compatible with DreamBox or Topfield TF5000PVR/TF5500PVR DVB set-top boxes, FireWire, Ethernet, USB and DVD devices like Elgato EyeTV digital video recorders, ReplayTV digital video recorders, the Humax PVR-8000 set-top box, the Panasonic SV-AV100 camcorder, the JVC Everio camcorder, the Sony T1 camera, the Panasonic VDR-M70 and the Hitachi DZ-MV230 camcorders. It is also compatible with MPEG-2 devices supported by DVHSCap and VirtualDVHS (free applications available from Apple as part of the FireWire SDK for developers); namely, the Sony IP7/MicroMV, the Sony HDR-FX1, the JVC GR-HD1 camcorders; the JVC HM-DH30000U and the Mitsubishi HD-2000U video cassette recorders; the Samsung SIR-T165 set-top box.

Check the MPEG Streamclip Guide at its Help menu for more details.

You can import the edited MPEGs to Toast Titanium, DVD Studio Pro or Sizzle 0.5b2 (some prefer Sizzle 0.1 because it can make DVDs which start playing as soon as you insert the disc, whereas Sizzle 0.5 demands you put in a menu. v0.1 might also be more reliable. There may also be differences in what audio formats each version likes and dislikes), and burn them directly, with no encoding time and no loss of quality. (Notice that iDVD doesn't accept MPEG as its input).

If you still have Toast 6, please update it least to version 6.0.9 as previous versions could alter audio/video sync of muxed MPEG files. Some versions of Toast may have trouble burning some MPEGs with mp2 audio -- a workaround is to demultiplex the MPEG to m2v and m1a (or aiff) with MPEG Streamclip and burn them. Toast may lose audio sync or be too picky and reject some MPEGs -- a workaround is to demultiplex the MPEG to m2v and aiff with MPEG Streamclip and burn them. Toast 7 now also features a preference to prevent the lengthy and lossy re-encoding -- enable it if you know the MPEG is valid for a DVD or (S)VCD. Converting to "Headed" MPEG via MPEG Streamclip adds a special header to the MPEG file that lets you import unsupported frame sizes into Toast 6 or 7 and skip recompression. However, DVDs made from "headed" MPEG files are not guaranteed to work with all players.

Toast accepts MPEGs, VOBs and VIDEO_TS folders as its input. Use Toast's Video/Advanced/DVD-Video setting (not the "DVD-Video from VIDEO_TS" setting if you want to burn several such items to a single DVD. Delete unnecessary items (such as unwanted DVD menus from old DVDs), change the description of the titles and the DVD itself to something that makes sense and burn the new DVD. This results in Toast authoring a new VIDEO_TS folder that has a title menu of the videos from your other VIDEO_TS folders or their contents. Toast basically treats the VOB sets as MPEG video. Toast adds the AUDIO_TS folder as part of its authoring process so you don't need to do anything other than drag the folders to Toast so it can find the videos.

You can also author the MPEGs which Toast rejects with Sizzle. On the other hand, Sizzle may not like the PCM audio in MPEG ripped from an iDVD-encoded disk -- a workaround is to convert such MPEGs to use mp2 audio with MPEG Streamclip.

Short Sizzle manual: Click "Add Title" and one-by-one select the desired MPEG files you want on the DVD. Then, with the "TOC Menu 1" still selected in the "Item" list, choose an existing button on Sizzle's preview screen, click "Edit Button", choose Action "Jump to menu...", select "Destination" and the desired MPEG, and edit the "Button Label" text as desired. For more MPEGs, choose "Add Button" and repeat as above. * If you want to break the MPEG as chapters: Play the MPEG in some other application and make notes for the desired chapter point times (there is no GUI for this in Sizzle). Then in Sizzle, select the MPEG in the "Item" list, the "Chapters" tab and "+" to add chapters (the first chapter is always at 00:00:00.00). Then on Sizzle's preview screen click the chapter button, "Edit button", Action: "Jump to chapter..." and Destination: and a desired chapter time. Choose "Add Button" and repeat for the remaining chapter points you have added. When you are finished click "Save Disc Image". * If you want to test the DVD image before burning: Mount the .dmg image by double-clicking it and launch the /Applications/DVD Player to test it. * Burn the DVD via Toast Titanium: Select Copy/Image File, select the .dmg Sizzle created, and hit Record. Or burn using the Disk Utility: Choose images/Burn... and select the .dmg Sizzle created, and click "Burn".

- ffmpegX ($15) can also convert .VOB or .mpg to .dv. It works OK but its installation and interface can be too overwhelming.

- DVDxDV ($25) can convert DVD-disks, VIDEO_TS folders and .VOB files to DV-encoded .mov files. iMovie 4 users should be aware that the audio is converted to 32 kHz when it imports DV-encoded .mov files (this is fixed in iMovie HD).

- DropDV ($40) can convert MPEG1 and MPEG2 streams to .dv.

- Cinematize ($60) can convert a DVD or a VIDEO_TS folder (not plain .VOB or .mpg) to .dv or QuickTime. There is a 15 day demo limited to 10 second content.

- In Toast Titanium ($100), select the Video tab, add the *.mpg or *.VOB files or drag a DVD or a VIDEO_TS folder to Toast's window, select the files in the list, choose Disc/Export Video... and Toast converts them with audio to DV streams. The converted files may even be on the (X)SVCD or DVD disk so no ripping is needed.

- A simple option to convert a DVD to DV is to just connect the DVD-player's analog outputs to a DV camcorder and convert the analog signal to DV.

- HandBrake can't output to DV but it can convert VIDEO_TS folder, DVD image or real DVD with AC-3, LPCM or MPEG audio tracks to MP4 (MPEG-4 or H.264), AVI or OGM with AAC, MP3, Vorbis or AC-3 pass-through. It supports chapter selection, basic subtitle support (burned into the picture), integrated bitrate calculator, deinterlacing, cropping and scaling and grayscale encoding.

Here are some other apps for MPEG encoding, editing or authoring:

- Capty MPEG Edit EX ($50) for Mac OS 9/X can do frame-accurate MPEG2 (not VOB or MPEG1) editing with 48 kHz PCM, AC3 or M1A single audio streams. It does this by converting a GOP to uncompressed video at the point of the edit. It supports all legal DVD resolutions. It can join different MPEGs to a single MPEG file and write as DV stream or MOV.

- Capty MPEG Edit Mac OS X can edit MPEGs frame-accurately (as opposed to GOP-accurately), so it must re-encode some frames (if you clip off an I-frame it must be re-encoded). It only accepts muxes of .m2v & .mp2/.pcm. It is a Japanese application, and unfortunately there is no english localization at the moment (Capty MPEG Edit EX may be a very similar app). It is a newer iteration of the english software that came with the ADS USB Instant DVD hardware MPEG encoder.

- Capty DVD/VCD 2 ($70) can encode and author single- or dual-layer video-DVDs as well as VCDs. It also accepts MPEG sources, does Dolby Digital encoding, offers 25 customizable motion menu templates, provides the ability to specify chapter points and chapter menus, and creates DVD slide shows that can display photo titles as well as have background music. Here is a CaptyDVD 2.0 quick tour.

- Pixe VRF Browser ($50) for Mac OS 9/X can view, edit and export video from a VR format DVD-RAM or DVD-RW or from a VIDEO_TS folder to DVD authoring applications. Pixe VRF Browser may be unnecessary if you have Toast 7 because its only real value is in extracting MPEGs from VR-mode DVDs recorded on a standalone DVD recorder or a DVD camcorder. It will not read MPEG files directly. There is a short review here. The data from VRF Browser is compatible with Pixela's Capty MPEG Edit EX, enabling detailed editing of frame by frame video and audio data. Unlike Capty MPEG Edit EX it doesn't play audio or allow preview of edits.

- MPEG Append ($50, the Mac OS 9 version is free) can combine MPEG files for DVD authoring applications like DVD Studio Pro.


...Many older MPEG tools handled only video and they are described below mainly for historical curiosity. To preserve audio you had to laboriously demultiplex audio and video to separate files and convert them separately to *.aif audio and *.dv video which you can import to iMovie and join there or combine in QuickTime Player:

1. Demultiplex MPEG to separate audio and video files:

You can do this with either MPEG2 Works, ffmpegX, MoreMissingTools' MPG DEMUX or mpgtx GUI (all use mpgtx as their demuxing engine. Note that for some reason iTunes can't currently convert MPEG audio if it is demultiplexed with bbDEMUX so use mpgtx for demuxing).

Demultiplexing yields *.mp2 as an audio file and either something like *.m2v (MPEG2) or *.m1v (MPEG1) as a video file. Don't throw the video file away because you convert it to DV later.

2. Convert *.mp2 audio to uncompressed 48 kHz 16 bit stereo *.aif which iMovie can import:

a) With iTunes you can convert the demuxed *.mp2 audio file to an uncompressed 48 kHz 16 bit stereo *.aif file, and import it to iMovie where you can combine it with the DV video you get in the next step. You can import the converted *.aif file via iMovie 3's Audio tab straight from the iTunes Library or locate and import the converted *.aif file to iMovie 2.

(You can select the AIF format in iTunes/Preferences/Importing, and define the folder where the *.aif is saved via iTunes/Preferences/Advanced. In iTunes select File/Add to Library... to add the .mp2 to the playlist, then select the .mp2 and choose iTunes/Advanced/Convert Selection to AIFF. You can then copy the .aif file from the iTunes folder elsewhere via the Finder or import it via iMovie 3's Audio tab).

b) You may also convert the *.mp2 to WAV with MPEG2 Works and use QuickTime Pro to export it as uncompressed 48 kHz 16 bit stereo AIFF.

c) You may also convert *.mp2 to *.aif with SoundApp although it isn't currently Mac OS X native.

3. Convert MPEG video to DV video: You can do the MPEG to DV conversion with tools like DiVA or MediaPipe.

a) DiVA is more user friendly but it doesn't exactly preserve the correct aspect ratio with resolutions like PAL/NTSC 352x576/480 (standard SVCD resolutions and DVD 720x576/480 are OK). DiVA doesn't require you to demultiplex the MPEG before converting it to another video format.

Set DiVA not to crop the MPEG and set it to scale to PAL/NTSC 720x576/480 in its main window. Set Compression to DV-PAL or DV/DVCPRO-NTSC with Best Quality and PAL/NTSC 25/29.97 fps.

b) With MediaPipe you have more control so you can maintain the correct aspect ratio even with weird MPEG resolutions. I have some preconfigured MediaPipe MPEG-to-DV templates. You can use the templates to convert _demultiplexed_ MPEG back to DV (the pipes don't have a demultiplexer so you have to demultiplex the MPEG first!). There are templates to convert MPEG resolutions PAL 352x288, 352x576, 480x576, 704x576 and 720x576 and NTSC 352x240, 352x480, 480x480, 704x480 and 720x480 to DV.

Note that some DV<->MPEG conversions require you to crop or add borders before or after scaling to maintain the correct aspect ratio. Check the original MPEG's resolution with tools like mpgtx GUI because QuickTime Player may report wrong MPEG resolutions.

A Quick Guide to Digital Video Resolution and Aspect Ratio Conversions <http://www.iki.fi/znark/video/conversion/>

c) By the way, iMovie 3 can import MPEG1 video if you drop the MPEG1 file to the iMovie timeline or shelf. MPEG-2 Playback Component is required for iMovie 3 MPEG2 importing or MPEG2 playing via QuickTime Player. Anyway, currently the converted MPEG files lack audio and the quality isn't as good as with DiVA or MediaPipe because in PAL, the output DV file every other frame is duplicated so the resultant video is jerky. Also in PAL the diplayed 720x540 must be resized to 720x576 in QuickTime Player to avoid distortion in interlacing. With DiVA or MediaPipe the converted DV quality is good and interlacing is preserved well with MPEG2 files.

4. Import to iMovie and join the converted video and audio:

a) Open the output DV-encoded QuickTime video file with QuickTime Pro and export it as a PAL or NTSC DV stream (with iMovie 3 you can skip this step). Import it to iMovie and combine with the imported *.aif audio.

b) Or, in QuickTime Pro paste the audio to the video track with the Add Scaled command to make video and audio sync.

Another commercial but expensive option to MPEG-to-DV conversion is to use Cleaner which should export also audio.




More Links, not in any particular order
================================

http://www.danslagle.com/mac/iMovie/tips_tricks/6010.shtml
http://www.danslagle.com/mac/iMovie/qt_plugins/3000.shtml

http://www.alfanet.it/squared5/mpegstreamclip.html
http://www.versiontracker.com/dyn/moreinfo/macosx/14618
http://www.versiontracker.com/dyn/moreinfo/macosx/17899

No comments: