简体   繁体   中英

Avconv command to combine image and audio file (to create a video)

Trying to perform a simple task: combine an image file with an audio file to create a video. I've already found a few examples using ffmpeg, but I'm using a cloud-based PythonAnywhere and they only use avconv.

Code would look something like this:

import os
image_file = "/dir/greenfrog.jpg"
audio_file = "/dir/AudioFile.wav"
output_file = "/dir/VideoFile.mp4"
cmd = xxxxx
os.system(cmd)

How should I write the cmd string to combine the two files? Thanks for your help here...

Here is you command:

avconv -f video4linux2 -r 25 -i /dev/video0 -f alsa -i plughw:U0x46d0x8ad,0 -ar 
22050 -ab 64k -strict experimental -acodec aac -vcodec mpeg4 -y webcam.mp4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM