#5121: Wrong sample rate read from / written to opus webm file -------------------------------------+------------------------------------- Reporter: pszemus | Type: defect Status: new | Priority: normal Component: | Version: undetermined | unspecified Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: As reported in https://bugzilla.mozilla.org/show_bug.cgi?id=1227153 trying to create a 24kHz opus@webm file produces a file that has 48kHz written to an opus header (?). What's strange is that MediaInfo shows this sample rate correctly.
How to reproduce: {{{ $ ffmpeg -i http://www.soundsnap.com/audio/play/72210%3A1448291371%3Ab4326304c013a3a61b3b87d83158c91b -c:a libopus -b:a 64k -ar 24000 /tmp/tmp.webm ffmpeg version N-77704-g68eb208 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --prefix=/home/pszemus/ffmpeg/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable- libopus --enable-libx264 --enable-libwebp --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/include --extra- ldflags='-L/opt/WP/common.libs/lib -ldl' libavutil 55. 12.100 / 55. 12.100 libavcodec 57. 21.100 / 57. 21.100 libavformat 57. 21.100 / 57. 21.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 23.100 / 6. 23.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [mp3 @ 0x2ae63a0] Skipping 0 bytes of junk at 0. [mp3 @ 0x2ae63a0] Estimating duration from bitrate, this may be inaccurate Input #0, mp3, from 'http://www.soundsnap.com/audio/play/72210%3A1448291371%3Ab4326304c013a3a61b3b87d83158c91b': Metadata: title : PleaseRefesh2015_1 date : 2015 track : 1 Duration: 00:00:04.13, start: 0.000000, bitrate: 192 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s Output #0, webm, to '/tmp/tmp.webm': Metadata: title : PleaseRefesh2015_1 date : 2015 track : 1 encoder : Lavf57.21.100 Stream #0:0: Audio: opus (libopus), 24000 Hz, stereo, s16, 64 kb/s Metadata: encoder : Lavc57.21.100 libopus Stream mapping: Stream #0:0 -> #0:0 (mp3 (native) -> opus (libopus)) Press [q] to stop, [?] for help size= 37kB time=00:00:04.13 bitrate= 73.7kbits/s speed=15.4x video:0kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.376523% }}} {{{ $ ffmpeg -i /tmp/tmp.webm ffmpeg version N-77704-g68eb208 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --prefix=/home/pszemus/ffmpeg/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable- libopus --enable-libx264 --enable-libwebp --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/include --extra- ldflags='-L/opt/WP/common.libs/lib -ldl' libavutil 55. 12.100 / 55. 12.100 libavcodec 57. 21.100 / 57. 21.100 libavformat 57. 21.100 / 57. 21.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 23.100 / 6. 23.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, matroska,webm, from '/tmp/tmp.webm': Metadata: title : PleaseRefesh2015_1 encoder : Lavf57.21.100 Duration: 00:00:04.14, start: 0.007000, bitrate: 73 kb/s Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp (default) At least one output file must be specified }}} {{{ $ mediainfo /tmp/tmp.webm General Unique ID : 23699742163318188445154506414781705045 (0x11D46780E7425B3B392AC806ACE92B55) Complete name : /tmp/tmp.webm Format : WebM Format version : Version 4 / Version 2 File size : 37.2 KiB Duration : 4s 135ms Overall bit rate : 73.6 Kbps Track name : PleaseRefesh2015_1 Writing application : Lavf57.21.100 Writing library : Lavf57.21.100 Audio ID : 1 Format : Opus Codec ID : A_OPUS Duration : 4s 135ms Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 24.0 KHz Bit depth : 16 bits Compression mode : Lossy Default : Yes Forced : No }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/5121> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker _______________________________________________ FFmpeg-trac mailing list FFmpeg-trac@avcodec.org http://ffmpeg.org/mailman/listinfo/ffmpeg-trac