Log in

View Full Version : Scenarist: Drop frame time codes problem


Dimmer
18th March 2004, 11:35
Here’s a problem I came across a in Scenarist 2.7 when trying to author a DVD out of NTSC TV program I captured into MPEG-2 using ATI Radeon VIVO card. In the most simple scenario, I demuxed .m2v video stream, set Scenarist default setting to Drop Frame, imported the .m2v, and created a new track with it. Then I created a scene at 00:39:59:27 (frame 71997). The problem is that when I double-click on this scene, the slider jumps to a different position: 00:39:57:15 (frame 71925). I calculated that this difference has something to do with the drop frame setting: Scenarist takes timestamp of the scene and for some reason converts it into non-drop frame time code before moving the slider. In this case, it’s 29.97fps/30fps*71997=71925, so it moves the slider to the frame 71925 instead of 71997. The same remains true anywhere on the track.

Although I already made many DVDs with captured video in Scenarist, I just noticed this problem because I decided to add subtitles. Whether I load them using .sst script or type them in manually, they go out of sync. If a certain subtitle screen is set to appear at the scene start time in my example (00:39:59:27) according to its Start Time to Video property, it will in fact appear at the "drop frame adjusted" point (00:39:57:15). I read a number of threads about subtitles going out of sync and how it can be fixed by setting drop type to Drop Frame; however, I already import all my assets with drop frame. Of course I could adjust the timing in the .sst script, but I see a more global issue here. Although things work fine if I use non-drop frame format for everything, I want to get to the source of the problem, especially since it says everywhere that you should use drop frame for NTSC.

Does anyone have an idea, what causes this Scenarist behavior? Is it the video, Scenarist settings, or something else?

By the way, I also imported Line 21 closed captioning data with the same time codes as subtitles in the .sst script, and the closed captions stay in sync just fine. I don’t have any issues with audio either.

I already tried a few things without any success:
- Ran my .m2v through pulldown.exe like this:
pulldown source.m2v target.m2v -nopulldown -drop_frame true

As I understand, .m2v file has internal drop type flag, which pulldown supposed to be able to set. I couldn’t find a program to check this flag, and pulldown didn’t change anything.
- Ripped a video stream from some DVD movie to ensure that it’s not my .m2v file that’s causing a problem. However, Scenarist still behaved the same way when I added a scene.
- Checked in VobEdit that the VOB produced out of my video had the drop flag set to non-drop, but the VOBs of the DVD I ripped for testing had the drop flag enabled.

Appreciate any suggestions how to make Scenarist handle drop frame time codes correctly. Thanks in advance.

SomeJoe
18th March 2004, 21:16
You're running into two separate problems here:

1. The reason that a scene marker seems to "jump" to a different timecode is because scene/chapter markers (which by definition make a cell boundary), must occur on an MPEG-2 I-frame. Most probably, the GOP structure of your MPEG-2 file is a standard 3/5 pattern of 1 I-frame, 4 P-frames, and 10 B-frames: BBIBBPBBPBBPBBP. Thus, I frames only occur every 15 frames, on 15 frame boundaries. A scene boundary can't be placed at 00:39:59:27, so Scenarist picks the closest previous I-frame at 00:39:59:15.

Though it happens that 29.97fps/30fps*71997=71925, this is pure coincidence, and has nothing to do with the aforementioned behavior.

2. The second problem you're running into with subtitles not syncing could indeed be a drop-frame issue. You say your .m2v has a timecode of 00:39:59:27 at frame 71997 - this indicates that the embedded timecodes in your .m2v file are non-drop-frame. Frame 71997 equals SMPTE non-drop-frame timecode of 00:39:59:27, and SMPTE drop-frame timecode of 00;40;02;09. In order to make your subtitles sync, the timecodes in the .sst file need to be non-drop-frame also to match the .m2v. An alternative would be to make your .m2v file have drop-frame timecodes by running it through pulldown. You say you already did that, but try it again, because pulldown should definitely change the timecodes in the file.

Dimmer
19th March 2004, 12:41
SomeJoe, thank you very much for your comments.
Originally posted by SomeJoe
1. The reason that a scene marker seems to "jump" to a different timecode is because scene/chapter markers (which by definition make a cell boundary), must occur on an MPEG-2 I-frame. Most probably, the GOP structure of your MPEG-2 file is a standard 3/5 pattern of 1 I-frame, 4 P-frames, and 10 B-frames: BBIBBPBBPBBPBBP. Thus, I frames only occur every 15 frames, on 15 frame boundaries. A scene boundary can't be placed at 00:39:59:27, so Scenarist picks the closest previous I-frame at 00:39:59:15.I wish it was that simple. The scene has been created earlier at 00:39:59:27, so that’s already an I-frame. When I double click on it in Track editor, the slider jumps to 00:39:57:15, i.e. 72 frames (over 2 seconds) behind. As you guessed correctly, my GOP is 15 frames long. The new slider position isn’t even an I-frame: if I click New Scene button at this point, it creates a new scene at the nearest I-frame 00:39:57:12. I performed this test on different positions of the track, and the slider is always 0.1% (i.e. 1-29.97fps/30fps) behind a scene start time. For example, for a scene at 02:00:00:00 the difference increases to 216 frames.

You must be right that my .m2v has embedded non-drop frame time codes. It looks like for some reason when I double-click on a scene, Scenarist takes the Scene Time property, finds a frame within .m2v with exactly the same time code, and then positions the slider there. This causes the problem since the scene was created using drop frame time code, and in .m2v it’s a non-drop frame. Apparently, Scenarist applies the same rule to the subtitles. Although it was easy to sync them by performing frame rate conversion from 30fps to 29.97fps in MaestroSBT, but now the start time of each subtitle screen in the .sst file and the properties window doesn’t match the time in Simulation window and on finished DVD.

So the problem remains. If I can’t change Scenarist behavior, I need a tool to update time codes within .m2v file. I tried Pulldown and its GUI version DoPulldown with all possible options on three different samples: captured video, ripped from DVD, and encoded with TMPGEnc. Unfortunately, no luck, although pulldown fixed the start time the DVD movie from 1:00:00:00 to 00:00:00:00, so apparently it did something to the time codes.

I’m really interested if anyone could suggest a way to view and modify timecodes and drop frame flag in .m2v files. Hard to believe I’m the first one to notice this behavior on behalf of Scenarist.

SomeJoe
19th March 2004, 18:31
Originally posted by dimmer
SomeJoe, thank you very much for your comments.

I wish it was that simple. The scene has been created earlier at 00:39:59:27, so that’s already an I-frame. When I double click on it in Track editor, the slider jumps to 00:39:57:15, i.e. 72 frames (over 2 seconds) behind.


Ahh sooo ... :)

I didn't read carefully enough. Didn't see that the slider jumped >2 seconds behind, I thought it only jumped 12 frames because I was only looking at the frame counter.

OK, well, frame 71925 = SMPTE NDF 00:39:57:15 = SMPTE DF 00;39;59;27.

And, frame 71997 = SMPTE NDF 00:39:59:27 = SMPTE DF 00;40;02;09.

The first question is, is frame # 71925 the actual frame number where you want the scene to start? Or do you want the scene to start at frame 71997, 72 frames later? (I'm assuming you actually want it to start at 71997).

The second question is, refresh my memory on how you're creating the scene in Scenarist (I only use Scenarist rarely, so I forget). Are you typing in the timecode to create the scene, or reading the timecodes from a .scn file, or something else?

My guestimate on what is going on is that Scenarist assumes that your timecodes that you're inputting are drop-frame (perhaps because of the notation with semicolons? - this is what DVDMaestro does). Thus when it converts the timecodes to a frame number internally to mark the scene start, it calculates frame # 71925. If it knew your timecodes were NDF it would come up with frame # 71997 to mark the scene start.

You have a couple of alternatives. If Scenarist will actually recognize the semicolon/colon delimiters, then just change the delimiters in the file or in your input to colons vice semicolons. If Scenarist won't do this, and simply assumes all inputted timecodes are DF, then you'll need to convert all your timecodes to DF and create the scenes with those.

Dimmer
19th March 2004, 23:05
Originally posted by SomeJoe
OK, well, frame 71925 = SMPTE NDF 00:39:57:15 = SMPTE DF 00;39;59;27.

And, frame 71997 = SMPTE NDF 00:39:59:27 = SMPTE DF 00;40;02;09.

The first question is, is frame # 71925 the actual frame number where you want the scene to start? Or do you want the scene to start at frame 71997, 72 frames later? (I'm assuming you actually want it to start at 71997).

The second question is, refresh my memory on how you're creating the scene in Scenarist (I only use Scenarist rarely, so I forget). Are you typing in the timecode to create the scene, or reading the timecodes from a .scn file, or something else?You right, I want to start the scene at the frame #71997, but Scenarist for some reason performs conversion according to your first formula and moves the slider (i.e. current time code) 72 frames back to frame #71925. And this is the actual point where a cell/chapter starts on the finished DVD.

Scenes are created in Scenarist by typing the time code and pressing New Scene button. Alternatively, you can watch the video track in a preview window and press that button at the desired moment. Of course, there are some freeware utilities that allow importing chapter lists from a text file.

The important thing is that Scenarist doesn’t have any special drop frame notation such as semicolons. It only looks at the project settings at the time the video is imported. If the DF flag was set, Scenarist will use drop frame clock for the tracks created with such video. Therefore, in my case if I wanted to import a list of chapters, I could have converted the time codes to DF format, but location of the chapter breaks would have been different on the timeline and on the finished DVD. I already did the same for subtitles, and even though the disc plays fine, it’s very inconvenient to work with a project when a position of either subtitles or scenes on the timeline doesn’t correspond the time codes on the finished DVD. In this example as per your second equation, if I wanted the chapter to start at 00:39:59;27 by DVD player clock, I would have had to set the scene break at 00:40:02;09.

After a lot of search, I only found that in MPEG file each GOP header contains DF flag and time code for the first frame. So I’m still looking for software that could modify these values. Although pulldown supposed to be able to do this, but it doesn’t seem to work for me.

Thanks for your help.