Log in

View Full Version : Synch Problem with HDTV OTA Capture


nicksteel
26th April 2006, 16:31
Having sound synch difficulties with conversion of ATI HDTV Wonder OTA captures of "24" to DVD. (Don't know if problem is related to DGIndex)

I edit commercials with VideoReDo (saved MPG is in synch)
Create D2V with DGIndex 1.4.6
Create Wav with DGIndex 1.4.6

Process with TMPGEnc as 29.97 704x480 non-interlaced

Process Audio with Headac3he to 192 mp2

Use DVDLab to process m2v and mp2.

The sound starts out in synch, but progressively becomes earlier than video, ending up about 1/2 second out after 40 minutes.

AVS Script used by TMPGEnc

LoadPlugin("C:\video\DGDecode.dll")
LoadPlugin("C:\video\RemoveGrainsse3.dll")
LoadPlugin("C:\video\Repairsse3.dll")
LoadPlugin("C:\video\SSe3Tools.dll")

Mpeg2Source("C:\MyTv\24\24.d2v",idct=7)
selecteven()

LanczosResize(720,368,0,1,1280,718)
LRemoveDust_YV12(17,1)
ConverttoRGB24()
AddBorders(0,56,0,56)

function LRemoveDust_YV12(clip input, int clmode, int "limit")
{
limit=default(limit,2)
clmode=default(clmode,17)
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=clmode)
return LimitChange(rg, input, limit, limitU=255)}

Guest
2nd May 2006, 01:40
All these other tools, and your script is truncated! Can you please isolate your problem a little better, because I don't have all that stuff?

nicksteel
2nd May 2006, 14:36
>This is my complete script.

It's missing the closing brace. :)

EDIT: Oops, I edited this instead of quoting. Sorry.

woah!
3rd May 2006, 09:11
http://forum.doom9.org/showthread.php?t=109988 post #20

nicksteel
23rd July 2006, 15:49
Still having problems, so will try to detail problem better.

Having sound synch difficulties with conversion of ATI HDTV Wonder OTA captures to dvr-ms with Microsoft MCE2005. Not all captures have problem and only with 1280x720, not 1920x1080.

I edit commercials with VideoReDo.

I have tested with VideoReDo output into dgindex:
MPG
VOB
TS
The raw files going into dgindex play in perfect synch with Nero Showtime and WinDVD. I am using the TS into dgindex test data here.

Create D2V with DGIndex 1.4.8 Beta 7 (same with 1.4.7)
Demux AC3 with DGIndex 1.4.6 Beta 7 (same with 1.4.7)
("I get Field Order corrected." message.

D2V:
DGIndexProjectFile13
1
E:\projx\SG1rawvrdqf.ts

Stream_Type=2
MPEG2_Transport_PID=1000,1001
MPEG_Type=2
iDCT_Algorithm=6
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=16:9
Picture_Size=1280x720
Field_Operation=0
Frame_Rate=59940 (60000/1001)
Location=0,0,0,24AE8E

(Can send complete D2V, but it is 558KB. DVR-MS is 8 GIG)

Use FitCD to produce resize line.

Process with TMPGEnc as 29.97 704x480 non-interlaced with KDVD 704x480 template.

Process Audio with Headac3he to 192 mp2

(The AC3 file is approx 1 1/2 sec longer than the m2v file from TMPGEnc.)

Use Mplex to mux m2v and mp2.

The sound starts out in synch, but progressively becomes later than video, ending up about 1 1/2 second out after 40 minutes. I presently use GoldWave to shrink audio to fit, but do not get perfect synch, as it appears frames are being dropped during encoding.

Complete AVS Script used by TMPGEnc 2.524.63.181

LoadPlugin("C:\video\Filters\DGDecode.dll")
LoadPlugin("C:\video\Filters\RemoveGrainsse3.dll")
LoadPlugin("C:\video\Filters\Repairsse3.dll")
LoadPlugin("C:\video\Filters\SSe3Tools.dll")

Mpeg2Source("E:\projx\projxnew.d2v",idct=7)
LanczosResize(704,368,171,91,940,540)
SelectEven()
LRemoveDust_YV12(17,1)

AddBorders(0,56,0,56)
ConverttoRGB24()


function LRemoveDust_YV12(clip input, int clmode, int "limit")
{
limit=default(limit,2)
clmode=default(clmode,17)
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=clmode)
return LimitChange(rg, input, limit, limitU=255)
}

Guest
23rd July 2006, 18:14
Get NicAudio.dll and then make a simple script like this:

vid=mpeg2source(...)
aud=NicAC3Source(...)
audiodub(vid,aud)

Serve the AVS script into VirtualDub and use the file information menu to get the audio and video durations.
What are they?

nicksteel
23rd July 2006, 20:22
VideoReDo input dvr-ms, output mpeg2

http://img46.imageshack.us/img46/9001/vdubscreenhg9.th.jpg (http://img46.imageshack.us/my.php?image=vdubscreenhg9.jpg)

LoadPlugin("C:\video\moviestacker\Filters\DGDecode.dll")
LoadPlugin("C:\video\moviestacker\Filters\NicAudio.dll")

vid=mpeg2source("E:\projectx\nicaudio.d2v")
aud=NicAC3Source("E:\projectx\nicaudio T01 2_0ch 320Kbps DELAY 0ms.ac3")
audiodub(vid,aud)

the source mpg into dgindex is in synch

VideoReDo input dvr-ms, output ts

http://img291.imageshack.us/img291/4701/nicaudiotsqs5.th.jpg (http://img291.imageshack.us/my.php?image=nicaudiotsqs5.jpg)

LoadPlugin("C:\video\moviestacker\Filters\DGDecode.dll")
LoadPlugin("C:\video\moviestacker\Filters\NicAudio.dll")

vid=mpeg2source("E:\projectx\nicaudiots.d2v")
aud=NicAC3Source("E:\projectx\nicaudiots PID 1001 T01 2_0ch 320Kbps DELAY 32ms.ac3")

audiodub(vid,aud)

the source ts into dgindex is in synch

Edited: Added durations for both mpeg2 and ts output from VideoReDo into DGIndex.

Guest
25th July 2006, 00:18
It appears to me that something in your post processing is at fault, then. I can't help you with that here.

Do an encode straight out VirtualDub to (say) Xvid. Is that in sync?

Ac3Dc3
27th July 2006, 11:24
have you tried letting VRD+ demux the audio? (save to elementary streams)

make sure you're using the latest version and tools -> options -> Detect / Resync is set to remove audio frames

nicksteel
27th July 2006, 14:32
have you tried letting VRD+ demux the audio? (save to elementary streams)

make sure you're using the latest version and tools -> options -> Detect / Resync is set to remove audio frames

Tried all these settings. Tried DVRMSTools to convert from dvr-ms to mpg and ts. Tried VideoReDo to convert from dvr-ms to mpg, ts, and elementary streams. (All the mpg and ts files play in sync.)

Problem is in the length of the video and audio files if you demux for use with avisynth and tmpgenc.

For example:

If I output from VideoReDo as elementary streams and check the size of mpv with VirtualDub-MPEG and the size of ac3 with GoldWave, the audio length is longer than the video by approx 1 1/2sec for 42 minute capture.

If I input the mpg or ts into DGIndex and create d2v and ac3 and feed the d2v and ac3 into VirtualDub-MPEG, I get the same unequal video/audio lengths. The m2v length is not uniformly compressed in relation to the ac3, because if I compress the ac3 length with GoldWave and remux after processing m2v with avisynth/tmpgenc, the beginning and end will be in synch, but the middle is not.

In other words, the video seems to lose frames when you attempt to demux the mpg or ts created from the dvr-ms.

My confusion is related to how the mpg and ts files can play in synch, yet the demuxed files or elementary streams have unequal durations and cannot be remuxed later. The problem seems to occur with tv series captures with 720. Captures of 1080 or 720 movies seem to work ok.

Totally confused.

Guest
27th July 2006, 14:44
MPEG and TS files can play in sync because they retain the PTS timestamps. They are lost when serving via Avisynth.

Did you possibly have some commercials that you cut out? If they had a different audio sampling rate and some of it was not fully cut out, this could be an explanation.

nicksteel
27th July 2006, 14:51
MPEG and TS files can play in sync because they retain the PTS timestamps. They are lost when serving via Avisynth.

Did you possibly have some commercials that you cut out? If they had a different audio sampling rate and some of it was not fully cut out, this could be an explanation.

Tried with cut out commercials with VideoReDo and with raw dvr-ms files with no editing. (loaded into VideoReDo and saved directly into mpg, ts and streams without any editing. I have suspected that the problem relates to switching between program and commercials, but don't know enough to attack the problem.

nicksteel
27th July 2006, 15:17
MPEG and TS files can play in sync because they retain the PTS timestamps. They are lost when serving via Avisynth.

Did you possibly have some commercials that you cut out? If they had a different audio sampling rate and some of it was not fully cut out, this could be an explanation.

Actually, I made one test with very careful commercial cuts. (In fact, being dimly aware of this problem, I am always as careful as possible.) Same result.

Dumb question: Is there anyway to scan a file to see if there are different sampling rates?

Guest
27th July 2006, 15:28
Dumb question: Is there anyway to scan a file to see if there are different sampling rates? I don't know of an application to do it, but I can do it in the debugger with DGIndex. That's what I plan to do with the stream that you are going to mail me (per our PM discussion).

nicksteel
28th July 2006, 15:04
Got email from VideoReDo last evening and downloaded latest beta. Problem went away for one capture (full screen wide screen) 1280x720. Still having problems with another one and have forwarded info to them.

Problem remains with capture of SG1 1280x720 (16x9) which has top and bottom black borders and station side borders.

They are good people. Actually respond and look at problems quickly.

smokeslikeapoet
14th August 2006, 16:17
I had the same problem with Audio/Video sync. I tried VideoRedo, Mpeg2schnitt, and finally Cuttermaran. Cuttermaran was the only application that gave me Video and audio tracks exactly the same length after I processed them.

My diagnosis is that during the capture Video frames were dropped. When they are demuxed the resulting elementary streams have no way of storing information about dropped frames, as Neuron2 stated.

Is there an application that will analyze a TS or PV file and replace the dropped video frames with dummy frames or the previous frame? Is there a setting in ProjectX that will do this?

nicksteel
14th August 2006, 17:02
I had the same problem with Audio/Video sync. I tried VideoRedo, Mpeg2schnitt, and finally Cuttermaran. Cuttermaran was the only application that gave me Video and audio tracks exactly the same length after I processed them.

Latest beta of VideoReDoPlus seems to be working for me.

smokeslikeapoet
14th August 2006, 18:37
Do you know if you have to purchase the full-version of VideoRedo Plus in order to use their betas?

I would rather use a free GPL solution if it works for me.

nicksteel
14th August 2006, 18:50
Do you know if you have to purchase the full-version of VideoRedo Plus in order to use their betas?

I would rather use a free GPL solution if it works for me.

I'm not sure, but I would think so. I have the full version and download betas through the forum. I posted my problem there and was told that the 720 issues with video length had been fixed. It seems to be. It is a good package and they respond very quickly to any problems or questions.

laserfan
15th August 2006, 16:11
Do you know if you have to purchase the full-version of VideoRedo Plus in order to use their betas?

I would rather use a free GPL solution if it works for me.There is no distinction to be made between "full-version" and "betas" -- they are the same. When you download and register it, you get 14 days of full usage of the product for free. If you don't register, it only outputs 30min of video.

If you record HD OTA though, VRD+ is a tool you will want--best $50 I spent last year on software.

p.s. I looked at your weblog and your process & software reqmts made me dizzy. Methinks you need VRD+ (note I am only a satisfied customer!).

nicksteel
15th August 2006, 16:32
If you record HD OTA though, VRD+ is a tool you will want--best $50 I spent last year on software.

I agree, especially given their forum and dedication to support. I recommend them highly.;)

smokeslikeapoet
15th August 2006, 16:49
That software list is a comprehensive list of all of the software I've used so far in my testing. I'll reduce it to only the requirements once my guide is complete. The guide is going to be specific to capturing and encoding ATSC OTA broadcasts like sporting events that aren't film source. Most of the guides I've seen so far try to be all-encompassing or are specific to film broadcast like Dramas and Movies.

laserfan
15th August 2006, 19:21
Sorry, I didn't mean to imply anything by my post i.e. to impune your efforts. I just reacted with the thought that you were "new to ATSC" and there are easy ways to do some stuff (example: VRD+ for repair, editing, and sync-correction of transport streams).

Glad you are here--I can see I am going to learn some stuff from your "high-motion 1080i" thread already! :)

nicksteel
15th August 2006, 19:26
I have been getting good results with my ATI HDTV Wonder captures. I edit in VRD+ and save as mpg. Use DGIndex to create D2V and AC3. Use FITCD to get resize values. Use avs script (have one I could send you) into TMPGEnc (KDVD template). Mux with DVDLab into DVD. Very good results.

smokeslikeapoet
15th August 2006, 19:51
FitCD Gives these results
SeparateFields()
LanczosResize(704,240,0,0,1920,540).Weave()
AddBorders(8,0,8,0)
Which was not recommended to me http://forum.doom9.org/showthread.php?p=863711according to this thread. However it does correct my resizing error. Do you have any input?

nicksteel
15th August 2006, 20:05
FitCD Gives these results
SeparateFields()
LanczosResize(704,240,0,0,1920,540).Weave()
AddBorders(8,0,8,0)
Which was not recommended to me http://forum.doom9.org/showthread.php?p=863711according to this thread. However it does correct my resizing error. Do you have any input?

Just use the LanczosResize and AddBorders lines from FITCD. Plug them into the script at the top of this tread. You will have to download the necessary dll's. Try it.

Also, if I want to trim the video, I use TMPGEnc clip to find the values to plug into FITCD. With my script above, set TMPGEnc output to 29.97fps.