Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *****************************************************************************************************
- * THIS BATCH FILE WILL CONVERT .MP4 VIDEOS INTO HIGHLY COMPRESSED, BUT GREAT SOUNDING AUDIO FILES. *
- * IT IS TO BE USED IF MAYBE YOU WATCH VIDEO FORMAT PODCASTS THAT DONT NEED THE VIDEO OR OTHER *
- * SITUATIONS WHERE THERE IS A POINTLESS STATIC VIDEO OF AN AUDIO RECORDING. USE THIS BATCH FILE *
- * ALONG WITH FFMPEG +++ YOU MUST HAVE FFMPEG +++ TO EXTRACT THE AUDIO AND DISCARD THE VIDEO. *
- *****************************************************************************************************
- (REMOVE ABOVE AND INCLUDING THIS - DUH!)
- @echo off
- setlocal enabledelayedexpansion
- :: Check for required parameters
- if "%~1"=="" (
- echo Please provide the source directory as the first parameter.
- echo Example: convert-to-ogg.bat "C:\Input" "C:\Output"
- exit /b 1
- )
- if "%~2"=="" (
- echo Please provide the target directory as the second parameter.
- echo Example: convert-to-ogg.bat "C:\Input" "C:\Output"
- exit /b 1
- )
- set "SOURCE_DIR=%~1"
- set "TARGET_DIR=%~2"
- :: Create the target directory if it doesn't exist
- if not exist "%TARGET_DIR%" (
- mkdir "%TARGET_DIR%"
- )
- :: Process each .mp4 file in the source directory
- for %%F in ("%SOURCE_DIR%\*.mp4") do (
- set "FILENAME=%%~nF"
- echo Converting: %%F
- ffmpeg -i "%%F" -vn -acodec libvorbis -ac 1 -aq 1 "%TARGET_DIR%\!FILENAME!.ogg"
- )
- echo.
- echo Done converting all files.
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement