Log in

View Full Version : scenchap.exe for Scenarist/ChapterXtractor


daxab
10th July 2002, 21:43
I think there already is a version of this tool, but I thought another flavor wouldn't hurt.

This is a small program that takes a Scenarist script and creates chapters in it. The chapters should be in a text file copied & pasted from ChapterXtractor. Example:

star_wars.chp:
Chapter 1 = 00:00:00:00
Chapter 2 = 00:09:38:93
Chapter 3 = 00:20:50:60
Chapter 4 = 00:30:49:46
Chapter 5 = 00:42:37:10
Chapter 6 = 00:51:38:33
Chapter 7 = 01:01:13:36
Chapter 8 = 01:10:00:30
Chapter 9 = 01:23:10:26
Chapter 10 = 01:32:17:13

scenchap star_wars.scp

This will update star_wars.scp (a Scenarist script) with the chapters given in star_wars.chp.

This works fine for my version of Scenarist. If you have trouble with this, it may be that your script format is different.

p3distxii
11th July 2002, 07:05
Anyone try it yet? Will try with the next movie I do. Thanks

daxab
11th July 2002, 22:18
Here's a new version. The previous version was a command-line script. This version is a normal app in a window.

Eyes`Only
11th July 2002, 23:11
Man, I can't wait to get home and try this! It doesnt modify any of the other parts of the script, correct? there were other versions of this but they always crashed my system because they used a prewritten script that was PAL based and had subtitle color all wrong...

daxab
11th July 2002, 23:44
Right. The Scenarist script is an XML-like text file (maybe it is XML) and it has an entry for each chapter ("scene" in Scenarist lingo). The program reads the script file, takes the first scene, and saves it. It deletes all scenes current in the script. Then it makes a new scene for each chapter from the chapter file, based on the saved scene info. In each new scene it changes the scene name and the scene start time but leaves everything exactly as they were in the first scene. Everything that is not a scene is also left unchanged.

This works if you have a single track. If you have multiple tracks, it will update the first track, and delete the scenes in other tracks. If this is a problem I can fix it, but for me, I just create my main track, add the chapters, and then add any other tracks I need.

It makes a new Scenarist script which you can then use with "New from script" to get back to where you were, but with all the chapters in place now. The original script is left as-is.

Eyes`Only
12th July 2002, 03:08
Very nice work, daxab. For a single pgc without subtitles, there's no problems. When I tried a .scp file that included subtitles, for some reason it failed on the import saying it couldn't find the sub graphics. But I simply removed the subs, exported, scenchap'd, imported, and readded the subs and all was fine.

If you could somehow make this work for multiple PGC you would be a godsend, I assure you. Obviously chapterxtractor doesnt do mult. chapters at one time, but we could cut and paste chapters from each pgc and manually enter in [PGC XXX] as a header before the start of each new PGC, if necessary. I've got tons of ideas of ways to make this work if you're interested, just let me know. We can do this!!!

p3distxii
12th July 2002, 03:13
I had trouble with this. Is this for an older version of Scenarist? The default file extension for Scenarist 2.6 is .scn, but this program needs an scp. I saved my project as an .scp, and the program patched it. However, when I launched the .scp, it just gave an error message and crashed scenarist. Any further help would be cool.

daxab
12th July 2002, 04:09
@Eyes`Only

I don't know what the subtitle problem was -- I've used it on a script with subtitles with no problem. It shouldn't touch anything but the scene (chapter) points. If you run into this again, send me the original and patched .scp files and I'll debug it. BTW, did you do "New from script" or "Import"? I've found that "Import" doesn't seem to work -- not sure why.

I've been thinking about multiple PGC support this afternoon. I think it can be done -- your [PGC xxx] idea is not bad. I'd also like to get around the need to run ChapterXtractor manually, but I'll save that for later.

@p3distxii

This should work with 2.6. It doesn't work on the .scn file -- you need to do an "Export" to a script, and then run it on the .scp file, and then do "New from script". Doing an "Import" doesn't seem to work.

p3distxii
12th July 2002, 06:46
Originally posted by daxab
@Eyes`Only

I don't know what the subtitle problem was -- I've used it on a script with subtitles with no problem. It shouldn't touch anything but the scene (chapter) points. If you run into this again, send me the original and patched .scp files and I'll debug it. BTW, did you do "New from script" or "Import"? I've found that "Import" doesn't seem to work -- not sure why.

I've been thinking about multiple PGC support this afternoon. I think it can be done -- your [PGC xxx] idea is not bad. I'd also like to get around the need to run ChapterXtractor manually, but I'll save that for later.

@p3distxii

This should work with 2.6. It doesn't work on the .scn file -- you need to do an "Export" to a script, and then run it on the .scp file, and then do "New from script". Doing an "Import" doesn't seem to work.

Cool.

Don't have a movie to try at the moment, but will give it a shot next time.

daxab
12th July 2002, 20:18
Okay, here's a new version.

1. Supports any number of tracks. Tracks are shown in separate tabs, with the current chapter points.

2. No chapter file. Instead, just launch ChapterXtractor and scenchap at the same time. Copy and paste from ChapterXtractor to scenchap.

3. A little more bulletproof.

4. Step-by-step instructions and some balloon help.

[Edit: Quick fix to display times using cents (1/100) to be compatible with ChapterXtractor.]

bluespot
13th July 2002, 15:35
daxlab, you rock!

I just manually set 50 chapters in Scenarist...I wish that I'd looked up here before I started! I've got another movie ready to bring into scenarist that I'll start as soon as this current one is done compiling. I'll let you know how it goes once I'm done. Thanks for putting this program together!

bluespot
13th July 2002, 17:09
Worked perfectly. Between scenchap and ifoupdate, this is almost getting too easy! Thanks again for the tool daxab.

Discoboy
14th July 2002, 19:39
Hi All,
Please can you help?
When I tried to use scanchap ver. 1.10 and after clicking on “Inset Chapter” I got the error “Error – unable to subtime in” I followed the info from the application main page.
I am using scenarist ver. 2.6 and this was my process flow:
- Start-up scenarist
- Drag and drop video and audio files in to the lower right hand side part of the first screen of scenarist.
- Drag and drop the video and audio files into the “track editor” page.
- “Export” project and close scenarist.
- Start-up scanchap and ChaptorXtractor. Copy and paste screen info into the track tab.
- Click on “insert Chapter” and get error.

Help to explain what I am doing wrong would be much appreciated.
:)

p3distxii
15th July 2002, 06:26
I got a little futher than Discoboy. I finished with ChapterXtracter and Scenchap and got my .scp file. When I start up scenarist, there is no option that says "New from Script" as the program states and as stated above, "Import" does not work. Please help me use this file.

Doom9
15th July 2002, 17:30
what does the "unable to sub time in" error mean? my scenarist project doesn't even have subtitles at the moment.

daxab
15th July 2002, 20:52
Hi folks, if anyone can send me a .scp file that causes the "unable to sub time in" error, I'll try to fix it today. Thanks.

@Doom9

"unable to sub time in" means the program couldn't find a time string, like this: 00:00:00:00 (but with 0-9 for the digits) in the .scp file where it thought there should be one. The message is cryptic because I didn't think it would ever really happen. I need to get a copy of one of the scripts that is causing this problem and then I'll try to fix the program. I never see this myself.

One thing that can go wrong is the user might not have defined any tracks yet. It needs at least one track, and that track needs at least one video asset in it. I should warn more intelligently about that.

@p3distxii

When you launch Scenarist the "Project Manager" window should have a button at the bottom "New from Script". I've tried using "Import" menu item and it didn't work for me -- I'm not sure why. Are you running 2.6?

@DiscoBoy

I think you and Doom9 have hit the same bug. If you can send me the .scp file that is causing problems I will take a look today.

Doom9
15th July 2002, 21:32
well.. I have one track.. it's not linked in the scenario editor though.. I tried having only one track with one video asset, one track with video asset and multiple audio tracks, and video and subs.. it was all a nogo. as you requested here's my scenarist script.

Discoboy
15th July 2002, 21:36
@daxab
As requested please find attached:

p3distxii
15th July 2002, 22:07
Cooooooooooooooooooool!

I got it to work and it works damn perfect!

Excellent program! I did this manually on Scarface (2hr 40min) and it took me about 30 minutes. This took less than a minute. Did you write this program, Daxab? If so be the case then God bless your soul. You have saved me sooooo much time.

Doom9
15th July 2002, 22:10
btw.. while we're at it.. since I couldn't get scenchap to work on my project I added the chapters manually.. and I used the following preset in chapterXtractor: %hh:%mm:%ss;%ff. I also used eyes' chapter trick for cce and copying and pasting the chapter positions in scenarist they matched perfectly in every instance.. dunno if this is just because the project is pal but maybe it would be best to accept the input in that format since it already perfectly matches the chapter positions (provided you also forced the appropriate i-frames in cce).

daxab
15th July 2002, 22:36
Will do. I looked for the %ff flag but I didn't find it. I had an old version of chapterXtractor. I see it now in 0.961. I'll look for either

%hh:%mm:%ss;%ff

or

%hh:%mm:%ss:%cc

or

%hh:%mm:%ss.%cc

BTW I noticed that %ff has a bug. It looks like it's doing the math wrong, because sometimes (for 24fps) it's getting frame number 24, when they can only run from 0..23. Same for other frame rates. I can try to work around this in my code.

(I'm actually having trouble getting the chapters to match exactly. I use the copy/paste/chapter=%f: method on the .ecl file, but everything is off a little. It's an NTSC movie that I've done force film on, but I don't see how that would throw things off, and if it did, it should only be a frame or two. I'm still scratching my head on this.)

Doom9
15th July 2002, 23:01
I guess ntsc is a bit more complicated but maybe chapterxtractor doesn't properly output it for ntsc.. the author lives in france and most likely uses pal titles to test.. maybe we can sponsor some ntsc titles to get that working properly, too. any ideas on our problems?

daxab
16th July 2002, 00:57
Here is another version that should fix the problem Doom9 and Discoboy were seeing. Version 1.10 didn't support PAL and didn't recognize the Drop Frame time stamps. Thanks to Doom9 and Discoboy for the .scp files.

Changes since 1.10:
- Detects (and shows) video type of the .scp file as NTSC or PAL
- Automatically uses either NTSC or PAL frame counts in .scp file
- Supports both Drop Frame and Non-Drop Frame .scp times
- Supports %hh:%mm:%ss;%ff (frames) ChapterXtractor format. If you use this, make sure you choose the right FPS Rate first.
- Supports %hh:%mm:%ss.%cc (cents) ChapterXtractor format

Doom9
16th July 2002, 16:20
as it happens I have to reencode my m2v :( and I'll be doing some renaming of the sources so that my scenarist project will look nicer (working on a guide once more ;) so as soon as my encoding session is done I'll give the new version a shot.

Discoboy
16th July 2002, 17:41
@daxab
Version 1.11 now works damn perfect on my PAL project!
Thanks for a great prog as it has saved me so much time with regards to a 35 chapter project.:D

Doom9
16th July 2002, 20:17
works here, too. Maybe you should mention that you also have to set a projectname when you create the new project from the script.. took me a couple of tries to find that one out :/

Discoboy
16th July 2002, 23:31
Had the same prob too, as you can’t use the same project name but have to start a new one. So I just added “chap” to the end of my project name to distinguish it from the original one that I exported the script file from.

Doom9
17th July 2002, 00:08
btw... a tip about the built-in help.. if you work together with ifoupdate you should not check the cells that are not checked by default (in chapterxtractor) or ifoupdate will bomb and you have to re-author your project again

bluespot
17th July 2002, 01:08
So if you use IFOUpdate, you don't need to worry about getting an identical chapter/cell structure? You only need to worry about having the same chapters, and the cell count dosen't matter. So you can just forget about the cells that are not checked by default in ChapteXtractor. You don't have to include them between the real chapters, and you don't have to go back and turn them into linked cells in the Scenario Editor???

That would be a nice time saver...please let me know if I've read everything correctly!

Thanks

jdobbs
17th July 2002, 01:17
In every movie that I've backed up so far (single and multiple PGC) I ignored the original cell count and the newly authored file has a one-to-one relationship between cells and chapters.

The thing you have to be careful about in IFOUpdate is ensuring you the chapters match. It can make the PGC area too big to fit in the original file's allocated space if you add more. It can also make the scene selection menus to be off if you create fewer.

jdobbs

daxab
17th July 2002, 07:51
if you work together with ifoupdate you should not check the cells that are not checked by default (in chapterxtractor)

Thanks for the tip -- I didn't know that. I'll update the help to that effect when I do my next rev.

Eyes`Only
13th August 2002, 07:25
Daxab,

I think if anyone can help us with a certain issue it would be you, so if you don't mind a request here goes:

It has been pointed out time and time again that the chapters set in Scenarist never correspond to the actual chapters in the original movie. After diagnosing this, I've found a formula which appears to get the chapters closer, if not exact (sometimes they're still a frame off, go figure!). I'll quote my posting from the ifoedit-cce thread--

I've found a solution to this issue. Here's an example of what I do. Say the chapter is at (00:10:10:15). Set that scene in Scenarist. Double click on the scene that was just created. You will notice the top left timebox changes to a time that is slightly less than the time you set. In this example, that time is now (00:10:05.05). Now subtract this timebox from the time you original entered. ex. (00:10:10.15)-(00:10:05.05) = (00:00:05.10). Add this result to the time in the scene you set (00:10:10.15)+(00:00:05.10)=(00:10:15.25). Now change the scene you set to that result. ex. Change (00:10:10.15) to (00:10:15.25). The scene should now be exactly where the chapter on the original movie is. I've verified this by opening the movie in PowerDVD, playing it, pausing it, then using the 'next chapter' button and looking at the starting image for each chapter, and they match exactly using my method. Not sure if it works for PAL users, or if you even have this problem, but for NTSC it seems to correct the issue!

So anyways, this seems to work. The question is, with all of your knowledge of Scenarist, can you figure out where these 'new times' are coming from, and/or the formula for calculating them? If so, a program could be devised that could correct Scenarist chapters automatically, I would think. As of currently though, no one seems to know why the times are tweaked, or what a formula could be to determine what they are tweaked to. By the end of the movie, chapters can be up to 7 seconds off!

Thanks,

Eyes`Only

daxab
15th August 2002, 08:05
Eyes`Only,

I think use of D2F-based chapter positions and ScenChap-generated scripts may fix this. That's certainly the goal, at least.

Your procedure is interesting. If Scenarist is doing a non-drop to drop frame conversion (or vice-versa) then the time code will shift by some delta X. If you then adjust by X in the other direction, you will end up getting the desired time code. Actually I bet that's it -- time codes in the IFO are non-drop, and Scenarist (for NTSC) wants a drop time code, so perhaps you are doing a manual adjustment of non-drop to drop. The math would tend to be off, but then it gets snapped to a GOP boundary and it becomes exact.

But I'm lazy -- after manually entering the scenes once or twice I couldn't take it anymore. I've gotten what I think is 100% exact (to the frame) chapter positioning by strictly following this procedure (a small variation on the Doom9 CCE/DVD guide):

1. Launch ScenChap. Load up the IFO. Load up the D2F. The D2F was created by DVD2AVI+frm when the latter was run over the VOB files. ScenChap should match up the IFO and D2F and tell you.
2. Before encoding in CCE -- before even the first VAF creation pass -- set the chapter points by pasting the text from ScenChap (the D2F tab, near the bottom) into the .ECL file.
3. Do the usual thing with Scenarist, and export to a .SCP script.
4. Use ScenChap (still open) and click Copy From D2F+IFO.
5. Launch Scenarist again and continue with Doom9's standard procedure, creating a new project from the "*-chap.scp" script that ScenChap created.

This is for NTSC stuff, both Force Film and Interlaced, and should work for PAL too (I haven't heard otherwise). The combination of DVD2AVI, bad timing data in some IFOs, minor bugs in ChapterXtractor time codes, drop vs. non-drop, are all compensated for.

The ultimate thing you want is the exact GOP I-frame position at the start of a new vob cell, as DVD2AVI is going to emit it. DVD2AVI can do weird things with VOB files that are not 100% pure film. Most things I've seen are not 100% film. Using a D2F file gets around this, because it knows the frame that DVD2AVI is actually going to emit to CCE.

Using ScenChap to emit the script should fix up the drop vs. non-drop problems and do the right math to convert the frame number to exactly the time code that Scenarist wants.

Anyway, I've gotten some really nasty DVDs to match up to the frame with this procedure (R1 Harry Potter and R1 Amelie). Since then I've used this with everything, and spot checks have so far shown the chapters to be right on.

Eyes`Only
14th December 2002, 22:37
Daxab,

I've enjoyed months and months of using your program with pleasure. I have but two requests to add to scenchap:

Can you include a mode where it makes a chapter for all cells, regardless of whether they are chapters in the original? It would be extremely helpful for seamless branching titles. As of now, I just take the list from the output your program does from .ifo file, copy/paste that into the pgc tab, delete everything on each line except the timecode, and then create a new file. This gives me a chapter for each cell, however it's very time-consuming. Could we automate it?

Also, we could really use a "VOBID MODE" where it assigns chapters from each vobid.. some vobids have 3 chapters when we demux them, and we have no way of adding chapters to it, especially since they need to be offset.

Thanks,

Eyes`Only

TRILIGHT
20th December 2002, 23:41
I too would like to add to Eyes`Only's request. It would be very helpful for dealing with some of the more complex titles. Thank you for all of the work you've done on ScenChap, Daxab!! It's come a long way and I don't know where I'd be without it!!