-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwavToPng.cmd
More file actions
41 lines (34 loc) · 989 Bytes
/
wavToPng.cmd
File metadata and controls
41 lines (34 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@echo off
echo ###################################################
echo # Description: Convert audio/video to waveform PNG
echo # Usage: wavToPng.cmd audio.wav 800 200
echo # Param 1: Audio/video file
echo # Param 2: Width in pixels
echo # Param 3: Height in pixels
echo # Requires: ffmpeg
echo ###################################################
echo.
REM Check parameters
IF "%~1"=="" (
echo Error: 1st arg must be an audio/video file
exit /b 1
)
IF "%~2"=="" (
echo Error: 2nd arg must be width in pixels
exit /b 1
)
IF "%~3"=="" (
echo Error: 3rd arg must be height in pixels
exit /b 1
)
REM Get filename
set "filename=%~1"
set "width=%~2"
set "height=%~3"
set "outputFile=%~n1.%width%x%height%.png"
echo Creating waveform image: %outputFile%
REM Do conversion
ffmpeg -i "%filename%" -filter_complex "aformat=channel_layouts=mono,showwavespic=s=%width%x%height%" -frames:v 1 "%outputFile%"
REM Complete
echo Success: Waveform created:
echo # %outputFile%