Opened 13 years ago

Closed 13 years ago

#825 closed defect (fixed)

Track number metadata read from ASF (WMAL) off by one

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

Description

While attempting to batch convert some old WMA Lossless files and copy the metadata, I noticed that the track number gets decremented by one in the process (see track number as reported by mediainfo after ffmpeg output):

Z:\Arlo Guthrie\tmp>ffmpeg -v 9 -loglevel 99 -i "Arlo Guthrie.The Best Of Arlo Guthrie.09.Last To Leave.wma"
ffmpeg version N-36088-gdd1fb65, Copyright (c) 2000-2011 the FFmpeg developers

built on Dec 22 2011 12:45:32 with gcc 4.6.2
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 51. 32.100 / 51. 32.100
libavcodec 53. 47.100 / 53. 47.100
libavformat 53. 28.100 / 53. 28.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 53. 0 / 2. 53. 0
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 5.100 / 0. 0.100
libpostproc 51. 2.100 / 51. 2.100

[asf @ 00000000002FD020] Format asf probed with size=2048 and score=100
[asf @ 00000000002FD020] Unsupported value type 1 in tag ASFLeakyBucketPairs.
[asf @ 00000000002FD020] gpos mismatch our pos=24, end=26
[asf @ 00000000002FD020] gpos mismatch our pos=24, end=3727
[asf @ 00000000002FD020] gpos mismatch our pos=24, end=34
[asf @ 00000000002FD020] gpos mismatch our pos=24, end=226
[asf @ 00000000002FD020] gpos mismatch our pos=24, end=32
[wmalossless @ 0000000000356EC0] err{or,}_recognition separate: 1; 1
[wmalossless @ 0000000000356EC0] err{or,}_recognition combined: 1; 10001
[wmalossless @ 0000000000356EC0] Unsupported bit depth: 0
[wmalossless @ 0000000000356EC0] [10] [0] [3] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [21] [1] [0] [0]
[asf @ 00000000002FD020] parser not found for codec wmalossless, packets or times may be invalid.
[asf @ 00000000002FD020] All info found
Input #0, asf, from 'Arlo Guthrie.The Best Of Arlo Guthrie.09.Last To Leave.wma':

Metadata:

album_artist : Arlo Guthrie
album : The Best Of Arlo Guthrie
genre : Folk
WM/Year : 1977
WMFSDKVersion : 10.00.00.3802
WMFSDKNeeded : 0.0.0.0000
IsVBR : 1
track : 8
title : Last To Leave
artist : Arlo Guthrie

Duration: 00:02:35.24, start: 0.000000, bitrate: 735 kb/s

Stream #0:0, 1, 1/1000: Audio: wmalossless (c[1][0][0] / 0x0163), 44100 Hz, stereo, flt, 733 kb/s

At least one output file must be specified

Z:\Arlo Guthrie\tmp>mediainfo "Arlo Guthrie.The Best Of Arlo Guthrie.09.Last To Leave.wma"
General
Complete name : Arlo Guthrie.The Best Of Arlo Guthrie.09.Last To Leave.wma
Format : Windows Media
File size : 13.6 MiB
Duration : 2mn 35s
Overall bit rate mode : Variable
Overall bit rate : 735 Kbps
Maximum Overall bit rate : 778 Kbps
Album : The Best Of Arlo Guthrie
Track name : Last To Leave
Track name/Position : 9
Performer : Arlo Guthrie / Arlo Guthrie
Genre : Folk
Recorded date : 1977
Encoded date : UTC 2006-06-08 00:29:40.396

Audio
ID : 1
Format : WMA
Format profile : Lossless
Codec ID : 163
Codec ID/Info : Windows Media Audio
Description of the codec : Windows Media Audio 9.1 Lossless - VBR Quality 100, 44 kHz, 2 channel 16 bit 1-pass VBR
Duration : 2mn 35s
Bit rate mode : Variable
Bit rate : 733 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Stream size : 13.6 MiB (100%)

Let me know if a sample file would be helpful and I'll upload to the FTP.

Attachments (1)

patchasftrack.diff (545 bytes ) - added by Carl Eugen Hoyos 13 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Carl Eugen Hoyos, 13 years ago

Component: undeterminedavformat
Keywords: asf added

Is this only reproducible with WMAL or also with one of the already supported WMA codecs?
What does WMP show for your sample?

comment:2 by fatcatfan, 13 years ago

WMP as well as VLC and MP3tag all report the track number as expected, one higher than reported by ffmpeg. I tested it with a non-lossless file with similar results:

Z:\Arlo Guthrie\tmp>ffmpeg -v 9 -loglevel 99 -i yohoho.wma
ffmpeg version N-36088-gdd1fb65, Copyright (c) 2000-2011 the FFmpeg developers

built on Dec 22 2011 12:45:32 with gcc 4.6.2
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope

ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib

libavutil 51. 32.100 / 51. 32.100
libavcodec 53. 47.100 / 53. 47.100
libavformat 53. 28.100 / 53. 28.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 53. 0 / 2. 53. 0
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 5.100 / 0. 0.100
libpostproc 51. 2.100 / 51. 2.100

[asf @ 0000000001FBCE50] Format asf probed with size=2048 and score=100
[asf @ 0000000001FBCE50] gpos mismatch our pos=24, end=26
[asf @ 0000000001FBCE50] gpos mismatch our pos=24, end=1233
[asf @ 0000000001FBCE50] gpos mismatch our pos=24, end=34
[asf @ 0000000001FBCE50] gpos mismatch our pos=24, end=166
[asf @ 0000000001FBCE50] gpos mismatch our pos=24, end=32
[wmav2 @ 0000000000315CA0] err{or,}_recognition separate: 1; 1
[wmav2 @ 0000000000315CA0] err{or,}_recognition combined: 1; 10001
[wmav2 @ 0000000000315CA0] Unsupported bit depth: 0
[asf @ 0000000001FBCE50] parser not found for codec wmav2, packets or times may be invalid.
[asf @ 0000000001FBCE50] All info found
Input #0, asf, from 'yohoho.wma':

Metadata:

WMFSDKVersion : 9.00.00.2980
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
WM/ToolName : Adobe Audition
WM/ToolVersion : 1.0.3211.2
track : 4

Duration: 00:02:38.11, start: 0.000000, bitrate: 16 kb/s

Stream #0:0, 1, 1/1000: Audio: wmav2 (a[1][0][0] / 0x0161), 22050 Hz, 1 channels, s16, 16 kb/s

Z:\Arlo Guthrie\tmp>mediainfo yohoho.wma
General
Complete name : yohoho.wma
Format : Windows Media
File size : 325 KiB
Duration : 2mn 38s
Overall bit rate mode : Constant
Overall bit rate : 16.8 Kbps
Maximum Overall bit rate : 16.6 Kbps
Track name/Position : 5
Encoded date : UTC 2004-09-18 17:51:46.711
Writing application : Adobe Audition 1.0.3211.2

Audio
ID : 1
Format : WMA
Format version : Version 2
Codec ID : 161
Codec ID/Info : Windows Media Audio
Description of the codec : Windows Media Audio 9 - 16 kbps, 22 kHz, mono 1-pass CBR
Duration : 2mn 38s
Bit rate mode : Constant
Bit rate : 16.0 Kbps
Channel(s) : 1 channel
Sampling rate : 22.05 KHz
Bit depth : 16 bits
Stream size : 309 KiB (95%)

in reply to:  2 comment:3 by Carl Eugen Hoyos, 13 years ago

Replying to fatcatfan:

WMP as well as VLC and MP3tag all report the track number as expected, one higher than reported by ffmpeg. I tested it with a non-lossless file with similar results:

Please provide a sample.

comment:4 by reimar, 13 years ago

While it seems crazy, the only explanation I can think of is that WM/TrackNumber is 1-based while WM/Track is 0-based. FFmpeg will convert Track to use TrackNumber instead, but assumes both are exactly the same.

comment:6 by fatcatfan, 13 years ago

Uploaded "wma_track_no_ticket825.wma" to the ftp, which was actually the second, non-lossless file mentioned in my second comment. Although, it looks like cehoyos has found the likely source of the problem without a sample.

by Carl Eugen Hoyos, 13 years ago

Attachment: patchasftrack.diff added

comment:7 by Carl Eugen Hoyos, 13 years ago

Reproduced by developer: set
Status: newopen

comment:8 by Carl Eugen Hoyos, 13 years ago

Keywords: metadata added
Resolution: fixed
Status: openclosed

Fixed differently.

Note: See TracTickets for help on using tickets.