i want to restream a live m3u8 file to youtube
.i used following code
fmpeg -re -i <http://mypanel.tv:8080/live/****/slyv0955k9/14131.m3u8
> -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 3000k -f flv "<rtmp://live-dfw.twitch.tv/app/{live_231566994_FS4BN0qoJMeXEuWklm6j0l1ODQj9u6}>"
and i return i get this from my linux server
[root#server ~]# ffmpeg -re -i http://mypanel.tv:8080/live/****/slyv0955k9/14131.m3u8
-c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 3000k -f flv "<rtmp://live-dfw.twitch.tv/app/{live_23156556994_FS4BN0qoJMeXEuWklm6j0l1ODQj9u6}>"ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[h264 # 0x1029ba0] non-existing SPS 0 referenced in buffering period
Last message repeated 1 times
[h264 # 0x1073680] non-existing SPS 0 referenced in buffering period
Input #0, hls,applehttp, from 'http://mypanel.tv:8080/live/***/slyv0955k9/14131.m3u8':
Duration: N/A, start: 39062.400000, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 133 kb/s
At least one output file must be specified
so can anyone help me with this?please note i'm not an expert in linux so please give me specific commands to restream a live m3u8 file
Try it:
#! /bin/bash
PRESET="ultrafast" # ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo
SOURCE="http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
KEY="xxxx-xxxx-xxxx-xxxx" # Your youtube key. (https://www.youtube.com/live_dashboard > encoder config > name/key)
ffmpeg \
-re -i "$SOURCE" -vcodec libx264 -preset $PRESET -maxrate 3000k -b:v 2500k \
-bufsize 600k -pix_fmt yuv420p -g 60 -c:a aac -b:a 160k -ac 2 \
-ar 44100 -f flv -s 1280x720 "$YOUTUBE_URL/$KEY"
Related
I have a number of video files stored on my Synology of which the audio doesn't play on when opening them with DS File. This is because DS File does not support eac3. I would like to convert those files to aac using ffmpeg, but when doing so, all audio is lost.
This is the file info:
Input #0, matroska,webm, from '<file>.mkv':
Metadata:
encoder : libebml v1.4.2 + libmatroska v1.6.4
Duration: 00:48:43.42, start: 0.000000, bitrate: 6566 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1 (default)
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English [SDH]
Stream #0:3(ara): Subtitle: subrip
Metadata:
title : Arabic
Stream #0:4(chi): Subtitle: subrip
This is my attempt:
ffmpeg -i <file>.mkv -map 0:v -map 0:a:0 -map 0:s -c copy -c:a aac -b:a 640k output.mkv
Subtitles are kept, but audio is completely removed. I would like to automate the process if possible.
This is my ffmpeg configuration:
ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8.5.0 (GCC)
configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Synology does not support eac3 out of the box. So is this even possible?
Try adding channels for audio as well along side bit rate to the command line after aac.
for 5.1 audio add:
-ac 6 -b:a 384k
For stereo audio add:
-ac 2 -b:a 128k
The final command would be like
ffmpeg -i <file>.mkv -map 0:v -map 0:a:0 -map 0:s -c copy -c:a aac -ac 6 -b:a 640k output.mkv
Found it, I was apparently using the built-in ffmpeg, while I should be using the community package: https://synocommunity.com/packages
/path/to/ffmpeg -i "input.mkv" -map 0 -c:s copy -c:v copy -c:a ac3 -b:a 640k "output.mkv"
What's the command to convert an MP4 to the output format similar to a video with this ffprobe:
ffprobe version N-82151-g1e660fe Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 35.100 / 55. 35.100
libavcodec 57. 65.100 / 57. 65.100
libavformat 57. 57.100 / 57. 57.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 66.100 / 6. 66.100
libswscale 4. 3.100 / 4. 3.100
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, avi, from '.\sample.mp4.hd.mojo':
Metadata:
encoder : Lavf57.57.100
Duration: 00:37:28.85, start: 0.000000, bitrate: 10461 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 960x540 [SAR 1:1 DAR 16:9], 9745 kb/s, 20 fps, 20 tbr, 20 tbn, 20 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 2 channels, s16, 705 kb/s
I've tried
ffmpeg -i "input.mp4" -c:v mjpeg -c:a pcm_s16le -an output.mp4
The output however does not play with the custom player.
Update:
I found a file which seemed to contain some config:
[high]
label=High quality
labelHelp=Converts to high quality
outSuffix=hd
codecParam=-vcodec mjpeg -vf scale=min'(960,iw)':-1 -acodec pcm_s16le -ar 22050 -ac 2 -r 20 -q:v 2
[medium]
label=Medium quality
labelHelp=Converts to medium quality
outSuffix=mid
codecParam=-vcodec mjpeg -vf scale=min'(960,iw)':-1 -acodec pcm_s16le -ar 22050 -ac 2 -r 20 -q:v 5
[low]
label=Low quality
labelHelp=Converts to low quality
outSuffix=low
codecParam=-vcodec mjpeg -vf scale=min'(960,iw)':-1 -acodec pcm_s16le -ar 22050 -ac 2 -r 20 -q:v 8
[main]
label=Convert to NComputing MOJO
labelHelp=Transcodes original file format to the NComputing MOJO format
outSuffix=
codecParam=
Finally I made it to work.
So to make a MOJO video file for NComputing devices here's the ffmpeg command:
ffmpeg -i "input.mp4" -vcodec mjpeg -vf scale=min'(960,iw)':-1 -acodec pcm_s16le -ar 22050 -ac 2 -r 20 -q:v 8 -f avi output.mojo
For low quality video. For other video quality just refer to the mojo.col file.
I'm trying to convert a .ts file with this output to mkv:
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.27)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mp3float # 0x7fbd6282b200] Header missing
[mpegts # 0x7fbd62809000] PES packet size mismatch
[mpegts # 0x7fbd62809000] Packet corrupt (stream = 2, dts = 7125804577).
[mpegts # 0x7fbd62809000] PES packet size mismatch
[mpegts # 0x7fbd62809000] Packet corrupt (stream = 2, dts = 7125804577).
[mpegts # 0x7fbd62809000] PES packet size mismatch
[mpegts # 0x7fbd62809000] Packet corrupt (stream = 1, dts = 7125790091).
Input #0, mpegts, from '/Users/"User"/Downloads/input.ts':
Duration: 02:11:32.82, start: 71283.837456, bitrate: 17149 kb/s
Program 1
Stream #0:0[0x1004]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 2.08 tbr, 90k tbn, 100 tbc
Stream #0:1[0x1104](swe): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s
Stream #0:2[0x704](swe): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 640 kb/s
To do that I'm using this command:
ffmpeg -i input.ts -c copy output.mkv
But the conversion fails with this error:
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska # 0x7fb8c1808200] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska # 0x7fb8c1808200] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska # 0x7fb8c1808200] Can't write packet with unknown timestamp
Error writing trailer of output.mkv: Invalid argument
frame= 27 fps=0.0 q=-1.0 Lsize= 74kB time=00:00:00.85 bitrate= 705.5kbits/s speed= 99x
video:1092kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
What should I do in order to fix this? I've already tried to add -fflags +genpts in the beginning but it fails anyway.
EDIT: I did solve it by using MKVToolNix instead.
For anyone else having this issue, I had a similar problem that was solved by adding -fflags +genpts before the input and have it generate the missing timestamps for me.
ffmpeg -fflags +genpts -i input.ts -c copy output.mkv
Edit:
Another solution might be to take it to mp4 instead of mkv (possibly using it as a middleman and then take to mkv.)
Extreme cases:
I have run into a scenario that required basically the "nuclear" option of taking the video to a raw stream file with its set frame rate, then pulling it back into a mp4 container with the audio.
First find the frame rate it should be
ffprobe -v quiet -loglevel panic -show_entries stream=avg_frame_rate -print_format flat -select_streams v <my_video>
It will output something like streams.stream.0.avg_frame_rate="60000/1001" and we care about what is in the quotes, 60000/1001
Convert the stream to a raw format of itself at that set frame rate. For example H264 would go into a .h264 container.
ffmpeg -fflags +genpts -ignore_editlist 1 -r 60000/1001 -i <my_video> -c:v copy -map 0:v -r 60000/1001 temp.h264
Then bring that raw track back in from the temp file -map 0:v -c:v copy and mux the audio -map 1:a -c:a copy and any subtitles -map 1:s -c:s copy from the original.
ffmpeg -fflags +genpts -r 60000/1001 -i temp.h264 -i <my_video> -c:v copy -map 0:v -map 1:a -map 1:s -c:a copy -c:s copy fixed_video.mp4
Try to run with the -ss flag.
ffmpeg -ss 0:01 -i input.ts -c copy output.mkv
I am splitting up a video into multiple 10 second ts-parts (mpeg-ts format) using ffmpeg on windows.
To create the 2nd part (that starts at 10 seconds into the video and ends at 20 seconds into the video):
ffmpeg -i sample.avi -ss 00:00:10 -to 00:00:20 -vcodec libx264 -acodec aac -vf scale=426:-1 out1.ts
But when i check the file using ffprobe it says:
Duration: 00:00:10.02, start: 1.458667, bitrate: 359 kb/s
So the duration is ok but the start time is incorrect. Is it anyway i can use ffmpeg to correct it to 00:00:20?
The best solution would of course to be able to set the correct start time in my first command where i take out the 10 second part but i would also be ok with running a 2nd command to fix the time.
Is this possible? Cant find any documentation and all examples i found are not for my exact problem and don't seem to work then i play around with them.
Full output from ffprobe:
ffprobe.exe out1.ts
ffprobe version git-2020-02-06-343ccfc Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20200122
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 39.100 / 56. 39.100
libavcodec 58. 68.100 / 58. 68.100
libavformat 58. 38.100 / 58. 38.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 74.100 / 7. 74.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegts, from 'out1.ts':
Duration: 00:00:10.02, start: 1.458667, bitrate: 359 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 426x260 [SAR 780:781 DAR 18:11], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 131 kb/s
You can add -muxdelay 10 argument.
Update: As jarno commented, add: -muxdelay 10 -muxpreload 10
I found the solution here.
Using the following command:
ffmpeg -y -i sample.avi -ss 00:00:10 -to 00:00:20 -vcodec libx264 -acodec aac -vf scale=426:-1 -muxdelay 10 out1.ts
I am getting the following result from ffprobe:
Input #0, mpegts, from 'out1.ts':
Duration: 00:00:10.05, start: 20.020222, bitrate: 141 kb/s
I used the following commands for testing:
Generating AVI sample file with synthetic video and synthetic audio (in uncompressed raw format):
ffmpeg -y -f lavfi -i testsrc=size=192x108:rate=30 -f lavfi -i sine=frequency=500 -c:v rawvideo -pix_fmt bgr24 -c:a pcm_s16le -ar 22050 -t 30 sample.avi
Executing the command from your question and ffprobe (I added -y for overwriting the output):
ffmpeg -y -i sample.avi -ss 00:00:10 -to 00:00:20 -vcodec libx264 -acodec aac -vf scale=426:-1 -muxdelay 10 out1.ts
ffprobe out1.ts
Update:
As jarno commented, adding -muxpreload 10 is also necessary.
For cleaner solution add: -muxdelay 10 -muxpreload 10
Command example:
ffmpeg -y -i sample.avi -ss 00:00:10 -to 00:00:20 -vcodec libx264 -acodec aac -vf scale=426:-1 -muxdelay 10 -muxpreload 10 out1.ts
I have this ffmpeg command that I use to create a video from a photo and a animated GIF border overlay, and a audio track.
ffmpeg -framerate 15 -loop 1 -i photo.jpg -ignore_loop 0 -i overlay.gif -filter_complex "scale=(iw*sar)*max(600/(iw*sar)\,750/ih):ih*max(600/(iw*sar)\,750/ih), crop=600:750, overlay" -i audio.wav -c:v libx264 -c:a aac -b:a 192k -shortest output.mp4
What I want is to lower the opacity of the overlay image.
I have checked a lot of threads, but I can't figure out how to combine something like this with my existing filters.
-filter_complex "blend=all_mode='overlay':all_opacity=0.7"
Any ideas?
Here's the full ffmpeg output of one of my tests:
ffmpeg -framerate 15 -loop 1 -i photo.jpg -ignore_loop 0 -i overlay.gif -filter_complex "scale=(iw*sar)*max(600/(iw*sar)\,750/ih):ih*max(600/(iw*sar)\,750/ih), crop=600:750, blend=all_mode='overlay':all_opacity=0.7" -i audio.wav -c:v libx264 -c:a aac -b:a 192k -shortest output.mp4
ffmpeg version N-83507-g8fa18e0 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enabl
e-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspe
ex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 47.100 / 55. 47.100
libavcodec 57. 80.100 / 57. 80.100
libavformat 57. 66.102 / 57. 66.102
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 73.100 / 6. 73.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, image2, from 'photo.jpg':
Duration: 00:00:00.07, start: 0.000000, bitrate: 15374 kb/s
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 400x600 [SAR 72:72 DAR 2:3], 15 fps, 15 tbr, 15 tbn, 15 tbc
Input #1, gif, from 'overlay.gif':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: gif, bgra, 600x750, 5.42 fps, 5 tbr, 100 tbn, 100 tbc
Guessed Channel Layout for Input Stream #2.0 : mono
Input #2, wav, from 'audio.wav':
Duration: 00:00:23.00, bitrate: 705 kb/s
Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
[swscaler # 00000000023300a0] deprecated pixel format used, make sure you did set range correctly
[swscaler # 000000000234d1e0] deprecated pixel format used, make sure you did set range correctly
[Parsed_blend_2 # 00000000022fd0c0] First input link top parameters (size 600x750, SAR 1:1) do not match the corresponding second input link bottom parameters (600x750, SAR 0:1)
[Parsed_blend_2 # 00000000022fd0c0] Failed to configure output pad on Parsed_blend_2
Error configuring complex filters.
Invalid argument
Use the colorchannelmixer filter.
ffmpeg -framerate 15 -loop 1 -i photo.jpg
-ignore_loop 0 -i overlay.gif
-i audio.wav
-filter_complex "[0]scale=(iw*sar)*max(600/(iw*sar)\,750/ih):ih*max(600/(iw*sar)\,750/ih),
crop=600:750[b];
[1]format=argb,colorchannelmixer=aa=0.5[ol];[b][ol]overlay"
-c:v libx264 -c:a aac -b:a 192k -shortest output.mp4
The 0.5 sets it to 50% transparent.