Opened 11 years ago

Closed 11 years ago

#2157 closed defect (fixed)

-metadata track=1/10 and M4A issues

Reported by: Atarikid Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov metadata
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Adding metadata track total to .m4a files does not work anymore with FFmpeg 1.1 and higher (gits)

ffmpeg -i source.mp3 -c:a aac -strict -2 -metadata track=1/10 -vn -output.m4a

It only adds the track number (1) but not the track total number (10)

Works fine with FFmpeg 1.0.1

Ouput :

[mp3 @ 0x7f94e8806600] max_analyze_duration 5000000 reached at 5015510 microseconds
Input #0, mp3, from '/Users/atarikid/Desktop/source.mp3':

Metadata:

artist : Dreadzone
album : Sound
title : Return of the dread
genre : Electronic
track : 1
date : 2001

Duration: 00:06:21.62, start: 0.000000, bitrate: 128 kb/s

Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Stream #0:1: Video: mjpeg, yuvj420p, 168x166 [SAR 1:1 DAR 84:83], 90k tbr, 90k tbn, 90k tbc
Metadata:

title :
comment : Cover (front)

File '/Users/atarikid/Desktop/output.m4a' already exists. Overwrite ? [y/N] y
Output #0, ipod, to '/Users/atarikid/Desktop/output.m4a':

Metadata:

artist : Dreadzone
album : Sound
title : Return of the dread
genre : Electronic
date : 2001
track : 1/10
encoder : Lavf54.61.100
Stream #0:0: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (mp3 -> aac)

Press [q] to stop, ? for help
size= 5942kB time=00:06:21.64 bitrate= 127.5kbits/s
video:0kB audio:5877kB subtitle:0 global headers:0kB muxing overhead 1.109580%

Attachments (1)

source.m4a (58.1 KB ) - added by Atarikid 11 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Atarikid, 11 years ago

To be more clear:
-metadata track="1/10" should save "1/10" to TRK but in only saves "1"

in reply to:  1 comment:2 by Carl Eugen Hoyos, 11 years ago

Replying to Atarikid:

To be more clear:
-metadata track="1/10" should save "1/10" to TRK but in only saves "1"

To make this clear you could add the output of "ffmpeg -i output.m4a"

And please add the complete, uncut console output for your original, failing command line, never cut the first 50 and the last 50 lines.

comment:3 by Carl Eugen Hoyos, 11 years ago

And since I am unable to reproduce the regression (ie that it worked with earlier versions):
Please also add command line together with complete, uncut console output for a working version.

comment:4 by Atarikid, 11 years ago

BTW it works fine for MP3 but for M4A (AAC and ALAC) it does not work.

The output for ffmpeg -i output/m4a

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/atarikid/Desktop/output.m4a':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
title : Return of the dread
artist : Dreadzone
album : Sound
date : 2001
encoder : Lavf54.61.100
genre : Electronic
track : 1

Duration: 00:06:21.65, start: 0.023220, bitrate: 127 kb/s

Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s
Metadata:

handler_name : SoundHandler

At least one output file must be specified

comment:5 by Atarikid, 11 years ago

Hmm.. strange .. It does not seems to be a regression after all (although I was pretty sure it worked fine with FFmpeg 1.0)
Anyhow, it should do it. It does with all other formats.
Or is there another metadata for track total?

comment:6 by Atarikid, 11 years ago

Some more info:
I just compiled ffmbc and it works fine.

comment:7 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavformat
Version: unspecifiedgit-master

Could you add the complete, uncut console output (including command line) for your failing command to make this a valid ticket?

comment:8 by Atarikid, 11 years ago

Ok here follows all information I can give you - including how it works fine with mp3 and a example file.

First let us show how it should work.

/Users/atarikid/Desktop/ffmpeg -i /Users/atarikid/Desktop/source.m4a -c:a libmp3lame -metadata track=1/10 /Users/atarikid/Desktop/output.mp3

ffmpeg version N-48986-g9a038a9 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 19 2013 08:27:49 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-pthreads --disable-shared --enable-static --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libfaac --enable-postproc --enable-runtime-cpudetect --disable-debug --disable-network --disable-doc --enable-small --enable-nonfree
libavutil 52. 15.100 / 52. 15.100
libavcodec 54. 89.100 / 54. 89.100
libavformat 54. 61.100 / 54. 61.100
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/atarikid/Desktop/source.m4a':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
encoder : Lavf54.61.100

Duration: 00:00:04.85, start: 0.023220, bitrate: 98 kb/s

Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
Metadata:

handler_name : SoundHandler

File '/Users/atarikid/Desktop/output.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to '/Users/atarikid/Desktop/output.mp3':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
TRCK : 1/10
TSSE : Lavf54.61.100
Stream #0:0(und): Audio: mp3, 44100 Hz, stereo, fltp
Metadata:

handler_name : SoundHandler

Stream mapping:

Stream #0:0 -> #0:0 (aac -> libmp3lame)

Press [q] to stop, ? for help
size= 77kB time=00:00:04.85 bitrate= 129.2kbits/s
video:0kB audio:76kB subtitle:0 global headers:0kB muxing overhead 0.419663%

Reading the output file:

/Users/atarikid/Desktop/ffmpeg -i /Users/atarikid/Desktop/output.mp3

ffmpeg version N-48986-g9a038a9 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 19 2013 08:27:49 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-pthreads --disable-shared --enable-static --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libfaac --enable-postproc --enable-runtime-cpudetect --disable-debug --disable-network --disable-doc --enable-small --enable-nonfree
libavutil 52. 15.100 / 52. 15.100
libavcodec 54. 89.100 / 54. 89.100
libavformat 54. 61.100 / 54. 61.100
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102

Input #0, mp3, from '/Users/atarikid/Desktop/output.mp3':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
track : 1/10
encoder : Lavf54.61.100

Duration: 00:00:04.88, start: 0.000000, bitrate: 128 kb/s

Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s

At least one output file must be specified

As you notice the track metadata reads 1/10 as it should.

Now the same but to m4a

/Users/atarikid/Desktop/ffmpeg -i /Users/atarikid/Desktop/source.m4a -c:a aac -strict -2 -metadata track=1/10 /Users/atarikid/Desktop/output.m4a

ffmpeg version N-48986-g9a038a9 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 19 2013 08:27:49 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-pthreads --disable-shared --enable-static --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libfaac --enable-postproc --enable-runtime-cpudetect --disable-debug --disable-network --disable-doc --enable-small --enable-nonfree
libavutil 52. 15.100 / 52. 15.100
libavcodec 54. 89.100 / 54. 89.100
libavformat 54. 61.100 / 54. 61.100
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/atarikid/Desktop/source.m4a':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
encoder : Lavf54.61.100

Duration: 00:00:04.85, start: 0.023220, bitrate: 98 kb/s

Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
Metadata:

handler_name : SoundHandler

File '/Users/atarikid/Desktop/output.m4a' already exists. Overwrite ? [y/N] y
Output #0, ipod, to '/Users/atarikid/Desktop/output.m4a':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
track : 1/10
encoder : Lavf54.61.100
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:

handler_name : SoundHandler

Stream mapping:

Stream #0:0 -> #0:0 (aac -> aac)

Press [q] to stop, ? for help
size= 77kB time=00:00:04.85 bitrate= 130.0kbits/s
video:0kB audio:75kB subtitle:0 global headers:0kB muxing overhead 2.081122%

Reading the output file:

/Users/atarikid/Desktop/ffmpeg -i /Users/atarikid/Desktop/output.m4a

ffmpeg version N-48986-g9a038a9 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 19 2013 08:27:49 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-pthreads --disable-shared --enable-static --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libfaac --enable-postproc --enable-runtime-cpudetect --disable-debug --disable-network --disable-doc --enable-small --enable-nonfree
libavutil 52. 15.100 / 52. 15.100
libavcodec 54. 89.100 / 54. 89.100
libavformat 54. 61.100 / 54. 61.100
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/atarikid/Desktop/output.m4a':

Metadata:

major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
encoder : Lavf54.61.100
track : 1

Duration: 00:00:04.88, start: 0.023220, bitrate: 129 kb/s

Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s
Metadata:

handler_name : SoundHandler

At least one output file must be specified

The track metadata is now only 1 which is not correct.

Notes:

  • It doesn't matter if you use aac, libfaac or any other aac encoder.
  • This issue also applies to ALAC encoding
  • All other codecs (ogg, wav, opus, ... ) it works fine as with mp3. So its only a .m4a issue

Hopes this helps fixing this.

by Atarikid, 11 years ago

Attachment: source.m4a added

comment:9 by Carl Eugen Hoyos, 11 years ago

Keywords: mov added
Reproduced by developer: set
Status: newopen
$ ffmpeg -i http://samples.ffmpeg.org/A-codecs/lossless/ALAC/old_midi_stuff.m4a -strict -2 -t 1 out.m4a
ffmpeg version N-49055-g60af6c3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 20 2013 15:48:14 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 15.100 / 52. 15.100
  libavcodec     54. 89.100 / 54. 89.100
  libavformat    54. 61.101 / 54. 61.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.101 /  3. 32.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://samples.ffmpeg.org/A-codecs/lossless/ALAC/old_midi_stuff.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 0
    compatible_brands: M4A mp42isom
    creation_time   : 2005-02-19 06:43:21
    title           : Track 02
    track           : 2/11
    encoder         : iTunes v4.7.1.30
  Duration: 00:03:21.23, start: 0.000000, bitrate: 485 kb/s
    Stream #0:0(und): Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s16, 485 kb/s
    Metadata:
      creation_time   : 2005-02-19 06:43:21
Output #0, ipod, to 'out.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 0
    compatible_brands: M4A mp42isom
    track           : 2/11
    title           : Track 02
    encoder         : Lavf54.61.101
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      creation_time   : 2005-02-19 06:43:21
Stream mapping:
  Stream #0:0 -> #0:0 (alac -> aac)
Press [q] to stop, [?] for help
size=      18kB time=00:00:01.02 bitrate= 146.2kbits/s
video:0kB audio:17kB subtitle:0 global headers:0kB muxing overhead 5.540479%
$ ffmpeg -i out.m4a
ffmpeg version N-49055-g60af6c3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 20 2013 15:48:14 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 15.100 / 52. 15.100
  libavcodec     54. 89.100 / 54. 89.100
  libavformat    54. 61.101 / 54. 61.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.101 /  3. 32.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    title           : Track 02
    encoder         : Lavf54.61.101
    track           : 2
  Duration: 00:00:01.05, start: 0.023220, bitrate: 142 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 135 kb/s
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified

comment:10 by Carl Eugen Hoyos, 11 years ago

Summary: -metadata track=1/10 and AAC issues-metadata track=1/10 and M4A issues

comment:11 by Carl Eugen Hoyos, 11 years ago

Keywords: metadata added

comment:12 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

Fixed in bb7f71d, thank you for the report!

Note: See TracTickets for help on using tickets.