Skip to content

Commit 7177b3d

Browse files
committed
ffmpeg for audio+image (youtube)
1 parent 01dacc5 commit 7177b3d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

media/ffmpeg.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# https://ffmpeg.org/ffmpeg.html
2+
23
# Takes two files (audio, video) and combine them together into mp4 file.
34
# As audio is shorter add offset to the video so it can sync with audio
45
#
@@ -19,4 +20,16 @@ ffmpeg -y -itsoffset 0.2 -i v.webm -i a.mp4 -map 0:0 -map 1:0 -c copy oFilename.
1920
# -ar rate set audio sampling rate (in Hz)
2021
# -ac channels set number of audio channels
2122
# -ab bitrate audio bitrate (please use -b:a)
22-
ffmpeg -i "$($_.FullName)" -vn -ar 44100 -ac 2 -b:a 192k "$($_.FullName.Replace('.wav','.mp3'))"
23+
ffmpeg -i "$($_.FullName)" -vn -ar 44100 -ac 2 -b:a 192k "$($_.FullName.Replace('.wav','.mp3'))"
24+
25+
26+
# Takes two files (audio, image) and combine them together into mp4 file.
27+
# -loop 1 - loop the input image infinitely (1 - loop, 0 - no loop)
28+
# -i img.jpg - specifies an input file (image)
29+
# -i audio.mp3 - second input file (MP3 audio)
30+
# -c:v libx264 - specifies the video codec
31+
# -c:a aac - specifies the audio codec. aac is a standard codec for MP4 files, offering good quality at lower bitrates.
32+
# -b:a 320k - sets the audio bitrate
33+
# -shortest - this option ensures that the output video will be as long as the shortest input.
34+
# output.mp4 - name of the output video file
35+
ffmpeg -loop 1 -i img.jpg -i audio.mp3 -c:v libx264 -c:a aac -b:a 320k -shortest output.mp4

0 commit comments

Comments
 (0)