demultiplexing Electronic Arts TGV videos

Codecs, formats, encoding/decoding of game audio, video and music
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

demultiplexing Electronic Arts TGV videos

Post by AlphaTwentyThree »

Hi fellows!
I've just written a script to extract the audio stream from those 90s TGV vides from EA. Everything works fine but the documentation of the audio format isn't clear enough to me: http://wiki.multimedia.cx/index.php?tit ... _Arts_1SNx. I suppose that the format doesn't require the 1SNd header (8 bytes) but then, why is it stated in the headlines in the article? I've tested both versions but obviously I don't know which extension to use for vgmstream to play these files.
Now, here are some TGV samples: http://*USE_ANOTHER_FILEHOSTING*/01d608f ... a98/TGV.7z
And here's my script:

Code: Select all

idstring "1SNh"
get SIZE_HEADER long # audio header
savepos OFFSET
math SIZE_HEADER -= 8
append
log MEMORY_FILE OFFSET SIZE_HEADER
append
math OFFSET += SIZE_HEADER
for i = 1
   goto OFFSET
   getDstring IDENT 3
   get MARKER byte
   get SIZE long
   savepos OFFSET
   math SIZE -= 8
   if IDENT == "1SN"
      append
      log MEMORY_FILE OFFSET SIZE
      append
   endif
   if MARKER == 0x65
      callfunction wrapup 1
   endif
   math OFFSET += SIZE
next i
startfunction wrapup
   get SIZE asize MEMORY_FILE
   get NAME basename
   string NAME += ".aud"
   log NAME 0 SIZE MEMORY_FILE
   cleanexit
endfunction

This version of the script writes the audio data with the "EACS" header and the plain data without the block headers. Does anyone know which extension I'll have to use to play these files?

Thanks for your help!
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: demultiplexing Electronic Arts TGV videos

Post by AlphaTwentyThree »

aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: demultiplexing Electronic Arts TGV videos

Post by aluigi »

Apparently there is not a fixed extension (http://www.extractor.ru/articles/electr ... escription the link inside your last one).

In ffmpeg there is the codec but no information about the extension.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: demultiplexing Electronic Arts TGV videos

Post by AlphaTwentyThree »

The documentation from above shows that my alternative extraction is correct.

Here's my second script. Everythig should be fine but the file isn't playable or decodable with anything I have.

Code: Select all

idstring "1SNh"
get SIZE_HEADER long # audio header
append
log MEMORY_FILE 0 SIZE_HEADER
append
math OFFSET += SIZE_HEADER
for i = 1
   goto OFFSET
   getDstring IDENT 3
   get MARKER byte
   get SIZE long
   if IDENT == "1SN"
      append
      log MEMORY_FILE OFFSET SIZE
      append
   endif
   if MARKER == 0x65
      callfunction wrapup 1
   endif
   math OFFSET += SIZE
next i
startfunction wrapup
   get SIZE asize MEMORY_FILE
   get NAME basename
   string NAME += ".as4"
   log NAME 0 SIZE MEMORY_FILE
   cleanexit
endfunction

Can somebody check if the resulting audio file is consistent with the documentation? That would be great! :)
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: demultiplexing Electronic Arts TGV videos

Post by AlphaTwentyThree »

Can somebody check if ffmpeg can decode these as4 files?