From TMB Wiki
Revision as of 22:50, 7 April 2006 by Bc (talk | contribs)
Jump to: navigation, search

ProjectX is a useful tool for de-multiplexing Transport Streams (.ts files). Typically it is used to process files captured with DVB cards. ProjectX has many useful features, but an intuitive user friendly interface isn't one of them.


Download the latest version from Doom9's website (do not download it from the ProjectX website!):

ProjectX is written in Java so you will need to have a Java VM installed on your computer too:

Configuring for first use

  1. Extract the all files from the zip file and run ProjectX.jar.
  2. Go to the View menu and change the look and feel to the one you feel most comfortable with.
  3. Go to the PreSettings menu and select PreSettings
  4. Go to the output tab and deselect Teletext, Subpicture, and Generic_VBI.
  5. Go to the audio tab and deselect delete CRC in MPEG-Audio Layer1,2.
  6. Close the PreSettings window.
  7. Click on the prepare >> button on the main window.
  8. Go to the Edit menu and select process all collections and close the ProcessWindow window.


ProjectX tut1.png

  1. Drag and drop files onto the window marked with A or click on the + button next to A to browse for files. If you want to de-multiplex more than one file at a time click on the + button next to B to create a new collection and you next file. Do not add more than one file to each collection unless you want the files in each collection to be joined together when de-multiplexing (you probably don't want to ever do this). If the files you are adding are audio only you might get a cannot find sequence header error in the preview window which can be safely ignored.
  2. Click on the + button by C and choose an output folder.
  3. Press the QucikStart button.

Checking ProjectX log files for errors

ProjectX will produce a log file for each collection which contains important information about any Transport Stream errors it might have encountered whilst de-multiplexing. This will alert you to any dropouts that have occurred, thus saving you the embarrassment of uploading a crap file.

Below is a portion of a log from a Transport Stream that contained errors (the red parts indicate the errors):

!> PID 0x2C2 (PMT) (376 #3) -> ignored
!> PID 0x12 (EIT) (752 #5) -> ignored
!> PID 0x0 (PAT) (8836 #48) -> ignored
ok> PID 0x1B0 has PES-ID 0xC0 (MPEG Audio) (9212 #50) 
!> PID 0x14 (TOT) (21056 #113) -> ignored
!> PID 0x11 (SDT) (73132 #390) -> ignored
!> PID 0x10 (NIT) (365848 #1947) -> ignored
!> PID 0x1B0 -> packet 435135 @ pos. 81805192 out of sequence (7/3) (shifting..) (~00:00:00.000)
!> incomplete ts packet at EOF detected @ 230378960
packs: 446246 100% 230379132

--> MPEG Audio (0xC0) on PID 0x1B0
-> check CRC of AC-3 / MPEG-Audio L1,2
-> add frames
Audio PTS: first packet 11:28:10.812, last packet 12:33:05.148
-> adjusting audio at its own timeline
-> src_audio: MPEG-1, Layer2, 48000Hz, jstereo, 160kbps, CRC @ 00:00:00.000
!> missing syncword @  27653281, @ 00:23:02.664
!> found syncword @ 27653636
!> missing syncword @  27655557, @ 00:23:02.760
!> found syncword @ 27655680
!> 9 frame(s) (216ms) inserted @ 00:23:02.760
!> 2 frame(s) (48ms) inserted @ 00:23:03.120
audio frames: wri/pre/skip/ins/add 162272/0/0/11/0 @ 01:04:54.528 done...
-> 538 stereo/jointstereo change(s) detected...
---> new File: 'D:\demux\(2006-03-25) Dub Bashment.mp2'

In this example ProjectX was unable to recover 216ms of audio 23 minutes and 2.76 seconds into the stream, and a further 48ms at 23:03.120. By default missing audio is replaced with silence to ensure the audio stream remains the same length it would have been had it contained no errors.

Sometimes you will see a warning about a packet being out of sequence in the first part of the log, but get no missing syncword errors/frames inserted in audio section. This is because not all packets contain audio data, and the error will be affecting a different stream instead (if your Transport Stream contains a video stream there will be section in the log file for video errors). Often Transport Streams will contain few small data streams that you are probably aren't interested in, and therefore errors in these probably don't matter.

Below is a portion of a log from an error free Transport Stream:

ok> PID 0x1842 has PES-ID 0xC0 (MPEG Audio) (376 #3) 
!> PID 0x12 (EIT) (752 #5) -> ignored
!> PID 0x0 (PAT) (9400 #51) -> ignored
!> PID 0x106 (PMT) (10152 #55) -> ignored
!> PID 0x14 (TOT) (21620 #116) -> ignored
!> PID 0x11 (SDT) (64108 #342) -> ignored
!> PID 0x10 (NIT) (93436 #498) -> ignored
!> incomplete ts packet at EOF detected @ 439238500
packs: 1040243 100% 439238656

--> MPEG Audio (0xC0) on PID 0x1842
-> check CRC of AC-3 / MPEG-Audio L1,2
-> add frames
Audio PTS: first packet 09:08:02.225, last packet 11:12:51.809
-> adjusting audio at its own timeline
-> src_audio: MPEG-1, Layer2, 48000Hz, stereo, 192kbps, CRC @ 00:00:00.000
audio frames: wri/pre/skip/ins/add 312072/0/0/0/0 @ 02:04:49.728 done...
---> new File: 'D:\demux\(2006-03-28) Breezeblock.mp2'

Dealing with audio errors

There is no way to recover missing audio that has occurred due to packet errors, however there are several different methods for dealing with the gaps.

Fill gaps with silence

This is the default method. It keeps the audio the same length as it would have been had there been no errors. This is useful if you are de-multiplexing a video stream with your audio as it will keep the two streams in sync. You will hear audible drop-outs where the errors would have been.

Fill gaps with previous frames

Instead of inserting silence ProjectX can insert duplicates of the last audio frame it encountered before the error. Occasionally this can sound better than inserting silence, but usually only if the gap being filled is very short (<=48ms). If the gap is longer you will normally hear a buzzing sound which is worse than silence.

You can enable this behaviour by going to the audio tab in the PreSettings and ticking fill gaps with prev. frame.

Delete gaps

The third method is to just delete the gaps. This will result in a jump/skip where the error would have been. You will loose sync with any video streams if you do this.

You can enable this behaviour by going to the special tab in the PreSettings and ticking Audio: use only first PTS for sync (intuitive huh?).

This is usually the best method for dealing with errors so it can be tempting to always leave this ticked, however this is not a good idea for several reasons:

  • You will not know how many dropouts there have been or how big they were (if there were lots it might not be worth keeping).
  • You will not know the time where the drop-outs occurred (maybe it didn't occur anywhere important).
  • You will forget to untick it when you are de-multiplexing video which will cause sync problems.

Generally it is best to only use this method when you already have already de-multiplexed using one of the other methods so that you know how big the gaps were, and untick it when you've finished.