#5121: Wrong sample rate read from / written to opus webm file -------------------------------------+------------------------------------- Reporter: pszemus | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+-------------------------------------
Comment (by pszemus): No, I want the ffmpeg to create with and report the correct sample rate value. Let's create an opus file like this: {{{ $ ffmpeg -i http://www.soundsnap.com/audio/play/72210%3A1448291371%3Ab4326304c013a3a61b3b87d83158c91b -c:a libopus -b:a 64k -ar 24000 /tmp/tmp.opus 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 @ 0x3c683a0] Skipping 0 bytes of junk at 0. [mp3 @ 0x3c683a0] 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, opus, to '/tmp/tmp.opus': 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 title : PleaseRefesh2015_1 date : 2015 TRACKNUMBER : 1 Stream mapping: Stream #0:0 -> #0:0 (mp3 (native) -> opus (libopus)) Press [q] to stop, [?] for help size= 36kB time=00:00:04.13 bitrate= 71.0kbits/s speed=15.3x video:0kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.533776% }}} Now compare the output form FFmpeg and opusinfo (from opus-tools) analysis: {{{ $ ffmpeg -i /tmp/tmp.opus 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, ogg, from '/tmp/tmp.opus': Duration: 00:00:04.13, start: 0.000000, bitrate: 70 kb/s Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp Metadata: ENCODER : Lavc57.21.100 libopus TITLE : PleaseRefesh2015_1 DATE : 2015 track : 1 At least one output file must be specified }}} {{{ $ opusinfo /tmp/tmp.opus Processing file "/tmp/tmp.opus"... New logical stream (#1, serial: 281a7d51): type opus Encoded with Lavf57.21.100 User comments section follows... encoder=Lavc57.21.100 libopus title=PleaseRefesh2015_1 date=2015 TRACKNUMBER=1 Opus stream 1: Pre-skip: 156 Playback gain: 0 dB Channels: 2 Original sample rate: 24000Hz Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min) Page duration: 1000.0ms (max), 828.0ms (avg), 140.0ms (min) Total data length: 36674 bytes (overhead: 1.51%) Playback length: 0m:04.130s Average bitrate: 71.03 kb/s, w/o overhead: 69.96 kb/s Logical stream 1 ended }}} Where this inconsistency come from? Why does FFmpeg and Firefox report 48kHz sample rate when MediaInfo and opusinfo show 24kHz? -- Ticket URL: <https://trac.ffmpeg.org/ticket/5121#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker _______________________________________________ FFmpeg-trac mailing list FFmpeg-trac@avcodec.org http://ffmpeg.org/mailman/listinfo/ffmpeg-trac