Opened 7 months ago

Closed 7 months ago

#6157 closed defect (fixed)

sound shake when change speed

Reported by: stevenliu Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: atempo
Cc: pkoshevoy@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description

Summary of the bug:
When transcode WAV file to aac, and use af_atempo change the speed,the audio sound shake.

How to reproduce:

localhost:commit StevenLiu$ ./ffmpeg -v trace -i ~/example.wav -af atempo=0.5 -acodec aac -y output.aac
ffmpeg version N-83545-g6baee21 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration:
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 80.100 / 57. 80.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 73.100 /  6. 73.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input url with argument '/Users/StevenLiu/example.wav'.
Reading option '-af' ... matched as option 'af' (set audio filters) with argument 'atempo=0.5'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output.aac' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument trace.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url /Users/StevenLiu/example.wav.
Successfully parsed a group of options.
Opening an input file: /Users/StevenLiu/example.wav.
[file @ 0x7fdbb0e01aa0] Setting default whitelist 'file,crypto'
Probing wav score:99 size:2048
[wav @ 0x7fdbb1800000] Format wav probed with size=2048 and score=99
[wav @ 0x7fdbb1800000] Before avformat_find_stream_info() pos: 46 bytes read:65582 seeks:1 nb_streams:1
[wav @ 0x7fdbb1800000] probing stream 0 pp:32
[wav @ 0x7fdbb1800000] probing stream 0 pp:31
[wav @ 0x7fdbb1800000] probing stream 0 pp:30
[wav @ 0x7fdbb1800000] probing stream 0 pp:29
[wav @ 0x7fdbb1800000] probing stream 0 pp:28
[wav @ 0x7fdbb1800000] probing stream 0 pp:27
[wav @ 0x7fdbb1800000] probing stream 0 pp:26
[wav @ 0x7fdbb1800000] probing stream 0 pp:25
[wav @ 0x7fdbb1800000] probing stream 0 pp:24
[wav @ 0x7fdbb1800000] probing stream 0 pp:23
[wav @ 0x7fdbb1800000] probing stream 0 pp:22
[wav @ 0x7fdbb1800000] probing stream 0 pp:21
[wav @ 0x7fdbb1800000] probing stream 0 pp:20
[wav @ 0x7fdbb1800000] probing stream 0 pp:19
[wav @ 0x7fdbb1800000] probing stream 0 pp:18
[wav @ 0x7fdbb1800000] probing stream 0 pp:17
[wav @ 0x7fdbb1800000] probing stream 0 pp:16
[wav @ 0x7fdbb1800000] probing stream 0 pp:15
[wav @ 0x7fdbb1800000] probing stream 0 pp:14
[wav @ 0x7fdbb1800000] probing stream 0 pp:13
[wav @ 0x7fdbb1800000] probing stream 0 pp:12
[wav @ 0x7fdbb1800000] probing stream 0 pp:11
[wav @ 0x7fdbb1800000] probing stream 0 pp:10
[wav @ 0x7fdbb1800000] probing stream 0 pp:9
[wav @ 0x7fdbb1800000] probing stream 0 pp:8
[wav @ 0x7fdbb1800000] probing stream 0 pp:7
[wav @ 0x7fdbb1800000] probing stream 0 pp:6
[wav @ 0x7fdbb1800000] probing stream 0 pp:5
[wav @ 0x7fdbb1800000] probing stream 0 pp:4
[wav @ 0x7fdbb1800000] probing stream 0 pp:3
[wav @ 0x7fdbb1800000] probing stream 0 pp:2
[wav @ 0x7fdbb1800000] probing stream 0 pp:1
[wav @ 0x7fdbb1800000] probed stream 0
[wav @ 0x7fdbb1800000] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 0x7fdbb1800000] All info found
[wav @ 0x7fdbb1800000] stream 0: start_time: -209146758205323.719 duration: 253.100
[wav @ 0x7fdbb1800000] format: start_time: -9223372036854.775 duration: 253.100 bitrate=1411 kb/s
[wav @ 0x7fdbb1800000] After avformat_find_stream_info() pos: 204846 bytes read:294958 seeks:1 frames:50
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from '/Users/StevenLiu/example.wav':
  Duration: 00:04:13.10, bitrate: 1411 kb/s
    Stream #0:0, 50, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Successfully opened the file.
Parsing a group of options: output url output.aac.
Applying option af (set audio filters) with argument atempo=0.5.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument aac.
Successfully parsed a group of options.
Opening an output file: output.aac.
[file @ 0x7fdbb0f01d80] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[Parsed_atempo_0 @ 0x7fdbb0c0f1e0] Setting 'tempo' to value '0.5'
[graph_0_in_0_0 @ 0x7fdbb0c0e840] Setting 'time_base' to value '1/44100'
[graph_0_in_0_0 @ 0x7fdbb0c0e840] Setting 'sample_rate' to value '44100'
[graph_0_in_0_0 @ 0x7fdbb0c0e840] Setting 'sample_fmt' to value 's16'
[graph_0_in_0_0 @ 0x7fdbb0c0e840] Setting 'channel_layout' to value '0x3'
[graph_0_in_0_0 @ 0x7fdbb0c0e840] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x3
[format_out_0_0 @ 0x7fdbb0d00c20] Setting 'sample_fmts' to value 'fltp'
[format_out_0_0 @ 0x7fdbb0d00c20] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[format_out_0_0 @ 0x7fdbb0d00c20] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_atempo_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0x7fdbb0d003e0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 0x7fdbb0d01560] [SWR @ 0x7fdbb180c600] Using s16p internally between filters
[auto_resampler_0 @ 0x7fdbb0d01560] ch:2 chl:stereo fmt:s16 r:44100Hz -> ch:2 chl:stereo fmt:fltp r:44100Hz
Output #0, adts, to 'output.aac':
  Metadata:
    encoder         : Lavf57.66.102
    Stream #0:0, 0, 1/44100: Audio: aac (LC), 44100 Hz, stereo, fltp, delay 1024, 128 kb/s
    Metadata:
      encoder         : Lavc57.80.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
No more output streams to write to, finishing.1kbits/s speed=27.1x
size=    8097kB time=00:08:26.10 bitrate= 131.1kbits/s speed=27.4x
video:0kB audio:7948kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.874797%
Input file #0 (/Users/StevenLiu/example.wav):
  Input stream #0:0 (audio): 10901 packets read (44646912 bytes); 10901 frames decoded (11161728 samples);
  Total: 10901 packets (44646912 bytes) demuxed
Output file #0 (output.aac):
  Output stream #0:0 (audio): 21796 frames encoded (22319104 samples); 21797 packets muxed (8138426 bytes);
  Total: 21797 packets (8138426 bytes) muxed
10901 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fdbb0f01f00] Statistics: 0 seeks, 21797 writeouts
[aac @ 0x7fdbb280f000] Qavg: 1065.791
[AVIOContext @ 0x7fdbb0e01be0] Statistics: 44712494 bytes read, 1 seeks
localhost:commit StevenLiu$

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Patch has send to Maillist :
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-February/207289.html

Change History (4)

comment:1 Changed 7 months ago by stevenliu

  • Status changed from new to open

https://pan.baidu.com/s/1cKPBqA

The wav file is too big, output of the limit size, so you can download from here.

comment:2 Changed 7 months ago by pkoshevoy

Last edited 7 months ago by pkoshevoy (previous) (diff)

comment:3 Changed 7 months ago by stevenliu

tested ok

comment:4 Changed 7 months ago by stevenliu

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.