Log in

View Full Version : 50fps Progressive to DVD


Chumbo
23rd June 2013, 19:56
Hi,
I have some shows I recorded with my HD-PVR and they are 50fps progressive. I've tried several programs and methods to encode to DVD but all the output always comes out jittery and jumpy. It's the best way I can explain it, so essentially not playing smooth like the original. Here's the mediainfo data on the video (in a TS container):Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=32
Codec ID : 27
Duration : 26mn 16s
Bit rate mode : Variable
Bit rate : 7 849 Kbps
Maximum bit rate : 20.0 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.170
Stream size : 1.44 GiB (91%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
The AVS I used is fairly simple:LoadPlugin("E:\Tools\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_13_21_8.dgi")
ChangeFPS(29.970)
bicubicresize(720,480)
converttoyv12()
Am just wondering if anyone can give me some pointers on how to convert this type of video to DVD correctly please. Thank you.

IanB
23rd June 2013, 23:34
Well a lot depends on the actual content, but reclocking straight to NTSC is always going to have bad jitter.

If the material is actually 25 fps, i.e. 2 frame repeated, then just throw away the duplicate frames and encode it as a 25p progressive pal dvd.LoadPlugin("E:\Tools\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_13_21_8.dgi")
SelectEven() # Discard odd frames
converttoyv12()
bicubicresize(720,576)
If the material is genuine 50fps, e.g. a sports broadcast, then interlace it and encode as a 25i interlaced pal dvd.LoadPlugin("E:\Tools\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_13_21_8.dgi")
converttoyv12()
bicubicresize(720,576)
AssumeTFF() # If you want your DVD to be top field first
DoubleWeave()
SelectEvery(4, 1)
If the material was originally film with 4% pal speed up applied, then undo the speed up and recover the original frames Encode as NTSC film with soft 3:2 telecine pulldown.LoadPlugin("E:\Tools\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_13_21_8.dgi")
SelectEven()
AssumeFPS("NTSC_Film")
converttoyv12()
bicubicresize(720,480)

Chumbo
24th June 2013, 00:25
Thanks for the options. To be honest, when I initially checked the FPS on these, I was surprised to see 50 FPS because I recorded these here in the US. So this is actually NTSC and not PAL. It's already 720x480 so I just need to get a smooth conversion. I'm not entirely sure if the material is actually 25 or 50 FPS. If it was 25 then mediainfo would show it as interlaced or 3:2 pulldown right? Also, the audio is fine, i.e., no speedup.

I wish I knew more about this stuff, but you may be on to something. I have successfully converted 25FPS to NTSC. Can I just do that in a script, i.e., go to 25 FPS and then to 29.97? That should work right?

TheSkiller
24th June 2013, 10:03
There has to be something wrong. I can guarantee you there is no way a broadcast in the US comes in 50 fps.

Your MediaInfo quote tells us something contrary to what you tell us. According to MediaInfo you are dealing with a European 720p HD broadcast or BD source.

To make an NTSC DVD from that it would first be a good thing to make a simple AVS script which loads the video and then step through the video frame by frame in for example VirtualDub.

This way we will be able to determine whether the video contains 50 or 25 individual steps of motion per second and start a rational conversion from that point.


Edit: Maybe things would become clearer if you tell us how exactly you recorded this. My guess is you have not recorded the exact video stream which was broadcast but recorded your video off a receiver (cable box) using your HD-PVR with bad settings (50 fps instead of 60 fps).

Ghitulescu
24th June 2013, 10:23
I do not understand: you have HD material and you want to convert it to NTSC/PAL? You can put HD material on a DVD (it's the trick used by the most camcorders, AVCHD) as BD5 or BD9. You need of course a HD player (mediatank, HD player like WDTV, or a BDplayer).

pandy
24th June 2013, 10:58
If the material is genuine 50fps, e.g. a sports broadcast, then interlace it and encode as a 25i interlaced pal dvd.LoadPlugin("E:\Tools\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_13_21_8.dgi")
converttoyv12()
bicubicresize(720,576)
AssumeTFF() # If you want your DVD to be top field first
DoubleWeave()
SelectEvery(4, 1)

Hmmm, Ian are You sure about converttoyv12() place
Isn't all temporal conversion shouldn't be performed before converting to YV12 and YV12 shouldn't be with flag (Interlaced=True)?

Guest
24th June 2013, 12:42
DGSource delivers YV12 so the convert call appears superfluous.

pandy
24th June 2013, 14:41
DGSource delivers YV12 so the convert call appears superfluous.

Thx neuron - so in other words chroma sample allocations will be exactly as specified by MPEG-2 (i mean chroma subsampling sample allocation progressive vs interlace).

Guest
24th June 2013, 15:25
The chroma sampling type, progressive versus interlaced, is specified in the MPEG2 syntax and is recorded in the DGI file.

pandy
25th June 2013, 09:55
OK, sample location are related to MPEG-2 syntax but i mean when source is progressive (720p) then it is resized and interlaced (576i25 in this case) - will syntax provided by IanB will change chroma sample locations or not (from progressive to interlace) - this was not clear for me.

From my perspective chain looks like:

720p->resize 576p->interleave(interlace)->color transformation

OR

720p->resize 576p->color transformation->interleave(interlace)

Guest
25th June 2013, 13:07
As I said, the convert call does nothing because the video is already YV12. You cannot use the ConvertToYV12() function to resample YV12 from progressive to interlaced.

TheSkiller
25th June 2013, 16:06
will syntax provided by IanB will change chroma sample locations or not (from progressive to interlace).

There is no difference between interlaced and progressive YV12, it's just YV12. Such distinction does not exist (hence there is no way to convert between the two).
The only differences are how the YV12 chroma is derived from YUY2, RGB (or whatever the source is) and how it is upsampled back to RGB for playback – interlaced or progressive.

Do not confuse chroma placement (MPEG2, MPEG1, DV) with interlaced/progressive.

IanB
26th June 2013, 00:03
The location of the chroma samples is the same for interlaced and progressive. But they are displaced in time so you need to consider that when re-sampling from other formats.O O O O
X X
O O O O

O O O O
X X
O O O OE.g. when converting from an interlaced 422 format for top fields you would interpolate the chroma to be between lines 1 and 2, for bottom fields you would interpolate the chroma to be between lines 3 and 4. I.e. bilinear 0.75*L1+0.25*L3 for the top field chroma and 0.25*L2+0.75*L4 for the bottom field chroma.

And of course if you are lucky enough to start with a double rate progressive source you can just do a progressive re-sample and then a simple selection of the temporally correct samples.

TheSkiller
26th June 2013, 10:31
And of course if you are lucky enough to start with a double rate progressive source you can just do a progressive re-sample and then a simple selection of the temporally correct samples.
One question I could never answer myself about this is: does this also somewhat improve the chroma fidelty of the final interlaced video compared to an interlaced downsample on already interlaced video?

IanB
26th June 2013, 15:57
For a case going from a double rate progressive 4:2:2 source to an interlaced 4:2:0 result versus an interlaced 4:2:2 source then probably yes.

With a progressive source you have access to both the line 1 and line 2 data to produce the first field chroma. (and lines 3 & 4 of the next frame for the 2nd field chroma)

With an interlaced source you only have access to line 1 and line 3, so you need to do a weighted interpolation from half the spatial data.

TheSkiller
26th June 2013, 16:53
Thanks for the explanation. :)

Chumbo
27th June 2013, 04:28
There has to be something wrong. I can guarantee you there is no way a broadcast in the US comes in 50 fps.

Your MediaInfo quote tells us something contrary to what you tell us. According to MediaInfo you are dealing with a European 720p HD broadcast or BD source.

To make an NTSC DVD from that it would first be a good thing to make a simple AVS script which loads the video and then step through the video frame by frame in for example VirtualDub.

This way we will be able to determine whether the video contains 50 or 25 individual steps of motion per second and start a rational conversion from that point.


Edit: Maybe things would become clearer if you tell us how exactly you recorded this. My guess is you have not recorded the exact video stream which was broadcast but recorded your video off a receiver (cable box) using your HD-PVR with bad settings (50 fps instead of 60 fps).
Some good questions. I agree that there's something funky going on here especially the 50fps. Not sure why you say what I said is contrary to what mediainfo is reporting. I said 50fps and mediainfo reports 50fps. So I'm not sure how those contradict each other. Anyhow, the source, in this case, is SD and NOT HD. My set top box was a DVR and I have not had any issues recording HD material. This is the only material I recorded from the SD source only because the channel was only available in SD.

So what I did is load the TS into VideoRedo TVSuite v4 H264 and it did report 50 frames at the 1-second mark. So it's definitely 50 and not 25. That was a good tip. :)

Unfortunately I dropped my service several months ago and no longer have the DVR and my PVR 1212 is no longer installed and neither is the software so I can't verify the settings. But, like I said, I had no issues with HD material. I wish I had the time to go through these when I first recorded them when I still had the DVR or even when the PVR was still installed. I appreciate all the help.

TheSkiller
27th June 2013, 21:57
Not sure why you say what I said is contrary to what mediainfo is reporting. So I'm not sure how those contradict each other.
The contradiction is
because I recorded these here in the US.
Yet you have a 50 fps video. If it was broadcasted in the US it was not broadcasted at 50 fps.

I'm still not exactly sure I understand how your video was recorded.
You say you had a DVR. Usually this means the data the DVR stores on it's hard drive (which is a lossless 1:1 copy of the data which was broadcast) is encrypted and cannot be copied to a computer. So the only way to get any video off that thing is to have it playback the video and record the video signal of the DVR with I guess your PVR which is an external USB capture device.

If that is correct that last step is where things might have gone wrong.

Chumbo
29th June 2013, 00:20
The contradiction is

Yet you have a 50 fps video. If it was broadcasted in the US it was not broadcasted at 50 fps.

I'm still not exactly sure I understand how your video was recorded.
You say you had a DVR. Usually this means the data the DVR stores on it's hard drive (which is a lossless 1:1 copy of the data which was broadcast) is encrypted and cannot be copied to a computer. So the only way to get any video off that thing is to have it playback the video and record the video signal of the DVR with I guess your PVR which is an external USB capture device.

If that is correct that last step is where things might have gone wrong.
All I did was give you the facts, which don't make sense to me either and why I posted this. I had never run into this too which is why I'm baffled.

If you want more info on the capture device, just Google PVR 1212. All the programming I recorded is in HD via the component connections with which I've had no issues. The DVR is set to send 1080i@30Hz so that's what gets recorded. The PVR is set to record whatever it gets so for this one show, broadcast in SD, I had set the DVR to output 720p so you would think the FPS would be 59.94 but it's 50 for whatever reason. So there was a problem, I would think, at the source with the DVR or a bug in the capture software. I can't check either because I no longer have the service nor the equipment and the PVR is no longer connected and the OS for that computer has been upgraded.

Bottom line is what I wanted help with, which is to find the method to properly convert these media to DVD. I can do the simple conversions but am not an expert so when it gets into the realm of advanced encoding I need to seek help. So hopefully there's an answer for this.

Guest
29th June 2013, 00:38
Did you post an unprocessed source sample?

Chumbo
29th June 2013, 15:33
Did you post an unprocessed source sample?
Nope, but I'll be happy to do so. Is 20MB enough you think?

Guest
29th June 2013, 15:37
Sure that will be fine. Of course try to use a section that shows the jumpiness you are concerned about. You can cut with DGSplit for example.

Chumbo
29th June 2013, 15:56
Actually, the clip I'm uploading is from the original which is fine. It's when I try to convert it to DVD-compliant, i.e., mpeg2 interlaced @ 29.97 is when it gets jumpy. Do you want me to upload a sample of the converted one then?

[EDIT] I'll go ahead and upload samples of both the original and converted clips too.

Guest
29th June 2013, 16:14
Yes, upload both and explain the exact process you used. Thank you.

SeeMoreDigital
29th June 2013, 16:39
Sufficed to say, the DVD video specification does not support 720x576 MPEG-2 video at 50p. So it would have to be 50i ;)

Chumbo
29th June 2013, 16:47
Yes, upload both and explain the exact process you used. Thank you.
The original TS file is recorded from the HD PVR 1212, via component connection, as mentioned in previous posts. It was set to record whatever it gets from the DVR. The DVR was set to output 720p. The AVC clips are taken from the original source. This is what I did to get to the mpeg2 version:

I used DGAVCIndexDI to create the DGI file (full file included in samples)
I created the AVS script as posted in the first post (http://forum.doom9.org/showpost.php?p=1633937&postcount=1).
I used the AVS file in HC 025 to convert to an MPEG2 M2V (ini HC config file included in samples)
Used eac3to to extract the audio
Used tsmuxer GUI to mux the m2v/ac3 into a TS for previewing result.


Samples available here (http://www.mediafire.com/download/d7gv45enmuzdfib/samples.rar). The RAR file is 64MB. Thanks for the help.

Guest
29th June 2013, 17:06
I am downloading.

Meanwhile, if you play the M2V file is it jumpy? Or does the jumpiness arise only after muxing with tsmuxer?

It seems you have given me two samples. Now I have to ask which one I should be looking at.

SeeMoreDigital
29th June 2013, 17:14
The original TS file is recorded from the HD PVR 1212, via component connection...

Samples available here (http://www.mediafire.com/download/d7gv45enmuzdfib/samples.rar). The RAR file is 64MB. Thanks for the help.
Hmmm... Some odd capturing options were selected me thinks...

Guest
29th June 2013, 17:17
Yes, possibly some strange capturing. Did you really get this from somewhere other than a broadcast? To be honest, your "dog ate my homework" answers are not very convincing (you no longer have the capture setup, etc.). If you were a noob the thread probably would have been closed for rule 6. You're getting the benefit of the doubt here. Please don't be offended, we are just pointing out what we see.

Anyway, it seems to be hard 3:2 frame pulldown, so you need this:

dgsource("avc_clip1.dgi")
tdecimate(cycleR=3,cycle=5)
bicubicresize(720,480)

That gives fluid video without duplicates but at 20 fps. You can use DGPulldown to change the M2V to 29.97 for DVD.

That again is mysterious, because it's unlikely Gunsmoke was filmed at 20 fps (and then virtually unthinkable that it was then hard frame pulled down to 50 fps for broadcast in an NTSC country).

Finally, why are you muxing to TS if you need a DVD?

Chumbo
29th June 2013, 17:43
Hmmm... Some odd capturing options were selected me thinks...
No I don't think so. I still think it's the DVR that was the issue. The PVR just records what it gets.

Yes, possibly some strange capturing. Was this broadcast in PAL or NTSC land, or did you get this from somewhere other than a broadcast? To be honest, your "dog ate my homework" answers are not very convincing (you no longer have the capture setup, etc.).

Anyway, it seems to be hard 3:2 frame pulldown, so you need this:

dgsource("avc_clip1.dgi")
tdecimate(cycleR=3,cycle=5)
bicubicresize(720,480)

That gives fluid video without duplicates but at 20 fps. You can use DGPulldown to change the M2V to 29.97 for DVD.

Finally, why are you muxing to TS if you need a DVD?
Not sure what you guys want. I had Dish for several years and got tired of the cost so I dropped the service last year. I used the PVR exclusively with the DVR (Motorola ViP612) and it's my only device that has component out. I recorded some westerns for my parents from Encore Westerns. I moved all the TS source files to my media server and haven't had a chance to get them until now. When I got rid of Dish, I also had no reason to use the PVR any longer so I put it away. I also upgraded my "capture" computer's OS earlier this year from Win7 to Win8. What exactly is the problem here? I have to spell it out otherwise it's BS? I had already provided all the details that are relevant to the issue so I don't appreciate your insinuation. Anyhow, I'm in the US, so I'd assume Dish is/was broadcasting in NTSC.

I'll give your recommended script a try. How did you find out it is hard 3:2 pulldown?

The TS was just for a quick preview of the material as I mentioned. No need to go through publishing the DVD and THEN finding out the result is all messed up right?

Guest
29th June 2013, 17:55
The problems are exactly those I pointed out. I know settop boxes, I know DVRs, and I know that PVR device. There is no plausible way you could have captured that stream with the environment you described.

I asked you not to get offended but you've flown off the handle. So I will leave you to your own devices from here on out. Good luck with your conversion and remember to follow forum rules.

Chumbo
29th June 2013, 18:06
The problems are exactly those I pointed out. I know settop boxes, I know DVRs, and I know that PVR device. There is no plausible way you could have captured that stream with the environment you described.

I asked you not to get offended but you've flown off the handle. So I will leave you to your own devices from here on out. Good luck with your conversion and remember to follow forum rules.
Where did you ask me not to get offended? You just made a statement that needed a reply because I thought I had provided all the info that was requested. I've flown off the handle because I didn't appreciate your baseless assertion? C'mon now...

The only one I couldn't answer 100% is the PVR capture software settings because the software is no longer installed. So I'm not going to make something up. I provided to the best of my recollection how it was set up.

I always try to follow the forum rules, so please let me know if I did something of which I'm not aware.

Yes, I captured this in EXACTLY the environment I've described.

Chumbo
29th June 2013, 18:12
I am downloading.

Meanwhile, if you play the M2V file is it jumpy? Or does the jumpiness arise only after muxing with tsmuxer?

It seems you have given me two samples. Now I have to ask which one I should be looking at.
Sorry I didn't reply to this as I didn't see it previously. Good question, as I didn't actually try to play the m2v by itself. But I did mux it to both TS via tsmuxer and MKV with mkvmerge and it played the same with MPC-HC.

The two samples are just paired AVC and MPEG2 of approximately the same part. The first is the intro to the show and the second is a bit into the show. I just figured to provide a couple options.

Guest
29th June 2013, 18:25
You missed my edit before your reply.

Guest
29th June 2013, 21:16
Oh, forgot to answer your question.

To determine it was 3:2 hard frame pulldown... I knew it was 3:2 because the pattern when stepping through frames was:

A A A B B C C C D D ...

I knew it was hard because there were no frame repeats shown in DGIndexNV preview.

Chumbo
30th June 2013, 15:24
Oh, forgot to answer your question.

To determine it was 3:2 hard frame pulldown... I knew it was 3:2 because the pattern when stepping through frames was:

A A A B B C C C D D ...

I knew it was hard because there were no frame repeats shown in DGIndexNV preview.
Thanks, I appreciate you explaining that. I'm always learning when it comes to this stuff.

Chumbo
30th June 2013, 15:31
You missed my edit before your reply.
I see that now. But again, this is a legitimate recording that I made. Mainly for my parents because my father likes the old Westerns. I could have just dumped it to VHS but wanted to put it on DVD instead. This is a hobby for me and everything I post about is something I've recorded myself or I own the BD/DVD. With that said, I agree with rule #6 wholeheartedly as it puts helpful forums like this at risk.

Chumbo
2nd July 2013, 21:41
I wanted to provide the final solution that works in case anyone else ever runs into this. The final AVS script:LoadPlugin("E:\dgavcdecdi\DGAVCDecodeDI.dll")
DGSource("2013_2_3_10_40_3.dgi").assumefps(60)
tdecimate(cycleR=3,cycle=5)
bicubicresize(720,480)
changefps(23.976)
The audio didn't need to be tinkered with either which was nice. Thanks again for everyone's contributions.