tooltips
Lplex is a console application meant to provide a free, quick, and hopefully painless way to You're already fully equipped for hi-res audio (up to 24-bit/96khz) if you have a typical dvd-player and digital amp, and lplex is a way to take advantage of this.
BASICS

MODE

INPUT

DVD LAYOUT

DVD NAVIGATION

QUICK START

Although lplex has no gui, its basic operation is fairly simple, requiring just drag & drop and a plain-text editor:


  1. Unzip the folder 'lplex-0.3' to a location of your choice.

  2. Double-click on lplex and close it again (this is to create the config file 'lplex.ini').

  3. If your tv system (see map) is
    • NTSC :
    • skip this step.
    • PAL or SECAM :
    • open 'lplex.ini' in Notepad and change 'video=ntsc' to 'video=pal', and save.

  4. If your set of audio files is
    • continuous (a concert):
    • skip this step.
    • discontinuous (a mix):
    • open 'lplex.ini' in Notepad and change 'splice=seamless' to 'splice=discrete', and save.
  5. Now drop a folder, disc or .iso file onto lplex.

    • If it contains wav or flac audio files, lplex automatically creates an .iso dvd image file suitable for burning with your favorite burning app (Imgburn, Nero, etc).

    • If it contains (or is) a VIDEO_TS folder, lplex automatically extracts any lpcm audio to wav format.
  6. Press CTRL C or just close the console at anytime to cancel the program.


That's it, as long as a one-title black-screen dvd with alphabetically-sorted input files is good enough. If not, using scripts or the command line will allow you to

USER APP DATA
Lplex maintains an application folder for each user:

  • %appdata%\lplex
    ~/.lplex

    which contains 3 application files:

  • lplex.ini
    lplex.conf
    User configuration file. Edit this in a plain-text editor to change the default global program settings. See OPTIONS below.
  • lplex.log
    Log of last run. This file is also copied by default to the 'XTRA' info folder of the dvd after authoring.
  • project.lplex
    Auto-generated project file for last non-project run.

    Windows:
    USAGE
    lplex [OPTIONS] <files> ... [FLAGS] <files> ...

    Examples:

    • Create a single-title NTSC dvd fileset:
      lplex --video=ntsc --create=dvd ~/myAudio

    • Create a 2 title PAL dvd with different backgrounds and splicing:
      lplex -t pal discrete jpg=a.jpg mySongs ts seamless jpg=b.jpg myConcert

    • Extract audio from a dvd disc to a specific folder at flac level 6:
      lplex --formatout=flac6 --dir=~/myFlacs /dev/dvd

    • See the Quick FAQ for more examples.

    Windows FILE PATHS: use single backslash on the command line or in scripts:
    --dvdpath=C:\myDVDs\
    and double backslashes in lplex.ini:
    dvdpath=C:\\myDVDs\\
    OPTIONS
    Options are settings that apply to the entire session. If an option occurs more than once, the last instance governs the session. All options are processed before filenames and flags, so it doesn't matter where they are placed, their scope is always over the entire session.
    Options can be set globally in lplex's configuration file (lplex.ini or lplex.conf), omitting the '--' prefix:
    video=pal
    or locally on the command line or in a script with the '--' prefix:
    --video=pal
    For option values below, =default, 1 and 0 can be used for yes/no:

    OPTIONVALUESDESCRIPTION
    --video (-t) ntsc
    pal
    secam
    use this tv standard.

    The TV standard must match your dvd player (for the purposes of dvd-video 'pal' and 'secam' are equivalent).

    --create (-c) lpcm
    m2v
    dvdstyler
    mpeg
    dvd
    iso
    author to this stage.

    isoAn iso image file ('<output name>.iso') suitable for burning with ImgBurn, Nero or similar programto disc will be created alongside the output folder.

    dvdA dvd file structure will be created in the dvd folder. Create an iso image from these files when you're ready to burn:
    Windows: Drop the dvd folder onto the 'mkisofs.bat' utility located in the 'util' subfolder.
    Linux: Assuming $dvdpath is the path to the dvd folder, this creates an iso with volume id (disc label) set to the folder's name:
    volid=$(basename "$dvdpath" | cut -b1-31)   # volume id must be < 32 characters
    mkisofs -dvd-video -V "$volid" -udf -o "$volid.iso" "$dvdpath"
    
    I don't recommend burning the dvd file structure directly with a burning program due to varying support for 24-bit audio content and the possibility of unwanted defaults such as automatic downsampling.

    mpegMpeg file(s) will be created in the work folder. The dvd folder (including the 'XTRA' info folder) will also be created.

    dvdstyler Same as mpeg, with an added xml configuration file in the work folder for loading into dvdStyler. This doesn't generate any menus, it's simply meant to help start the process of designing them.
    QUICK HOW-TO

    m2vRaw lpcm and m2v files only will be created in the work folder.

    lpcmRaw dvd-order lpcm file(s) only will be created in the work folder.



    There is no need to change the 'cleanup' setting for partial authoring (lpcm , m2v , dvdstyler , or mpeg). The work folder is automatically left intact.

    --name (-n) <projectname>name the project this.

    --md5aware (-m) yes
    no
    insert lplex tags into the dvd.

    Md5 signatures and restoration tags will be embedded in the dvd for future reference during extraction.

    When extracting, if the dvd is lplex-authored the audio data will be md5-verified and the original filenames and folder structure restored. If not lplex-authored the audio files will be named according to their position in the dvd structure and an md5 value will be calculated.

    --splice (-l) seamless
    discrete
    padded
    none
    splice the tracks together this way.

    How to physically structure the immediate track transition point:

    seamless ("concert" mode - lossless, gapless, unpadded).
    Track startpoints will be shifted to where audio and video frames are in alignment, ensuring gapless playback and no need for any padding between tracks. Shift direction is determined by the 'shift' setting (see below).

    discrete ("compilation" mode - lossless with gaps and padding).
    Tracks will be padded with silence to the next full audio frame in order to prevent stream truncation during multiplexing. A playback gap (equal to video duration - audio duration) is introduced. An additional half-second pause will also occur during playback because of stc discontinuity.

    padded ("compilation" mode - lossless with padding only).
    Tracks will be padded with silence to the next point of a/v frame alignment. Unlike 'discrete' there is technically neither a playback gap nor a discontinuity pause in this model, though the padding is much greater.

    none ("as-is" mode - lossy, unpadded, with gaps).
    Tracks will be padded to next dvd sample unit if required. Audio will be dropped at the end of each track, unless your files happen to be the exact length to require no truncation.

    The purpose of this setting is to achieve clean, efficient transitions and to avoid undesirable playback artifacts such as gaps and pops. It is not intended as an audio effect and its scope is always less than one video frame. If you want an extended pause between tracks you must include physical silence in your source audio. See the ARCANE DISCUSSION below for more on splicing and alignment.


    --shift (-s) backward
    forward
    nearest
    move seamless startpoints in this direction.

    Direction to shift the track startpoints if 'splice' is 'seamless' (see above).

    --infofiles (-x) yes
    no
    make an 'XTRA' info folder on dvd.

    All non-wav/flac files encountered will be copied, with the folder structure intact, to an archive folder named 'XTRA' in the root of the dvd.

    When extracting, if the dvd is lplex-authored the file/folder structure in the 'XTRA' folder will be copied to the output folder.

    --infodir (-i) <dir>copy files in this folder to 'XTRA'.

    --jpeg (-j) <filename>
    black
    black_#
    - use this jpeg as the background
    - or use a default black screen
    - of this size (# = L,M,S,XS)

    The accompanying video will be a black screen. Default size is 352x240 NTSC or 352x288 PAL, or you can specify the size using 'black_#', where # is:
       L          M          S          XS*
    720x480    704x480    352x480    352x240    NTSC
    720x576    704x576    352x576    352x288     PAL
    
    You can substitute your own jpeg image by specifying a valid filename. To use different backgrounds on different tracks or set widescreen backgrounds, see the 'jpg' and 'jpgw' positional flags in the FLAGS section below.
    See also note on Windows FILE PATHS above.

    --rescale (-R) yes
    no
    rescale jpegs ntsc<->pal if required.

    If jpegs sized for ntsc are being used to create a pal dvd, rescale them to the nearest legal pal size, and vice-versa.

    --media (-z) dvd+r
    dvd-r
    dl
    none
    don't exceed this disc size.

    Will verify that output fits on the given media before authoring. This is only a size check. Important: for 'dl' (dual-layer) media, see CAVEATS section below.

    --editing (-e) no
    yes
    absolute
    relative
    do a demo run and write it as a script.

    - using absolute file paths
    - using relative file paths

    This option has two qualifiers, 'v' and 'p', which can be added using a comma, for example '--editing=relative,v' or '-e 1,vp':

    v Verbose. The track time and total space it occupies on the dvd (audio+video) will appear on the far right, helping you decide what to trim if your dvd is oversize:
       "02 - From Hank to Hendrix.flac"                       #  103 MB    5:45
       "03 - Ambulance Blues.flac"                            #  173 MB    9:42
       "04 - Sad Movies.flac"                                 #   76 MB    4:17
       "05 - A Man Needs A Maid.flac"                         #   78 MB    4:22
       "06 - No One Seems To Know.flac"                       #   58 MB    3:15
       "07 - Harvest.flac"                                    #   67 MB    3:47
    
    p Print to screen. See COMMAND LINE section below for more on ',p'.

    --menu (-M) <dir>use these user-supplied menus.

    lplex doesn't create menus, it will just incorporate your pre-authored custom menus into the dvd, checking first to make sure they're titleset/system-compatible with the lplex-authored dvd. The purpose of this option is to allow packaging of menus and audio files so that the identical dvd can be regenerated later, e.g. when sharing or archiving.

    If this option is omitted the same result (minus validation tests) can be achieved "by hand" if you simply drop your menus into the VIDEO_TS folder after creating the dvd fileset with lplex.

    You can create menus using DvdStyler, q-dvdauthor, or similar general purpose dvdauthor frontends. A dvd menu fileset consists of files in the VIDEO_TS folder named as follows

    VIDEO_TS(.IFO .VOB .BUP)
    VTS_**_0(.IFO .VOB .BUP)
    where '**' is the titleset number and '_0' designates it as a menu file. For example, menu files for a 2 title dvd would be:
    VIDEO_TS.IFO    VTS_01_0.IFO    VTS_02_0.IFO
    VIDEO_TS.VOB    VTS_01_0.VOB    VTS_02_0.VOB
    VIDEO_TS.BUP    VTS_01_0.BUP    VTS_02_0.BUP
    

    .BUP (BackUP) files are optional and can be ommitted.

    Projects with menus aren't automatically universal, meaning that NTSC menus can't automatically be converted to PAL, and vice versa. You will need to create separate menus for each system if you want your package to be universal. Each menu fileset must be in its own separate folder.


    --dir (-d) <dir>output everything to this directory.

    --dvdpath (-p) <dir>
    adjacent
    output dvd files to this directory.

    The output folder is by default right next door to the input folder if input is on your hard drive, and named '<input folder name>_DVD', i.e. dropping 'c:\someAudio' will output to 'c:\someAudio_DVD'. You can instead redirect dvd file output globally to any valid path by editing this setting. Note: unless a name is explicitly given using the -d command line switch when the input folder is either an unnamed dvd disc or the dvd is multi-title, output is named '<YYYY-MM-DD_HHMM>_DVD'.
    See also note on Windows FILE PATHS above.

    --workpath (-w) <dir> use this folder for temporary space.

    Globally redirects temporary workspace, same as above. This setting defaults to your system 'temp' folder.
    • To open your system 'temp' folder in Windows, type '%temp%' into Explorer's (or any other) address box and press enter, then look for your project work folder (usually something_DVD).

    • See also note on Windows FILE PATHS above.

    --isopath (-a) <dir>
    adjacent
    output disc images to this directory.

    Globally redirects iso image output, same as above.
    See also note on Windows FILE PATHS above.

    --extractpath (-E) <dir>
    adjacent
    extract to this directory.

    Globally redirects extraction output, same as above, except the output folder name suffix will be '_UNPACKED'.
    See also note on Windows FILE PATHS above.

    --readonlypath <dir>where to output if source is read-only (e.g. a dvd drive).

    This is by default the current user's home directory, e.g.
    readonlypath=C:\\Documents and Settings\\buffy\\
    but you can edit it to be any valid existing path.
    See also note on Windows FILE PATHS above.

    --unauthor (-u)extract audio from dvd.

    --formatout (-f) wav
    flac
    flac#(0-8)
    raw
    extract audio to this format. (flac equals flac8)

    When extracting, format will be wav (or flac# where # specifies compression level, or raw dvd-order lpcm). 'flac' is the same as 'flac8'.

    --restore (-r) yes
    no
    restore files to original length.

    When extracting, if the dvd is lplex-authored track startpoints will be shifted back to their original pre-authored locations, entirely restoring the original fileset, and if set to 'no', output will correspond to the dvd start and end points as-is, excluding any padding. This setting only takes effect if 'md5aware=yes'.

    --cleanup (-C) yes
    no
    delete interim files when done.

    All interim files (raw lpcm, m2v, mpg, etc) will be deleted in progress; otherwise these files are left wherever 'workpath' points to (your system's temp directory by default) - make sure you have adequate additional free space (roughly an extra 2x input size).

    --verbose (-v) no
    yes
    show all messages.

    If 'verbose=yes' all of lplex's screen messages will be shown in progress. This verbose version is always written to 'lplex.log' in the 'XTRA' folder regardless of this setting.

    When extracting, same as above, except 'lplex.log' is written to the output folder.

    --color (-L) yes
    no
    dark
    bright
    colorize console output.

    --pause (-P) yes
    no
    pause console before exiting.
    Defaults to 'no' in linux.

    --versionprint out the version and build info.

    --licenseprint out the GNU GPL License notice.

    --help (-h)print this lot out!

    FLAGS

    Flags are "fall through" settings, applying only to subsequent files and only until the next instance, if any, of the same flag. For instance

    lplex jpg=a.jpg x.wav y.wav jpg=b.jpg z.wav

    will use a.jpg as the background for x.wav and y.wav, and b.jpg for z.wav.



    FLAGARGDESCRIPTION
    tsstart a new titleset here.

    jpg <jpegfile>use this 4:3 background from now on.

    jpgw <jpegfile>use this 16:9 background from now on.

    prj <projectfile>merge this .lplex script here.

    seamless
    discrete
    padded
    use this splice from now on.

    CAVEATS
    Multi-channel audio Lplex produces technically correct dvds containing multi-channel lpcm audio as allowed by the dvd-video spec. Finding a player that actually supports their proper playback is another story. In theory multi-channel lpcm output should be available via analog (not digital, since SPDIF is intentionally limited to stereo), but I know of no player where analog output isn't remapped to stereo. Please report any players that actually do support this feature.

    20-bit audio Not supported.

    Dual-layer discs Dual-layer images are not created correctly, lacking a properly defined layer break.
    You can try the following workaround to create and burn a dl iso image (I haven't tested this myself):
    • set 'create' to 'dvd' and 'media' to 'dl' or 'none' and author the dvd file structure using lplex.
    • process the resulting 'VIDEO_TS' folder using the free tools PgcEdit and Imgburn as described here
      (n.b. the 'Seamless layer break' section for continuous audio).
    DVD Menus Lplex can't generate menus, but it will accept and incorporate user-provided menus into the dvds it creates (see the 'menu' option).

    Upsampling There is no facility for upsampling CD audio in lplex.
    You can, at your own discretion, try the following free resamplers for this purpose:
    Non-canonical wav files Lplex may reject some non-canonical wav files (wav files with extra chunks of non-audio data). In this case try converting to flac prior to authoring with lplex, as flac's support for variants of wav is much more robust.

    Size Estimate Dvd size is slightly overestimated (on the order 10-20 MB), so a few borderline cases will end up falsely reported as being too large for the given media.

    QUICK FAQ
    Q: I have a folder of audio files named in alphabetic order, how do I make a one-title dvd?
    A:
    • From the desktop just drop the folder onto the lplex program icon.
    • Or on the command line type:
      lplex c:\myfolder

    Q: How do I burn a dvd once lplex is finished?
    A: Just open or drop the generated '.iso' image file into/onto your favorite burning program and press go.

    Q: How do I stop lplex while it's running?
    A:
    • Just close the console window.
    • Or in the console press CTRL C.
    You can do this safely at any time; the worst that can happen is that some temporary files won't be cleaned up.

    Q: How do I group my files into separate titles on the dvd?
    A: Put a 'ts' (titleset) flag wherever you want the breaks:
    lplex a1.flac a2.flac ts b1.flac b2.flac

    Q: How do I generate a multi-title dvd corresponding to my input folders?
    A: Put a 'ts' (titleset) flag between the folders:
    lplex c:\folder1 ts c:\folder2 ts c:\folder3

    Q: How do I change backgrounds?
    A: Use the 'jpg' flag to change images as you go along:
    lplex jpg=A.jpg a.wav jpg=B.jpg b.wav jpg=C.jpg c.wav

    Q: How do I use widescreen backgrounds?
    A: Use the 'jpgw' flag:
    lplex jpgw=w1.jpg a.wav jpgw=w2.jpg b.wav

    Q: How do I create properly rendered widescreen backgrounds?
    A: Prepare an oversize true 16:9 jpeg in your favorite image editor, unlock the aspect ratio and resize to a legal dvd image size (e.g. PAL 720x576 or NTSC 720x480).

    Thanks to Richard Harvey for this detailed guide

    Q: How do I preview the auto-generated dvd layout for a folder?
    A: From inside your folder type:
    lplex -e .,p
    and the layout will be printed to the screen.

    Q: How do I start a project called 'foo' from the desktop?
    A: Make an empty 'foo.lplex' text file in your source directory, drop it onto the lplex program icon and then edit it in Notepad.

    Q: How do I start a project called 'foo' from the command line?
    A: From inside your source directory type (note the dot at the end):
    lplex -n foo -e .
    and then edit 'foo.lplex' in any plain text editor.

    Q: How do I generate a dvd from my script?
    A: Make sure your script sets '--editing=no', then
    • From the desktop drop 'myproject.lplex' onto the lplex program icon.
    • Or on the command line type:
      lplex myproject.lplex

    SCRIPTS

    lplex scripts, or project files, are just a command line in the form of a text file, meant as

    Any text file with a '.lplex' extension containing a valid command string can serve as a script, so you could of course write and edit your script entirely on your own without interfacing with lplex at all.

    In practice it's quicker to put lplex into edit mode and let it scan your folders and write an automatic script for you, which you can then edit to reorder the file sequence, define multiple titles and backgrounds, and so on.

    QUICK HOW-TO

    1. Open up any plain-text editor (e.g. Notepad) and save an empty text file as 'foo.lplex' in the folder containing your audio files, jpegs, etc. (these may be arranged in subfolders if you like).

    2. Drop 'foo.lplex' onto lplex.exe and and then reopen it in notepad afterwards; it should look something like this:

         #!/usr/local/bin/lplex -P 1
      
         # lplex version 0.3 beta 
         # Project : foo_DVD 
         # Layout is roughly 54 MB (DVD+R/RW is 1% full) 
          
         # Settings: 
          
         --name=foo_DVD
         --md5aware=yes 
         --infofiles=yes 
         --splice=seamless  
         --shift=backward 
         --create=iso 
         --media=dvd+r 
         --cleanup=yes 
         --jpeg=black 
         --verbose=no 
         --editing=relative 
          
         # VIDEO_TS
          
         # Title 1 - (24 bit 96 khz 2 ch / 352x240  4:3)
          
         d1\a.wav 
         d1\b.flac 
         d2\c.flac 
         d2\d.wav 
          
         # XTRA - Info files
          
         img\blue.jpg 
         img\green.jpg 
         "img\red 2.jpg"
         info.txt 
         foo.lplex 
      
    3. You now have a project called 'foo' with the current lplex settings and a list of the files in that folder; essentially a command line in the form of a text file with one difference: it's interspersed with some unix-style comments to make it more human-readable. The project effectively lists what would have been the result of dropping the parent folder onto lplex, except that the project takes its name from the script rather than the folder name as usual.

      The file is organized in 3 main sections representing the dvd's configuration and layout:

      # Settings: Program options for this dvd.

      # VIDEO_TS Audio files, menus, and flags describing the contents of the dvd's 'VIDEO_TS' folder, grouped by titleset.

      # XTRA - Info files Files, if any, to be placed in the dvd's 'XTRA' folder.

      In this example you can see that lplex has found audio files in the subfolders 'd1' and 'd2', and jpegs in the subfolder 'img' (which by default it considers to be info files that go into the XTRA dvd folder).

    4. Edit this file as desired. You can reorder or delete input files, change the settings, put in positional flags, and so on. In this example we'll split the dvd into two titlesets and define custom backgrounds for each file:

      Move the jpg files up into the list of audio files as desired, prefixing each with a 'jpg' or 'jpgw' flag as appropriate. For instance, in the excerpt below 'blue.jpg' will become the background for 'a.wav', 'green.jpg' for 'b.flac', etc. Note also the 'ts' flag added after 'b.flac' (line 4) to start a new titleset, and that this titleset uses 'jpgw' flags to denote widescreen (16:9) backgrounds:

         jpg=img\blue.jpg 
         d1\a.wav 
         jpg=img\green.jpg 
         d1\b.flac ts 
         jpgw="img\red 2.jpg" 
         d2\c.flac 
         jpgw=img\green.jpg 
         d2\d.wav 
      
    5. Save the file, drop it onto lplex again, and reopen it. The edited area is rewritten, and you now have a 2-title dvd corresponding to the location of the 'ts' flag:

         # Title 1 - (24 bit 96 khz 2 ch / 352x240  4:3)
          
         jpg=img\blue.jpg 
         d1\a.wav 
         jpg=img\green.jpg 
         d1\b.flac 
          
         ts 
         # Title 2 - (24 bit 96 khz 2 ch / 720x480 16:9)
          
         jpgw="img\red 2.jpg" 
         d2\c.flac 
         jpgw=img\green.jpg 
         d2\d.wav 
      
    6. Keep cycling through this process until you're satisfied with the layout. Once you're ready to create the dvd, you either delete the --editing=whatever line (at the top of the file, last item under 'settings'), or comment it out by placing a '#' at its beginning, or if you're feeling especially pedantic you can explicitly set the editing mode to 'no' as shown below:

         --editing=no 
      

      and rerun.

    NOTES

      EDITING & SYNTAX

    1. The two rules of editing a script are:
      • there must be some sort of whitespace separating the arguments, it doesn't matter what or how much.
      • anything between a '#' and the end of the same line is considered a comment and ignored. This is mainly to allow lplex's pretty printing. There isn't any point in writing your own comments while in editing mode, since you won't get them back. Only after your project is finalized and you set --editing=no will any added comments persist.
    2. You can always insert more material by typing a valid file or folder path (relative or absolute, it makes no difference) somewhere and rerunning. If your path is a folder, its full listing is inserted wherever you typed it, and its info files, if any, are placed in the 'XTRA' section at the bottom.

    3. You can switch at any time between '--editing=absolute' to see full file paths, or '--editing=relative' to see relative paths.

    4. Using '--editing=relative' makes your project a portable package which can be shared or archived, allowing the identical dvd to be created anywhere. A typical package would be a set of source files and folders containing the various wavs, flacs, jpegs, menus, etc, with a script in the top folder. You can also share just a script by itself with fellow end-users of an existing file-shared set provided by others.

    5. COMMAND LINE

    6. The simplest way to start a project from the command line is, from the source directory, to type

      lplex -e.
      which means (-e) go into edit mode, and (.) scan the current directory, using its name as the project name. So in 'c:\myAudio' you will get a script called 'myAudio_DVD.lplex' which will in turn generate a dvd labeled 'myAudio_DVD'. Add the -n option if you want to control naming from the command line, e.g.

      lplex -n foo -e .
      which will give you 'foo.lplex' and use 'foo' as the dvd label. You can also change the dvd label by editing '--name' directly in the generated script, of course.

    7. If you just want to preview the layout without editing, add ',p' to the -e argument, for example

      lplex -e .,p
      will print the current directory as a project to screen instead of writing a file.

      AUDIO

    8. Audio characteristics must match within each titleset. In editing mode lplex performs a 'lax' scan of your input, meaning it will automatically start a new titleset (and warn you about it) anytime it finds an audio file with characteristics differing from the preceding one. This may or may not result in an acceptable layout, so be sure and review the results and rearrange as appropriate. Needless to say audio files must be dvd-compliant.

      VIDEO

    9. Jpegs must be dvd-compliant, i.e. one of the acceptable sizes listed in the readme, and the sizes and aspect ratios (i.e. 'jpg' or 'jpgw' flags) must all match within each titleset.

    10. Menuless projects are universal, meaning that the same script can be used to generate either an NTSC or PAL dvd, determined by the end-user's settings in lplex.ini. By default lplex omits the '--video' setting in a script so as to keep it neutral.

    ARCANE DISCUSSION

    PADDING AND PLAYBACK GAPS

    Dvd-video imposes a somewhat arbitrary minimum unit of an 'audio frame' onto lpcm data, so unless padded the audio will end up truncated to the nearest full audio frame. Padding ensures that no audio is dropped, though a commensurately tiny (or gigantic depending on your point of view) stretch of silence is introduced as a result. The outside limit for audio frame-completion padding is just short of 150 pts ticks, or 0.00167 seconds.

    Another constraint is that the last frame of audio should occur within the last frame of video, so that unless the frames happen to be perfectly aligned, a playback gap occurs when audio has run out but video has not, with naturally an outside limit of just under one video frame (NTSC = 0.033 and PAL = 0.04 seconds). For discontinuous audio this is tolerable, since there's a break anyway, but there's an additional wrinkle. This discontinuity, for reasons I confess I don't entirely understand, causes dvd playback to pause for an additional half second over and above the predicted gap. To entirely prevent any "gap" (in a strictly technical sense) then, one would be forced to pad forward to the next 'magic point' of perfect a/v alignment (see below). Although there's no clear advantage to authoring this way as opposed to allowing the combined gap and pause, lplex will, at your option, author discontinuous audio by either method ('discrete' or 'padded' audio-splicing). My own feeling is that it's better to use 'splice=discrete' so as to avoid padding, since it won't be separated out if extraction is done using any other utility.

    NOTE: Lplex always discards any padding during extraction, so that audio data is ultimately unaltered.

    See the title layout tables section of the verbose output (or 'lplex.log') for the precise gap and/or padding length at the end of any given track.

    SEAMLESS PLAYBACK

    For truly seamless playback of continuous audio lplex's approach is to recut the tracks at 'magic points' where both audio and video frame boundries coincide (somewhat similar to sector boundary alignment in cd-audio). In dvd time is measured in PTS (Presentation Timestamp) ticks. Here's the math:
         
             One second           = 90000 PTS ticks
             One lpcm audio frame =   150 PTS ticks
             One NTSC video frame =  3003 PTS ticks
             One PAL  video frame =  3600 PTS ticks
    
    so the system-specific 'magic' cut points are
         
             NTSC: every 50 video frames = 1001 audio frames = 1.66 seconds
             PAL : every  1 video frame  =   24 audio frames = 0.04 seconds
    
    and 'universal magic points' occur (unfortunately too far apart for a single universal solution to recutting) at
         
             every 1200 NTSC frames = 1001 PAL frames = 24024 audio frames
                = 40.04 seconds
    
    Lplex's 'seamless' audio-splicing moves the track startpoints to an immediate system-specific 'magic point' when authoring (which, to my mind at least, is a tolerable shift), then restores the original startpoints on extraction.

    (THEORETICALLY) PERMITTED AUDIO

    According to mpeg.org, dvd-video allows the following types of lpcm. Lplex presently attempts to support the varieties marked '+'.
             Rate  Depth   :   Channels
             (khz) (bits)  :   1     2     5(+1)  8
             -------------------------------------------
             48       16   :   Yes+  Yes+  Yes+   Yes+
                      20   :   Yes   Yes   Yes    -
                      24   :   Yes+  Yes+  Yes+   -
             96       16   :   Yes+  Yes+  -      -
                      20   :   Yes   Yes   -      -
                      24   :   Yes+  Yes+  -      -
    

    LPLEX TAGS DESCRIPTION

    Lplex writes tags at two locations in every dvd program

    The tags consist of the following two contiguous pieces:

    1. 42 byte flac header (STREAM, METADATA_BLOCK_HEADER and METADATA_BLOCK_STREAMINFO) describing the audio data extracted to wav-order from the dvd as-is. See flac documentation for header details.

    2. Variable-length xml entity of the form

      <Lplex ver="*" path="*" id="*" shift="*" md5prev="*"/>
      
      where
    3. ver
    4. version of lplex which wrote the tag.
    5. path
    6. path and filename under root folder to use for output.
    7. id
    8. index relative to all authored tracks present on the dvd.
    9. shift
    10. number of audio bytes to shift (+)in/(-)out at track end to restore original pre-authored state.
    11. md5prev
    12. 32 byte text-form md5 signature for track after shift.

    BUILDING
    HOW TO BUILD IN UBUNTU
    1. Install flac, libdvdread, mjpegtools, and dvdauthor from the official repos:
      sudo apt-get install libflac++-dev libdvdread-dev mjpegtools dvdauthor
      

    2. Install an ansi (not unicode) build of wxwidgets 2.8.12 (not 2.9.x, which is currently incompatible), by either

      • Adding the repo at apt.wxwidgets.org (steps 1-3 as described here) and then
        sudo apt-get install wx2.8-i18n libwxgtk2.8-dev libwxgtk2.8-ansi-dev wx-common libgtk2.0-dev
        

      • Or building from source. To compile a static ansi version, from the top folder:
        mkdir wxgtk-ansi
        cd wxgtk-ansi
        ../configure --disable-shared
        make
        sudo make install
        

    3. Build lplex in the usual way:
      ./configure
      make
      sudo make install
      

    Note: if you get a configure error for wx-config, try symlinking as follows:
    sudo ln /usr/bin/wx-config /usr/local/bin/wx-config
    
    ACKNOWLEDGMENTS

    Lplex was initially modeled on Dave Chapman and Fabrice Nicol's excellent open source utility dvda-author, which creates dvd-audio discs, and wav2lpcm, which converts lpcm from wav to dvd order. Dvd-audio is admittedly superior to dvd-video in the sense that it handles a far wider range of lpcm audio (from 16-bit 44khz mono up to 24-bit 96khz 6ch and 24-bit 192khz 2ch), but has the one drawback of requiring a dvd-audio player for playback, which in the real world remains a relatively rare bird. Dvd-video players are everywhere, on the other hand, and offer identical digital quality for their narrower range of supported lpcm audio types, which is where lplex comes in. Dvd navigation and extraction was modeled primarily on dvdunauthor by Scott Smith and Ralf Engels, another great open source utility.

    Lplex is free software distributed under the GNU GPL License.
    Get Lplex at SourceForge.net. Fast, secure and Free Open Source software downloads