<p>Looks like ffmpeg needs to see the quotes around the parens, so you need to protect them from the shell with another layer of quotes.</p>

<p><code>ffmpeg -i ~/Downloads/in.mov -vcodec copy -af "volume=enable='between(t,0,3)':volume=0" ~/Downloads/out2.mov</code></p>

<p>Also, don't forget to specify something about the audio codec.  ffmpeg's default AAC encoder is bad compared to libfdkaac.  And you're not specifying an audio bitrate or quality.</p>

CC BY-SA 3.0
2015-04-11T12:53:20.897Z
Is there a better way of formating console code here, maybe with a linebreak to better distinguish it from the answer?
p2or
CC BY-SA 3.0
2015-04-11T13:23:13.093Z
oops, I left out a trailing backquote so my ffmpeg command got mis-formatted.  The only difference is that i added double quotes around the entire argument to `-af`.  There are many other ways to protect the single quotes from the shell, or to quote the parens for ffmpeg's parser with backslashes.
Peter Cordes
CC BY-SA 3.0
2015-04-11T12:40:24.280Z
2015-04-11T13:20:18.430Z
2015-04-11T13:20:18.430Z
Peter Cordes
<p>If you want to mute the first 3 seconds of each audio stream then you have to filter each one:</p>

<pre><code>ffmpeg -i input.mov -filter_complex \
"[0:a:0]volume=enable='between(t,0,3)':volume=0[a0]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a1]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a2]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a3]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a4]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a5]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a6]" \
-map 0:v -map "[a0]" -map "[a1]" -map "[a2]" -map "[a3]" \
-map "[a4]" -map "[a5]" -map "[a6]" -map 0:d -c copy -c:a pcm_s24le output.mov
</code></pre>

<p>If you prefer to merge all of the channels into a single, multichannel stream, then use <a href="http://ffmpeg.org/ffmpeg-filters.html#amerge" rel="nofollow"><code>amerge</code></a> first:</p>

<pre><code>ffmpeg -i input.mov -filter_complex \
"[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6]amerge=inputs=6,volume=enable='between(t,0,3)':volume=0[a]; \
-map 0:v -map "[a]" -map 0:d -c copy -c:a pcm_s24le output.mov
</code></pre>

<p>I didn't test these examples since I do not have a similar input file and I was too lazy to make one.</p>

CC BY-SA 3.0
2015-04-10T17:57:51.587Z
filtering each audio stream doesn't seem to work or I'm missing the syntax somewhere as it just results in the prompt >
Tony
CC BY-SA 3.0
2015-04-10T18:08:41.140Z
@Tony There were extra `"` in my example. Copy paste typo. I removed them. Try again. Or provide a short input sample and I can perform an actual test on it.
llogan
CC BY-SA 3.0
2015-04-10T18:14:51.083Z
hmm ok revised version works but the audio is now slightly out of sync from where it was before.
Tony
CC BY-SA 3.0
2015-04-10T18:48:49.167Z
@Tony You should update your question with your command and the console output.
llogan
CC BY-SA 3.0
2015-04-09T21:14:39.767Z
2015-04-10T18:08:08.963Z
llogan
<p>Looking to edit a blip out of the beginning of a video/audio file:</p>

<ul>
<li><p>How can I use <code>ffmpeg</code> to only edit the first two seconds of the clip so that there's no longer that blip in the audio?</p></li>
<li><p>How do I ensure that all 7 audio tracks are affected by the audio filter?</p></li>
<li><p>How do I ensure that all 7 are also present in my output file in the same input specs?</p></li>
</ul>

<p>Complete output:</p>

<pre><code>ffmpeg -i ~/Downloads/in.mov  -vcodec copy -acodec pcm_s24le -q:a 0 -af "volume=enable='between(t,0,3)':volume=0"  ~/Downloads/out2.mov
ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Guessed Channel Layout for  Input Stream #0.7 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '~/Downloads/in.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2014-01-16 18:02:27
  Duration: 00:00:06.44, start: 0.000000, bitrate: 119128 kb/s
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 109843 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 (HQ)
      timecode        : 01:00:00;00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:8(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:28
      handler_name    : Apple Alias Data Handler
      timecode        : 01:00:00;00
File '~/Downloads/out2.mov' already exists. Overwrite ? [y/N] y
Output #0, mov, to '~/Downloads/out2.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf56.25.101
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 109843 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 2997 tbc (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 (HQ)
      timecode        : 01:00:00;00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.26.100 pcm_s24le
Stream mapping:
  Stream #0:0 -&gt; #0:0 (copy)
  Stream #0:7 -&gt; #0:1 (pcm_s24le (native) -&gt; pcm_s24le (native))
Press [q] to stop, [?] for help
frame=  193 fps=109 q=-1.0 Lsize=   88166kB time=00:00:06.43 bitrate=112155.7kbits/s    
video:86349kB audio:1811kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.006946%
</code></pre>

CC BY-SA 3.0
2015-04-08T20:33:18.877Z
You can mute audio sections like this  http://stackoverflow.com/questions/29215197/mute-specified-sections-of-an-audio-file-using-ffmpeg/29222419#29222419. You cannot use `-acodec copy` at the same time.
aergistal
CC BY-SA 3.0
2015-04-09T16:39:03.300Z
Ah looks like putting quotes around the entire filter results in ffmpeg not throwing the error but I also get no other audio which is not intended.

`ffmpeg -i ~/Downloads/in.mov -vcodec copy -af "volume=volume='between(t,0,3)':volume=0" ~/Downloads/out2.mov `
Tony
CC BY-SA 3.0
2015-04-09T16:50:18.560Z
You should always include the **complete** console output along with your command when asking for help with `ffmpeg`.
llogan
CC BY-SA 3.0
2015-04-09T18:12:38.100Z
You have 7 audio streams. Default [stream selection](https://ffmpeg.org/ffmpeg.html#Stream-selection) will automatically select the stream with the most channels (`0:7`). Do you want to include the rest? They are just being ignored. The output is being encoded as AAC. Do you want that, or do you want it to be the same as the input? Also, your filtering command should probably look like: `volume=enable='between(t,0,3)':volume=0`.
llogan
CC BY-SA 3.0
2015-04-09T20:29:59.980Z
@LordNeckbeard updated question a bit and posted most recent result.
Tony
<audio><ffmpeg>
ffmpeg: mute first 2 seconds in all audio streams
Tony
# ffmpeg: mute first 2 seconds in all audio streams

(Asked by: username_0 on 2015-04-08)

Looking to edit a blip out of the beginning of a video/audio file:

How can I use ffmpeg to only edit the first two seconds of the clip so that there's no longer that blip in the audio?
How do I ensure that all 7 audio tracks are affected by the audio filter?
How do I ensure that all 7 are also present in my output file in the same input specs?

Complete output:
ffmpeg -i ~/Downloads/in.mov  -vcodec copy -acodec pcm_s24le -q:a 0 -af "volume=enable='between(t,0,3)':volume=0"  ~/Downloads/out2.mov
ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Guessed Channel Layout for  Input Stream #0.7 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '~/Downloads/in.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2014-01-16 18:02:27
  Duration: 00:00:06.44, start: 0.000000, bitrate: 119128 kb/s
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 109843 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 (HQ)
      timecode        : 01:00:00;00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
    Stream #0:8(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:28
      handler_name    : Apple Alias Data Handler
      timecode        : 01:00:00;00
File '~/Downloads/out2.mov' already exists. Overwrite ? [y/N] y
Output #0, mov, to '~/Downloads/out2.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf56.25.101
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 109843 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 2997 tbc (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 (HQ)
      timecode        : 01:00:00;00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2014-01-16 18:02:27
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.26.100 pcm_s24le
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:7 -> #0:1 (pcm_s24le (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
frame=  193 fps=109 q=-1.0 Lsize=   88166kB time=00:00:06.43 bitrate=112155.7kbits/s    
video:86349kB audio:1811kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.006946%

**Tags:** audio, ffmpeg

> **Comments:**
> **username_1**: You can mute audio sections like this  http://stackoverflow.com/questions/29215197/mute-specified-sections-of-an-audio-file-using-ffmpeg/29222419#29222419. You cannot use `-acodec copy` at the same time.  
> **username_0**: Ah looks like putting quotes around the entire filter results in ffmpeg not throwing the error but I also get no other audio which is not intended.  `ffmpeg -i ~/Downloads/in.mov -vcodec copy -af "volume=volume='between(t,0,3)':volume=0" ~/Downloads/out2.mov `  
> **username_2**: You should always include the **complete** console output along with your command when asking for help with `ffmpeg`.  
> **username_2**: You have 7 audio streams. Default [stream selection](https://ffmpeg.org/ffmpeg.html#Stream-selection) will automatically select the stream with the most channels (`0:7`). Do you want to include the rest? They are just being ignored. The output is being encoded as AAC. Do you want that, or do you want it to be the same as the input? Also, your filtering command should probably look like: `volume=enable='between(t,0,3)':volume=0`.  
> **username_0**: @LordNeckbeard updated question a bit and posted most recent result.  

---

## 2 answers

### Answer by username_3 on 2015-04-11. Score: 2

Looks like ffmpeg needs to see the quotes around the parens, so you need to protect them from the shell with another layer of quotes.

`ffmpeg -i ~/Downloads/in.mov -vcodec copy -af "volume=enable='between(t,0,3)':volume=0" ~/Downloads/out2.mov`

Also, don't forget to specify something about the audio codec. ffmpeg's default AAC encoder is bad compared to libfdkaac. And you're not specifying an audio bitrate or quality.

> **Comments:**
> **username_4**: Is there a better way of formating console code here, maybe with a linebreak to better distinguish it from the answer?  
> **username_3**: oops, I left out a trailing backquote so my ffmpeg command got mis-formatted.  The only difference is that i added double quotes around the entire argument to `-af`.  There are many other ways to protect the single quotes from the shell, or to quote the parens for ffmpeg's parser with backslashes.  

---

### Answer by username_2 on 2015-04-09. Score: 1

If you want to mute the first 3 seconds of each audio stream then you have to filter each one:
ffmpeg -i input.mov -filter_complex \
"[0:a:0]volume=enable='between(t,0,3)':volume=0[a0]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a1]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a2]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a3]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a4]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a5]; \
 [0:a:0]volume=enable='between(t,0,3)':volume=0[a6]" \
-map 0:v -map "[a0]" -map "[a1]" -map "[a2]" -map "[a3]" \
-map "[a4]" -map "[a5]" -map "[a6]" -map 0:d -c copy -c:a pcm_s24le output.mov

If you prefer to merge all of the channels into a single, multichannel stream, then use amerge first:
ffmpeg -i input.mov -filter_complex \
"[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6]amerge=inputs=6,volume=enable='between(t,0,3)':volume=0[a]; \
-map 0:v -map "[a]" -map 0:d -c copy -c:a pcm_s24le output.mov

I didn't test these examples since I do not have a similar input file and I was too lazy to make one.

> **Comments:**
> **username_0**: filtering each audio stream doesn't seem to work or I'm missing the syntax somewhere as it just results in the prompt >  
> **username_2**: @username_0 There were extra `"` in my example. Copy paste typo. I removed them. Try again. Or provide a short input sample and I can perform an actual test on it.  
> **username_0**: hmm ok revised version works but the audio is now slightly out of sync from where it was before.  
> **username_2**: @username_0 You should update your question with your command and the console output.  

---

