MediaArea / RAWcooked

Encodes RAW audio-visual data into the Matroska container (MKV), using the video codec FFV1 for the image and audio codec FLAC for the sound.
https://mediaarea.net/RAWcooked
BSD 2-Clause "Simplified" License
42 stars 11 forks source link

dpx folder name when converting MKV --> DPX #381

Open dlasusa opened 2 years ago

dlasusa commented 2 years ago

Hi all,

I've notice when converting an MKV file (encoded with RawCooked) to DPX files (also using RawCooked). If I point the output for example to C:\temp RawCooked will put the dpx files in a subfolder (based on what looks like the folder the original dpx files were in).
I assume this is stored in the reversibility data attachment in the mkv?

If so, is there a way to parse the stream?

I found with ffmpeg I can create a file which I think contains the data...

ffmpeg.exe -dump_attachment:t:0 out.txt -i .\test2.mkv

I can open the file in hex editor, but it's not very easy parse.

All I'm really after is the name of the folder RawCooked plans to create, so if there is another/better way to access that info, it would be super helpful! Or...is there a way to pull that out of the reversibility attachment?

Thanks!

JeromeMartinez commented 2 years ago

If so, is there a way to parse the stream?

MediaInfo trace feature (" --Details") is able to show the content of the RAWcooked reversibility file, either the MKV file or the extracted attachment, see below. We need to show this information in rawcooked --info, will do.

Would an option for removing the top folder during extraction be useful? If so, please fill another issue (I reserve this one for rawcooked --info).

00185   AttachedFile (245 bytes)
00185    Header (4 bytes)
00185     Name:                               8615 (0x21A7)
00187     Size:                               241 (0x00F1)
00189    FileName - RAWcooked reversibility data (31 bytes)
00189     Header (3 bytes)
00189      Name:                              1646 (0x066E)
0018B      Size:                              28 (0x1C)
0018C     Data:                               RAWcooked reversibility data
001A8    FileMimeType - application/octet-stream (27 bytes)
001A8     Header (3 bytes)
001A8      Name:                              1632 (0x0660)
001AA      Size:                              24 (0x18)
001AB     Data:                               application/octet-stream
001C3    FileData (172 bytes)
001C3     Header (4 bytes)
001C3      Name:                              1628 (0x065C)
001C5      Size:                              168 (0x00A8)
00000     EBML (25 bytes)
00000      Header (5 bytes)
00000       Name:                             172351395 (0xA45DFA3)
00004       Size:                             20 (0x14)
00005      DocType - rawcooked (12 bytes)
00005       Header (3 bytes)
00005        Name:                            642 (0x0282)
00007        Size:                            9 (0x09)
00008       Data:                             rawcooked
00011      DocTypeVersion - 1 (0x1) (4 bytes)
00011       Header (3 bytes)
00011        Name:                            647 (0x0287)
00013        Size:                            1 (0x01)
00014       Data:                             1 (0x01)
00015      DocTypeReadVersion - 1 (0x1) (4 bytes)
00015       Header (3 bytes)
00015        Name:                            645 (0x0285)
00017        Size:                            1 (0x01)
00018       Data:                             1 (0x01)
00019     RawcookedSegment (22 bytes)
00019      Header (4 bytes)
00019       Name:                             29299 (0x007273)
0001C       Size:                             18 (0x12)
0001D      LibraryName (11 bytes)
0001D       Header (2 bytes)
0001D        Name:                            112 (0x70)
0001E        Size:                            9 (0x09)
0001F       LibraryName:                      RAWcooked
00028      LibraryVersion (7 bytes)
00028       Header (2 bytes)
00028        Name:                            113 (0x71)
00029        Size:                            5 (0x05)
0002A       LibraryVersion:                   21.01
0002F     RawcookedTrack (121 bytes)
0002F      Header (4 bytes)
0002F       Name:                             29300 (0x007274)
00032       Size:                             117 (0x75)
00033      FileName (12 bytes)
00033       Header (2 bytes)
00033        Name:                            16 (0x10)
00034        Size:                            10 (0x0A)
00035       Size:                             0 (0x00)
00036       Data:                             32/32.wav
0003F      BeforeData (105 bytes)
0003F       Header (2 bytes)
0003F        Name:                            1 (0x01)
00040        Size:                            103 (0x67)
00041       Size:                             102 (0x66)
00042       Compressed data:                  (102 bytes)
00000       WAVE (12 bytes)
00000        Header (12 bytes)
00000         Name:                           RIFF
00004         Size:                           960094 (0x000EA65E)
00008         Real Name:                      WAVE
00000       Wave (0 bytes)
0000C        Stream format - Audio (48 bytes)
0000C         Header (8 bytes)
0000C          Name:                          fmt 
00010          Size:                          40 (0x00000028)
00014         FormatTag:                      65534 (0xFFFE)
00016         Channels:                       1 (0x0001)
00018         SamplesPerSec:                  48000 (0x0000BB80)
0001C         AvgBytesPerSec:                 192000 (0x0002EE00)
00020         BlockAlign:                     4 (0x0004)
00022         BitsPerSample:                  32 (0x0020)
00024         cbSize:                         22 (0x0016)
00026         ValidBitsPerSample / SamplesPerBlock: 32 (0x0020)
00028         ChannelMask:                    4 (0x00000004)
0002C         SubFormat:                      00000001-0000-0010-8000-00AA00389B71
0003C        Tags (34 bytes)
0003C         Header (12 bytes)
0003C          Name:                          LIST
00040          Size:                          26 (0x0000001A)
00044          Real Name:                     INFO
00048         Encoded_Application - Lavf59.3.100 (22 bytes)
00048          Header (8 bytes)
00048           Name:                         ISFT
0004C           Size:                         13 (0x0000000D)
00050          Value:                         Lavf59.3.100
0005D          Alignement:                    (1 bytes)
0005E        Raw datas (8 bytes)
0005E         Header (8 bytes)
0005E          Name:                          data
00062          Size:                          960000 (0x000EA600)
dlasusa commented 2 years ago

Hi @JeromeMartinez Thanks so much for the reply. Perhaps I'm calling MediaInfo incorrectly, but when I try to use the --details option on an .mkv file (created by rawcooked), it simply opens a blank MediaInfo gui window. Attaching a screenshot of what I tried to make sure I'm not missing something super simple and that I'm using the option correctly?

Screenshot 2022-09-16 072717

I do think showing the information via rawcooked --info would be a useful feature so it's available via a single tool.

For my current purposes, as long as I can identify the folder, I personally don't need an option for removing the top folder during extraction. That said, I think it could be a useful addition to have better (more expected) control of where the files are going when running rawcooked in a programmatic fashion. I'll open an issue like you suggested for easier tracking.

Thanks!!

JeromeMartinez commented 2 years ago

MediaInfo gui window

You are trying with the GUI version, please download and use the CLI (command line interface) version for the option. With the GUI, menu debug, "details - 10" line, and open a file.

dlasusa commented 2 years ago

ah! Works perfectly now! Thank you!! I'm going to leave this open for the rawcooked --info enhancement.