#1 2010-02-08 17:33

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Recognize MP4 signature?

I have some MP4 files. If I view them with a text editor, their header contains the text "ftypmp42".
But ReNamer is unable to detect their file type and attach the correct extension.

It does not offer multiple option, as in case of MSO docs, where ReNamer shows "doc|xls|ppt" as possible extensions.

Would it be possible to add the mp4 signatures to the Extension rule, so that it can detect these files?

Thaks in advance!

Last edited by narayan (2010-02-08 17:33)

Offline

#2 2010-02-08 17:59

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Recognize MP4 signature?

Read mine post about it and use Hex Editor XVI32 to check it again; it's really hard to get what you want. Read this topic and use Marc0's library, it's better in extensions detecting. There are few Andrew's scripts starting from here which can help you... wink


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#3 2010-02-09 02:16

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Recognize MP4 signature?

Thanks for the tip.

Can we simplify that for the "Newbie"-level users?
I mean, a user should not have to go through all that discussion

I would like to add this to the wiki, but I am not getting the jist of it.
So I'd prefer if a knowledgeable member does this.

What I have understood is, the user has to do the following:
1. Place the dll and pref files into ReNamer folder.
2. Add Andrew's script using the Script rule's editor. name it "TrIDScript" or something similar
3. There are definitions to be added
   - How?
   - Where? to the TrID script?
   - Which of those definitions are to be added? (There are multiple lists in that post)

Anything left?

Offline

#4 2010-02-09 13:35

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Offline

#5 2010-02-09 15:27

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Recognize MP4 signature?

narayan, use my final script from that topic. Get the latest DLL and Pref files from the TrID site. Defs are to be optionally added only if TrID misidentifies a file type and you want to add its signature to the existing database. For now, don't worry about it. Just try with your files and see if you get the desired results.

P.S. Adding defs is an advanced topic so we can add that later, or even direct folks to the TrID site, since doing it involves the use of additional command-line utilities that people in general might not be comfortable with.

Last edited by Andrew (2010-02-09 15:29)

Offline

#6 2010-02-12 05:10

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Recognize MP4 signature?

The dll and def files have to be placed in the Scripts subfolder; NOT in the main folder (where the ReNamer.exe file is).
Otherwise when the script rule is added, the program reports an error: "Either the dll or the def file is missing"
(I have turned on the options of "autopreview when new files are added" and  "autopreview when new rules are added")

********
BTW I was unable to identify the mp4 extension for my files with the latest default defs.

I need this facility frequently nowadays, because the mp4 formats are used by video host websites (Youtube, Vimeo, eHow, etc.).

Earlier these sites hosted only low resolution videos, and used just the flv format. ReNamer had no problem in identifying that extension. But nowadays these sites offer their videos in up to 4 different resolutions. The encoding may not be common amongst all these sites and resolutions.

To make the matter worse, the downloaded file usually does not have extensions: I use a FireFox plugin to detect the URL of the video and then pass it on to FreeDownloadManager to download it. This chain cannot detect the file extension on its own. Thus the user has to identify the extension himself (flv/mp4).

I guess many users would be facing the same issue like me. So if ReNamer can natively detect these encoding (without having to use TrID dll+def+script), it would be great.

Offline

#7 2010-02-12 10:30

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Recognize MP4 signature?

narayan wrote:

The dll and def files have to be placed in the Scripts subfolder; NOT in the main folder (where the ReNamer.exe file is).

I don't know which version of ReNamer you're using, but I used the latest beta and the script would simply not run if the DLL and TRD files aren't in the same dir. as the main ReNamer executable. Placing them in the Scripts sub-dir. does not work. Try with a fresh download, extract to a new dir. and check.

narayan wrote:

BTW I was unable to identify the mp4 extension for my files with the latest default defs.

What does TrID report for the files?

narayan wrote:

I guess many users would be facing the same issue like me. So if ReNamer can natively detect these encoding (without having to use TrID dll+def+script), it would be great.

The problem is the same as before. Since MP4 is a container format that can encapsulate a variety of audio/video streams encoded using various codecs, as well as subtitle streams etc., there might be a significant amount of difference between various MP4s depending on what exactly they contain. If all of them have some unique identifying bytes, then it's certainly possible to add those to both ReNamer, and to TrID.

Last edited by Andrew (2010-02-12 10:32)

Offline

#8 2010-02-12 11:34

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Recognize MP4 signature?

narayan wrote:

The dll and def files have to be placed in the Scripts subfolder; NOT in the main folder (where the ReNamer.exe file is).

This would be the case if current working directory for ReNamer has been changed to another folder, i.e. Scripts folder. Basically, "TrIDLib.dll" has to reside in the current working directory (or possibly in any of the system folders).

I totally understand the need for identifying MP4 files, but there is very little we can do to help you here. The only specific file signature that I could find for MP4 files is header hexdump: 00 00 00 which is way to common. http://file-extension.net/seeker/file_extension_mp4

Offline

#9 2010-02-12 12:38

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Recognize MP4 signature?

I am using beta dated 1st Feb 2010, with the latest TrID files.
The Renamer exe is in this folder ----> D:\Util\ReNamer
I copied the TrID pascal script from your link (ReNamer:Scripts:TrID)

I removed the extensions of some "known good" pdf, exe and zip files, and then tried two experiments.
But both do NOT give the desired results:

Experiment-1.
   When the TrID's dll and def files are in the main folder"
   When I add the TrID pascalscript rule, ReNamer shows the following Warning:
              ---------------------------
              Warning, found 1 invalid filename(s)!
              1 of which conflict with existing filepath(s).
              ---------------------------
     But the file to be renamed has no namesake in the folder. So why does this problem come?

Experiment-2:

        When the TrID's dll and def files are in the Scripts folder:
        ReNamer does not find the extension at all (There is no action at all).
        (The Name and New Name columns remain same).

Last edited by narayan (2010-02-12 12:40)

Offline

#10 2010-02-13 14:49

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Recognize MP4 signature?

den4b wrote:

This would be the case if current working directory for ReNamer has been changed to another folder, i.e. Scripts folder. Basically, "TrIDLib.dll" has to reside in the current working directory (or possibly in any of the system folders).

Denis, how does one do this anyway (change CWD of ReNamer)? I thought the CWD was always the one where the EXE resided? Or do you mean create a shortcut to ReNamer.exe and set the "Start in" field to a different directory?

narayan, re. your problem, can you try using v5 of my script and tell me what's the output you see? A screenshot of the result after pressing the Preview button would be nice. Try with an assortment of files, including some MP4s since that's what you're focussing on mainly.

P.S. Run the EXE directly (i.e. not from a modified shortcut etc.) and be sure to place the TrID files in the same dir. as the EXE. That's the way it works for me, without fail.

Offline

Board footer

Powered by FluxBB