1 year ago
#306907
Willis
How can I mix several audio files and an image to a mp4 file using ffmpeg
I'm trying to make a mp4 video like This one with ffmpeg.
First, let's get the media info of the video
ffprobe -i "/path/to/Hedley - Lose Control.mp3"
This is it's media info
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9044808200] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/path/to/Young Griffo - Pennies.stem.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2017-12-16T17:34:20.000000Z
Duration: 00:04:37.80, start: 0.000000, bitrate: 1288 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:2(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:3(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:4(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:5: Video: png, rgba(pc), 512x512 [SAR 20157:20157 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
In the media info above, Stream #0:5
is a video stream, but actually it's an png image.
I'm using this command to mix 3 m4a file and an image to a mp4 file, it can generate a mp4 file, but the mp4 file can't be played
ffmpeg -i /path/to/1.m4a -i /path/to/2.m4a -i /path/to/3.m4a -i image.png -c:a aac -c:v png -map 0:a:0 -map 1:a:0 -map 2:a:0 -map 3:v:0 /path/to/output.mp4
The media info of it's video track is
Stream #0:3(und): Video: png (mp4v / 0x7634706D), rgb24(pc, progressive), 360x278 [SAR 1:1 DAR 180:139], 12236 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Not like the one we mentioned at the beginning:
Stream #0:5: Video: png, rgba(pc), 512x512 [SAR 20157:20157 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
I think this is because I use the wrong args, but I don't know what args should I use, anyone who know something about this?
ffmpeg
video-encoding
0 Answers
Your Answer