Why audio element currentTime on ffmpeg encoded mp3 file in Chrome browser does not work -
i have html5 audio element:
<audio id="mp3_audio_player" preload="auto"> <source src="./sound/recording.mp3" type="audio/mpeg"> </audio>
and need able play last 4 seconds mp3 recording. javascript is:
audio.currenttime = audio.duration-4; audio.play();
works ok in ie10 , firefox, chrome starts playing wrong place. difference between reported audio.currenttime , actual playback position 20s. recording.mp3 created ffmpeg:
ffmpeg -i recording.wav -ab 32k recording.mp3
it works, when strip id3v2 header recording.mp3 (deleting first couple bytes in file before audio data).
it works when compress ogg. can point me right direction (ffmpeg switches, audio element attributes or whatever) work in chrome?
thanks in advance
edit: ffmpeg output:
ffmpeg version n-53528-g160ea26 copyright (c) 2000-2013 ffmpeg developers built on may 27 2013 15:20:09 gcc 4.7.3 (gcc) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo- amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs -- enable-libxvid --enable-zlib libavutil 52. 34.100 / 52. 34.100 libavcodec 55. 12.100 / 55. 12.100 libavformat 55. 7.100 / 55. 7.100 libavdevice 55. 1.101 / 55. 1.101 libavfilter 3. 72.100 / 3. 72.100 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 [wav @ 0433e840] max_analyze_duration 5000000 reached @ 5015510 microseconds guessed channel layout input stream #0.0 : mono input #0, wav, 'recording.wav': duration: 02:30:07.86, bitrate: 176 kb/s stream #0:0: audio: pcm_s16le ([1][0][0][0] / 0x0001), 11025 hz, mono, s16, 176 kb/s output #0, mp3, 'recording.mp3': metadata: tsse : lavf55.7.100 stream #0:0: audio: mp3 (libmp3lame), 11025 hz, mono, s16p, 32 kb/s stream mapping: stream #0:0 -> #0:0 (pcm_s16le -> libmp3lame) press [q] stop, [?] size= 35188kb time=02:30:07.86 bitrate= 32.0kbits/s video:0kb audio:35187kb subtitle:0 global headers:0kb muxing overhead 0.000672%
Comments
Post a Comment