A few months ago I’ve faced up with a task converting audio track in video file to another format in Windows. There are not much simple programs to do this task. The task is simple: convert any audio track to mp3 without converting video track. All programs that were tested propose to convert video and audio track without any options to copy video stream. This case increase a time of converting a lot and was dismissed by default.

I decided to use ffmpeg program. In Linux it’s easy to write the converter script, but in Windows I never faced up with such task.


  • convert audio stream to mp3,
  • copy video stream,
  • script cmd for Windows
  • batch converter


@echo off

ECHO =========================

setlocal enabledelayedexpansion

set argCount=0
for %%x in (%*) do (
   set /A argCount+=1
   set "argVec[!argCount!]=%%~x"
   set "argFex[!argCount!]=%%~nxx"

echo Number of files to process: %argCount%

for /L %%i in (1,1,%argCount%) do (
  echo Processfile !argVec[%%i]!
  cmd /k C:\ffmpeg.exe -i "!argVec[%%i]!"  -c:v copy -c:a libmp3lame "C:\convert\!argFex[%%i]!"
  echo File saved at C:\convert\!argFex[%%i]! 

explorer.exe C:\convert

ECHO =========================



First loop check arguments and write them to array. In the second loop the call of ffmpeg initiated with needed parameters for converting video file.

At the end of the process folder with converted files opened.


Add new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed.
 oooooooooo.   ooooooo  ooooo                .ooo              oooooo     oooo 
`888' `Y8b `8888 d8' .88' `888. .8'
888 888 Y888..8P .oooo.o d88' .oooo.o `888. .8'
888oooo888' `8888' d88( "8 d888P"Ybo. d88( "8 `888. .8'
888 `88b .8PY888. `"Y88b. Y88[ ]88 `"Y88b. `888.8'
888 .88P d8' `888b o. )88b `Y88 88P o. )88b `888'
o888bood8P' o888o o88888o 8""888P' `88bod8' 8""888P' `8'

Enter the code depicted in ASCII art style.