Cannot remove audio from video in FFMPEG (-an or -map doesnt work)

the following dont work

ffmpeg -i <input> -an <output>.mp4

ffmpeg -i <input> -map 0:0 -v:c copy <output>

The output returns the converted video WITH the audio still included. I’m trying to remove it.


Input video info

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:28.70, start: 0.000000, bitrate: 858 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt709/bt709), 1920x1080 [SAR 1:1 DAR 16:9], 717 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Answer

ffmpeg -i <input> -map 0:0 -map 0:1 -c:v copy -an <output>

Make a complete map, and then put the code for every of “-map”.

The demostration: I create a video with the same especifications as in your question…

ffmpeg -i video.mp4

enter image description here

ffmpeg -i video.mp4 -map 0:0 -map 0:1 -c copy -an video_cdpp.mp4

enter image description here

ffmpeg -i video_cdpp.p4

enter image description here

… and remember to specify all paramets for any “-map stream”, if you want have to copy to new file, some important examples:

-an *if yuo don't want to copy "-map type audio"*
-vn *for not copying video*
-sn *for not copying subtitle*
-map_metadata -1 *for not  copying complete metadata*

Attribution
Source : Link , Question Author : cdpp , Answer Author : slhck

Leave a Comment