ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Mike55 on April 05, 2023, 02:51:15 AM

Title: Rename only QuickTime videos
Post by: Mike55 on April 05, 2023, 02:51:15 AM
Hello,

is there a way to rename only QuickTime videos?
For example, this is a Quicktime video and has the extension mp4:
exiftool -ext mp4 "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" "2018-09-22 12-31-00.mp4"

However, I want to make sure that only Quicktime videos are renamed and not all MP4 videos.

Thanks a lot.
Title: Re: Rename only QuickTime videos
Post by: Phil Harvey on April 05, 2023, 08:26:01 AM
I don't think you understand the question.

Technically, MP4 videos are not QuickTime videos.  MP4 is based on the QuickTime format, but it isn't the same thing.  Actual QuickTime videos have a .MOV extension.

- Phil
Title: Re: Rename only QuickTime videos
Post by: StarGeek on April 05, 2023, 11:00:02 AM
I went looking for something that could tell the difference and it looks like even ffmpeg considers them to be the same.

I used the command from this SuperUser answer (https://superuser.com/a/1473048/314998), every MOV and MP4 I threw at it gave the same answer
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV

Similarly, every Webm and MKV gave the same result. Looking more into this, I find the line "All WebM files are MKV files, but not all MKV files are WebM".  So TIL.

Going further down the rabbit hole, this SuperUser (https://superuser.com/a/1586326/314998) answer says that ffmpeg uses the same muxer/demuxer for MOV/MP4 and you have to look at the MajorBrand tag to tell the difference.

But of course, one of my test files doesn't have MajorBrand tag, even testing with ffprobe.  Just to be complete, this is the ffprobe command I used
ffprobe -loglevel error -show_entries format_tags=major_brand -of default=nw=1 file.mp4
Title: Re: Rename only QuickTime videos
Post by: wywh on April 05, 2023, 11:55:43 AM
I have considered .mp4, .m4v and .mov files all as 'QuickTime' files as far as metadata goes (although some apps like Google Photos treat metadata such as pre-1921 'Keys:CreationDate' slightly differently in .mp4 vs .m4v and .mov before 1921-0501-00-00 at least in my location).

AFAIK .mp4 and .m4v are very close cousins, and if some app insists, .m4v can usually simply be renamed as .mp4 because .m4v only has some DRM add-ons. Please correct if I am wrong.

- Matti