<p>Drop the vorbis audio</p>

<p><code>ffmpeg -i EnergyVideo.mp4 -i EnergyAudio.mp3 -filter_complex \
"[1:a]volume=enable='between(t,27,33)+between(t,38,42)'[1a];[0:a][1a]amerge=inputs=2[a]" \
-map 0:v -map "[a]" -c:v copy -c:a aac -ac 2 -shortest energyvideooutput2.mp4</code></p>

CC BY-SA 4.0
2018-05-19T06:18:49.633Z
2018-05-19T06:18:49.633Z
Gyan
<p>I run below command for this question that is working and give output file in mp4 but that file is not open in QuickTime Player but open in VLC Player and not open in other PC also.</p>

<p><strong>Command:</strong></p>

<pre><code>ffmpeg -i EnergyVideo.mp4 -i EnergyAudio.mp3 -filter_complex \
"[1:a]volume=enable='between(t,27,33)':volume=0, volume=enable='between(t,38,42)':volume=0[1a];[0:a][1a]amerge=inputs=2[a]" \
-map 0:v -map "[a]" -c:v copy -c:a libvorbis -ac 2 -shortest energyvideooutput2.mp4
</code></pre>

<p>Output file Log:</p>

<pre><code>ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'EnergyVideo.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:42.03, start: 0.000000, bitrate: 9889 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 9779 kb/s, 30 fps, 30 tbr, 19200 tbn, 38400 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 101 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mp3, from 'EnergyAudio.mp3':
  Metadata:
    TCM             : Jimmy Tran
    TT1             : This video is about ENERGY Track #1 Clip 1
    title           : ENERGY Track #1 Clip 1
    encoded_by      : iTunes 9.1
  Duration: 00:00:42.27, start: 0.000000, bitrate: 258 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 258 kb/s
Stream mapping:
  Stream #0:1 (aac) -&gt; amerge:in0
  Stream #1:0 (mp3float) -&gt; volume
  Stream #0:0 -&gt; #0:0 (copy)
  amerge -&gt; Stream #0:1 (libvorbis)
Press [q] to stop, [?] for help
[Parsed_amerge_2 @ 0x7fe0db617100] No channel layout for input 1
[Parsed_amerge_2 @ 0x7fe0db617100] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mp4, to 'energyvideooutput.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.12.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 9779 kb/s, 30 fps, 30 tbr, 19200 tbn, 19200 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1: Audio: vorbis (libvorbis) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp (default)
    Metadata:
      encoder         : Lavc58.18.100 libvorbis
frame=  711 fps=0.0 q=-1.0 size=   29696kB time=00:00:23.63 bitrate=10293.5kbitsframe= 1261 fps=0.0 q=-1.0 Lsize=   50650kB time=00:00:41.96 bitrate=9886.9kbits/s speed=45.8x
video:50177kB audio:415kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.114199%
</code></pre>

<p>Thank You.</p>

CC BY-SA 4.0
2018-05-18T11:32:11.843Z
Why libvorbis? What's the video codec? Show log.
Gyan
CC BY-SA 4.0
2018-05-18T11:39:17.070Z
I add log to question.
Jinal Somaiya
CC BY-SA 4.0
2018-05-18T13:01:44.703Z
Why libvorbis ?
Gyan
CC BY-SA 4.0
2018-05-19T06:14:33.120Z
I don't know more about ffmpeg. I searched from google and run that command but these type of error occured.
Jinal Somaiya
<ffmpeg>
merge audio and video(having audio) using ffmpeg command
Jinal Somaiya
# merge audio and video(having audio) using ffmpeg command

(Asked by: username_0 on 2018-05-18)

I run below command for this question that is working and give output file in mp4 but that file is not open in QuickTime Player but open in VLC Player and not open in other PC also.
Command:
ffmpeg -i EnergyVideo.mp4 -i EnergyAudio.mp3 -filter_complex \
"[1:a]volume=enable='between(t,27,33)':volume=0, volume=enable='between(t,38,42)':volume=0[1a];[0:a][1a]amerge=inputs=2[a]" \
-map 0:v -map "[a]" -c:v copy -c:a libvorbis -ac 2 -shortest energyvideooutput2.mp4

Output file Log:
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'EnergyVideo.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:42.03, start: 0.000000, bitrate: 9889 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 9779 kb/s, 30 fps, 30 tbr, 19200 tbn, 38400 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 101 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mp3, from 'EnergyAudio.mp3':
  Metadata:
    TCM             : Jimmy Tran
    TT1             : This video is about ENERGY Track #1 Clip 1
    title           : ENERGY Track #1 Clip 1
    encoded_by      : iTunes 9.1
  Duration: 00:00:42.27, start: 0.000000, bitrate: 258 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 258 kb/s
Stream mapping:
  Stream #0:1 (aac) -> amerge:in0
  Stream #1:0 (mp3float) -> volume
  Stream #0:0 -> #0:0 (copy)
  amerge -> Stream #0:1 (libvorbis)
Press [q] to stop, [?] for help
[Parsed_amerge_2 @ 0x7fe0db617100] No channel layout for input 1
[Parsed_amerge_2 @ 0x7fe0db617100] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mp4, to 'energyvideooutput.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.12.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 9779 kb/s, 30 fps, 30 tbr, 19200 tbn, 19200 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1: Audio: vorbis (libvorbis) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp (default)
    Metadata:
      encoder         : Lavc58.18.100 libvorbis
frame=  711 fps=0.0 q=-1.0 size=   29696kB time=00:00:23.63 bitrate=10293.5kbitsframe= 1261 fps=0.0 q=-1.0 Lsize=   50650kB time=00:00:41.96 bitrate=9886.9kbits/s speed=45.8x
video:50177kB audio:415kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.114199%

Thank You.

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Why libvorbis? What's the video codec? Show log.  
> **username_0**: I add log to question.  
> **username_1**: Why libvorbis ?  
> **username_0**: I don't know more about ffmpeg. I searched from google and run that command but these type of error occured.  

---

## 1 answers

### Answer by username_1 on 2018-05-19. Score: 0 | Accepted answer

Drop the vorbis audio

`ffmpeg -i EnergyVideo.mp4 -i EnergyAudio.mp3 -filter_complex \
"[1:a]volume=enable='between(t,27,33)+between(t,38,42)'[1a];[0:a][1a]amerge=inputs=2[a]" \
-map 0:v -map "[a]" -c:v copy -c:a aac -ac 2 -shortest energyvideooutput2.mp4`


---

