Search code examples
ffmpeg

How to use https input with ffmpeg "amovie" filter?


I'm applying a filter on my audio file before adding it to the video. This is the command I use:

ffmpeg -y -i video-input.mp4 -f lavfi -i "amovie=audio.mp3:loop=0,asetpts=N/SR/TB,afade=in:st=0:d=1,afade=out:st=92:d=2" -shortest -c:v copy -c:a aac -strict -2 video-output.mp4

I would like to use a https input:

ffmpeg -y -i video-input.mp4 -f lavfi -i "amovie=https://www.xxxx.com/audio.mp3:loop=0,asetpts=N/SR/TB,afade=in:st=0:d=1,afade=out:st=92:d=2" -shortest -c:v copy -c:a aac -strict -2 video-output.mp4

But this is the error I get:

[Parsed_amovie_0 @ 0x55da3a414a40] Failed to avformat_open_input 'https'
[lavfi @ 0x55da3a436660] Error initializing filter 'amovie' with args 'https://www.xxxx.com/audio.mp3:loop=0'
amovie=https://www.xxxx.com/audio.mp3:loop=0,asetpts=N/SR/TB: No such file or directory

From the "amovie" documentation on ffmpeg:

filename: The name of the resource to read (not necessarily a file; it can also be a device or a stream accessed through some protocol).

How can I use a https input in my audio filter ?


Solution

  • The URL has to be escaped as : is a special character, as is /. So, for bash, use

    amovie=https\\\:\/\/www.xxxx.com\/audio.mp3