or Connect
AVS › AVS Forum › Video Components › Home Theater Computers › HDTVtoMPEG2 latest version
New Posts  All Forums:Forum Nav:

HDTVtoMPEG2 latest version - Page 11

post #301 of 2239
I think I've solved my problem. Instead of using dvd2avi2 on the output of HDTVtoMPEG2, I'm using ProjectX, which seems to have a more intelligent demux routine. Kind of like I described above, it goes through and massages the AC3 data, modifying it when necessary (usually, inserting delays or discarding bad frames) to keep it in sync with the video per the .TS information. It results in two files of identical lengths. Seems like ProjectX is a great substitute for DVD2AVI. It will create .d2v files also, although I had to use a DirectShowSource directly on the produced .mpv file to see the identical video length that matches the ac3 stream reported by ProjectX. The .d2v file reports video that's 2 seconds longer, and I didn't want to waste a day attempting to encode video that wasn't as likely to work. I'm not really sure why .d2v files are useful in this situation anyway.

Ultimately it would be great to see an intelligent demux built into HDTVtoMPEG2 (give it a ts, edit out the commercials, get your sync'd elements in the format of your choice).
post #302 of 2239
Quote:


Originally posted by Cris Moore
"but the File Size Limit, will just cut the TS on 188 byte boundary, right?"

As it currently does now.

"I think these two cases need to be handled differently."

Please elaborate why.

Cris

I think my wording was unforunate and misleading. What I meant was that the two cases should be handled differently from each other, which is exactly what you're doing. So, no change is necessary.

I was hoping the 1.11 beta version would alleviate the MyHD "Long Pause" bug, but it hasn't. Most of the programs I record can be sub-channel and null stripped and play with no problems on MyHD and some that can't. The ones that can't (most notably Alias from KGO SF) are not helped by using 1.11 beta vs. NPS. 1.11 beta does have the benefit of fixing up the PAT/PMT, so stripped streams and audio don't show up in the player. This should particularly benefit VLC users. One pass editing and stripping is also nice.

My normal practice of editing is also unchanged from 1.10.5. I set the commercial edit cut points to the first and last I-frames of the commercial breaks to get smooth playback on MyHD. When Cris implements the new audio cut, MyHD will probably transition better and may show part of the commercial the way I'm editing now. That remains to be seen.

- Mike
post #303 of 2239
DJRobX I've been using HDTVtoMPEG2 and ProjectX a couple months. It's a winning combo to minimize the audio sync problems. I normally use ProjectX first and then HDTVtoMPEG2 to remove commercials/output a program stream for transcoding to DivX AVI. Is it better to first use HDTVtoMPEG2 and then ProjectX? With the order I use, I consistantly have 200 to 250ms of audio sync wherever commercials were cut.

To fix the offsets I use Media Player Classic on my out-of-sync audio AVI to identify the commercial breaks and try +200ms offset at these places (or 250ms depending on how the lip sync is matching up to what I see in the player).
I work with the audio as WAV and then insert the appropriate silence I identified on the timeline using Soundforge (or SoundEdit if you need a free application to do it).

I had begun setting up a tutorial on my method if anyone wants to see my process:

http://www.strangeseeds.com/howto/vi...vx/default.htm

Just wondering if I should maybe use HDTVtoMPEG2 first followed by ProjectX.
post #304 of 2239
You don't ever want to output anything other than a .TS file from HDTV2MPEG2 after editing commercials until Cris fixes the audio-offset problem. Even then I'm not sure that will be a total solution, because if there's any problems with the audio stream, you'll have a tough time correcting them.

If you output the edited video in TS format, and then use ProjectX to demux it, ProjectX will use the timestamp information present in the TS to insert/remove bits from the the AC3 stream to re-align them. In other words, it will do exactly what you're doing manually for you.

There is a bug though! Someone has bad math!

ProjectX says:

59.94 fps, 292630 Frames (01:21:20.410)

VirtualDub says:

59.94 fps, 292630 Frames (01:21:22.04)

My calculator says:

292630 / 59.94 = 4882.0487 seconds, or 81, minutes 22.04 seconds

Yep, ProjectX has bad math.

Naturally, the AC3 is synced using ProjectX's math, and you guessed it, the sync will slowly creep away as you get further into the video. However, it IS linearly aligned, so if you recalculate the framerate to fit the audio (59.96fps, or 23.984 if you've converted to film) they will line up perfectly and you will get perfect sync!

I'm going to report the situation to the ProjectX author, although his homepage is less up to date than the existing release, and the release we have is months old. The source code for projectx is there also so maybe I can fix it, although I'm not too familiar with Java, I'm a C++ guy.

-- Rob
post #305 of 2239
Actually I was being a hypocrit and telling you I did it in one order, but my tutorial is actually the way I am doing it (oops). Still... I am outputting the editted MPG from HDTVtoMPEG2 and using that in ProjectX and now I remember why. I could not select the subchannel I wanted in ProjectX, so the resultant mpv and AC3 files were usually the wrong subchannel. I suppose I could use NullPacketStripper first before anything else to strip out the other subchannels, but that'd add another 5-10 minutes of waiting for yet more pre-processing.

There's a fool-proof way for 29.97fps source to be editted and retain sync all across the board. Use ProjectX to first clean up and demux. Take the mpv and ac3 files and use in Mpeg2schnitt to clip commercials and create the final mpv and ac3 files. Create a divx AVI with these with no post-processing to align audio sync. When my CBS station was using 1920X1080i @29.97fps this method worked absolutely perfect. Then the bastids switched to 1280X720P @ 59.94fps and that method no longer worked. I had sync issues every time, so I wound-up doing it the way in my guide since I had sync problems anyway (and like I said, it is always 200-250ms audio sync where each commercial was cut, so I have been able to correct it by modifying the original editted audio track and then re-integrating/compressing it with the encoded video). It's not an elegant solution and it takes a little practice, so I can correct the sync in post-processing, but I still don't really enjoy doing it.
post #306 of 2239
Yes, the video I'm working with is 720p. I'm guessing the constant for 59.94fps is wrong (59.96) which would explain why it works correctly with 29.97fps but not 59.94.

I'm looking at the source and they use some bizzare integer constant that looks to be 90000 / (x) = FPS. The constant they have for 29.97fps is 3003. It's uneven, which means the constant for 59.94fps (they have 1501) does not result in something that's properly double the rate of 29.97. I'm not completlely sure why they chose that constant scheme.

This "1/90th" of a second constant is hardcoded *everywhere* in the code, though.... so instead I added another digit to the end (15015) and divided it by 10 in most places except some of the more complex formulas. I did it somewhat haphazardly, but it seems to have done the job! It now produced an .ac3 of the proper length to sync with my original video at the RIGHT framerate! Hoorah!

If you want to give my patched version a try I've uploaded it here. Run the projectx2.jar file.

http://www.tvrules.net/misc/ProjectX-5994patch.zip


-- Rob
post #307 of 2239
Quote:


I'm looking at the source and they use some bizzare integer constant
that looks to be 90000 / (x) = FPS.

Not bizarre at all. In MPEG-2 Transport and Program Streams, the timestamps
are based on a 90 kHz clock (or more precisely, on a 27 MHz clock divided by
300).

If you look at the video timestamps of a 720p@59.94 stream, they will increment
by 1501 followed by 1502 in a repeating pattern. If ProjectX is really using
1501 for calculations (and from your 292630 frame example, it looks like it
does), it's a bug (or more likely a feature yet to be "fully developed").

BTW, the correct way to calculate 29.97 and 59.94 frame rates is 1000/1001 * 30
and 1000/1001 * 60.

Ron
post #308 of 2239
Thanks for the info, dr1394! That also explains why some of the Windows mpeg decoders like the MainConcept MPEG splitter seem to have the same bug in them. Hopefully the ProjectX authors can implement it properly, I've posted on the author's site about it. Since the author is German I doubt he runs into 720p/59.94 fps too frequently.

BenC - I had a look over your writeup. The only problem is in HDTV2MPEG2, you're outputting in MPEG-2 format instead of TS format. That causes you to drop the critical sync information. None of my streams ever have multiple channels (I'm using digital cable), so I don't know if HDTV2MPEG2 can still be used to strip the other channels away when outptuting in TS format. Either that or perhaps it's possible to select the PIDs inside ProjectX?

I see I'm not the only fool who went through lots of hoops to save Big Brother 5 digitally.

-- Rob
post #309 of 2239
Quote:


Originally posted by DJRobX
If you want to give my patched version a try I've uploaded it here. Run the projectx2.jar file.

http://www.tvrules.net/misc/ProjectX-5994patch.zip


-- Rob

Thank you so much Rob! I'll give it a shot.
post #310 of 2239
Hello,

I am a novice at this stuff trying to develop a decent conversion of football games from 16:9 HDTV to DVD for playback in regular stand-alone DVD players. Yes I know there is quality degradation, but 480p WS is a good bit better than 480i 4:3 and I can impress my non-HDTV gameday buddies. Here is my latest script:

1. Capture ts/tp with MyHD or the R5000 (so far only 720p sources)
2. Strip using NullPacketStripper
3. Edit commercials using HDTV2MPEG2
4. Run the ts/tp through DVD2AVI to strip out the wav (simple stereo is fine although I may play around w/ the AC3 later)
5. Convert the ts/tp to mpeg2 w/ HDTV2MPEG2
6. Run the mpeg2 through TMPG Source Creator using the DVD template
7. Use TMPG DVD Author to make the DVD folders, using the video file generated in (6) and the wav file from (4). Took me a while (mostly finding & reading this forum) to figure out TMPG doesn't do audio for some reason.
8. Burn to DVD

Even at a 4800 bitrate the video is very clear (2 quarters or about 1.5 hrs per disc), except it is jerky....suspect this is due to the conversion from 720p 60 fps to 30 but not sure.

Anyone have a suggestion to deal with the jerkiness?

Any other comments critical or otherwise on this technique fire away.

riga
post #311 of 2239
DJRobX Thanks so much for the patched ProjectX. Worked PERFECT last night to clean the source which allowed me to transcode 59.94fps Survivor to an IN-SYNC divx AVI!!!

And Cris, thanks for letting me test your latest HDTVtoMPEG2 app. I saved oodles of time not having to use nullpacketstripper since you built it right into your editor.

These two fixes on these apps saved me at least an hour sine I don't need to manually locate and correct audio sync. BRAVO!
post #312 of 2239
For your steps 4 and 5, I recommend running your TS file through ProjectX. It will automatically make you an MPV (mpg) and AC3 audio file (I use PX3Conv to quickly convert the AC3 to WAV). ProjectX also compensates for problems in the recording by adding and shifting frames around so the audio will match the video perfectly. Use Rob's modified version of ProjectX since you're also working with 59.94fps source.

I use the decimate by 2 option under Framerate in Virtualdub to halve the framerate. If I were encoding to DVD, I would also go through Virtualdub and set it to frameserv to TMPGEnc for the actual MPG encoding. This way I can control what I want done to the video (halved framerate) and know that TMPGEnc is getting exactly the specs (resolution and framerate) I need. I usually just do divx AVI, but I am pretty sure this will work for you. If you want to get really fancy, you could install AVISYnth and use that as a wrapper to apply other video effects and feed that into Vdub and feed that into TMPGEnc.




Quote:
Originally posted by riga
Hello,

I am a novice at this stuff trying to develop a decent conversion from 16:9 HDTV to DVD for playback in regular stand-alone DVD players. Yes I know there is quality degradation, but 480p WS is a good bit better than 480i 4:3 and I can impress my non-HDTV gameday buddies. Here is my latest script:

1. Capture ts/tp with MyHD or the R5000 (so far only 720p sources)
2. Strip using NullPacketStripper
3. Edit commercials using HDTV2MPEG2
4. Run the ts/tp through DVD2AVI to strip out the wav (simple stereo is fine although I may play around w/ the AC3 later)
5. Convert the ts/tp to mpeg2 w/ HDTV2MPEG2
6. Run the mpeg2 through TMPG Source Creator using the DVD template
7. Use TMPG DVD Author to make the DVD folders, using the video file generated in (6) and the wav file from (4). Took me a while (mostly finding & reading this forum) to figure out TMPG doesn't do audio for some reason.
8. Burn to DVD

Even at a 4800 bitrate the video quality is great (2 quarters or about 1.5 hrs per disc). But the problem I'm having is the jerky video....suspect this is due to the conversion from 720p 60 fps to 30 but not sure.

Anyone have a suggestion to deal with the jerkiness?

Any other comments critical or otherwise on this technique fire away.

riga
post #313 of 2239
Quote:
Originally posted by riga
...but 480p WS is a good bit better than 480i 4:3

Always convert live sporting events to interlaced. DVDs don't have a 60 fps progressive format, so you'll end up going to 30 fps progressive. 60 fps interlaced will look much better.
Quote:
1. Capture ts/tp with MyHD or the R5000 (so far only 720p sources)
2. Strip using NullPacketStripper

There's no need to do this step. You're completely decoding the video from the original stream, so there's no need to massage the original stream.
Quote:
3. Edit commercials using HDTV2MPEG2

HDTVtoMPEG2 will only allow you to edit on the I-frames. These occur about every 1/2 second. If you were leaving the video in TS format, this would be a reasonable limitation. But since you are re-encoding the video anyway, I'd recommend a different editor (see below).
Quote:
4. Run the ts/tp through DVD2AVI to strip out the wav (simple stereo is fine although I may play around w/ the AC3 later)

ATSC uses AC3 audio, exactly the same as DVD players. There is no need to convert the audio, only to edit it with the video.
Quote:
5. Convert the ts/tp to mpeg2 w/ HDTV2MPEG2

There is no need for this step. You can extract the frames from the TS just as well.
Quote:
6. Run the mpeg2 through TMPG Source Creator using the DVD template
7. Use TMPG DVD Author to make the DVD folders, using the video file generated in (6) and the wav file from (4). Took me a while (mostly finding & reading this forum) to figure out TMPG doesn't do audio for some reason.
8. Burn to DVD

Even at a 4800 bitrate the video is very clear (2 quarters or about 1.5 hrs per disc), except it is jerky....suspect this is due to the conversion from 720p 60 fps to 30 but not sure.

Probably.

Here's what I recommend (and have done):

1. Capture with MyHD or FusionHDTV (in TS format).
2. Run the video through DGIndex (new version of DVD2AVI) to create the D2V file and extract the AC3 audio stream.
3. Use AVISynth to process the video (be sure to use DGMPEG.dll instead of MPEG2DEC.dll):
Code:
MPEG2Source("HDTV.d2v")
AssumeTFF()
KernelBob(order=1).AssumeTFF() # Only for 1080i sources
LanczosResize(720, 480)
SeparateFields()
SelectEvery(4, 0, 3)
Weave()
4. Run VirtualDubMod and load the above AVISynth script.
5. Add the AC3 as a stream.
6. Edit out commercials (on any frame boundary). Locate the beginning of each commercial break and set the start marker. Locate the end and mark it. Then hit 'delete'. [Note that on some machines this can be slow, because there is a lot of processing on each frame (decode, deinterlacing, scaling). Don't drag the slider too much, just grab it and place it where you want it to go and release. Wait for the counter/timer at the bottom to be updated in order to be sure you are looking at the frame you want. Left and right arrows, and page up and page down are your friends.]
7. SAVE THE SETTINGS!!! (Be sure the checkmark to save the edits is checked!)
8. Export the edited AC3 file from the stream menu.
9. Remove the AC3 stream (it interferes with steps below).
10. Start the VirtualDubMod frameserver.
11. Open the .VDR file and encode the video using your favorite MPEG-2 encoder (no audio).

[In my experience, the delay calculated by DGIndex/DVD2AVI (in the file name of the extracted AC3) is wrong for ATSC, so we have to calculate it by hand. If you want to experiment, you can skip to step 19 or 20 and see what happens.]

12. Select enough of the first portion of your video to provide you with pictures you can sync with the sound (e.g. someone speaking).
13. Edit the rest of the video out (mark and delete).
14. Add a filter to scale to 320x240.
15. Choose a simple codec for the video (one that can play back easily on your machine in real time at 320x240) and save an AVI.
16. Use BeSweet/BeSweetGUI to convert the AC3 to WAV (I know we could do this with DGIndex above, but 1) this is only for sync purposes, and at least on my machine it's quicker to do the conversion this way than run through DGIndex twice, once for the WAV and once for the AC3).
17. Load the AVI and WAV into your favorite editor and count the frame delay between the video you see and the audio you hear.
18. Multiply the delay by the frame rate (29.97 fps) to determine the delay (if the audio is ahead of the video, the delay is negative).

19. Use AC3DelayCorrector to cut or pad the edited AC3 file with the amount of time determined above.

20. Use the MPEG-2 file and delay-corrected AC3 file to author your DVD.

I know it's sounds complicated, but with the exception of the audio sync problem (that I hope the DGIndex/DVD2AVI guys will figure out one day), this is the best sequence I've been able to find. It requires no intermediate video files (except for syncing) and does not decode/re-encode the audio.

Xesdeeni
post #314 of 2239
Quote:


DJRobX Thanks so much for the patched ProjectX. Worked PERFECT last night to clean the source which allowed me to transcode 59.94fps Survivor to an IN-SYNC divx AVI!!!

Great! Glad to hear it's working for you. I haven't had any troubles with the patch, I encoded a couple more episodes of LOST and they came out perfect every time. I think we really need to spread the word about ProjectX around here. It would have saved me so many headaches.

Quote:


2. Run the video through DGIndex (new version of DVD2AVI) to create the D2V file and extract the AC3 audio stream.

Xesdeeni, if you use ProjectX on this step instead to do the demux, you will not need to deal with any of that ac3 delay nonsense. It will make you an D2V and an AC3 file precisely aligned to the video, with the delay corrected. What's better is that if there are any flubs in the source, it will use the sync information present in the TS to keep the two in sync.
post #315 of 2239
Quote:


Originally posted by DJRobX
I think we really need to spread the word about ProjectX around here. It would have saved me so many headaches.

Aint that the truth? Countless hours wasted manually syncing audio by finding the points of offset and compensating with audio editing utils. Probably 8 hours of my life wasted right there since I got my HDTV card! Not to mention the thinning hair!
post #316 of 2239
DJRobX,

Great work, congratulations!

Do you know how to use the ProjectX command line interface?

It does exist, they call it CLI, but I can't find any specific way to use it.

Edit: found it, don't bother!
post #317 of 2239
Does HDTVtoMPEG2 cause lip-sync issues with streams archived to a JVC30K if HDTVtoMPEG2 is used to trim the excess material from the beginning and ends of PC HD captures?
post #318 of 2239
I am having a problem, but I don't know if it has to do with HDTV2MPEG2. I used it to cut out the commercials from a 1080i tp file made by FusionHDTV, and I saved it as a ts file. I changed the extension temporarily to tp so that it would play back in FusionHDTV, and it played back fine. But, after demuxing it with two separate programs (xport.exe and ProjectX), the mpeg video output from each program plays back as if it is in fast foward, but the audio plays back normally.

This doesn't semm to be a problem with HDTVtoMPEG2, because the file it created plays back fine, but I really would like to know why this isn't demuxing correctly.

Edit: I think this may have had to do with running an encoding process in the background WHILE playing back an mpeg. As soon as I tried playin back the demux WITHOUT an encoding process in the background, there were lipsync problems (to be expected), but at least it wasn't playing in fast foward any more. I think this may have something to do with processes in the background being the same processes that are used to play back mpegs.
post #319 of 2239
Quote:


Originally posted by mmortal03
I am having a big problem with HDTV2MPEG2....

I doubt this is a problem with HDTVtoMPEG2....

Huh?
post #320 of 2239
Yeah, I figured somebody might (as it always happens) read into the semantics of my post, and disregard it, without instead just trying to help me with the problem that I am having. All for having a low post count. I guess my post wasn't specifically on topic, but hey, HDTVtoMPEG2 WAS part of the chain of programs I used, so I think it was a relevant post.

No matter, I found the problem anyway. Thanks a bunch.
post #321 of 2239
Quote:


No matter, I found the problem anyway. Thanks a bunch.

Now that you know what was causing the problem, can you tell me what it was? I'd like to know just for future reference.

Thanks
Kenny
post #322 of 2239
Quote:


Originally posted by DJRobX
Xesdeeni, if you use ProjectX on this step instead to do the demux, you will not need to deal with any of that ac3 delay nonsense. It will make you an D2V and an AC3 file precisely aligned to the video, with the delay corrected. What's better is that if there are any flubs in the source, it will use the sync information present in the TS to keep the two in sync.

Can you tell me how to do this? I tried "demux," and I got an MP2 and an AC3, but no D2V.

Xesdeeni
post #323 of 2239
@ chris moore

is there any chance that HDTVtoMPEG2 will come to mac os x? there is only one app that can handle .ts files but it's not able to join or keep the audio file when you transform hdtv files from mpeg back to .ts.
post #324 of 2239
Also, will this work with DGDecode.dll (http://neuron2.net/fixd2v/decodefix.html)?

Xesdeeni
post #325 of 2239
BenDERmac,

I would say there is no chance of H2 being ported to MAC. I think I read somewhere on this forum that some MAC users were successful using H2 under an windows emulator.

BTW, H2 does not have the ability to convert mpeg files back to ts files.

Cris
post #326 of 2239
Can anyone tell me if there are some special settings that need to get set in ProjectX, or can I just open my TS files and click Go? I seemed to have good luck with a 720p file, but with a 1080i capture I get lots of messages like this...

-> starting export of video data @ GOP#0
!> dropping useless B-Frames @ GOP#0 / new Timecode 00:00:00.000
!> dropping GOP#16 @ orig.PTS 08:56:11.538 (2895438463)

Maybe this is normal?

The 1080i capture creates a much smaller .mpv file than my 720p capture. Both are 1/2 hour sitcoms.
post #327 of 2239
A lot of people here are re-encoding their .ts to some other format. If I want to just create a single mpeg, keeping the original quality, what should I use? It seems HDTVtoMPEG2 output mpgs dont play back properly. I've tried to demux with ProjectX and remux with TMPEGEnc, but that wouldn't work either.
post #328 of 2239
Try Moonlight's Xmuxer to remux .TS into .MPG.

Late!
post #329 of 2239
Quote:
Originally posted by Cris Moore
BenDERmac,

I would say there is no chance of H2 being ported to MAC. I think I read somewhere on this forum that some MAC users were successful using H2 under an windows emulator.

BTW, H2 does not have the ability to convert mpeg files back to ts files.

Cris

yes, h2 runs under virtual pc but i have problems with the app in win98 se. the app always crashes and under xp it's just a pain as it seams microsft didn't really make a good programming for vpc7 as xp always crashes.

are there any known problems with win 98 se since this is very stable on my mac

as for the mpeg to ts convertion: so my troy hdtv trailer is lost as h2 made the file and any other converted file unplayable on my mac
post #330 of 2239
Quote:
Originally posted by DJRobX
Xesdeeni, if you use ProjectX on this step instead to do the demux, you will not need to deal with any of that ac3 delay nonsense. It will make you an D2V and an AC3 file precisely aligned to the video, with the delay corrected. What's better is that if there are any flubs in the source, it will use the sync information present in the TS to keep the two in sync.

DJRobX, I am using your patched ProjectX. I want to get a .d2v and a .ac3 from my TS files captured by MyHD. My current process is

.TS -> [DVD2AVI] -> .d2v+.ac3 -> [AviSynth/VirtualDubMod] -> TMPGENC -> .m2v

.m2v + .ac3 -> [TmpgEnc DVD Author] -> .vob

I am plagued by audio sync issues.


If I read your post correctly, I can use ProjectX instead of DVD2AVI. I used both the command line interface (-dvx2) and the gui, but I could not get a *.d2v proje ct from ProjectX.

Can someone please post a small tutorial that shows all the steps necessary ? I may be missing something basic.

Thanks.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Home Theater Computers
AVS › AVS Forum › Video Components › Home Theater Computers › HDTVtoMPEG2 latest version