<html> <head> <title> Linux Video Stream Processing Tool - Examples</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="DVD, digital video, DV, encoder, divx, DivX;-), lame, source, posix, avifile, opendivx, codec, linux, AC3, program stream, video, audio, transcode, decoder, stream, YV12"> </head> <body bgcolor=#CDB5CD> <a name=top></a> <table cellspacing="10" cellpadding="0" border="0" width="100%"> <tr> <td align=left valign="top" width=30% bgcolor="#a0a0a0"> <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%> <td align="left" bgcolor="#e9e9e9"> <FONT FACE="Lucida,Helvetica"> <font>transcode core modes:</font> </tr> <tr> <td> This chapter gives a short introduction on the various basic operation modes transcode has to offer for MPEG video sources. <ul> <li> <a href="#chapter"> <FONT FACE="Lucida,Helvetica"> DVD chapter mode</font></a> <p> <li> <a href="#cluster"><FONT FACE="Lucida,Helvetica"> Cluster batch encoding modes</font></a><p> <li> <a href="#psu"><FONT FACE="Lucida,Helvetica"> VOB program stream unit mode</font></a><p> </ul> </td> </tr> </table> </table> <a name=chapter></a> <table cellspacing="10" cellpadding="0" border="0" width="100%"> <tr> <td align=left valign="top" width=30% bgcolor="#a0a0a0"> <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%> <td align="left" bgcolor="#e9e9e9"> <font> DVD chapter mode</font> </tr> <tr> <td> Documentation not finished.<br> <a href=dvd.html#top>more information here</a> </table> </table> <a name=cluster></a> <table cellspacing="10" cellpadding="0" border="0" width="100%"> <tr> <td align=left valign="top" width=30% bgcolor="#a0a0a0"> <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%> <td align="left" bgcolor="#e9e9e9"> <font> Cluster batch encoding modes</font> </tr> <tr> <td> Documentation not finished.<br> <a href=cluster_guide.txt>more information here</a> </table> </table> <a name=psu></a> <table cellspacing="10" cellpadding="0" border="0" width="100%"> <tr> <td align=left valign="top" width=30% bgcolor="#a0a0a0"> <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%> <td align="left" bgcolor="#e9e9e9"> <font> VOB program stream unit mode</font> </tr> <tr> <td> This new core mode is for NTSC sources that otherwise fail to transcode with other strategies and yield bad audio/video synchronization results. It also only works with MPEG program streams in connection with import module "-x vob". <p>In general, it's a good idea to move the various chunks of the big program stream, we previously ripped from a DVD, into a directory, we denote as <i>vob_dir</i>. Please see the DVD backup <a href=dvd.html#tccat>guide</a> for details. We will need to put the "*.VOB" files into this extra directory to make the directory mode of tccat and transcode work. Please keep the <i>vob_dir</i>clean of other files.<p> <font size=+2 color=red> Restrictions:</font> Options -c / -M3 / -M4 / -L / -S do not work for this mode because transcode sets some of the parameters internally for navigation.<p> The first step is to create the navigation logfile <i>nav_log</i> containing the frame and related group of picture (GOP) list with file offsets:<p> <table> <tr> <td align=left valign="top" bgcolor="#ccffcc"> tccat -i vob_dir | tcdemux -W >nav_log</td> </tr> </table><p> A typical output of the command looks as follows:<p> <code> Sisko:cluster>tccat -i vob_dir | tcdemux -W >nav_log<br> (seqinfo.c) 284 video frame(s) in unit 0 detected<br> (seqinfo.c) 413 video frame(s) in unit 1 detected<br> (seqinfo.c) 3506 video frame(s) in unit 2 detected<br> (seqinfo.c) 150662 video frame(s) in unit 3 detected<br> </code> <p> This result shows, that the entire stream is made up of 4 program stream units (PSU), that are defined by a reset of the presentation time stamp (PTS) in the stream pack header. This situation may require a re-synchronization at the beginning of each PSU, which transcode can only handle in this new core mode. This trick is to restart import at every PSU. We need to provide only two flags (long options) to make it work:<p> <table> <tr> <td align=left valign="top" bgcolor="#ccffcc"> transcode [...] -i vob_dir --psu_mode movie --nav_seek nav_log</td> </tr> </table> <p> This will eventually produce the 4 output files: <code> movie-psu00.avi, movie-psu01.avi, movie-psu02.avi, movie-psu03.avi. </code><p> transcode does not switch off the audio or video encoder. However, a video keyframe is forced at the beginning of each output file so each file played individually. This will make the chunks perfect candidates for <i>avimerge</i>. The above example shows small units before the main movie. In most cases, these junk trailers or film company/distributor intro logos and can be skipped with the additional option:<p> <code> --psu_chunks 2-4 </code><p> Simlar to the "-c" option, only units 2 and 3 but not 4 are encoded. <p> Other movies are even more complicated and have a chapter-like/episodes superstructure imposed with a large number of PSUs. In this case, you will need to use this new core mode. If you prefer 2-pass encoding, latest <i>0.6.0pre5</i> snapshots provide another long option<p> <code> --no_split </code><p> that will generate only a single output file <i>movie-psu.avi</i> for proper 2-pass bitrate estimation, valid for the entire movie.<p> <font size=+2 color=red> Notes:</font>I have noticed that some frames are dropped at the end of a unit, which does not break AV sync but lead to a jump in the audio track. I will try to improve this issue, but somehow audio is short in frames.<p> </table> </table> <!-- hhmts start --> Last modified: Thu May 16 12:57:26 CEST 2002 <!-- hhmts end --> </body> </html>