Skip to content

Instantly share code, notes, and snippets.

@zinntikumugai

zinntikumugai/mp4tom4a.bat

Last active Apr 28, 2017
Embed
What would you like to do?
スペース対応版 「.mp4」から音声抽出「.m4a」AAC版
@echo off
cd /d %~dp0
setlocal enabledelayedexpansion
rem ||行末のスペース削除
rem -----------------------
set FFMPEG=ffmpeg.exe -y -i
set FFMPEGOUT=-acodec copy
rem -----------------------
rem ||「.mp4」のファイルを取得(スペースありも可)
for /f "usebackq delims=" %%i in (`dir /B /S *.mp4`) do (
echo ----------------------------------------------------
echo %%i
echo.
rem ||変数に一旦格納
set dmpppp=%%i
rem ||ffmpegで抽出 上部変数初期化時点でのスペースをこちらに移動
%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