PDA

View Full Version : HD TS to one HD (no hyphen) DVD for Sigma Design Player


Xesdeeni
19th February 2007, 22:18
As the proud new owner of a Zensonic Z500, I join the IOData, SRD-100U, etc. owners in enjoying even more HD playback. I primarily use my Z500 for playing back OTA ATSC HD TS. But I have two other major uses:

1. I want to convert my collection of multi-DVD HD TS movies to single (red laser) DVDs for easy (and family friendly) playback, but still in HD.

2. I want to convert the oldest HD TS programs on my HTPC to something still in HD, but smaller to save hard drive space. This would ideally be a relatively automatic background task.

The Z500 can handle DIVX/XVID, WMV, and MPEG-4 Pt. 2. I don't do WMV, so I'm trying to find a reasonable compromise between:
a. Quality
b. Speed
c. Simplicity

I tried Auto Gordian Knot, but it chooses the final resolution based on your destination file size, and I want it left in HD.

I'm working with Nero's Recode, but I'm having some compatibility issues.

I tried ffdshow via VirtualDub and VirtualDubMod (see below), but its MPEG-4 encoder can't handle 24 or 23.976 fps (same clip set to 25 fps works).

XVID requires two manual interventions, to initiate the first and second passes, and the quality isn't as good as Recode.

I tried x264, but I don't understand enough about MPEG-4 to downgrade the settings of x264 to get an MPEG-4 Pt. 2 file instead of a h.264/MPEG-4 Pt. 10/AVC file. And besides, that thing was excruciatingly slow.

Also, I've found that I still need to manually pre-process the file to inverse the telecine. I use DGIndex/DGDecode with AVISynth and Decomb. I suspect there might be a faster MPEG-2 decoder than DGDecode, and I don't know if there's a faster plugin to inverse the telecine.

I'm hoping for suggestions and discussions.

Xesdeeni

Boulder
20th February 2007, 07:46
I don't think there's any faster MPEG2 decoder than DGDecode. There is NaN's SSE2 build but it is based on DGDecode v1.1.0 which might be quite outdated for your needs.

For faster IVTC, try tritical's TIVTC package, see the Avisynth development forum.

Pookie
20th February 2007, 07:47
"I don't think there's any faster MPEG2 decoder than DGDecode"

Boulder, you beat me to the punch ! LOL

Xesdeeni - You can try Mencoder and the various front ends that go with it. It is quite easy to create a batch file to perform all of the tasks to get to a DivX/Xvid 2-pass file.
Any way you choose, transcoding HD res material is slow...very slow if you don't have a higher end machine.

Note: Not checked for errors, logic, etc. Just an example of how you can automate it.
dgindex -IF=[HDmovie.TS] -FO=0 -IA=2 -OM=3 -DSD=1 -OF=[HDmovie] -AT=[1920x1080template.avx] -EXIT
Rem - Check Dgindex documentation for command line syntax specific to your requirements

mencoder.exe "1920x1080template.avs" -ovc xvid -xvidencopts bitrate=3500:turbo:pass=1 -nosound -o NUL: 2> 2.txt
mencoder.exe "1920x1080template.avs" -nosound -ovc xvid -xvidencopts bitrate=3500:pass=2 -o "output.avi" 2>> 2.txt

for %%i in ("*.ac3") do delaycut.exe -auto "%%a" -out fixed.ac3
ffmpeg -i fixed.ac3 -i output.avi -vcodec copy -acodec copy -y HDmovie.avi





1920x1080template.avx
SetMemoryMax(640)
LoadPlugin("bt709tobt601.dll")
LoadPlugin("tivtc.dll")
LoadPlugin("DGDecode.dll")

mpeg2source("__vid__")


converttoyv12()
bt709tobt601()

TFM()
tdecimate()

Xesdeeni
22nd February 2007, 22:38
"I don't think there's any faster MPEG2 decoder than DGDecode"I've always thought it might be possible to use the DxVA to help with the decode, just like the video players, which should decode faster. What I don't know is if transferring the data back across from the video card (where normally it would have stayed there and been displayed) defeats the speedup.Xesdeeni - You can try Mencoder and the various front ends that go with it. It is quite easy to create a batch file to perform all of the tasks to get to a DivX/Xvid 2-pass file.SWEET! That looks like just the ticket for batch processing! Thanks!1920x1080template.avxSetMemoryMax(640)
LoadPlugin("bt709tobt601.dll")
LoadPlugin("tivtc.dll")
LoadPlugin("DGDecode.dll")

mpeg2source("__vid__")


converttoyv12()
bt709tobt601()

TFM()
tdecimate()I see a couple of interesting things here.

First, DGDecode outputs in YV12 already, right?

Second, I see you are using bt709tobt601. This was the first I have seen of this, but checking into it, is that really right? I normally play the TS with the Z500 anyway. Does it do this conversion? So then the question is whether I should be doing it when I encode to DivX/XviD/MP4.2, or would that be redundant. And if I have to do it, is it NOT being done when playing back TS? Certainly for going to DVD, where 601 is the standard, but for HD?

Third, there is a note in bt709tobt601 that says "It assumes progressive (or deinterlaced) input so use after TomsMoComp or Telecide if needed." I don't know if that's still valid (this comes from the first 2003 post), but I thought I'd mention it.

Finally, let me thank you again!

Xesdeeni

Pookie
22nd February 2007, 22:50
Oh, sorry about that. Bt709toBT601 is a bit long in the tooth. The prefered plugin is the newer ColorMatrix, which does have support for interlaced sources. Good docs on that one as well.

I don't have your player, so I don't know if any automatic conversion occurs.

ConverttoYV12() gets ignored if the source is already YV12

Xesdeeni
23rd February 2007, 15:45
I don't have your player, so I don't know if any automatic conversion occurs.I've posted on the Z500 forum to see if I can find out.

Another question. How do I get the syntax of a codec so I can address it from mencoder? I'm experimenting with DivX, and it has a dialog for configuration. Presumably I need to adjust the settings form the mencoder script, right?

And I have one other weird problem. I'm converting movies captured from ABC. Apparently they like to play time stretching games. So telecined movies aren't always 23.976 fps. Is there a tool that I could use to automatically tell me the number of unique frames in a clip so I could calculate the actual frame rate? (I'm assuming here that the Z500 can play a clip at any frame rate, converting to the right field repeat pattern, so long as I give it the right fps.)

Xesdeeni

Pookie
23rd February 2007, 22:42
By far, the easiest way to get the settings for Mencoder is to snag them from a GUI front end, such as Winmenc , which generates an actual batch file, or DVBmenc which shows you syntax in the log file it creates http://users.bigpond.net.au/nexx1/dvbmenc/dvbmenc_beta0.1i.zip

And of course, the documentation (which is quite readable)

http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html


Regarding the ABC issues - Lots of discussion as of late on the subject. I have great results with the following:

1) Use the latest DGindex

2) Include in AVS script

SelectEven()
Tdecimate() #from TIVTC by Tritical

laserfan
24th February 2007, 16:48
I use StaxRip to convert 1080i broadcasts to 720p Xvids--it's easy though not fast (nothing will be "fast" I think). I just use the default HDTV profile in one-pass mode and my SC200 (kin to Z500 has EM8620L chip) loves 'em.

Stax is very automated--you might want to give a look.

Xesdeeni
25th February 2007, 01:06
Well, the video looks fine, but I had audio drift, so by the end it's a second or two off (it's fine at the start). The audio is out of sync on both the computer and Z500, so it's not just the player's fault.

Specifically, I used the following AVISynth scriptMPEG2Source("Toy Story (WFAA).d2v")
AssumeBFF()
Crop(0, 0, 0, -8)
tfm()
tdecimate(mode=2, rate=23.2603)
LanczosResize(1280, 720)I fed this into VirtualDubMod, and added the AC3 extracted with DGIndex as a stream. I did a two-pass encode with DivX (7.4 Mbps).

Any suggestions?

Xesdeeni

Pookie
25th February 2007, 01:17
What is your source - 720p? Just try the example I posted a few messages above.

How did you derive 23.2603 ?

Xesdeeni
25th February 2007, 03:01
What is your source - 720p? Just try the example I posted a few messages above.

How did you derive 23.2603 ?Check out this thread. (http://forum.doom9.org/showthread.php?t=122472)

Xesdeeni

Pookie
25th February 2007, 04:16
Gotcha. Well, scharfis_brain is a hell of a smart fellow.

Xesdeeni
25th February 2007, 05:02
Gotcha. Well, scharfis_brain is a hell of a smart fellow.Yeah! I never even considered that they'd telecine at a non-standard frame rate. $*#! ABC.

But I'm still not sure why I get the audio sync issue. If I calculate the 23.976 vs 23.2603 ratio, I get about 3% difference. Over a 79 minute movie, that would equate to a more than 2 minute difference. I get a second or so. I did notice that VirtualDubMod only showed the frame rate as 23.260. I'm not sure whether this was just rounded for display purposes, but even if it somehow lost the .0003, that only accounts for two frames over the 79 minute movie.

Xesdeeni

Pookie
25th February 2007, 05:06
loadplugin("NicAudioSource")

NicAc3Source("input.ac3", Channels=6, DRC=1) #this will keep 5.1
ConvertAudiotofloat()

And to modify the audio to match the video
http://forum.doom9.org/archive/index.php/t-117287.html

Xesdeeni
25th February 2007, 20:41
loadplugin("NicAudioSource")

NicAc3Source("input.ac3", Channels=6, DRC=1) #this will keep 5.1
ConvertAudiotofloat()

And to modify the audio to match the video
http://forum.doom9.org/archive/index.php/t-117287.htmlI'm not sure I understand your point. I shouldn't have to process the audio at all. I did not alter the length of the movie. The TS is 1:19:37.90 in length. The AC3 extracted by DGIndex is 1:19:37.95. The above AVISynth script (inversing the telecine) is 1:19:37.88. The AVI I created is 1:19:37.84.

However, the audio is in sync at the beginning, and out by a second or so at the end.

This is the first of a number of movies I'm preparing to convert, so I really need to find the root cause.

Xesdeeni

Xesdeeni
25th February 2007, 20:54
Xesdeeni - You can try Mencoder and the various front ends that go with it. It is quite easy to create a batch file to perform all of the tasks to get to a DivX/Xvid 2-pass file.I thought mencoder would allow me to use the DivX codec itself. Instead, it uses its own built-in one. In my tests (and YMMV), I prefer the DivX codec. But I'd still like to automate the conversion if possible. Is there a command line app that will use standard codecs? Basically, I want to do what I do with VirtualDubMod (load the AVISynth script and the AC3 stream to have it save out using the DivX codec), but from a command line. I would create a batch file from that would process a specific show from another batch file. (I.E. I've looked at VDM's scripting, but I don't see how to specify the source and destination filenames, or how to configure the codec.)

Xesdeeni

Pookie
26th February 2007, 00:06
Yes, - AVS2AVI http://sasteam66.free.fr/vrac/source_codes/avs2avi-140.7z

Xesdeeni
28th February 2007, 18:02
However, the audio is in sync at the beginning, and out by a second or so at the end.I thought I'd update this thread for anyone seeing the same problem. The culprit is tivtc. When using this, although the length of the video is correct, the end of the movie gets chopped off, resulting in the sync problem. I switched to using Telecide() from Decomb and FDecimate() and all appears well.

Xesdeeni

Boulder
28th February 2007, 18:09
Would you mind posting this issue in the TIVTC thread as well so that it would be noticed by tritical?

Pookie
1st March 2007, 01:11
Well done. What was the date of TIVTC ?

As Boulder mentioned... Tritical will want to know the version of DGindex as well.

Xesdeeni
1st March 2007, 03:56
I've posted the details in the TIVTC thread.

Once again, thanks for the help!

Now to bug Donald Graft about an automated framerate finder....

Xesdeeni