Could someone help with the disappeared audio?
video_2.mp4 logo3.mp4 - has audio
ffmpeg -i video_2.mp4 -i logo3.mp4 -filter_complex \
"color=black:s=1920x1080:d=24 \
,format=yuv444p \
,geq='lum=X*255/W: \
cr=128: \
cb=128' \
[alpha]; \
[0:v]scale=1920x1080, setsar=1[0v]; \
[1:v]scale=1920x1080, setpts=PTS-STARTPTS+10/TB, setsar=1[1v]; \
[1v][alpha]alphamerge[1v]; \
[0v][1v]overlay=enable='between(t\,11,14)',format=yuv420p [v]" -map "[v]" -map 1:a \
-an out.mp4
In -map 1:a -an, the -an negates the mapping. Remove it.
Related
I can't get FFMPEG to accept any spaces when I try to assign it to the metadata. Below is the command I am using in Terminal on MacOS. It gives me an error: [NULL # 0x7fce76026600] Unable to find a suitable output format for 'World' World: Invalid argument
ffmpeg -hide_banner \
-i Trolls.World.Tour.2020.Bluray-2160p.m2ts \
-ss 00:10:00 -t 00:1:00 \
-pix_fmt yuv420p10le \
-map_chapters 0 \
-metadata:s:t:0 filename="" -metadata:s:t:0 mimetype="image/jpeg" \
-metadata title=“Trolls World Tour” \
-map 0:0 -metadata:s:v:0 language=eng -metadata:s:v:0 title=“Trolls World Tour” \
-map 0:2 -metadata:s:a:0 language=eng -metadata:s:a:0 title=“Dolby TrueHD 7.1 Atmos” \
-map 0:6 -metadata:s:a:0 language=eng -metadata:s:a:1 title=“AC-3 2.0” \
-c:v libx265 -preset slow -crf 16 \
-x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,500)" \
-c:a copy \
Trolls.World.Tour.2020.2160p.BluRay.REMUX.HEVC.TrueHD.7.1.Atmos.mkv
I have tried 'title="Trolls World Tour"' title=Trolls" "World" "Tour to no luck.
Using title="Trolls\ World\ Tour" works but then the title includes the backslashes.
Any thoughts?
Replace the “smart / fancy” quotes with "normal double quotes".
Bad: “ & ”
Good: "
I can't get FFMPEG to accept any spaces when I try to assign it to the metadata. Below is the command I am using in Terminal on MacOS. It gives me an error: [NULL # 0x7fce76026600] Unable to find a suitable output format for 'World' World: Invalid argument
ffmpeg -hide_banner \
-i Trolls.World.Tour.2020.Bluray-2160p.m2ts \
-ss 00:10:00 -t 00:1:00 \
-pix_fmt yuv420p10le \
-map_chapters 0 \
-metadata:s:t:0 filename="" -metadata:s:t:0 mimetype="image/jpeg" \
-metadata title=“Trolls World Tour” \
-map 0:0 -metadata:s:v:0 language=eng -metadata:s:v:0 title=“Trolls World Tour” \
-map 0:2 -metadata:s:a:0 language=eng -metadata:s:a:0 title=“Dolby TrueHD 7.1 Atmos” \
-map 0:6 -metadata:s:a:0 language=eng -metadata:s:a:1 title=“AC-3 2.0” \
-c:v libx265 -preset slow -crf 16 \
-x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,500)" \
-c:a copy \
Trolls.World.Tour.2020.2160p.BluRay.REMUX.HEVC.TrueHD.7.1.Atmos.mkv
I have tried 'title="Trolls World Tour"' title=Trolls" "World" "Tour to no luck.
Using title="Trolls\ World\ Tour" works but then the title includes the backslashes.
Any thoughts?
Replace the “smart / fancy” quotes with "normal double quotes".
Bad: “ & ”
Good: "
I'm trying to scale and crop an image and use it as MKV attachment in one shot, but without success.
I understand that the "-attach" command does exactly that, but the problem is that I don't have the final image as a file. Instead I'm trying to crop and scale the file on the fly, doing something like this:
ffmpeg -fflags +genpts \
-i video.h265 \
-i audio.ac3 \
-i sub.ass \
-i cover_img.jpg \
-filter_complex "[3:v]crop=in_h:in_h,scale=600:600[cover]; [3:v]crop=in_h:in_h,scale=120:120[small_cover]; [3:v]scale='-1:600'[cover_land]; [3:v]scale='-1:120'[small_cover_land]" \
-map 0:v:0 -map 1:a:0 -map 2:s:0 \
-map "[cover]" -disposition:v:1 attached_pic -metadata:s:v:1 filename="cover.jpg" -metadata:s:v:1 mimetype="image/jpeg" \
-map "[small_cover]" -disposition:v:2 attached_pic -metadata:s:v:2 filename="small_cover.jpg" -metadata:s:v:2 mimetype="image/jpeg" \
-map "[cover_land]" -disposition:v:3 attached_pic -metadata:s:v:3 filename="cover_land.jpg" -metadata:s:v:3 mimetype="image/jpeg" \
-map "[small_cover_land]" -disposition:v:4 attached_pic -metadata:s:v:4 filename="small_cover_land.jpg" -metadata:s:v:1 mimetype="image/jpeg" \
-r 24000/1001 -c:s ass -c:a copy \
-c:v mjpeg -c:v:0 libx265 \
out.mkv
But it doesn't work, because the streams are mapped as video, not attachments.
I also tried to change the "[3:v]" in filter_complex to "[3:t]", but it doesn't work, since pictures are considered as video streams.
Now I resorted to a two-step process, but I'm looking for a way to do both things at the same time:
ffmpeg -i cover_img.jpg \
-filter_complex "[0:v]crop=in_h:in_h,scale=600:600[cover]; [0:v]crop=in_h:in_h,scale=120:120[small_cover]; [0:v]scale='-1:600'[cover_land]; [0:v]scale='-1:120'[small_cover_land]" \
-c:v mjpeg \
-map "[cover]" cover.jpg \
-map "[small_cover]" small_cover.jpg \
-map "[cover_land]" cover_land.jpg \
-map "[small_cover_land]" small_cover_land.jpg
ffmpeg -fflags +genpts \
-i video.h265 \
-i audio.ac3 \
-i sub.ass \
-map 0:v:0 -map 1:a:0 -map 2:s:0 \
-attach "cover.jpg" -metadata:s:t:0 mimetype="image/jpeg" \
-attach "small_cover.jpg" -metadata:s:t:1 mimetype="image/jpeg" \
-attach "cover_land.jpg" -metadata:s:t:2 mimetype="image/jpeg" \
-attach "small_cover_land.jpg" -metadata:s:t:3 mimetype="image/jpeg" \
-r 24000/1001 -c:s ass -c:a copy \
-c:v libx265 \
out.mkv
Thank you for your help.
-attach expects an external file URL and does not work with streams sent from a filtergraph output.
I wanted to record multiple screens simultaneously on MacOS and store them in a video file.Same as the screenshot below.
I found a command to do this, but need to know the size of each screen.
ffmpeg \
-f avfoundation -pix_fmt uyvy422 -i 1 \
-f avfoundation -pix_fmt uyvy422 -i 2 \
-pix_fmt yuv420p -r 30 -preset ultrafast -b:v 5000k -t 15 \
-filter_complex \
"nullsrc=size=3286x1080 [background]; \
[0:v] setpts=PTS-STARTPTS [left]; \
[1:v] setpts=PTS-STARTPTS [right]; \
[background][left] overlay=shortest=1 [background+left]; \
[background+left][right] overlay=shortest=1:x=1366 [left+right]" \
-map [left+right] out.mp4 -y
Is there a way to record a screen without knowing the size of each screen?
You can do it using the new xstack filter.
Use
ffmpeg \
-f avfoundation -pix_fmt uyvy422 -i 1 \
-f avfoundation -pix_fmt uyvy422 -i 2 \
-filter_complex \
[0:v] setpts=PTS-STARTPTS [left]; \
[1:v] setpts=PTS-STARTPTS [right]; \
[left][right] xstack=inputs=2:layout=0_0|w0_0 [left+right]" \
-map [left+right] -pix_fmt yuv420p -r 30 -preset ultrafast -b:v 5000k -t 15 \ out.mp4 -y
Get the latest dated build from https://ffmpeg.zeranoe.com/builds/macos64/static/
In Reference to https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg
I have a bunch of images. and I want to make a video using these images.
Below is my code for FFMpeg. But the problem is how can I append an audio file to -filter_complex (with bitrate)
ffmpeg \
-loop 1 -i input0.png \
-loop 1 -i input1.png \
-loop 1 -i input2.png \
-loop 1 -i input3.png \
-loop 1 -i input4.png \
-filter_complex \
"[0:v]trim=duration=15,fade=t=out:st=14.5:d=0.5[v0]; \
[1:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v1]; \
[2:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v2]; \
[3:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v3]; \
[4:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v4]; \
[v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4