Skip to content

Instantly share code, notes, and snippets.

@zinntikumugai
Created April 28, 2017 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zinntikumugai/5fa6479928cfead533993eec1cac6a07 to your computer and use it in GitHub Desktop.
Save zinntikumugai/5fa6479928cfead533993eec1cac6a07 to your computer and use it in GitHub Desktop.
「.mp4」ファイルの音声(AAC)のみ抽出して、「.m4a」ファイルとして保存するスクリプト
@echo off
cd /d %~dp0
setlocal enabledelayedexpansion
rem || ffmpegの設定及び引数
rem ------------------------
set FFMPEG=ffmpeg.exe -y -i
set FFMPEGOUT= -acodec copy
rem ------------------------
rem ||ファイル名が「.mp4」のみ対象
for /f "usebackq" %%i in (`dir /B /S *.mp4`) do (
echo ----------------------------------------------------
echo %%i
echo.
rem ||ファイル名を変数に格納
set dmpppp=%%i
rem ||抽出コマンド実行(ffmpeg.exe -y -i <ファイル名> -acodec copy <出力ファイル名>
%FFMPEG%%%i%FFMPEGOUT%!dmpppp:~0,-3!m4a
echo ----------------------------------------------------
)
echo.
rem pause>NUL
pause
exit /b 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment