PDA

View Full Version : technical telecine question


EricBall
16th January 2003, 22:26
I've been looking closely at the frame/field structure of the SW:TPM DVD (NTSC), and have "discovered" that the video is at 23.976fps. The TFF/RFF cadence doesn't change, even over several thousand frames.

I find this curious, since I would have expected a missing field every thousand frames to resynchronize the frame rate to 24fps. Does this mean that the audio stream has been stretched by 0.1%, or have frames been dropped prior to the telecine process?

One other niggly point - should the closed_GOP flag be set when there are no leading B frames? (i.e. temporal_reference = 0 & picture_coding_type = 1 = I)

Slogra
16th January 2003, 22:28
Yep, the sound/video is slowed down from 24 to 23.976

mpucoder
16th January 2003, 22:47
The GOP closed flag means no B or P frames make reference to frames in the preceeding GOP. Therefore a closed GOP must have an I frame as temporal sequence 0.
However the flag is used only for editing, so if it's not set, even though it could be logically, it makes no difference to a DVD player. Editors (and other processes that need to interupt a video stream) use the flag to determine when a cut can be made without any messed up macroblocks. If a cut is made with the flag clear, then the "Broken GOP" flag should be set.

EricBall
17th January 2003, 04:08
Sorry mpucoder, I have to disagre. As per the ISO spec:
"closed_gop -- This is a one-bit flag which indicates the nature of the predictions used in the first consecutive B-pictures (if any) immediately following the first coded I-frame following the group of
picture header. closed_gop is set to ‘1’ to indicate that these B-pictures have been encoded using only backward prediction or intra coding."

Thus if you have the following:
group of pictures header { closed_gop = 1 }
picture header { temporal_reference = 2, picture_type = I }
...picture data...
picture header { temporal_reference = 0, picture_type = B }
...picture data...
picture header { temporal_reference = 1, picture_type = B }
...picture data...

the closed_gop flag indicates that the 2 B pictures may be safely decoded without any pictures other than the I frame.

Hmm, reading this, I guess the "(if any)" answers my question. It still doesn't mean much when no B pictures temporally preceed the first I frame anyway.

mpucoder
17th January 2003, 04:54
My misinterpretation of the spec. The meaning to editors is still clear, the stream can be cut before a closed GOP.
Now, to revisit an old thread about dvd2avi dropping those 2 B frames...

fu2k
17th January 2003, 07:07
Originally posted by EricBall
Sorry mpucoder, I have to disagre. As per the ISO spec:


I'd be interested to know what spec you are referring to. If it's the DVD spec then I'd be very interested in seeing it. If it's an MPEG2 spec, then you should be aware that the DVD spec effectively "overrides" the MPEG2 spec as far as DVD video is concerned. I've seen snippets and they could easily say stuff like "value of closed_gop flag is unimportant".

mpucoder
17th January 2003, 07:12
Eric was referring to ISO 13818-2, mpeg-2 video. The DVD specs are not ISO, otherwise they would be more easily obtainable.

-h
17th January 2003, 08:48
Eric was referring to ISO 13818-2, mpeg-2 video. The DVD specs are not ISO, otherwise they would be more easily obtainable.

I would be most interested in a list of differences! This could save me many headaches down the line.

-h

EricBall
17th January 2003, 14:35
Originally posted by mpucoder
My misinterpretation of the spec. The meaning to editors is still clear, the stream can be cut before a closed GOP.

Yeah, I realized this morning that closed_cop is just an indicator to an editor/player that no information prior to the GOP is required (irrespective of whether there are any B frames). Which is good for Q&D GOP accurate editors I guess, since then they don't have to parse the picture headers.

I do remember seeing a one-page summary of the differences between ISO 13818-2 and what is implemented for DVD. IIRC, it was more a limitting thing i.e. only these resolutions, either 29.97 NTSC or 25 PAL, max bitrate & GOP length etc. I believe it also required the full segment header sequence prior to each GOP (which is optional in the MPEG-2 spec.

Back to my original topic - why slow down both the audio & video? Sampling rate conversion from 48kHz to (effectively) 47.95kHz seems like a lot of effort versus simply changing field cadence every thousand frames. Or would that cause too much drift to audio/video synch?

mpucoder
17th January 2003, 15:02
Actually you raise the effective sampling rate to slow down the audio (it will be reproduced at 48K). The reason is simple, DVD is intended for television, and NTSC uses 29.97fps for reasons too complex to cover here (it has to do with harmonics of the audio carrier interfering with the visual carrier). NTSC television also shows movies at 23.976fps with pulldown to 29.97fps. Initially this was done mechanically, synchronizing the telecine (a combination projector and video camera) to the video and displaying frames for 3 and 2 fields. This became known as 3:2 pulldown, and is still used today.
Also, for history buffs, American television prior to color (NTSC) ran at 30fps, and telecines showed the film at 24fps. With the advent of NTSC no changes were made to the machines, they just naturally slowed down, being sync'ed to the video.
As you noticed you could drop a frame every 1000, but it doesn't. What you do need to do is adjust your timecode periodically, which counts at 30fps. This is what "drop frame" timing is, and in NTSC it is done in frame pairs (known as superframes, it takes four fields for the color subcarrier to return to the same phase at the start of the field).

I have a list of differences between mpeg and DVD at http://mpucoder.kewlhair.com/DVD/dvdmpeg.html
This was taken from DVD Demystified, 2nd edition. It is a list of restrictions, as DVD is fully mpeg 1/2 compliant.

EricBall
17th January 2003, 15:27
Yeah, I think that was the page (or something similar).

Whoops, you're right, you have to sample at a higher frequency.

But still, my question is: why go to the trouble, especially since the audio stream is probably already in a digital format? (Maybe not AC3, but probably a LPCM master.) Resampling the audio seems to be overkill when you can fix the video frame rate to 24Hz by just fiddling with the field cadence. There must be a reason.

mpucoder
17th January 2003, 15:38
Yes, there is a reason. The same equipment used for preparing a film for television broadcast is used for DVD transfers. Only newer digitally mastered films have to be resampled, older films are transfered at 23.976fps by the same old equipment.
Fiddling with the pulldown sequence wreaks havoc with large screen televisions which use "line doubling" (bob or weave interlaced to progressive conversion).
The truly appalling transfers are to PAL, which runs at 25fps. Good transfers use pitch shifting to lower the pitch back to normal, cheap transfers do not (and you can hear the difference)

EricBall
17th January 2003, 20:22
Ahh, thanks. Hmm, I guess a periodic cadence glitch would become very annoying if the de-interlacer didn't handle it correctly.

Slogra
18th January 2003, 00:32
Originally posted by mpucoder
The truly appalling transfers are to PAL, which runs at 25fps. Good transfers use pitch shifting to lower the pitch back to normal, cheap transfers do not (and you can hear the difference)

Well, pitch correction is a very difficult process, which results in a far from perfect soundtrack (bleeps, dropouts etc). Personally i prefer a bit higher pitch, without any errors.

DJ Bobo
18th January 2003, 01:01
I don't think it is that complex as you people describe.

I think it's very easy to modify the speed at which the film is being read, they simply have to set 24 frames per 1001ms, not per 1000ms. Is is that difficult?!

About PAL things, pitch correction is perfect nowadays, don't know what you're talking about, I personally make NTSC2PAL speed ups quite often with Prosoniq TimeFactory and they sound simply perfect, and I mean perfect!
If you experienced any dropouts or something, you've got a badly mastered DVD, done with some cheap machine.