[File] [PATCH] of Magdir/riff forTrID defs *.trd+ MIDI Stream *.mds+ extensions

Jörg Jenderek joerg.jen.der.ek at gmx.net
Tue Jul 14 07:10:05 UTC 2020


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some days ago i handled some RIFF based video files. When i run
file command version 5.39 on more RIFF based samples i get a
correct output like:

8ball1.rmi:                          RIFF (little-endian) data,
				     MIDI
AQUA.MMM:                            RIFF (little-endian) data,
				     multimedia movie
BBALL.MMM:                           RIFF (little-endian) data,
				     multimedia movie
dracula.4xm:                         RIFF (little-endian) data,
				     4X Movie file
sample.dat:                          RIFF (little-endian) data,
				     wrapped MPEG-1 (CDXA)
sample.mpg:                          RIFF (little-endian) data,
				     wrapped MPEG-1 (CDXA)
Shakira - Hips Don't Lie.amv:        RIFF (little-endian) data,
				     AMV
TABB4.MDS:                           RIFF (little-endian) data
tada.wav:                            RIFF (little-endian) data,
				     WAVE audio, Microsoft PCM,
				     16 bit, stereo 44100 Hz
test-noid3.mpr:                      RIFF (little-endian) data,
				     WAVE audio, MPEG Layer 3,
				     stereo 44100 Hz
test.webp:                           RIFF (little-endian) data,
				     Web/P image
TestRFIB.rdi:                        RIFF (little-endian) data,
				     device-independent bitmap
TestRMP3.txt:                        RIFF (little-endian) data,
				     MPEG Layer 3 audio
The Black Eyed Peas - Pump It.amv:   RIFF (little-endian) data,
				     AMV
TimeGatep01s01n01a02_2.4xm:          RIFF (little-endian) data,
				     4X Movie file
Toy-Story2_better-image-quality.4xa: RIFF (little-endian) data,
				     4X Movie file
triddefs.trd:                        RIFF (little-endian) data
Unison.SF2:                          RIFF (little-endian) data
				     SoundFont/Bank

All samples are at least general described by Magdir/riff with line
 0	string		RIFF		RIFF (little-endian) data
but with --extension option only ??? is displayed. Furthermore with
- -i option for many samples only generic application/octet-stream is
shown.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This list the used
file name extension and often with -v option the related URL
pointing to used file format information.

So i add this information to Magdir/riff. For example AQUA.MMM with
the RIFF Multimedia Movie File format i add at corresponding
position a comment line like
 # URL:	http://fileformats.archiveteam.org/wiki/RIFF_Multimedia_Movie
After the identifying line i now show file name extension by
additional line like
 !:ext	mmm
If no mime type is mentioned on corresponding website i add a
meaningful user defined mime type. For the MMM-sample this
information is shown by additional line like
 !:mime	video/x-mmm
Then i repeat this procedure for all other inspected RIFF examples
if information is available.

After applying the above mentioned modifications by patch
file-5.39-riff-else.diff then for other riff samples with
- --extension option now i get output like:

8ball1.rmi:                          rmi
AQUA.MMM:                            mmm
BBALL.MMM:                           mmm
dracula.4xm:                         4xm/4xa
sample.dat:                          mpg/dat
sample.mpg:                          mpg/dat
Shakira - Hips Don't Lie.amv:        amv
TABB4.MDS:                           mds
tada.wav:                            wav/wave
test-noid3.mpr:                      wav/wave
test.webp:                           webp
TestRFIB.rdi:                        rdi/dib
TestRMP3.txt:                        ???
The Black Eyed Peas - Pump It.amv:   amv
TimeGatep01s01n01a02_2.4xm:          4xm/4xa
Toy-Story2_better-image-quality.4xa: 4xm/4xa
triddefs.trd:                        trd
Unison.SF2:                          sf2

I hope my diff file can be applied in future version of
file utility.

Unfortunately i found no information for RIFF wrapped MP3 with RMP3
tag. I handled only 32 bit little endian files. Probably the
observed information about file name extension and mime type also
applies to big endian variants. For 64 bit files still no name
extension and mime type is displayed.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek






-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXw1aOwAKCRCv8rHJQhrU
1muDAKCCwXIAAGYDX7AqihFTFDeEn0h1XACfTEw9lOHjnhug87XACF3jxBDulBU=
=wqoU
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.39/magic/Magdir/riff.old	2020-06-15 00:01:01 +0000
+++ file-5.39/magic/Magdir/riff	2020-07-14 06:08:15 +0000
@@ -99,3 +99,5 @@
 # RIFF Device Independent Bitmap format
+# URL: http://fileformats.archiveteam.org/wiki/RDIB
 >8	string		RDIB		\b, device-independent bitmap
+!:ext	rdi/dib
 >>16	string		BM
@@ -112,10 +114,24 @@
 # RIFF MIDI format
+# URL:	http://fileformats.archiveteam.org/wiki/RIFF_MIDI
 >8	string		RMID		\b, MIDI
+# http://extension.nirsoft.net/rmi
+!:mime	audio/mid
+#!:mime	audio/x-rmid
+!:ext	rmi
 # RIFF Multimedia Movie File format
+# URL:	http://fileformats.archiveteam.org/wiki/RIFF_Multimedia_Movie
 >8	string		RMMP		\b, multimedia movie
+!:mime	video/x-mmm
+!:ext	mmm
 # RIFF wrapper for MP3
 >8	string		RMP3		\b, MPEG Layer 3 audio
+#!:mime	audio/x-rmp3
 # Microsoft WAVE format (*.wav)
+# URL:		http://fileformats.archiveteam.org/wiki/WAV
 >8	string		WAVE		\b, WAVE audio
+#!:mime	audio/vnd.wave
 !:mime	audio/x-wav
+# https://www.macdisk.com/macsigen.php
+#!:apple	????WAVE
+!:ext	wav/wave
 >>12    string  >\0
@@ -270,12 +286,38 @@
 # SoundFont 2 <mpruett at sgi.com>
->8	string		sfbk		SoundFont/Bank
+# URL:	http://fileformats.archiveteam.org/wiki/SoundFont_2.0
+>8	string		sfbk		\b, SoundFont/Bank
+!:mime	audio/x-sfbk
+!:ext	sf2
 # MPEG-1 wrapped in a RIFF, apparently
+# URL:	http://file.fyicenter.com/17_Video_.DAT_File_Extension_for_VCD_Files.html
 >8      string          CDXA            \b, wrapped MPEG-1 (CDXA)
+!:mime	video/x-cdxa
+!:ext	mpg/dat
+# URL:	http://fileformats.archiveteam.org/wiki/4X_IMA_ADPCM
 >8	string		4XMV		\b, 4X Movie file
+!:mime	video/x-4xmv
+!:ext	4xm/4xa
 # AMV-type AVI file: https://wiki.multimedia.cx/index.php?title=AMV
 >8	string		AMV\040		\b, AMV
+# http://fileformats.archiveteam.org/wiki/MTV_Video_(.AMV)
+!:mime	video/x-amv
+!:ext	amv
+#!:ext	amv/mtv
+# URL:	http://fileformats.archiveteam.org/wiki/WebP
 >8      string          WEBP            \b, Web/P image
 !:mime	image/webp
+!:ext	webp
 >>12	use		riff-walk
 # From:		Joerg Jenderek
+# URL:		http://fileformats.archiveteam.org/wiki/RIFF_MIDS
+>8      string          MIDS            \b, MIDI Stream
+!:mime	audio/x-mids
+!:ext	mds
+# From:		Joerg Jenderek
+# URL:		http://mark0.net/soft-trid-e.html
+# Reference:	http://fileformats.archiveteam.org/wiki/Trd_(TRID)
+>8      string          TRID            \b, TrID defs package
+!:mime	application/x-trid-trd
+!:ext	trd
+# From:		Joerg Jenderek
 # URL:		https://en.wikipedia.org/wiki/CorelDRAW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.39-riff-else.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200714/c97b7cdb/attachment.obj>


More information about the File mailing list