I have an audio file which I would like to convert to a video. If possible, I would like to use a static image for appearing at the video. I have investigated a couple possible solutions, but non of them is fully functional.
This solution in previous thread
ffmpeg -loop_input -shortest -y -i image8.jpg -i sound11.mp3 -acodec copy -vcodec mjpeg result.avi
does not work any more, as it does not extend the video to the duration of the audio file. Additionally, ffmpeg complains that it is deprecated and suggests to use avconv instead.
avconv -i sound11.mp3 -strict experimental -i 341410.jpg -map 0:a out.mp4
but the image does not appear
Finally I have tried with gstreamer
gst-launch filesrc location=deltio.mp3 ! mp3parse ! mp4mux name=mux filesink location=output.mp4 filesrc location=341410.jpg ! jpegdec ! x264enc ! mux.
but I get an error
ERROR: from element /GstPipeline:pipeline0/GstX264Enc:x264enc0: Can not initialize x264 encoder.
Additional debug info: gstx264enc.c(1269): gst_x264_enc_init_encoder (): /GstPipeline:pipeline0/GstX264Enc:x264enc0
ERROR: pipeline doesn't want to preroll.
Since I want to include this conversion into a Python script, the latter solution seems the best, as there is a Python wrapper for GStreamer