Log in

View Full Version : PgcEditPreview INI file and CLI arguments - *unleashed*


CirTap
24th September 2005, 21:20
for the impatient interested in the naked truth only: here are the links to jeanl' and r0lz' posts in this thread INI file (http://forum.doom9.org/showthread.php?p=716207#post716207) CLI arguments (http://forum.doom9.org/showthread.php?p=716265#post716265)

Hi,

jeanl, I think this is yours :)

I was playing a little with PgcEditPreview, misusing(?) it as a small, quick, and handy VOB viewer outside of PgcEdit. The INI file written by PgcEdit for preview drag my attention, and now I'm wondering about a few values that happen to do "nothing", no matter what I put. In particular: CellNumber = any number
AutoLocate = any number , seems to default to 500
SleepOnSingleFrame = any number , seems to default to 3000
here's a full length file I tweaked to play with
[PgcEditPreview]
VOBFileName = E:\VCR\4400\VOBs\VIDEO_TS.VOB
NumCells = 6
DAR = 16
Scale = 50
PGCTitle = Foo bar - actually just a string
DefaultFileName = E:\VCR\4400\PgcEditPreview.ini
CellNumber = 0
StartPlay = 0
AutoLocate = 500
NoOverlay = 0
AutoQuit = false
SleepOnSingleFrame = 3000
ThisID = 7456

[CellStartEnds]
1=0 290
2=291 824
3=825 1317
4=1318 1859
5=1860 2430
6=2431 2758
as a matter of fact, the VMGM shown has only one cell, but I changed "NumCells=6" and added some offsets to [CellStartEnds], so I can step to certain points in this particular VOB using the cell +/- buttons -- which did actually work to my surprise :D

I'm also wondering if I can tell the programm to jump to a particular cell (offset). I thought "CellNumber" or "AutoLocate" could do this, but the former seem to be informational only when previewing a single cell from within PgcEdit (Cells = 1, CellNumber = 5)
The reason why I'm asking is that I'm looking for a tool to batch-capture images from specific frames of a VOB. I'm aware that PgcEditPreview isn't ment for that, but maybe it has more abilities that aren't that obvious? <g>
like are there any secret command line arguments apart from the ini file?

Thanks for any clarification.

Have fun,
CirTap

r0lZ
24th September 2005, 22:13
The AutoLocate option has been added by jeanl as a workaround for a problem with the original DVD2AVI code.
In some cases, the last packs of a cell are all only audio or nav packs. For example, it's the case of a still frame + audio.
When you ask to display a frame which is not at the beginning of the cell, the original DVD2AVI code jumps to the next frame available, even if that frame is not in the same cell. Unfortunately, there is no way to know by analyzing the IFO if a cell is a still frame or an animated video. As a consequence, sometimes, the preview showed a bad frame. It's especially unacceptable when the preview is used to generate a BMP as a background for the menu viewer.
Jeanl has added a check for the VOB/Cell ID, and, if the cell is not the right one, the preview go back the number of sectors specified in the AutoLocate argument. At this point, it tries to reload the next frame again. If the frame is still in a bad cell, it return to the beginning of the good cell.
The AutoLocate argument has been added to fine tune the value, to have a good compromise between speed and efficiency. After some tests, I have hardcoded that value at 500.
Anyway, for what you want to do, you should not change this value.

You should use the menu button viewer, and play with the Next and Prev frame arrow buttons. In this case, the INI file is different, and is more suitable for what you want to do. You should be able to save a BMP with any keyframe in the cell.

CirTap
25th September 2005, 01:36
ok, I'll checkout the INI format from the menu button viewer to see the difference.
I thought of using this nice little app outside of PgcEdit in a batch script and screen-capture the frame it display but not by me clicking the BMP button but a "regular" screen capture proggy, hence I was curious about the numbers and their effect in order to locate the frame(s) in question.
However, it'd be cool if PgcEditPreview had a CLI argument/INI setting that would allow creating a BMP from the currently shown frame automagically :-)

I'll see if I can tweak this to my needs.
Thanks for insight.

Have fun,
CirTap

r0lZ
25th September 2005, 03:00
However, it'd be cool if PgcEditPreview had a CLI argument/INI setting that would allow creating a BMP from the currently shown frame automagically :-)It's exactly what it does in 'menu button viewer mode', except that the GUI is not opened at all, so, you cannot see the image.

CirTap
25th September 2005, 23:46
d'accord, main enfin ...
I can't find any big difference except that it reports the no. and values of a single cell, like it does in the "normal" PGC-Editor preview when I click on any VID/CID button for preview. There are of course the cell's offsets that differ (as expected) -- or am I overlooking anything in particular? [PgcEditPreview]
...
NumCells = 1
...
CellNumber = ##
[CellStartEnds]
1=#### ####
what I was dreaming of was the automagic generation of BMP files just as if I had pressed cell [+] - BMP - [+] - BMP [+] ... (kinda tedious).
based on the INI settings or taking some basename (from CLI) for the bitmaps and create these BMPs itself for as many cells listed in [CellStartEnds] (6 in my example file above)
However, as mention in my initial post, I was thinking of writing a batch/script to run PgcEditPreview with different INIs and take screenshots from its window, but then I figured it would be easier if I'd create a small AVS, load a D2V, and have ImageWriter do the job. And the pix would be more "original" than a screenshot.
The inital idea was to get a bunch of thumbnails as a visual aid in the documentation of a pretty scary DVD project I'm working on :)

Anyway, it would have make a nice goodie-feature for PgcEditPreview since it already knows how to write BMPs ;-) <hint>

Have fun,
CirTap

CirTap
26th September 2005, 00:21
I noticed a little misbehaviour in the BMP save routine: if the filename already has the suffix .bmp, a second .bmp is added:
foobar.bmp => foobar.bmp.bmp
this quickly happens if you want to overwrite an existing file, but then get a second one with the duplicated extension.

Have fun,
CirTap

jeanl
26th September 2005, 04:14
yeah, if there's already an extension, pgceditpreview does not check that, and adds one to it (pretty dumb!). From the readme.txt file from the sources, here's the explanation for all the options (which you probably already figured out!)

- NumCells indicates half the length of CellStartEnds.
- CellStartEnds contains the LBA (sectors) of the start and ends of cells
which enable PgcEditPreview to take you to any cell in the PGG.
- DAR is the aspect ratio. 4 is 4/3, 16 is 16/9.
- Scale is in percent and should be between 0 and 150.
- PGCTitle will be the title of the window.
- DefaultFileName contains the path to the file where PgcEditPreview stores
its defaults (window position etc)
- CellNnumber is only used if NumCells is 1, and indicates which cell we're
looking at.
- StartPlay =1 means playback starts upon launch.
- AutoLocate is used to locate accurately the beginning and end LBAs of all
the cells.
- NoOverlay = 1 indicates the overlay buffer shouldn't be used.
- AutoQuit = 1 means the preview quits when playback finishes.
- BlankString is the string that will be displayed by the "blank" check box. If
"", no check box.
- BlankIsChecked is the default state of the check box.
- SleepOnSingleFrame is the number of ms preview waits before quitting (if
AutoQuit is 1) if there's just 1 cell.
- ThisID should be a unique identifyer for the instance of the calling program.
If the calling program launches a second instance of PgcEditPreview,
the new instance of pgceditpreview will broadcast a message telling all
other instances of PgcEditPreview to kill themselves, as long as they have
the same ThisID. The idea is that this way you can kill the previous instance
of the preview simply by launching a new one. Also, this ensures that you can
have 2 instances of the caller program and they won't kill each other's
previews...
- KillSelf = 1 indicates that the new instance of PgcEdit should tell the
previous one to shut down, then kill itself. This is what PgcEdit uses when it
quits, to make sure that any PgcEditPreview instance also quits with it...

jeanl

Taelon
26th September 2005, 09:01
yeah, if there's already an extension, pgceditpreview does not check that, and adds one to it (pretty dumb!). [code]
Tends to drive me a little crazy at times, especially after the 3rd or 4th screen capture.

r0lZ
26th September 2005, 09:45
Sorry, I was not clear in my mind!
When used to save a BMP, the preview is called with a command line. The INI file is not used.

Syntax:
PgcEdit_preview "VOBfile.VOB" LBA VOB_ID Cell_ID Number_of_buttons X_resize_factor Y_resize_factor bool_save_as_PPM_instead_of_BMP "outfile.[bmp|ppm]"

Where VOB_ID, Cell_ID and Number_of_buttons are used to check if the right nav pack is passed in argument. -1 disables the check for that particular option.

Example: PgcEdit_preview VIDEO_TS.VOB 3425 -1 -1 -1 1.0 1.0 0 "test.bmp"

Note that you can read the command line used by PgcEdit in the console window, if debug mode is enabled. Open the console (Control-middle-double-click on the "PGC" menu button in the main window), and type "set ::config(debug) 1", then open the menu button viewer. You should see the command. Alternatively, you may want to use the debug plugin (currently in the beta folder (http://www.videohelp.com/~r0lZ/pgcedit/beta/) on my homepage.)

CirTap
26th September 2005, 15:09
wow! so much information about this little "helper" :-)
Do you have any idea how incredibly useful this feature is? I've been googling for days to find anything flexible -- and small! -- like this.
Maybe some of this is considered "legacy knowledge" for those who know the ancestor and origins of this tool, but for my father's son (and possibly any/most new user) this is some very valuable, and brand new information!
@jeanl: thanks a bunch for sharing this list; most users (hence this distinct term) don't bother to d/l or look at the sources, and thus never find out *)
@r0lz: you were right (initially), it's exactly what I was looking for :-)
although D2V/AVS would work, it would have been an extra (tedious) step creating D2Vs and scripts (though automated) for intermediate or temporary files only, such that don't really make it to the final DVD, like mini-VOBs from MuxMan or VobEdit to feed VobBlanker etc. pp.
@jsoto: in case you're reading this: I started to "reverse engineer" VobBlanker.ini ;)

@r0lz: do you mind if I write this down for the "appendix"? <g>

Thanks a lot guys!

Have fun,
CirTap

*) I'm aware that publishing this kind of "internal" feature may lead to people (like me) using them, and then complain if future updates cause a BC break :)

r0lZ
26th September 2005, 16:40
@r0lz: do you mind if I write this down for the "appendix"? <g>Of course you can! The information is publicly available (though not easily ;))

jeanl
26th September 2005, 16:44
CirTap,
I'm glad you find these command-line options useful! We only put them there because that was the only way PgcEdit could "talk" to the preview... I didn't really think people would find that useful, but see, I was wrong!
jeanl

CirTap
26th September 2005, 16:58
now that the "secrets" are revealed, let's see what other users do with that :D
I changed the thread title to reflect the additiional information the both of you kindly provided.

Keep up your excellent work!

Have fun,
CirTap

jeanl
26th September 2005, 16:59
:D nice title!
jeanl