Help with metadata writing (mp4)... what's possible?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with metadata writing (mp4)... what's possible?

Karen Norton
Hello all,

I'm hoping someone can help with understanding writing metadata to files
using ffmpeg. The type of metadata I'm referencing is information such as
movie/song title, artist, album, author, genre, show, etc.

I do all of my encoding to AVC/AAC in the mp4 container. I use these
because it's pretty much guaranteed the file will play on all systems,
browsers and media player software. I'm using version 4.1 of ffmpeg
(windows).

I have used ffmpeg hundreds of times to do this so my questions aren't
about getting it to work.... my questions are around what can be written
with ffmpeg because I can't seem to find definitive info about this. So
here are my questions:
1. Is there an actual ffmpeg documentation page on this? I couldn't find
anything. The only references I could find were from other sites such as:
https://wiki.multimedia.cx/index.php/FFmpeg_Metadata#QuickTime.2FMOV.2FMP4.2FM4A.2Fet_al.
and https://kdenlive.org/en/project/adding-meta-data-to-mp4-video/
2. I quickly went through the mp4 standards document and couldn't find
anything related to these specific keys (ex: "title", "episode_id", etc.)
so I'm trying to understand whether these keys are defined by the mp4
standard or whether each software developer writes their own keys?
3. When I look at the websites mentioned in #1 they are different in so far
as what is available for mp4 through ffmpeg. The wiki site references
seventeen keys for mp4 but the kdenlive site references thirty that are
available. I guess this goes back to finding out exactly what is available
through ffmpeg. Also whether this is the full set available to mp4 as a
standard.
4. Is there anyway to write in custom metadata? I read this is not possible
with ffmpeg for mp4 but is possible with ffmpeg for matroska. I read that
here:
https://superuser.com/questions/1208273/add-new-and-non-defined-metadata-to-a-mp4-file.
So this goes back to whether custom metadata is not available through the
mp4 standard or whether it just hasn't been written for ffmpeg? I would
like to write a custom key/field for TV shows for Episode Number (as in
"episode_number" as a string). The reason I want this is because according
to the kdenlive site sorting (episode_sort) is limited to 0-255 so when it
comes to shows like Law & Order SVU which is already up to about 457
episodes the sorting key doesn't work. In this regard either episode_sort
could be changed or a custom field added. Something like
"title": Law & Order
"show": Prescription For Death
"episode_number": Episode 1 or Ep1 or 1 or One (any of these would be an
acceptable input or as mentioned "episode_sort" is changed).

As a side note this superuser page also references a different number of
available keys than either the wiki site and the kdenlive site which goes
back to finding a comprehensive list with definitions of the keys.

Personally I would like to be able to write in custom fields but I would
also like episode_sort updated to be useful for shows that go beyond 255
episodes. This means episode_sort could remain as a numeric value but
something like "episode_number" would be alphanumeric so the user could
write in the data however they want as in Ep1, Episode 1, 1 or One, etc.

If there is somewhere else I should post this let me know or point me to
the official documentation (not only for mp4 but all files types would be
helpful). I googled and googled until my brain hurt but the only references
I could find are the ones noted above (and others like this).

Thanks.

Karen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Carl Eugen Hoyos-2
2018-12-06 19:26 GMT+01:00, Karen Norton <[hidden email]>:

> I'm hoping someone can help with understanding writing metadata to files
> using ffmpeg. The type of metadata I'm referencing is information such as

> movie/song title, artist, album, author, genre, show, etc.

Command line and complete, uncut console output missing.
(Works fine by default here.)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
On Thu, Dec 6, 2018 at 1:30 PM Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-12-06 19:26 GMT+01:00, Karen Norton <[hidden email]>:
>
> > I'm hoping someone can help with understanding writing metadata to files
> > using ffmpeg. The type of metadata I'm referencing is information such as
>
> > movie/song title, artist, album, author, genre, show, etc.
>
> Command line and complete, uncut console output missing.
> (Works fine by default here.)
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


Hi Carl,

Thanks for the speedy reply. As mentioned in my email my questions aren't
about getting it to work. I can write the metadata just fine (ex: my most
recent one was ffmpeg -i input.mp4 -metadata media_type="10" -metadata
show="Law & Order" -metadata season_number="1" -metadata
title="Prescription For Death" -metadata episode_id="66209" -metadata
episode_sort="1" -metadata:s:a:0 language=eng -c:v libx264 -c:a aac
output.mp4). This writes fine and gives me the results I expect.

My questions are about finding the full scope of keys that can be written
with ffmpeg because the sites I reference give varying sets of keys. I
would like to find a comprehensive list of keys for all files in general
(video and audio) but for mp4 in particular. I would also like to know
about writing custom tags/keys. Is this possible for mp4 in general but
more importantly mp4 with ffmpeg. :-D

Thanks.


Karen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Carl Eugen Hoyos-2
2018-12-06 19:40 GMT+01:00, Karen Norton <[hidden email]>:

> On Thu, Dec 6, 2018 at 1:30 PM Carl Eugen Hoyos <[hidden email]> wrote:
>
>> 2018-12-06 19:26 GMT+01:00, Karen Norton <[hidden email]>:
>>
>> > I'm hoping someone can help with understanding writing metadata to files
>> > using ffmpeg. The type of metadata I'm referencing is information such
>> > as
>>
>> > movie/song title, artist, album, author, genre, show, etc.
>>
>> Command line and complete, uncut console output missing.
>> (Works fine by default here.)
>
> Thanks for the speedy reply. As mentioned in my email my questions aren't
> about getting it to work. I can write the metadata just fine (ex: my most
> recent one was ffmpeg -i input.mp4 -metadata media_type="10" -metadata
> show="Law & Order" -metadata season_number="1" -metadata
> title="Prescription For Death" -metadata episode_id="66209" -metadata
> episode_sort="1" -metadata:s:a:0 language=eng -c:v libx264 -c:a aac
> output.mp4). This writes fine and gives me the results I expect.
>
> My questions are about finding the full scope of keys that can be written
> with ffmpeg because the sites I reference give varying sets of keys.

For mp4, you can see them in the source code:
http://git.videolan.org/?p=ffmpeg.git;f=libavformat/movenc.c;h=6dab519;hb=HEAD#l3508

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Gyan Doshi
In reply to this post by Karen Norton
On 07-12-2018 12:10 AM, Karen Norton wrote:

>
> My questions are about finding the full scope of keys that can be written
> with ffmpeg because the sites I reference give varying sets of keys. I
> would like to find a comprehensive list of keys for all files in general
> (video and audio) but for mp4 in particular. I would also like to know
> about writing custom tags/keys. Is this possible for mp4 in general but
> more importantly mp4 with ffmpeg. :-D

The MP4 file format itself does not provide any restrictions on metadata
keys. The list in my SU answer lists all the iTunes tags that our muxer
currently supports. Custom global tags are possible if

    -movflags use_metadata_tags

is added to the command.

Then -metadata somekey=somevalue can be stored. I should update my
answer to reflect this. I can't test this but it's possible that Apple
applications may not read these or any other tags if this method is used.

Thanks,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Peter van Houten
In reply to this post by Karen Norton
On Thursday December 6, 2018 at 20:26 <[hidden email]> wrote:
>
> Hello all,
>
> I'm hoping someone can help with understanding writing metadata to files
> using ffmpeg. The type of metadata I'm referencing is information such as
> movie/song title, artist, album, author, genre, show, etc.


Not sure if this is comprehensive enough but here are a few from a
script I use to clear and/or insert metadata:

ffmpeg -i "$i" -c:v copy -c:a copy -c:s copy -metadata description=""
-metadata title="" -metadata year="" -metadata category="" -metadata
podcast="" -metadata genre="" -metadata artist="" -metadata date=""
-metadata album="" -metadata comment="" -metadata media_type=""
-metadata:s:v:0 title="" -metadata:s:v:0 language=eng -disposition:v:0
default -metadata:s:a:0 title="" -metadata:s:a:0 language=eng
-disposition:a:0 default -metadata:s:a:1 title="" -metadata:s:a:1
language=eng -disposition:a:1 none -metadata:s:a:2 title=""
-metadata:s:a:2 language=eng -disposition:a:2 none -metadata:s:a:3
title="" -metadata:s:a:3 language=fre -disposition:a:3 none
-metadata:s:a:4 title="" -metadata:s:a:4 language=ita -disposition:a:4
none -metadata:s:a:5 title="" -metadata:s:a:5 language=eng
-disposition:a:5 none -metadata:s:s:0 title="Default" -metadata:s:s:0
language=eng -disposition:s:0 none -metadata:s:s:1 title="Second"
-metadata:s:s:1 language=eng -disposition:s:1 none -metadata:s:s:2
title="Third" -metadata:s:s:2 language=dut -disposition:s:2 none
-metadata:s:s:3 title="Fourth" -metadata:s:s:3 language=fre
-disposition:s:3 none -metadata:s:s:4 title="Fifth" -metadata:s:s:4
language=eng -disposition:s:4 none -y "$o"

--
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what'spossible?

yUGz afterLife
In reply to this post by Gyan Doshi
Here iz an exemple in php
Ull see correct metadatatagz sample to get infoz
The script should be human readable

< ?php
        if (is_file($imgsrc)) unlink($imgsrc);
        exec("$ffmpegbin -i \"$fullfile\" \"$imgsrc\" 2>&1");
        if (!is_file($imgsrc)) if (is_file($imgfile)) copy($imgfile,$imgsrc);

        if (is_file($tagzfile)) unlink($tagzfile);
        exec("$ffprobebin -i \"$fullfile\" -v quiet -print_format json -show_format -show_streams > \"$tagzfile\"");

        $infoz = array();
        foreach (array('artist','subartist','album','track','title','label','ref','genre','bpm','bitrate','frequency','version','layer','desc','country','url','secs') as $plop) {
                $infoz[$plop] = '';
        }
        $infoz['date'] = '????/??/??';

        $str = file_get_contents($tagzfile);
        $json = json_decode($str, true);

        //print_r($json);

        if (!empty($json['format']['tags']['artist'])) $infoz['artist'] = $json['format']['tags']['artist'];
        else if (!empty($json['format']['tags']['ARTIST'])) $infoz['artist'] = $json['format']['tags']['ARTIST'];
        if (!empty($json['format']['tags']['album_artist'])) $infoz['subartist'] = $json['format']['tags']['album_artist'];
        else if (!empty($json['format']['tags']['ALBUM_ARTIST'])) $infoz['subartist'] = $json['format']['tags']['ALBUM_ARTIST'];
        if (!empty($json['format']['tags']['album'])) $infoz['album'] = $json['format']['tags']['album'];
        else if (!empty($json['format']['tags']['ALBUM'])) $infoz['album'] = $json['format']['tags']['ALBUM'];
        if (!empty($json['format']['track_number'])) $infoz['track'] = $json['format']['track_number'];
        else if (!empty($json['format']['TRACK_NUMBER'])) $infoz['track'] = $json['format']['TRACK_NUMBER'];
        else if (!empty($json['format']['track'])) $infoz['track'] = $json['format']['track'];
        if (!empty($json['format']['tags']['title'])) $infoz['title'] = $json['format']['tags']['title'];
        else if (!empty($json['format']['tags']['TITLE'])) $infoz['title'] = $json['format']['tags']['TITLE'];
        if (!empty($json['format']['tags']['publisher'])) $infoz['label'] = $json['format']['tags']['publisher'];
        if (!empty($json['format']['tags']['Catalog Number'])) $infoz['ref'] = $json['format']['tags']['Catalog Number'];
        if (!empty($json['format']['tags']['genre'])) $infoz['genre'] = $json['format']['tags']['genre'];
        else if (!empty($json['format']['tags']['GENRE'])) $infoz['genre'] = $json['format']['tags']['GENRE'];
        if (!empty($json['format']['tags']['bpm'])) $infoz['bpm'] = $json['format']['tags']['bpm'];
        else if (!empty($json['format']['tags']['TBPM'])) $infoz['bpm'] = $json['format']['tags']['TBPM'];
        if (!empty($json['format']['bit_rate'])) $infoz['bitrate'] = $json['format']['bit_rate'];
        if (!empty(preg_split('/\//',$json['streams'][0]['codec_time_base'])[1])) $infoz['frequency'] = preg_split('/\//',$json['streams'][0]['codec_time_base'])[1];
        if (!empty($json['format']['tags']['date'])) $infoz['date'] = preg_replace('/(\d{4})[-|\/]*(\d{2})[-|\/]*(\d{2}).*/',"$1/$2/$3",$json['format']['tags']['date']);
        else if (!empty($json['format']['tags']['DATE'])) $infoz['date'] = preg_replace('/(\d{4})[-|\/]*(\d{2})[-|\/]*(\d{2}).*/',"$1/$2/$3",$json['format']['tags']['DATE']);
        if (!empty($json['format']['tags']['comment'])) $infoz['desc'] = $json['format']['tags']['comment'];
        if (!empty($json['format']['tags']['country'])) $infoz['country'] = $json['format']['tags']['country'];
        if (!empty($json['format']['tags']['url'])) $infoz['url'] = $json['format']['tags']['url'];
        if (!empty($json['streams'][0]['duration'])) $infoz['secs'] = floor($json['streams'][0]['duration']);
?>

< ?php
        $metaz = '';
        if (is_file($imgsrc)) $metaz .= ' -i "'.$imgsrc.'" -map 0:0 -map 1:0 -id3v2_version 3 -metadata:s:v title="album COVER" -metadata:s:v comment="COVER (front)"';
        if (!empty($artist)) $metaz .= ' -metadata artist="'.$chandle->real_escape_string($artist).'"';
        if (!empty($subartist)) $metaz .= ' -metadata album_artist="'.$chandle->real_escape_string($subartist).'"';
        if (!empty($title)) $metaz .= ' -metadata title="'.$chandle->real_escape_string($title).'"';
        if (!empty($album)) $metaz .= ' -metadata album="'.$chandle->real_escape_string($album).'"';
        if (!empty($track)) $metaz .= ' -metadata track="'.$chandle->real_escape_string($track).'"';
        if (!empty($genre)) $metaz .= ' -metadata genre="'.$chandle->real_escape_string($genre).'"';
        if (!empty($label)) $metaz .= ' -metadata publisher="'.$chandle->real_escape_string($label).'"';
        if (!empty($ref)) $metaz .= ' -metadata catalog_number="'.$chandle->real_escape_string($ref).'"';
        if (!empty($bpm)) $metaz .= ' -metadata bpm="'.$chandle->real_escape_string($bpm).'"';
        if (!empty($date)) $metaz .= ' -metadata date="'.$chandle->real_escape_string(str_replace('/','/',$date)).'"';

        $fileParts = pathinfo(basename($fullfile));
        $ext = $fileParts['extension'];
        $temppfile = $fullfile.'.tmp.'.$ext;

        if (!empty($metaz)) {
                exec("$ffmpegbin -i \"$fullfile\"$metaz -vn -sn -codec:a copy \"$temppfile\" 2>&1");
        }
        if (is_file($temppfile)) {
                unlink($fullfile);
                rename($temppfile,$fullfile);
        }
?>

-metadata artist
-metadata album_artist
-metadata album
-metadata title
-metadata genre
-metadata publisher
-metadata bpm
-metadata date

By the way iam trying to write CATALOG NUMBER tag (TXXX :CATALOGNUMBER)
-metadata catalog_number
-metadata TXXX :CATALOGNUMBER
Both dont work

If u have any tip, thx



Hugo

De : Gyan Doshi
Envoyé le :jeudi 6 décembre 2018 19:56
À : [hidden email]
Objet :Re: [FFmpeg-user] Help with metadata writing (mp4)... what'spossible?

On 07-12-2018 12:10 AM, Karen Norton wrote:

>
> My questions are about finding the full scope of keys that can be written
> with ffmpeg because the sites I reference give varying sets of keys. I
> would like to find a comprehensive list of keys for all files in general
> (video and audio) but for mp4 in particular. I would also like to know
> about writing custom tags/keys. Is this possible for mp4 in general but
> more importantly mp4 with ffmpeg. :-D

The MP4 file format itself does not provide any restrictions on metadata
keys. The list in my SU answer lists all the iTunes tags that our muxer
currently supports. Custom global tags are possible if

    -movflags use_metadata_tags

is added to the command.

Then -metadata somekey=somevalue can be stored. I should update my
answer to reflect this. I can't test this but it's possible that Apple
applications may not read these or any other tags if this method is used.

Thanks,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
In reply to this post by Gyan Doshi
On Thu, Dec 6, 2018 at 1:56 PM Gyan Doshi <[hidden email]> wrote:

> On 07-12-2018 12:10 AM, Karen Norton wrote:
>
> >
> > My questions are about finding the full scope of keys that can be written
> > with ffmpeg because the sites I reference give varying sets of keys. I
> > would like to find a comprehensive list of keys for all files in general
> > (video and audio) but for mp4 in particular. I would also like to know
> > about writing custom tags/keys. Is this possible for mp4 in general but
> > more importantly mp4 with ffmpeg. :-D
>
> The MP4 file format itself does not provide any restrictions on metadata
> keys. The list in my SU answer lists all the iTunes tags that our muxer
> currently supports. Custom global tags are possible if
>
>     -movflags use_metadata_tags
>
> is added to the command.
>
> Then -metadata somekey=somevalue can be stored. I should update my
> answer to reflect this. I can't test this but it's possible that Apple
> applications may not read these or any other tags if this method is used.
>
> Thanks,
> Gyan
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


Thank you Gyan. This is exactly the information I was looking for. I was
trying to understand whether the limitations were with the mp4 standard or
the keys I found were defined by ffmpeg and you confirmed it isn't a
limitation of the mp4 standard. I'm also so glad to know custom tags can be
written because that directly contradicts the page I found on the superuser
website.

I understand that writing custom tags doesn't mean they will suddenly show
up in software. Ex: If I added in a custom tag called "episode_number" I
won't necessarily see it in software like mediainfo or itunes, etc. but
it's good to know they can be written in case there is software that will
display all tags including custom.

Just a few more questions:

1. Where do I find your SU answer that you mention? Is there a link to see
it?
2. To make sure I understand using that -movflags use_metadata_tags does
this mean my command line would now be:
ffmpeg -i input.mp4 -metadata media_type="10" -metadata show="Law & Order"
-metadata season_number="1" -metadata title="Prescription For Death"
-metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
language=eng -movflags use_metadata_tags -metadata episode_number="Episode
1" -c:v libx264 --c:a aac output.mp4
3. Will custom tags display in ffprobe?
4. Can episode_sort be changed from Int8 to general number that allows more
than 255 or maybe alphanumeric? As mentioned I can't use this for Law &
Order Special Victims Unit and Law & Order because they are well over 255.

Thanks also to Carl and Peter for your replies!


Karen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Gyan Doshi
On 07-12-2018 12:49 AM, Karen Norton wrote:
>
> Just a few more questions:
>
> 1. Where do I find your SU answer that you mention? Is there a link to see
> it?

It's the SuperUser page you linked to :)

> 2. To make sure I understand using that -movflags use_metadata_tags does
> this mean my command line would now be:
> ffmpeg -i input.mp4 -metadata media_type="10" -metadata show="Law & Order"
> -metadata season_number="1" -metadata title="Prescription For Death"
> -metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
> language=eng -movflags use_metadata_tags -metadata episode_number="Episode
> 1" -c:v libx264 --c:a aac output.mp4

Looks right.

> 3. Will custom tags display in ffprobe?

Yes. They do, for me.

> 4. Can episode_sort be changed from Int8 to general number that allows more
> than 255 or maybe alphanumeric? As mentioned I can't use this for Law &
> Order Special Victims Unit and Law & Order because they are well over 255.

Here's the weird thing. The muxer does write 32 bits. But the demuxer
treats the high 24 bits as padding and ignores it. In effect, ffmpeg
will show    (stored-value % 256)

Mediainfo does the same, which would indicate that this is the iTunes
spec. However, I find other sources which treat it as full 32-bits. Let
me look into it. But it can't be a string.

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
On Thu, Dec 6, 2018 at 2:58 PM Gyan Doshi <[hidden email]> wrote:

> On 07-12-2018 12:49 AM, Karen Norton wrote:
> >
> > Just a few more questions:
> >
> > 1. Where do I find your SU answer that you mention? Is there a link to
> see
> > it?
>
> It's the SuperUser page you linked to :)
>
> > 2. To make sure I understand using that -movflags use_metadata_tags does
> > this mean my command line would now be:
> > ffmpeg -i input.mp4 -metadata media_type="10" -metadata show="Law &
> Order"
> > -metadata season_number="1" -metadata title="Prescription For Death"
> > -metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
> > language=eng -movflags use_metadata_tags -metadata
> episode_number="Episode
> > 1" -c:v libx264 --c:a aac output.mp4
>
> Looks right.
>
> > 3. Will custom tags display in ffprobe?
>
> Yes. They do, for me.
>
> > 4. Can episode_sort be changed from Int8 to general number that allows
> more
> > than 255 or maybe alphanumeric? As mentioned I can't use this for Law &
> > Order Special Victims Unit and Law & Order because they are well over
> 255.
>
> Here's the weird thing. The muxer does write 32 bits. But the demuxer
> treats the high 24 bits as padding and ignores it. In effect, ffmpeg
> will show    (stored-value % 256)
>
> Mediainfo does the same, which would indicate that this is the iTunes
> spec. However, I find other sources which treat it as full 32-bits. Let
> me look into it. But it can't be a string.
>
> Gyan
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


LOL... I didn't realize SU meant that superuser page. Haha! I think it
would be very helpful if you updated that page because it comes up a fair
bit in search results. :-)

That's too bad that episode_sort can't be changed to a string but if it can
do a full 32 bits that might resolve the issue.

I just tested adding a custom tag and it worked. It also shows in ffprobe.
Yeah!! So this worked for me:
ffmpeg -i input.mp4 -metadata media_type="10" -metadata title="Law & Order"
-metadata show="Prescription For Death" -metadata season_number="1"
-metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
language=eng -movflags use_metadata_tags -metadata episode_number="Episode
1" -c:v libx264 -c:a aac output.mp4

ffprobe shows in the Format section:
[FORMAT]
filename=testoutput.mp4
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=3254.063000
size=213344376
bit_rate=524499
probe_score=100
TAG:minor_version=512
TAG:major_brand=isom
TAG:compatible_brands=isomiso2avc1mp41
TAG:episode_number=Episode 1
TAG:media_type=10
TAG:title=Law & Order
TAG:show=Prescription For Death
TAG:season_number=1
TAG:episode_id=66209
TAG:episode_sort=1
TAG:encoder=Lavf58.13.100
[/FORMAT]

This is fantastic!! No metadata limitations. :-D :-D

Is this all in the official ffmpeg documentation? As mentioned I couldn't
find anything and I searched through all of the references for metadata but
it's possible I missed it.

At least this answers my questions and solves my problem.

Thanks again Gyan!!

Cheers.


Karen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
On Thu, Dec 6, 2018 at 3:19 PM Karen Norton <[hidden email]> wrote:

> On Thu, Dec 6, 2018 at 2:58 PM Gyan Doshi <[hidden email]> wrote:
>
>> On 07-12-2018 12:49 AM, Karen Norton wrote:
>> >
>> > Just a few more questions:
>> >
>> > 1. Where do I find your SU answer that you mention? Is there a link to
>> see
>> > it?
>>
>> It's the SuperUser page you linked to :)
>>
>> > 2. To make sure I understand using that -movflags use_metadata_tags does
>> > this mean my command line would now be:
>> > ffmpeg -i input.mp4 -metadata media_type="10" -metadata show="Law &
>> Order"
>> > -metadata season_number="1" -metadata title="Prescription For Death"
>> > -metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
>> > language=eng -movflags use_metadata_tags -metadata
>> episode_number="Episode
>> > 1" -c:v libx264 --c:a aac output.mp4
>>
>> Looks right.
>>
>> > 3. Will custom tags display in ffprobe?
>>
>> Yes. They do, for me.
>>
>> > 4. Can episode_sort be changed from Int8 to general number that allows
>> more
>> > than 255 or maybe alphanumeric? As mentioned I can't use this for Law &
>> > Order Special Victims Unit and Law & Order because they are well over
>> 255.
>>
>> Here's the weird thing. The muxer does write 32 bits. But the demuxer
>> treats the high 24 bits as padding and ignores it. In effect, ffmpeg
>> will show    (stored-value % 256)
>>
>> Mediainfo does the same, which would indicate that this is the iTunes
>> spec. However, I find other sources which treat it as full 32-bits. Let
>> me look into it. But it can't be a string.
>>
>> Gyan
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
> LOL... I didn't realize SU meant that superuser page. Haha! I think it
> would be very helpful if you updated that page because it comes up a fair
> bit in search results. :-)
>
> That's too bad that episode_sort can't be changed to a string but if it
> can do a full 32 bits that might resolve the issue.
>
> I just tested adding a custom tag and it worked. It also shows in ffprobe.
> Yeah!! So this worked for me:
> ffmpeg -i input.mp4 -metadata media_type="10" -metadata title="Law &
> Order" -metadata show="Prescription For Death" -metadata season_number="1"
> -metadata episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
> language=eng -movflags use_metadata_tags -metadata
> episode_number="Episode 1" -c:v libx264 -c:a aac output.mp4
>
> ffprobe shows in the Format section:
> [FORMAT]
> filename=testoutput.mp4
> nb_streams=2
> nb_programs=0
> format_name=mov,mp4,m4a,3gp,3g2,mj2
> format_long_name=QuickTime / MOV
> start_time=0.000000
> duration=3254.063000
> size=213344376
> bit_rate=524499
> probe_score=100
> TAG:minor_version=512
> TAG:major_brand=isom
> TAG:compatible_brands=isomiso2avc1mp41
> TAG:episode_number=Episode 1
> TAG:media_type=10
> TAG:title=Law & Order
> TAG:show=Prescription For Death
> TAG:season_number=1
> TAG:episode_id=66209
> TAG:episode_sort=1
> TAG:encoder=Lavf58.13.100
> [/FORMAT]
>
> This is fantastic!! No metadata limitations. :-D :-D
>
> Is this all in the official ffmpeg documentation? As mentioned I couldn't
> find anything and I searched through all of the references for metadata but
> it's possible I missed it.
>
> At least this answers my questions and solves my problem.
>
> Thanks again Gyan!!
>
> Cheers.
>
>
> Karen
>
>

------------------
I thought I would provide an update to this.

Everything worked great adding the custom metadata and it shows up fine in
ffprobe however all of the metadata stopped displaying in mediainfo, vlc,
etc. I expected the custom tags not to show but I'm a bit perplexed as to
why the existing tags ("title", etc.) stopped displaying. It's as if the
metadata was never added even though ffprobe displays it fine. Very weird
and a setback. It looks like I can't use custom tags after all.

Cheers.

K
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Gyan Doshi
On 07-12-2018 03:09 AM, Karen Norton wrote:


> I thought I would provide an update to this.
>
> Everything worked great adding the custom metadata and it shows up fine in
> ffprobe however all of the metadata stopped displaying in mediainfo, vlc,
> etc. I expected the custom tags not to show but I'm a bit perplexed as to
> why the existing tags ("title", etc.) stopped displaying. It's as if the
> metadata was never added even though ffprobe displays it fine. Very weird
> and a setback. It looks like I can't use custom tags after all.

Ok, so it looks like the muxer writes the tags in a non-standard manner
i.e. as a child of the udta atom rather than at the top-level. I'' check
into this when I can.

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Moritz Barsnick
In reply to this post by Karen Norton
On Thu, Dec 06, 2018 at 15:19:41 -0500, Karen Norton wrote:
> Is this all in the official ffmpeg documentation? As mentioned I couldn't
> find anything and I searched through all of the references for metadata but
> it's possible I missed it.

I would at least appreciate it if it made it into the ffmpeg wiki.
(Yeah, I know, I could edit it myself.)

Valuable thread, BTW.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
In reply to this post by Gyan Doshi
On Fri, Dec 7, 2018 at 1:06 AM Gyan Doshi <[hidden email]> wrote:

> On 07-12-2018 03:09 AM, Karen Norton wrote:
>
>
> > I thought I would provide an update to this.
> >
> > Everything worked great adding the custom metadata and it shows up fine
> in
> > ffprobe however all of the metadata stopped displaying in mediainfo, vlc,
> > etc. I expected the custom tags not to show but I'm a bit perplexed as to
> > why the existing tags ("title", etc.) stopped displaying. It's as if the
> > metadata was never added even though ffprobe displays it fine. Very weird
> > and a setback. It looks like I can't use custom tags after all.
>
> Ok, so it looks like the muxer writes the tags in a non-standard manner
> i.e. as a child of the udta atom rather than at the top-level. I'' check
> into this when I can.
>
> Gyan
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


Awesome!! Thanks Gyan! 👍👍
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help with metadata writing (mp4)... what's possible?

Karen Norton
In reply to this post by Moritz Barsnick
I agree about the wiki. If you guys need help with this let me know.
Metadata, tagging, etc. is an obsession of mine so I will gladly help out
in anyway I can. :-)

I'm compiling a list of all of the tags/keys I've been able to find and am
cross-referencing them with what seems to be available through ffmpeg.
Maybe there's room to add more if it makes sense to do so (assuming there
aren't limitations in adding them). For example I've seen the use of short
and long descriptions (movies/tv shows). I don't think I saw available tags
for these, and others, in ffmpeg.

I will send the list in a new thread once I'm done (hopefully over the
weekend).

Cheers.

Karen

On Fri, Dec 7, 2018 at 3:26 AM Moritz Barsnick <[hidden email]> wrote:

> On Thu, Dec 06, 2018 at 15:19:41 -0500, Karen Norton wrote:
> > Is this all in the official ffmpeg documentation? As mentioned I couldn't
> > find anything and I searched through all of the references for metadata
> but
> > it's possible I missed it.
>
> I would at least appreciate it if it made it into the ffmpeg wiki.
> (Yeah, I know, I could edit it myself.)
>
> Valuable thread, BTW.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".