MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
636 stars 175 forks source link

Incorrect GIF format detection if extension was omitted? #1065

Open mooyoul opened 5 years ago

mooyoul commented 5 years ago

Hello, I've found some GIF files were detected as non-GIF format.

Please see this screenshot:

2018-12-14 5 35 40

Left: Results from FFprobe / Right: Results from MediaInfo

As you see, Detected formats are non-GIF format or missing even these files have valid GIF89a files and has GIF file signature with 89a extension (GIF89a signature).

Please see left panel on this screenshot:

2018-12-14 5 41 15

Interesting part is: GIF analysis works if i add .gif extension to files. Please see right panel of this screenshot:

2018-12-14 5 36 52

You can download sample files on below links:

Is it intended result? what's different if filename has extension, or not?

JeromeMartinez commented 5 years ago

Not intended. When the extension is .gif, the GIF parser is prioritized, and it catches the file; when no extension is provided, all parsers are tested, and here some parsers (not GIF) consider it is their formats, due to not enough precise detection. Definitely a bug.

mooyoul commented 5 years ago

Ah okay, Is there any way to prioritize specific parser without modifying original filename? I've tried with mediainfo --File_FileName=some-image.gif mediainfolib-samples/hijl325b9s06xggrhsd9 but there's no luck.

JeromeMartinez commented 5 years ago

Hidden option (definitely lack of doc :( ) mediainfo --File_ForceParser=GIF

mooyoul commented 5 years ago

woo, works like a charm. In the meantime i'll just peek given file to detect GIF signature and pass force parser option to mediainfo if given file was detected as GIF. Merci, @JeromeMartinez!