Log in

View Full Version : DGIndex audio file names


vampiredom
4th October 2008, 03:18
Hi neuron2 (et al),

As I alluded to in another thread, I'm working on a Perl shell script for automating conversions via DGIndex. I took your advice and looked at the getbit.cpp file to see how the audio files were being names. I tried to break this down into REGEX-land. Perhaps you could check it out to see if I've screwed up or omitted anything:

(assuming you've some familiarity with Perl's REGEX)

# AAC
/^$prefix(?: PID [a-z0-9]{3})?(?: DELAY -?\d+ms)?\.aac$/

# MPA
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)? L[123] (?:2ch|mono) (?:44\.1|48|32) (?:\d{1,3}|free)(?: DELAY -?\d+ms)?\.mp[a123]$/

# AC3
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) \d[_\+]\dch \d{1,3}Kbps(?: DELAY -?\d+ms)?\.ac3$/

# DTS
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)(?: DELAY -?\d+ms)?\.dts$/

# PCM
/^$prefix PCM PID [a-z0-9A-Z]+(?: DELAY -?\d+ms)?\.pcm$/

# WAV
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) (?:\d[_\+]\d \d{1,3}Kbps|\d+K \d+bit \d+ch)\.wav$/

Guest
4th October 2008, 13:29
(assuming you've some familiarity with Perl's REGEX) Bad assumption, sorry.

vampiredom
4th October 2008, 23:06
That's cool. It seems to work -- at least for MPA and AC3 when "Demux All" is selected. From looking at the source code (given my cursory knowledge of C++) that different naming conventions are used based on the demuxing options, but so far what I have serves my purposes.

I'll continue to update the REGEXs above as I test things more (.dts, .pcm, etc.) should anybody else want to match the output files with regular expressions.

I did notive that, unlike DGIndex, DGAVCIndex includes the .dga prefix in the audio file names. Perhaps a more "universal" solution for me would be to set -OF="Project.d2v" in DGIndex -- then rename the project file back to "Project.d2v" (instead of Project.d2v.d2v) ?

Guest
5th October 2008, 00:49
I did notice that, unlike DGIndex, DGAVCIndex includes the .dga prefix in the audio file names. Really? That's not good. I'll have a look. I never noticed that. Do you mean from the CLI, or GUI, or both?

vampiredom
5th October 2008, 03:32
Do you mean from the CLI, or GUI, or both?

I don't know about the GUI, but it does this from the CLI.

It would actually be better if it kept the extension of the source file (in both DGavcIndex and DGIndex) so that multiple files...
filename.m2t
filename.m2ts
filename.mpeg

....would generate unique audio filenames, no?