jazz-e
jazz-e

Reputation: 115

How to tag metadata m4v files using FFmpeg

So I'm trying to tag metadata to a video file m4v from the filename. However, I can't seem to find the answer in the man -h page and everything online shows how to pull the metadata from m4v.

I've looked here on StackOverflow and also online for the answer and most are answers on pulling the metadata from the m4v file but nothing on tagging the file (other than stripping out metadata). I found this http://jonhall.info/create_id3_tags_using_ffmpeg/ regarding tagging an mp3 file, which I tried the syntax and it fails.

Here's the mp3 syntax I tried subbing out mp3 to m4v

ffmpeg32 -i in.m4v -metadata title="The Title You Want" out.m4v

Also tried the following as well

ffmpeg -i "$filedir$name" -metadata title="The Title You Want" -c:v copy -c:a copy "$filedir$newname"

This command works for removing the metadata from the file

ffmpeg -i "$filedir$name" -map_metadata -1 -c:v copy -c:a copy "$filedir$newname"

The error I usually get a syntax error.

Any help much appreciated

Upvotes: 1

Views: 900

Answers (1)

jazz-e
jazz-e

Reputation: 115

So apparently I did not have the path in my profile so the command was failing in my script. By adding the full path /usr/local/bin/ffmpeg I was able to get the following command to work

/usr/local/bin/ffmpeg -i in.m4v -metadata title="The Title You Want" out.m4v

Hope this helps someone else which may overlook this.

Upvotes: 1

Related Questions