Log in

View Full Version : TS is missing pieces or audio/video different length


Bucky Wheat
27th September 2006, 00:17
Well, I have started scattering my questions all over the topics, maybe I better start a new topic. This is a little lengthy, since I have tried so many things already.

Since maybe a couple of weeks, some of my TS captures are flawed. Usually this shows through a mismatch of audio and video duration. Usually, the audio is longer that the video. It seems like the video is "too short".
I capture the video through firewire from my Comcast Motorola DCT6412III with D-VHS 0.3.0.6 using "the usual" settings recommended everywhere.

In my usual process, I open the TS in DGIndex, set the markers to beginning and end (I usually record around 3 minutes extra front and back) and I create a project. It does not matter, how I process the audio (wav vs. demux), both audio stream have the same (correct) length. I have a simple AVS script like this (example for wav audio): LoadPlugin("c:\dvd\filter\DGDecode.dll")
LoadPlugin("c:\dvd\filter\Decomb521VFR1.3_P4-Athlon.dll")
v=mpeg2source("file.d2v").Telecide(order=1).Decimate(mode=1, threshold=1.0).LanczosResize(720,544,256,18,1418,1072)
a=wavsource("file PID 801 T01 3_2ch 384Kbps 48KHz.wav")
return audiodub(v,a)
I have used this script for many caps (also with a different decomb.dll), and am still using it often without a problem.

But usually, this is where the problem starts.
When I open the script in VDub, the video is usually too short. In the stream list, I see that the audio has the proper length.

Here is what I have tried so far:
- Convert the TS with HDTV2MPEG = no change
- Run the file through MPEG-Corrector = no change
- Do a QuickStream Fix in VideoReDo = no change (summary shows less video frames than audio frames and says that there were 4 Audo frame errors)
- Do a simple "Save as" in VideoReDo = no change
- Run the file through MPEG2Repair = sometimes no change, right now I get an error "can't find sync byte in rest of input file. Remaining data discarded" (happened after 99 % complete)
Here is the MPEG2Repair log:
Sequence Frame 102697(6-B) / Time 1:04:38 :
Error: Packet 35769603 has no TS Sync Byte.
Error: Packet 35769606 has no TS Sync Byte.
Error: Packet 35769609 has no TS Sync Byte.
Error: Packet 35769612 has no TS Sync Byte.
Error: Can't find next TS Sync Byte. Terminating operation.
Additional error(s) detected. Increase VerboseLogLevel in INI file for details.
FileInfo: Last video errors span 17 bytes at file offset 6725324735

Sequence Frame 102698(6-B) / Time 1:04:38 :
Info: End of MPEG2 sequence

Sequence Summary:

File Size Processed: 6.32 GB, Play Time: 01h:04m:38s
1920 x 1080, 29.97 fps (26.48 fps Telecine), 45.00 Mbps (13.10 Mbps Average).
Average Video Quality: 60.40 KB/Frame, 0.24 Bits/Pixel.
AC3 Audio: 3/2 Channels (L, C, R, SL, SR) + LFE, 48.0 kHz, 384 kbps.
Dialog Normalization: -20.0 dB, Center Mix Level: -3.0 dB, Surround Mix Level: -3.0 dB
1 of 102698 video frames found with errors.
0 of 121214 audio frames found with errors.
17 corrupted video bytes in file.
0.000000 seconds of video timestamp gaps.
0.000000 seconds of audio timestamp gaps.

End of Log
I have tried to do something in ProjectX but the program overwhelms me a bit. I loaded a file and clicked QuickStart, but that gave me a pretty small demuxed file (20 MB vs. 6 GB) after a lot of "doing things". I also get the message "error while decoding frame, not enough data in buffer".

I think this should be fixable because in VideoReDo and in ProjectX, the length is showing correctly.

This only happens on some channels, for example on HBO, CBS and NBC. I have captured from all channels successfully before, and still do every now and then. It doesn't seem to happen on non-HDTV channels.

Can anyone help me? ProjectX seems like the most promising candidate, but I have to admit that most of the possible settings mean nothing to me.

Any help would be greatly appreciated.
Bucky

Bucky Wheat
27th September 2006, 00:46
PS: I just managed to run it through ProjectX, and generated a new TS - but alas, still short (7 minutes here)
<<< quick info >>>
-> Input File 0: 'I:\file.mpg' (6,056,298,500 bytes)
-> Filetype is MPEG-2 PS/SS (PES Container)
-> make a TS
-> found PES-ID 0xE0 (MPEG Video) mapped to 0xE0 @ 14
-> found PES-ID 0xBD (private stream 1) (SubID 0x80) mapped to 0x80 @ 122894
---> new File: I:\\file.ts

summary of created media files:
Stream: 'I:\\file.ts'
=> 5,769,908 bytes written...
-> we have 0 warnings/errors.
<<< end of quick info >>>

Pookie
27th September 2006, 01:06
Don't process the audio in AviSynth. Demux the audio from the video in ProjectX, and then mux it with your newly created Avi/MKV/MOV (whatever)when you are done transcoding your video.

Bucky Wheat
27th September 2006, 03:08
But from what I see, the audio is ok. The video is 7 minutes shorter than it is supposed to be. It could be AviSynth, but it also shows shorter when I drop the MPG right into VDub without going through a script. So the processed video will be shorter than the audio and the final file is out of sync.

I am trying to do an XviD btw

Edit:
It happened again, I tried to record Law and Order Criminal Intent, after selecting from the beginning to the end in DGIndex, it comes out as 49:09 min in VDub. When I load the file in VideoReDo with the same Cut points, the timeline there shows 59:23. I am losing 10 minutes :-(

Pookie
27th September 2006, 09:10
Yeah, but that could be decoder/application issues giving your bad information.

Download TSsplitter from http://www.videohelp.com/tools?tool=TSSplitter

Split your .TS (or TP or whatever your Transport Stream file is called) into a bunch of small pieces. Cut it into at least 8 pieces - you want short segments to test individually. Try encoding and muxing a couple of small pieces - I'm guessing the small segments will give you more accurate times.

You've seen this : http://www.avsforum.com/avs-vb/showthread.php?s=&threadid=403695
and this ? : http://www.avsforum.com/avs-vb/showthread.php?s=&postid=5315313#post5315313

Finally, have you tried transcoding the mpeg file and muxing the target with your sound file ? Is it really off by 7 minutes ?

Schmendrick
27th September 2006, 17:00
You might also try DVBstreamexplorer using the Ts-file-driver to analyse the content of your ts-file and also to demux it.
( http://www.dvbstreamexplorer.dk/ )
MPEG2Repair might be able to repair errors within the ts-file.

Nomolu
27th October 2006, 04:31
I use CapDVHS with a Samsung SIR-T165 for capturing and ProjectX for conversion/synching. ProjectX gave me the most grief and couldn't produce video and audio files that were in sync for a capture when I tried the recommended options for CapDVHS. Namely, turning on "Convert 188 bytes", "Check PTS", and "Delete to SyncByte" didn't do me any good. Life is better for me with them off.

Now for ProjectX, you seem to have used it wrong because you wrote that you used it to produce a TS file. If you want it to produce audio and video streams that are in sync, I believe you must use it to convert/demux TS files to the elementary M2V/M2P and AC3/DTS streams.

You're correct that ProjectX definitely a lot of confusing options. Here what I think are the pertinent ones which should be enabled in version 90.4:
OUTPUT tab: Process all video and audio streams and write all video and other data.
SPECIAL tab: "TS: ignore scrambled packets", "TS: generate PMT stream dependent", "ensure 1st PES-packet start with video", and "generate PCR/SCR from PTS". The rest of my "TS:" and "Audio:" and "Video:" options are unchecked.
VIDEO tab: "add sequence" end code", "ensure each GOP has a sequenceheader"
AUIDO tab: "check CRC of AC-3 ..." and "add frames"


Then use ProjectX to demux the TS file. Hopefully this helps!

- Nomolu

drtj
18th November 2006, 02:08
@ bucky wheat

I am pretty much using the same setup that you are (cable box through firewire)

I have had the same exact problems. From reading various posts and experimenting on my own, I have found the reason to be 1 of 2 things:

1) Are you cutting out commercials? If you use something like HDTV2MPEG, and you are cutting between GOPs (group of pictures), this causes a sync problem and the audio and video not to match up.

2) There are times in the original .ts file that you have corrupt video. Since your sync issue is that big, this is what I am assuming it is. Basically, the video blacks out and goes haywire while the audio keeps going. If this is the case, then my advice is if you still have the original show on your cable box, play it and see where there might be a problem with the video. Or you can make an .avi file and search for the point in the video that goes bad, which coincides with a major break in audio and video sync (not just a second off) then go to the original .ts file, and demux after that point by setting the appropriate project range in DGIndex, and then join the 2 .avi files together.