text:
opus decoding in ffmpeg: how to pass target sample rate and ensure libopus decoder?
As I understand, ffmpeg compiled with --enable-libopus has two opus decoders: builtin and libopus. I am decoding an opus file to wav.

How can I know which opus decoder is being used by ffmpeg?

opusdec has an option --rate which can directly downsample to the needed sample rate. When I use ffmpeg for decoding an opus file and set -ar, the decoding time grows x6 from the baseline 10sec (for a 3Mb, 2hour opus file). For opusdec, the decoding time is same regardless of used --rate. So I suspect that ffmpeg has some bug or duplicates resampling work. For workaround, is there a way to pass an option to ffmpeg to pass it down to libopus and to emulate the effect of --rate?

Thank you!
UPD
Adding -acodec libopus in the beginning of ffmpeg command clearly does something (forces libopus decoder?) and completes decoding in 6.2sec. When I add -ar 8000, it slows down to 7.3sec. I would assume, it's still too large of a change for a fair effect of downsampling (for opusdec -ar 8000 actually speeds things up, not slows it), so maybe ffmpeg has a decoder configuration / resampling bug even when libopus decoder is used.

The libopus decoder in ffmpeg will only output at a fixed rate of 48000 Hz. Using -ar leads to resampling using the swresample library.

It appears that you're right and the sample_rate is reset at avc->sample_rate    = 48000;. It's a shame that there is no way to save compute and resample directly to the requested sample_rate... I guess the proper way would be to introduce special libopus decoder options if -ar is supposed to only affect post-hoc swresample processing.

introduce special libopus decoder options --> this possibility will depend on whether the resampling is taken care of by the decoder directly or does opusdec delegate it to a bundled resampler. If the latter, then it will be the responsibility of the libopus decoder wrapper in ffmpeg to insert a resampler and that won't be allowed since ffmpeg architecture guidelines don't allow mixing of resampling inside a decoder interface. That violates clean separation of library roles. That said, you haven't posted your command and log, so I can't check if you've unnecessary compute in your runtime.

I'll check if I can repro on a synthetic file and will post full ffmpeg command lines. libopus can do resampling to the target sample rate directly during decoding, but it appears that ffmpeg doesn't let the user access this functionality. It also appears post-hoc resampling severely affects wall clock time for the builtin opus decoder case (no such bad difference for libopus decoder)


text:
Possible to force FFmpeg to omit silence in audio files and produce discontinuous `webm`/`mka`?
Does webm/mka/mkv/mp4 support discontinuous audio streams?
I'm wondering, can ffmpeg transcode .wav-audio into opus-encapsulated-into-webm, but filter out silent frames - especially full seconds of silence, completely drop them from the stream to save space? (maybe via https://ffmpeg.org/ffmpeg-bitstream-filters.html ?)
The goal of all this is to very efficiently represent near-silence in phone-call-recording files for archival purposes (i.e. by completely omitting it from the stream and having it replaced by digital zeros at audio decoding time).
As far as I understand opus-encapsulated-into-ogg does not support such timestamp discontinuities. opus-encapsulated-into-rtp assumingly does support this, but I'm wondering if more "offline" formats such as webm and whether it's possible to produce them directly without passing by rtp format first.
These frames could then be replaced by zeros at audio decoding time by some form of PLC or DTS gaps replacement by zero signal.
Thanks!

UPD1: Unfortunately, silenceremove filter does not work as I need it. The way I used it below, the audio duration after silenceremove is shortened by the amount of silence. This is not what I am looking for. I am looking to preserve the timestamps, have the silence imputed by digital silence at decoding time and preserve the original audio duration (as reported by ffprobe or audio players)
ffmpeg -y -f lavfi -i sine=f=440:d=5 -f lavfi -i anullsrc=d=3600:cl=mono -f lavfi -i sine=f=880:d=5 -filter_complex "[0][1][2]concat=n=3:v=0:a=1" 5sec_silent1h_5sec.wav

ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus 5sec_silent1h_5sec.opus

ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus -af silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0 5sec_5sec.mkv

The good duration of 5sec_silent1h_5sec.opus and bad duration of 5sec_5sec.mkv are confirmed by ffprobe (1h10s and 10s respectively).
Is there a way to adjust the filters/command line arguments to preserve the audio duration?

UPD2
The following somewhat works, although ~1s of 880hz audio leaks into the first segment (before the long silence segment), no matter how I adjust the between bounds - very strange!
ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus -af "aselect='between(t,0,4)+between(t,3606,3610)'" 5sec_silent1h_5sec_with_leakage.mkv
If this leakage can be fixed, then this can be used together with silencedetect filter.
But of course it would be nicer to get the output in a single invokation of ffmpeg.
The example output file with "leakage": https://1drv.ms/u/s!Apx8USiTtrYmq9Q4QaETF2OJWdKGQA?e=ACTmMg

UPD3: On a recent ffmpeg 6.1 adding timestamp=copy filter option also produces a file with a correct duration, but with leakage ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus -af silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0:timestamp=copy 5sec_1hsilence_5sec_with_leakage.mkv. So it seems that timestamps are still not copied exactly.

You can have timestamp gaps in an audio stream in Matroska-family or MOV/MP4 format files. That's how Google records and stores WebRTC recordings. There won't be zero signal audio data, rather there will be no packets corresponding to the gap and timestamps of the packets before and after the gap will indicate audio position.
However, it is not the encoder's job or feature in ffmpeg to drop those sections. You will need to use the silenceremove filter with option timestamp=copy (6.1+ or git master > May 2023 needed).

Would silenceremove produce such output with gaps? Or would it "collapse" the gaps and make the wall-clock-duration shorter? This was my misunderstanding while originally reading its documentation which led my to asking this question.

silenceremove can only remove data; it doesn't consolidate gaps.

silenceremove does not affect any timestamps and they stay original (as if no gaps were introduced), right? My goal is to have the encoded file have the same duration as before encoding (and have silence imputed by zeros at decoding time). Do you know if gaps are supported by webm/mka? Am I correct that ogg does not support gaps? Would you have an advice of how to instruct ffmpeg to encode separately .wav streams / in a decoupled mode (for phone call recordings, there are long periods of silence if one considers every channel separately)?

I tested the silenceremove solution. Unfortunately, it does not create gaps and it changes the duration of the audio - this is not what I need. I'd like to simply drop the silent packets from the stream, but preserve the timestamps and keep the audio duration and have the dropped packets be replaced by digital silence at decoding time.

Here is a repro: ffmpeg -y -f lavfi -i sine=f=440:d=5 -f lavfi -i anullsrc=d=3600:cl=mono -f lavfi -i sine=f=880:d=5 -filter_complex "[0][1][2]concat=n=3:v=0:a=1" 5sec_silent1h_5sec.wav; ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus 5sec_silent1h_5sec.opus; ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus -af silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0 5sec_5sec.mkv

The good duration of 5sec_silent1h_5sec.opus and bad duration of 5sec_5sec.mkv are confirmed by ffprobe (1h10s and 10s respectively)

Updated answer. See at the end.

Thanks for helping out with this :) I've just tried your updated proposal using ffmpeg 6.1 static bits from https://johnvansickle.com/ffmpeg/, the duration turns correct, but it has the same leakage/wrong pts problem as my attempts with aselect filter :(

I converted the input 5sec_silent1h_5sec.wav to be 48khz (in my original code above it was 44.1khz), but it made no difference - still leakage

Probably to do with the attack/release used by the filter. Will have to debug when I have time.

Thank you! However, this leakage is quite long - a full second :( I hope my repro above will help!

Also, maybe the leakage is related to some silenceremove filter options I used above?
But given the strangeness of such leakage, I suspect that somehow some packets of the 880hz-segment get incorrect timestamps assigned which forces them to be played before the 1h-long silence/gap

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Frame-perfect audio cutting using ffmpeg filter graphs and frame filtering
I'm curious, is it possible to do frame-perfect audio cutting using ffmpeg's complex filter graphs + frame filtering aselect functionality?
I've tried a bunch of other approaches (using -segment_times and -ss/-t) - they worked but were only ~0.02sec accurate, just for reference:

ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" -ar 48000 test.wav
ffmpeg -y -i test.wav -f segment -segment_times "1.55,2.00" -segment_list_type csv -segment_list output.csv test%04d.opus
ffmpeg -y -i test.wav -ss 0.00 -t 1.55 test0000.opus -ss 2.00 -t 1.00 test0001.opus

My filter-based attempts:

ffmpeg -y -i test.wav -ar 48000 -af "aselect=between(samples_n\,100\,16100)" test0000.opus as an example but this produces a 5-second long test0000.opus instead of a 0.25-second one
ffmpeg -y -i test.wav -ar 48000 -af "aselect=between(t\,0.0\,1.55)" test0000.opus kind of works, but still gives a 1.57-second audio instead of 1.55-second one.

Can this be done in principle using frame filtering? Am I missing something in these commands above? If the filter-based approach is not more accurate, I will fall back to my initial attempts.
Thanks!

Same issue as https://video.stackexchange.com/q/26451/

I think the linked issue is about generation of files of specific duration while here I'm inquiring about cutting from an input PCM with sample-perfect provided boundaries (I realize that some padding may appear during encoding to opus, but I care that input cutpoints are as sample-precise as possible)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Loop the first frame of a video and then play a selected portion of the video
I would like to to play the first frame of an input video for 260 frames and then play frames 310–930 of the input video:
$ ffmpeg -i video.mp4 -i video.mp4 -filter_complex '
    [0:v]loop=loop=259:size=1:start=0[first-frame];
    [1:v]trim=start_frame=310:end_frame=930,setpts=PTS-STARTPTS[rest];
    [first-frame][rest]concat=n=2:v=1:a=0[output]
' -map [output] -c:v libx264 -crf 18 -y output.mp4

The above command produces the first frame of the input video for 260 frames as expected, but then continues with frames 0-620 of the input video followed by frames 310–930 of the input video.
When I drop the [first-frame] part, frames 310–930 of the input video are correctly produced:
$ ffmpeg -i video.mp4 -i video.mp4 -filter_complex '
    [1:v]trim=start_frame=310:end_frame=930,setpts=PTS-STARTPTS[rest];
    [rest]concat=n=1:v=1:a=0[output]
' -map [output] -c:v libx264 -crf 18 -y output.mp4

This is perhaps a timestamp problem, since the documentation for the concat filter clarifies that “for this filter to work correctly, all segments must start at timestamp 0.”
I am using the following version of ffmpeg:
$ ffmpeg -version
ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil      55. 34.101 / 55. 34.101
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.101 / 57. 56.101
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libavresample   3.  1.  0 /  3.  1.  0
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

A shorter method is
ffmpeg -i video.mp4 -vf 'select=eq(n,0)+between(n,310,930),setpts=if(eq(N,0),0,(N+260)/FRAME_RATE/TB)' -map [output] -vsync cfr -c:v libx264 -crf 18 -y output.mp4

It seems that this method also does not waste space encoding frames 1–260. Only frame 0 is encoded and the waiting is done by timestamp manipulation, which is neat.

The loop filter produces the rest of the video after it has stopped looping. If this is undesirable, trim the resulting video as follows:
$ ffmpeg -i video.mp4 -i video.mp4 -filter_complex '
    [0:v]loop=loop=259:size=1:start=0,trim=start_frame=0:end_frame=259[first-frame];
    [1:v]trim=start_frame=310:end_frame=930,setpts=PTS-STARTPTS[rest];
    [first-frame][rest]concat=n=2:v=1:a=0[output]
' -map [output] -c:v libx264 -crf 18 -y output.mp4

This behavior is perhaps counterintuitive and poorly documented, but it covers the common case, when one wants to loop at the beginning of a video. This behavior also makes loop=0 an identity filter that passes the video unchanged.

The loop filter is meant to pass through untouched portions of the input while looping the specified portion. If it dropped the remainder, then the size and start are unnecessary and users would need to always manually trim and then concat the various segments, like your command does.


text:
Is a TBC required for converting VHS home videos to digital format?
This is a follow-up question to this one. The DigitalFAQ forum, whose members seem to know a lot about this particular topic, say about TBCs:

You must have some form of TBC, it's not optional. You can try to scrimp by with an ES10/15 unit, for under £100. It's minimalist, and not actually a TBC. But if funds matter more than quality, it's probably the only avenue if really pinching pennies.

What exactly is a TBC, and do I really need one to get decent quality from a VHS capture?

related: https://video.stackexchange.com/questions/32492/what-causes-audio-sync-drift-when-digitizing-vhs


text:
Premiere Pro shifting keyframes during an insert edit
During an insert edit all clips (video and audio) shift right except the keyframes (track volume) themselves on the audio tracks. Similar if I select all and move, keyframes are not included. How can I shift the audio track along with its keyframes during an insert?

When I do an insert edit (using the shortcut '.' key) in CC 2018, I do not see this problem.
Make sure the Source Patching on the audio tracks is selected correctly, otherwise the audio tracks won't move when you do the insert?  Apologies if this is teaching you to suck eggs - maybe a screen recording would better demo what's going wrong?
Before insert edit

After insert edit (note keyframes have moved)

I have selected Track keyframes/Volume and not Clip keyframes. I think this is my problem, as Track keyframes don't seem to shift when inserting. Think this is a hard stop problem and I need to redo my keyframes as clip keyframes? Thanks for your help!

I think you're right.


text:
How to double every frame (and the length of the video itself) in an mp4 video (timelapse)?
The video has length of t and is 30fps. I want it to have a length of 2*t.
I just want each frame to be shown a little longer. According to VLC the codec is H264-MPEG4 AVC.
Is there some simple command with ffmpeg?

Any audio present?

No audio. I may add some later.

setpts filter can be used to retime frames. Basic usage is
ffmpeg -i in -vf setpts=PTS*2 out.mp4

PTS*2 sets output timestamp of each frame to 2x its input value.


text:
How to overlay 2 videos using depth layers
I'm trying to overlay 2 videos which both have depth layers (e.g. how far a pixel is away from the camera) using ffmpeg filters. (I have a few hundred of those videos so I'd like to do batch job out of this)
the video files are perfectly in sync with each other and their depth layers. The Files are saved in the lagarith lossless encoding (which ffmpeg can read). The video files are also using a greenscreen which I already filter using this command:
ffmpeg -loglevel info -hide_banner -i "%fst%" -i "%snd%" -filter_complex "[1:v]chromakey=0x00ff00:0.5:0.0[ckout];[0:v][ckout]overlay[out]" -map [out] -c:v hevc_nvenc -preset lossless -c:a aac "result.mp4"

This command takes video %snd% makes the greenscreen transparent and puts the result on top of %fst% and writes it to result.mp4
The issue is, that I'd like also include the depth layers into the merge process, so that the nearer pixel is selected from both videos (the pixel with the brighter depth layer pixel). (the greenscreen can be rendered transparent in a later iteration, so we don't have to worry about that)
For the depth layers the variables %fst_depth% and %snd_depth% are defined.
Does anyone an idea at what filter I should take look at or even a full solution for this issue?
Thanks in advance.
UPDATE:
I have partially a working solution:
@ffmpeg -i %fst% -i %snd% -i %fst_depth% -i %snd_depth% -filter_complex  "[2:v][3:v] blend=all_expr='if(lt(A,B),0,255)' [mask] ;[0:v][1:v][mask] maskedmerge [out]" -shortest -map [out] -c:v hevc_nvenc -preset lossless -c:a aac "result2.mp4"

The issue with this one is, that for some reason, the second video objects are missing most of the colors and are partially transparent for some reason. The weird blocky glitches got solved (depth map inaccurate), but the colors are still weird:

Example of a Video Frame:
Example of the according depth Frame (black near, white far):

About the glitches, check manually if the depth maps are accurate in those regions at those times.

@Gyan you were correct, the render truncated the values to 8bit which caused these artifacts ... thx

The main issue was, that the Z-Layer was not accurate enough, as Gyan said. Addtionally the condition needed to be changed from lt(A,B) to lte(A,B).


text:
ffmpeg add loop to this line of code i have
windows 7 64 bit running latest ffmpeg command-line.
ffmpeg -i "song.mp4" -i "2.mp3" -filter_complex "[1:a]adelay=3000|60000[1a];[0:a][1a]amix" -vcodec copy -y "output1.mp4"

I want to loop the 2.mp3 all the way till the video ends.
The 2.mp3 finishes after xxx time in 2.mp3 so I wish to loop it instead of how do I add a loop to this.

Welcome! It is a bit unclear what you are asking. Are you saying that 2.mp3 is shorter than song.mp4 and you want to loop the mp3? Or is it the other way around?

You want to take a look at the aloop-filter.
ffmpeg -i "song.mp4" -i "2.mp3" -filter_complex "[1:a]aloop=loop=-1[al];[al]adelay=3000|60000[1a];[0:a][1a]amix" -vcodec copy -y "output1.mp4"

https://ffmpeg.org/ffmpeg-filters.html#aloop
And then you will probably want to limit the song.mp4, so we are using the duration option of amix, to tell it to limit by the first input given. https://ffmpeg.org/ffmpeg-filters.html#amix
ffmpeg -i "song.mp4" -i "2.mp3" -filter_complex "[1:a]aloop=loop=-1[al];[al]adelay=3000|60000[1a];[0:a][1a]amix=duration=first" -vcodec copy -y "output1.mp4"

Since I am not sure which of the two files you want to loop and don't know if you want to loop before or after the delay you might need to adjust the order of filters.


text:
what kind of action cameras are good for 1080p video onboard a high moving object(more than 800kph)?
I'm working on a project that will have a camera onboard the object for FPV as it moves in the air at very high speeds. What kind of frame rates are good to transmit and/or record onboard the flight, and what kind of characteristics in  action cameras should I look for. I know asking for 1080p can be hard but nowadays cameras have improved. DO suggest compromises in different areas and their effects on the transmitted video. I'm new to community so do help improve the question with edits and help me out.
EDIT: This will be onboard a plane so under 100-200g with mount and casing(etc) should be ideal for each camera. 30-60 fps of 1080p is more than good enough for FPV as well as other onboard cameras. We aim to supply electricity as part of the electronics onboard, so any battery it has is more an inconvenience and can be bypassed to maintain electronic supply. FPV maybe live(low latency preferred), but other onboard cameras can be just recorded. I found most budget action cameras(60-200$) are around 64GB compatible and 1080p video consumes about 20-40MB/s depending on the camera. Budget is flexible but for 3-4 cameras I have about 700$ but I can stretch by little it if needed. Should I focus on 720p if data consumption limits my flight time, and/or is there any way to have them store onboard a larger data storage system(?)
Thanks a lot. Came here on the recommendation from photography stack exchange.

Welcome! What is your budget? What are you size and weight constraints? Live and/or recorded? If live, what are the constraints of your transmission system?

The usual solution here, used by many pilots is actually the ubiquitous GoPro. They are robust, housings are built for most purposes and the tech is tried and tested, and compatible with everything. Solutions already exist for continuous power.
And the new GoPro 360 cameras will give you views in every direction - may or may not be useful for your use case.
There are budget versions/copies, but GoPro are the most robust I have used for high-g, high exposure uses.
If you are expecting extreme temperatures, then make sure your housing has the temperature control you need. That's what everyone does for mounting cameras on fast/high aircraft :-)

Hey @dr mayhem, agreed. I have seen sounding rockets with go pro, but I also notice that gopro doesn't work well with extreme temp. Freeze issues plague it below -10 C and I believe alll electronic face issues with heat above say 60 C. I'm curious about the housing and the lens in that case, and how cameras can work in such extreme cases and if GoPro is built for it(?)

The temp range of the newer models seems to be better than that - and low temperatures don't cause issues with the electronics - it's the battery that suffers in the cold. If you are expecting extremes, then you make sure your housing has the temperature control you need. That's what everyone does for mounting cameras on fast/high aircraft :-)

I did not know the source of the faulty behaviour at low temperatures. Is it the Li-ion tech that fails to perform in cold temperatures(?). So, the lens and the sensor can perform reliably under much more extreme conditions if housed in protective gear(?). Thank you for the information

You can check Phantom high speed cameras, they can reach 12500 fps at 1080p.

the object mounted on has high speed and may require live footage, so highspeed cameras with large fps, may not mkae sense


text:
How to combine and optimize ffmpeg filters to avoid encoding multiple times?
I never worked with ffmpeg before and I'm wondering which optimization I can take for my situation.
In a loop I have multiple input.mp4 files which I first convert one by one to have a common scale and audio rate with this command:
ffmpeg -i input_01.mp4 -vf 'scale=1280:720,setdar=16/9' -ar 44100 -ac 1 input_01_tmp.mp4
Later I add images to each input.mp4 files again one by one:
ffmpeg -i input_01_tmp.mp4 -i input_01_logo.png -filter_complex "[0:v][1:v]overlay=10:10:enable='between(t,2,11)',fade=t=in:start_time=1.5:d=0.5:alpha=1,fade=t=out:start_time=10.5:d=0.5:alpha=1[fg];[0][fg]overlay=format=auto,format=yuv420p" -c:a copy input_01_unified.mp4
Finally after the loop I combine them with mkvmerge:
mkvmerge -o output.mkv \+ input_01_unified.mp4 +\ input_02_unified.mp4 ...
I'm sure this is not the optimal solution and wondering how I should change it.
Is it possible to do all of this in one command? Either for each file or for the whole process.

Can be done in one command. Share entire command for 1st and 2nd step

@Gyan thanks! added the missing parts to the commands in the question

The single command will be long, but here's an example for 3 inputs.
ffmpeg -i input_01.mp4 -loop 1 -t 11 -i input_01_logo.png
       -i input_02.mp4 -loop 1 -t 11 -i input_02_logo.png
       -i input_03.mp4 -loop 1 -t 11 -i input_03_logo.png
       -filter_complex
        "[0]scale=1280:720,setsar=1[0v];
         [1]fade=t=in:st=1.5:d=0.5:alpha=1,fade=t=out:st=10.5:d=0.5:alpha=1[0l];
         [2]scale=1280:720,setsar=1[1v];
         [3]fade=t=in:st=1.5:d=0.5:alpha=1,fade=t=out:st=10.5:d=0.5:alpha=1[1l];
         [4]scale=1280:720,setsar=1[2v];
         [5]fade=t=in:st=1.5:d=0.5:alpha=1,fade=t=out:st=10.5:d=0.5:alpha=1[2l];
         [0v][0l]overlay=10:10:format=auto:enable='between(t,2,11)'[0vl];
         [1v][1l]overlay=10:10:format=auto:enable='between(t,2,11)'[1vl];
         [2v][2l]overlay=10:10:format=auto:enable='between(t,2,11)'[2vl];
         [0]pan=1c,aresample=r=44100[0a];
         [2]pan=1c,aresample=r=44100[1a];
         [4]pan=1c,aresample=r=44100[2a];
         [0vl][0a][1vl][1a][2vl][2a]concat=n=2:v=1:a=1[v][a]"
        -map "[v]" -map "[a]" -pix_fmt yuv420p output.mkv

You may need single quotes in the map depending on your shell.
Use a recent version of ffmpeg, at least 4.0

Thank you! I'll try this out today and accept the answer. Besides time saving, has this any effects on better quality in comparison to what I did?

Thanks @Gyan I didn't forget and accept the answer. Much appreciate your help <3

For clarification, is it beneficial to combine filters like this? Does it ensure that everything will be done in one encode, or will it still encode multiple times just like running each operation separately?

Yes, this is the standard method and only carries out single encoding operation after all filtering.

What if we have some hundreds of input files and overcome the command line characters limits (for example, in Windows it is 8192 chars). The "filter_complex" could be written into a file and use "-filter_complex_script" instead. But what about the "-loop" commands? Is there a way to "shrink" the loops in some way? Or another way to have the same result with a shorter command line? I ask because I have this specific problem right now...


text:
What is more important number of CUDA cores on GPU or VRAM for video editing and graphics?
What is more important number of CUDA cores on GPU or VRAM for video editing and graphics? What are benefits from good graphic card? Better preview when working with 4k files with effects on them?
I am using Adobe Premiere and After Effects, sometimes Davinci Resolve...
Rendering times is not important to me much as smoother preview of 4k files when I edit them on timeline, smaller lagging when I put Magic Bullet Looks or something similar on clips...

Welcome! Can you be more specific? What are you trying to accomplish? What is important to you in terms of performance and in terms of your workflow?

I added more content...

It depends entirely on which software you are using, as well as plugins. Adobe Premiere takes advantage of CUDA, which radically increases rendering speeds and playback of specific file types.
But if you've applied filters, or 3rd party plugin filters that do not take advantage of CUDA optimization, your bottleneck will be the speed of your CPU.
Alternatively, certain 3D platforms are only accelerated by NVIDIA cards, others, require AMD.
The amount of VRAM affects how much data the card can handle in one single load (typically 1 frame), which comes into play mostly with 3D work.


text:
After Effects Radio Waves FX Initial Size
My business partner and I are working on our company's portfolio, we decided to add some animations in order to make it more fun. We are really new to After Effects but we both learn quickly and we have a big Flash background knowledge from the good old days.
As we started with our first element to animate we already encountered an obstacle, when adding the radio wave effect we cant make it start from a desired size, we've seen many videos using masks to achieve it but we failed to make them work. Have in mind that the mouse shape has no background at all, just a border, and we'd like to keep it transparent if possible.
Is there a simple way of achieving it?

Generate radio waves on a solid, adjust settings so they're looking appropriate.
Drag the time cursor forward until the waves have expanded to the point where you want them to start.
Cut your layer using the alt + left square bracket ( alt + [ )
Drag your layer left until it is at the beginning of your comp.
Make a solid layer that goes between your radio waves layer and your mouse image.
Mask the solid to the same size as your mouse image.
Set the Track Matte on your radio waves layer to "Alpha Inverted"


text:
How do movie makers navigate point-of-view among still characters
Some movies seem to move the camera amongst the people in a crowded scene, but everyone and everything is completely still.  For example, in the series "The Flash", season 3, episode 16 starts off with such an effect.
In "The Matrix", various angles on a still situation were shot by having a series of adjacent cameras, and I suppose some image processing was used to interpolate between their images to achieve the effect of continuous panning. This can't, however, be used to seemingly weave a camera among the people in a crowd.
Was the effect achieved by computer-generated imagery (CGI)?  The characters looked so real, and CGI characters are usually pretty bad.  Unless the technology has advanced so much, and the challenge of achieving realism is simplified by the fact that they characters aren't moving.
To those who marked this question as duplicate: I already referred to the Matrix in my post.  I explained that the puzzling aspect of this question was that the POV seemed to traverse amongst the group of people.  Hence, this seems to differ from the previous question that was referenced, the answers to which contained links about techniques involving cameras positioned outside the group of people in the scene, i.e., as per the Matrix film that I mentioned.

Possible duplicate of Technique that seems to freeze everything in the world except the camera

You assume that the Matrix technique cannot be used to weave a camera among people. The exact same technique - a combination of multiple cameras, cgi, and interpolation - can do exactly this.
That said, the Flash has much more mature cgi technology than the Matrix, and in fact is famous for the cgi quality. Check out this video for some behind the scenes info. The majority of the intro you mention appears to be cgi.

It seemed difficult to position cameras amongst the crowd in that way, and then to digitally erase them afterward. To me, its feasibility is a valid question, especially since all the examples provided were from POVs outside the crowd. That is why I wondered whether it was CGI instead of multiple cameras.

The example you posted mostly showed CGI, and texturing of the animal surfaces or waves/foliage, but the structural details in the footage I described was a lot less "entropous". Clothing and instrumentation details; human facial expressions (which are done rather imperfectly in CGI, from what I've seen in the past).So it seemed valid to question whether it was CGI as well. If that is the actual answer, it would be amazing (to me).

It's not that amazing. Getting fur right was one of the first challenging things the guys at Alias|Wavefront managed to do, followed by flowing fabrics. Stationary models of humans - not so difficult.

If all I saw was flowing fabrics and wavy hair, I'd say that was done in the Lion King.  I can't think of good renderings of human faces.  Think of the virtual Princess Leia in the live action Star Wars (can't recall which one, as I'm not really a fan), or the virtual Terminator in place of an aging Arny.  Admittedly, the faces in The Flash were not moving, but the camera angle changed continuously.  They captured real people's faces in 3D in minute detail, while the faces were in a transient expression.  Not just any face, but ones that look like the actual characters.

Stationary is really easy. Fixed 3D models with texture and palette map.

Agreed.  There have been many good examples on youtube for years.  But this isn't just making 3D models look real.  It's making 3D models look real and look indistinguishable from known people.  Maybe the techniques exist, but not being an expert in the area, it seems to me that you would need to capture (not create) 3D models in fine detail of real people's faces -- not while they are sitting still for a transient facial expression to be scanned, but while it is in transience.

In the series "The Flash", season 3, episode 16 starts off with such an effect.

You undermine the power of "Hey guys, get in a comfortable position and hold your breath".
They are all in simple positions. I'm sure you can stay still for one minute or so.

Image belongs to The CW
You can add a fast framerate, let's say 60fps for the slow-mo parts, and cover any movement of the actors with the "warp" effect.

For more dynamic poses, you can use multiple cameras. You can have a bunch of cheap ones (for a tv production) or rent some dozens of them and put them on some rig. Shoot that on a green screen and compose it.


text:
Convert to ProRes with ffmpeg adds unwanted contrast to footage
I'm trying to convert H.264 footage from a Panasonic EVA1 camera to Apple ProRes with ffmpeg. However no matter which setting I use, the output file has slightly more contrast than the original input file.
Some of the commands I've tried are:
ffmpeg -i /Users/roy/Desktop/devnull/ffmpeg\ test/ffmpeg.MOV -vcodec prores -acodec copy /Users/roy/Desktop/devnull/ffmpeg\ test/prores_auto.mov

ffmpeg -i /Users/roy/Desktop/devnull/ffmpeg\ test/ffmpeg.MOV -c:v prores_ks -profile:v 2 -c:a copy /Users/roy/Desktop/devnull/ffmpeg\ test/prores_ks_standard.mov

When I convert the input footage with the Quicktime Animation codec first ffmpeg does not introduce extra contrast in the output footage.
Is there an extra flag that I'm supposed to be using? Does is it have something to do with a wrongly interpreted colourspace in ffmpeg?
The log for the first command:
> Roy-iMac:~ roy$ ffmpeg -i /Users/roy/Desktop/devnull/ffmpeg\
> test/ffmpeg.MOV -vcodec prores -acodec copy
> /Users/roy/Desktop/devnull/ffmpeg\ test/prores_auto.mov ffmpeg version
> 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers   built with Apple LLVM version 9.1.0 (clang-902.0.39.2)   configuration:
> --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma   libavutil      56. 14.100 / 56. 14.100   libavcodec     58. 18.100 / 58. 18.100   libavformat    58. 12.100 / 58. 12.100   libavdevice    58.  3.100 /
> 58.  3.100   libavfilter     7. 16.100 /  7. 16.100   libavresample   4.  0.  0 /  4.  0.  0   libswscale      5.  1.100 /  5.  1.100   libswresample   3.  1.100 /  3.  1.100   libpostproc    55.  1.100 /
> 55.  1.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd96c800000] decoding for stream 0 failed Guessed Channel Layout for Input Stream #0.1 : stereo
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> '/Users/roy/Desktop/devnull/ffmpeg test/ffmpeg.MOV':   Metadata:
>     major_brand     : qt
>     minor_version   : 537986816
>     compatible_brands: qt  pana
>     creation_time   : 2018-10-12T13:49:01.000000Z
>     com.panasonic.Semi-Pro.metadata.xml: <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
>                     : <ClipMain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="urn:schemas-Professional-Plug-in:Semi-Pro:ClipMetadata:v1.0">
>                     :   <ClipContent>
>                     :     <GlobalClipID>060A2B340101010501010D431300000060F44F8E038405C6008045821D6BD519</GlobalClipID>
>                     :     <Duration>420</Duration>
>                     :     <EditUnit>1/25</EditUnit>
>                     :     <EssenceList>
>                     :       <Video>
>                     :         <Codec BitRate="150">H264_422_LongGOP</Codec>
>                     :         <ActiveLine>2160</ActiveLine>
>                     :         <ActivePixel>3840</ActivePixel>
>                     :         <BitDepth>10</BitDepth>
>                     :         <FrameRate>25p</FrameRate>
>                     :         <TimecodeType>NonDrop</TimecodeType>
>                     :         <StartTimecode>03:19:16:01</StartTimecode>
>                     :         <StartBinaryGroup>00000000</StartBinaryGroup>
>                     :       </Video>
>                     :       <Audio>
>                     :         <Channel>2</Channel>
>                     :         <SamplingRate>48000</SamplingRate>
>                     :         <BitsPerSample>24</BitsPerSample>
>                     :       </Audio>
>                     :     </EssenceList>
>                     :     <ClipMetadata>
>                     :       <UserClipName>A014C005_181012_K7B3</UserClipName>
>                     :       <Access>
>                     :         <CreationDate>2018-10-12T14:49:01+01:00</CreationDate>
>                     :       </Access>
>                     :       <Device>
>                     :         <Manufacturer>Panasonic</Manufacturer>
>                     :         <SerialNo.>K7TAA0323</SerialNo.>
>                     :         <ModelName>AU-EVA1</ModelName>
>                     :       </Device>
>                     :       <Shoot>
>                     :         <StartDate>2018-10-12T14:49:01+01:00</StartDate>
>                     :       </Shoot>
>                     :     </ClipMetadata>
>                     :   </ClipContent>
>                     :   <UserArea>
>                     :     <AcquisitionMetadata xmlns="urn:schemas-Professional-Plug-in:P2:CameraMetadata:v1.2">
>                     :       <CameraUnitMetadata>
>                     :         <ISOSensitivity>2500</ISOSensitivity>
>                     :         <WhiteBalanceColorTemperature>4500K</WhiteBalanceColorTemperature>
>                     :         <Gamma>
>                     :           <CaptureGamma>V-Log</CaptureGamma>
>                     :         </Gamma>
>                     :         <Gamut>
>                     :           <CaptureGamut>V-Gamut</CaptureGamut>
>                     :         </Gamut>
>                     :       </CameraUnitMetadata>
>                     :     </AcquisitionMetadata>
>                     :   </UserArea>
>                     : </ClipMain>
>                     :    Duration: 00:00:16.80, start: 0.000000, bitrate: 150123 kb/s
>     Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 147693 kb/s, 25
> fps, 25 tbr, 90k tbn, 50 tbc (default)
>     Metadata:
>       creation_time   : 2018-10-12T13:49:01.000000Z
>       timecode        : 03:19:16:01
>     Stream #0:1(eng): Audio: pcm_s24be (lpcm / 0x6D63706C), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
>     Metadata:
>       creation_time   : 2018-10-12T13:49:01.000000Z
>       timecode        : 03:19:16:01
>     Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
>     Metadata:
>       creation_time   : 2018-10-12T13:49:01.000000Z
>       reel_name       : A014
>       timecode        : 03:19:16:01 File '/Users/roy/Desktop/devnull/ffmpeg test/prores_auto.mov' already
> exists. Overwrite ? [y/N] y Stream mapping:   Stream #0:0 -> #0:0
> (h264 (native) -> prores (native))   Stream #0:1 -> #0:1 (copy) Press
> [q] to stop, [?] for help [prores @ 0x7fd96e003a00] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96e006200] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96e008a00] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd970066400] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd9700cf800] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96e00b200] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96e00da00] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96e806200] encoding with
> ProRes standard (apcn) profile [prores @ 0x7fd96c80a400] encoding with
> ProRes standard (apcn) profile Output #0, mov, to
> '/Users/roy/Desktop/devnull/ffmpeg test/prores_auto.mov':   Metadata:
>     major_brand     : qt
>     minor_version   : 537986816
>     compatible_brands: qt  pana
>     com.panasonic.Semi-Pro.metadata.xml: <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
>                     : <ClipMain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="urn:schemas-Professional-Plug-in:Semi-Pro:ClipMetadata:v1.0">
>                     :   <ClipContent>
>                     :     <GlobalClipID>060A2B340101010501010D431300000060F44F8E038405C6008045821D6BD519</GlobalClipID>
>                     :     <Duration>420</Duration>
>                     :     <EditUnit>1/25</EditUnit>
>                     :     <EssenceList>
>                     :       <Video>
>                     :         <Codec BitRate="150">H264_422_LongGOP</Codec>
>                     :         <ActiveLine>2160</ActiveLine>
>                     :         <ActivePixel>3840</ActivePixel>
>                     :         <BitDepth>10</BitDepth>
>                     :         <FrameRate>25p</FrameRate>
>                     :         <TimecodeType>NonDrop</TimecodeType>
>                     :         <StartTimecode>03:19:16:01</StartTimecode>
>                     :         <StartBinaryGroup>00000000</StartBinaryGroup>
>                     :       </Video>
>                     :       <Audio>
>                     :         <Channel>2</Channel>
>                     :         <SamplingRate>48000</SamplingRate>
>                     :         <BitsPerSample>24</BitsPerSample>
>                     :       </Audio>
>                     :     </EssenceList>
>                     :     <ClipMetadata>
>                     :       <UserClipName>A014C005_181012_K7B3</UserClipName>
>                     :       <Access>
>                     :         <CreationDate>2018-10-12T14:49:01+01:00</CreationDate>
>                     :       </Access>
>                     :       <Device>
>                     :         <Manufacturer>Panasonic</Manufacturer>
>                     :         <SerialNo.>K7TAA0323</SerialNo.>
>                     :         <ModelName>AU-EVA1</ModelName>
>                     :       </Device>
>                     :       <Shoot>
>                     :         <StartDate>2018-10-12T14:49:01+01:00</StartDate>
>                     :       </Shoot>
>                     :     </ClipMetadata>
>                     :   </ClipContent>
>                     :   <UserArea>
>                     :     <AcquisitionMetadata xmlns="urn:schemas-Professional-Plug-in:P2:CameraMetadata:v1.2">
>                     :       <CameraUnitMetadata>
>                     :         <ISOSensitivity>2500</ISOSensitivity>
>                     :         <WhiteBalanceColorTemperature>4500K</WhiteBalanceColorTemperature>
>                     :         <Gamma>
>                     :           <CaptureGamma>V-Log</CaptureGamma>
>                     :         </Gamma>
>                     :         <Gamut>
>                     :           <CaptureGamut>V-Gamut</CaptureGamut>
>                     :         </Gamut>
>                     :       </CameraUnitMetadata>
>                     :     </AcquisitionMetadata>
>                     :   </UserArea>
>                     : </ClipMain>
>                     :
>     encoder         : Lavf58.12.100
>     Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 0.04 fps, 12800 tbn,
> 25 tbc (default)
>     Metadata:
>       creation_time   : 2018-10-12T13:49:01.000000Z
>       timecode        : 03:19:16:01
>       encoder         : Lavc58.18.100 prores
>     Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
>     Metadata:
>       creation_time   : 2018-10-12T13:49:01.000000Z
>       timecode        : 03:19:16:01 frame=  420 fps= 20 q=-0.0 Lsize= 1036081kB time=00:00:16.78 bitrate=505533.8kbits/s speed=0.797x
> video:1031347kB audio:4725kB subtitle:0kB other streams:0kB global
> headers:0kB muxing overhead: 0.000812%

Share the full log of the first command. How are you checking the output file?

I've added the log for the first command.
I checked the files in Adobe Premiere Pro, but the increased contrast can also be seen in other video players

Ok, so your input is full-range (pc, bt709) which is unusual, so let's try to correct that.
ffmpeg -i ffmpeg.MOV -vf scale=in_range=pc:out_range=tv -c:v prores -c:a copy prores_auto.mov

This seems to work for the contrast (still a tiny bit more contrast thought. But with this command the colour in the output has changed every so slightly.

screenshot of Lumetri Scopes of original footage:
https://www.dropbox.com/s/twk01qcojhsvoa1/original%20footage.png?dl=0
screenshot of Lumetri Scopes of transcoded footage:
https://www.dropbox.com/s/ul9t7rg798x70gt/ProRes%20footage.png?dl=0

Change to scale=in_range=pc:out_range=tv:out_color_matrix=bt709

The output is still the same with that command (colour shift). The footage is recorded in LOG in 10bit by the way. Not in Rec.709. Don't know if that helps?

ffmpeg -i "source.mov" -map_metadata 0 -pix_fmt yuv422p10le -c:v prores_ks -profile:v 4 -c:a pcm_s24le -movflags write_colr "out.mov"

this will create ProRES (10bit) MOV file (-map_metadata allows to keep recording dates). Audio will be PCM 24bit. Timecode will be also copied by default.
If you want to flag ProRES as full range you add: -color_range pc. By default it's always flagged as limited range (even if FFmpeg properly reads the color range).


text:
Improve performance on 4 x 4K mosaic with FFmpeg
I'm using a NVIDIA Quadro P4000 and my config is Intel i7 2.4 GHz with 8 Go of RAM. I'm working on Ubuntu 16.04, I've installed NVIDIA drivers using apt repo aswell as CUDA. I'm using FFmpeg in version 3.3.
I've managed to display a mosaic of 4 x 4K videos (same videos for test purpose) with FFmpeg, using hardware acceleration (previous post), using this command line :
ffmpeg \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-filter_complex "nullsrc=size=2560x1440 [base]; \
[0:v] scale_npp=1280:720, hwdownload, format=nv12 [upperleft]; \
[1:v] scale_npp=1280:720, hwdownload, format=nv12 [upperright]; \
[2:v] scale_npp=1280:720, hwdownload, format=nv12 [lowerleft]; \
[3:v] scale_npp=1280:720, hwdownload, format=nv12 [lowerright]; \
[base][upperleft] overlay=shortest=1:eval=init [tmp1]; \
[tmp1][upperright] overlay=shortest=1:eval=init:x=1280 [tmp2]; \
[tmp2][lowerleft] overlay=shortest=1:eval=init:y=720 [tmp3]; \
[tmp3][lowerright] overlay=shortest=1:eval=init:x=1280:y=720, hwupload_cuda" \
-c:v h264_nvenc -preset llhp -profile:v baseline -f matroska pipe:1 | ffplay -i -

Now my issue is about performance, videos are played at 80% of their original speed, so close to my goal...
As I understand from now, this manipulation has several steps :

The four videos are decoded by the GPU.
Scaling to 720p is also performed by the GPU.
The four flux are downloaded in the CPU and formated in NV12.
Mosaic is made by the CPU using overlay filter.
Mosaic video flux is uploaded in the GPU.
The GPU encodes it in H.264.

After this I'm not sure if the encoded video is retrieved by the CPU and then piped to ffplay or if it's stays in the GPU and directly displayed on the monitor.
Moreover, I'd like ffplay to use hardware acceleration but I didn't manage to force it to use h264_cuvid.

ffplay s/w h264 decoder gives me 300 fps for a 1440p stream on a Ivy Bridge i5 so that's not the bottleneck. Check the presets for nvenc.

I've tried all presets and all profiles but I still got speed around 0.8, sometime worse

What's the fps speed if you replace -c:v h264_nvenc -preset llhp -profile:v baseline -f matroska pipe:1 with -an -f null -?

I get a speed around 0.9

ok, what about ffmpeg -hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 -hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 -hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 -hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 -map 0:v -map 1:v -map 2:v -map 3:v -f null - ?

@Gyan I get a speed around 1.3 so as Paul B. Mahol said, the overlay filter slows the thing down. Is there another way of building a mosaic, can the gpu directly doing it ?

hstack the top videos and bottom videos and then vstack the result

Aaaaannnnnd it's working, even in 1080p ! Thank you again Gyan, you're a real life saver.

The problem was about the overlay filter which is too slow. I've changed for a combination of hstack and vstack as you can see here :
ffmpeg \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-hwaccel cuvid -c:v h264_cuvid -i bbb_sunflower_2160p_30fps_normal.mp4 \
-filter_complex " \
[0:v] scale_npp=1280:720, hwdownload, format=nv12 [upperleft]; \
[1:v] scale_npp=1280:720, hwdownload, format=nv12 [upperright]; \
[2:v] scale_npp=1280:720, hwdownload, format=nv12 [lowerleft]; \
[3:v] scale_npp=1280:720, hwdownload, format=nv12 [lowerright]; \
[upperleft][upperright] hstack [upperline]; \
[lowerleft][lowerright] hstack [lowerline]; \
[upperline][lowerline] vstack [mosaic]; \
[mosaic] hwupload_cuda" \
-c:v h264_nvenc -preset llhp -profile:v baseline -f matroska pipe:1 | ffplay -i -

It works very well and I even can build a 1080p mosaic using lossless preset and high444p profile.


text:
Help needed editing music more precisely in Premiere
I have shot a video with 23,976 FPS and now need to expand the timeline to double that, so I can make more precise edits with the music.
But Premiere Pro only allows certain FPS

Is there a way to set custom FPS? As there isn't even a 48p Option like Hobbit used.
Or are there other better ways to edit music more precisly within Pr?

Perhaps the quickest option for better accuracy of audio editing would be to right-click on the actual numbers of the timeline and select "Show Audio Time Units" ?


text:
No Maximum Bitrate H264 codec
I am trying to export a video with a low bitrate. Regardless of what I set as the target bitrate, the video always is exported with the highest possible bitrate. This occurs whether I use VBR or CBR.
The option to set a Maximum Bitrate is not present. Why?

Welcome to Video Production Stack Exchange!
I presume this is Adobe Premiere Pro?

Yes, thank you.


text:
2000 hours to render/encode 45 minute video, what machine should I build to make this manageable?
I shot 45 minutes of stereo VR footage (6400x6400 frame size, 29.97 fps) and after adding color correction, rotation, adaptive de-noise and re-sharpen I got 2000 hours estimate to render and encode to H264. This is on maxed out MacBook Pro 2018.
I'm thinking it's time to build a video rendering machine, so I can edit, render and encode larger projects without keeping a laptop running for months. Any recommendations for what kind of hardware to get? Number of cores vs base clock vs memory speed and so on?
The render times break down like this:

2-pass VBR and all effects = 2000 hours, CPU at 100%, GPU at 5%
1-pass VBR and all effects = 800 hours, CPU at 100%, GPU at 5%
1-pass VBR and Lumetri Color + VR Re-Orient = 400 hours, CPU at 20%, GPU at 5%

It seems like I need to hit hard on CPU power and disk/memory speed, since that last estimate means I am I/O bound.

Soliciting advice for product recommendations on stack exchange is going to get this question flagged as opinion-based.  You might want to look over this https://video.stackexchange.com/help/dont-ask  Keep in mind, you can always edit your question to better meet the site guidelines.  Having said that, I did my best to give a helpful answer.

I found a better site dealing specifically with "what components to get": https://pcpartpicker.com/b/MbdXsY. We can limit this thread therefore to "what kind of components to get"

Your post has inspired me to do some benchmarking of my own.  My requirements aren't nearly as intense as yours, so I've been testing 5000 frames of 60fps UHD 4K.  I'm testing a 2017 15"MBPi7 580, a 2013 12core 2xD700, and a 2018i7 mac mini with various combinations of eGPUs, and codec decode/encode scenarios.  I'm finding GPUs don't matter much except that intel discreet is actually best for h.264 encode, CPU cores help prores encoding.  New 64 bit apple compressor dramatically improves HEVC8.  HEVC10 still sucks on everything I've thrown at it.

I ended up building a copy of https://pcpartpicker.com/b/MbdXsY, but with a high-speed SSD RAID0 drive and two M.2 drives to ensure I am not IO bound. I also gave up on rendering 6K stereo with effects, so now I do stereo 6K with color correction only and a separate mono 4K with all effects. Going to write an article when I have more time.

Before you go out and spend a lot more money on hardware, optimize your process.  Run tests on short pieces of your video, and see what you can adjust to get faster results.
For example, H.264 is pretty taxing to encode, especially at higher frame sizes.  Experiment with writing to intermediate codecs first, and then transcoding to your delivery format.  Often, that method is faster than writing directly to the delivery format.  See how long it takes your setup to churn out a five second clip directly to h.264, then time the same export to an intermediate codec + transcode.
Another thing you can optimize is your disk caching strategy.  If your disk cache is on your system drive, try moving it to something speedy and external.  Some NLE's give you the option to use the disk cache at render time.  Experiment with these settings.  Also maybe try changing your GPU driver settings if your system allows (OSX mojave deprecates OpenCl.  Depending on your NLE/OS, Metal may be your only option).
Another small piece of advice, get a good process monitoring utility and use it to help clue you in on where bottlenecks occur.  I use XRG for Mac.  It's free, and provides more information than Activity Moitor.  If you notice that your GPU's are pegged, then think about adding GPU horsepower.  If they're not pegged, your CPU isn't either, but you notice a lot of disk activity, then think about how you might improve that.

I like the XRG suggestion. I tried to find a monitoring utility for Mac, but kept hitting articles telling me to use Activity Monitor.

Jason, I updated my post with XRG screenshot. I still can't tell for sure, is it I/O bound when effects are off?


text:
Why do I keep getting videos darker than the frames from which they were made regardless of the software I use?
I have tried using both VSDC and VideoPad for editing videos, and both of them randomly darken the videos I put into them. Is this a common issue? If not, what information do you need me to give to solve this problem?
This is a problem I have had on multiple computers now.
Here are some side-by-side comparisons, with each pair being first the input video and then second the output video.

You can see that this second image is darker.

You can see that this second image is darker also.
Edit: I tried editing the video with FFmpeg, and it did the same thing.
Edit 2: Here are the outputs of ffmpeg -i [videofile]:
Original video:
Metadata:
    encoder         : Lavf58.12.100
Duration: 00:01:32.75, start: 0.000000, bitrate: 1012233 kb/s
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), bgr0, 1920x1080, 1012406 kb/s, 60 fps, 60 tbr, 60 tbn, 60 tbc

Edited video:
Duration: 00:01:36.98, start: 0.000000, bitrate: 514031 kb/s
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 512695 kb/s, 59.99 fps, 59.99 tbr, 59.99 tbn, 59.99 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s

Edit 3: The original video was compiled from a series of .png files. Here is the command I used to do so:
ffmpeg -framerate 60 -i %05d.png -c:v huffyuv -pix_fmt rgb24 output.avi

Share the console output of ffmpeg -i videofile

@Gyan I added part of the console outputs. Are they what you were looking for? If not, should I post the full output? All I removed was all of the --enable arguments and the versions of FFmpeg's various libraries.

How were the source videos generated/captured - which app and settings?

@Gyan It was a series of .png files compiled as frames into a video using FFmpeg. I added the command I used to my question.


text:
FFmpeg afade produces horrible audio quality
I'm trying to add a video and audio fade in and fade out to my video using the fade and afade filters. I'm using the following command:
ffmpeg -i trimmed.mp4 -vf 'fade=in:0:60,fade=out:2940:300' -af 'afade=in:st=0:d=1,afade=out:st=53:d=2' -c:a aac -c:v libx264 -crf 18 -preset veryfast fadeInOut.mp4

The resulting audio sound like TV static was overlayed. I've tried specifying audio quality by adding -b:a 128k, but that didn't help either. Any ideas what might be wrong?
Here's the output of ffmpeg -i if that's helpful:
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands:
isomiso2avc1mp41
    encoder         : Lavf58.20.10
0
  Duration: 00:00:54.54, start: 0.000000
, bitrate: 9964 kb/s
    Stream #0:
0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 9589 kb/s,
60 fps, 60 tbr,
15360 tbn,
120 tbc
 (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:
1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 364 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

@PaulB.Mahol Whoops, here it is: ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20190212

@PaulB.Mahol Oh shoot good point, it might be my player's fault. I'm using VLC. I also just tested it with Windows's Photos app, and the same still happens.

For me the best option is to convert audio files first to lossless .wav, do all things that I need to do and then covert them back to .mp3 or other lossy formats. This is the way that is used in audio editing apps and the most gentle way to work with audio or video files


text:
Generating video thumbnails preview / contact sheet in batch, color issue
I have a large collection of videos to sort out, and for that purpose I want to create a thumbnail preview for each one of them, as quickly and efficiently as possible. I have tested several tools which have that capacity, with a varying degree of satisfaction.

Media Player Classic : Does not allow command line interaction or batch directory processing. The presentation of timestamps and other informations is good enough as it is, but not customizable. The aspect of the screenshots, as I found out, depends upon the settings of the graphic driver : whether there are “enhancements” active or disabled, or whether the entry levels are set to full range or restricted range. With the default “restricted range”, the picture appears more vivid, with more contrast, but the blacks are crushed and the highlights are blown ; with entry levels set to “full range”, the picture is rather dull, with slightly faded / washed-out colors, similar to the representation of the other tools below.

{default graphic settings}

{“full range” in Intel graphic settings}

{all “enhancements” disabled in Intel graphic settings}

SMPlayer : Does not allow command line interaction or batch directory processing. The display of information is not customizable (does not allow to display the file size in bytes for instance). The colors on the screenshots appear shifted compared with the other tools, i.e. the greens are darker / less saturated while the reds are lighter / more saturated, which I know is related with the matrix used for YUV>RGB conversion (Bt.601 vs. Bt.709), but it's hard to determine which of these provide the most accurate representation.

Scorp Video Thumbnail Maker (GUI tool) : The display of information is fairly customizable, it allows to treat a whole directory recursively, but there's a huge logo / watermark covering one tile with the free license.

MTN / Movie Thumbnailer (CLI tool, also included in StaxRip) : The display of informations is fairly customizable, but the aspect of the screenshots is slightly blurry compared with the others (perhaps it creates JPEG-compressed temporary files ?). That tool, which apparently hasn't been updated since 2008, comes as an already compiled .exe file interacting with a bunch of DLL (based on libavcodec), so I don't know how to see which commands it uses internally.

VCSI (Python script) : The display of informations is fairly customizable, but some useful items are missing (video bitrate for instance). A small drawback is that it seems to be creating a temporary PNG file for each tile before generating the actual thumbnails file, it's still quick enough with 4 tiles but could make it slower for more complex presentations. Since it comes as a script interacting with ffmpeg, I could modify some parameters if necessary.

QUESTIONS :

My main issue is the color accuracy and sharpness of the screenshots. MTN would have been fine as it's simple and quick and provides all the relevant informations in the description, but the resulting files are definitely blurry : what are the likely causes of this ? When comparing the results, how can I determine which color representation is the most accurate, and is there a way to modify this behaviour, either by tweaking each tool's parameters or by adjusting global, system-wide parameters ?
Are there other similar tools which would be worth trying ?

So here is what I found out, if anyone's interested (however unlikely this might be, considering the poor popularity of that question ! :)) :
– Scorp Video Thumbnails Maker gets the colors right for Bt.709 footage with its “Engine 2” rendering module (not the other three with the current 11.0.0.3 version) and the CCCP codec pack. I created a thread about that issue on the support forum for that tool.
– I managed to tweak VCSI by adding "-vf", "zscale=matrixin=709:matrix=709,format=rgb24", to each ffmpeg call, so that it preserves Bt.709 colors; it's still slower and less convenient than Scorp VTM (and that modified script won't get accurate colors for Bt.601 footage so both versions would have to be installed and used accordingly), but it's free.
– Since I created this thread I found a few other tools which can perform this task : StaxRip (which has an internal thumbnails preview generation module, in addition to the older MTN), PotPlayer, BSPlayer, Auto Movie Thumbnailer. The latter is based on MPlayer, and is supposed to give control over the rendering engine, but I couldn't get it to use Bt.709. Otherwise it's a good free dedicated GUI alternative to Scorp Movie Thumbnails Maker, with many customization options.
I also created a thread on VideoHelp regarding that specific issue, and another about the color accuracy of screenshots in general.


text:
BlackMagic hyperdeck Connection failed
I've got a Blackmagic hyperdeck and a computer. Their are both connected on the same network.
The network settings of the hyperck are :
Remote : ON
DHCP:OFF
IP address:192.168.1.100

I can ping the ip address provided by the hyperdeck.
$ ping 192.168.1.100
>>11 packets transmitted, 11 packets received, 0.0% packet loss

But when I try to connect myself with telnet for a TCP connection it failed :
$ telnet 192.168.1.100 9993
>>Trying 192.168.1.100...
>>telnet: connect to address 192.168.1.100: Connection refused

Do I have to configure something else on the hyperdeck or the computer ?

I'm voting to close this question as off-topic because it was just a simple mistake in the IP address - not anything to do with Video Production.

We made a new set up but my computer had a new IP which was the old hyperdeck IP. And the switch of the hyperdeck was off.
So if was pinging my own computer.
I switch on the switch, change the ip adress, it work back again.


text:
Importing multiple images into premiere, getting the same one multiple times
I'm trying to import multiple images into premiere which I've prepared and exported in illustrator before. All I'm getting is the same images all over again. Even if I browse the folder through premiere I see them exactly the same. In finder they are fine

If I place them onto the timeline and render in to out, they are also all the same.

Are you importing via drag & drop, or through file>import? Try using import from the menu (or ctrl/cmd+i), drag and drop is notorious for causing problems.

Thanks for your response! Tried both...

Solved by using the "Video" mode in Illustrator which you can select while setting up your file after you click "create new"


text:
Creating the Star Trek warp effect in After Effects
I am trying to figure out how to create the effect of going into warp from the Star Trek tv shows like The Next Generation and so forth - the one where the ship stretches forward, blurs a bit and then disappears in a flash of light. I've been trying to find out if some guide exists online on how to do it, but haven't been able to find anything useful, so I was curious if there's anybody more experienced with After Effects who could push me in the right direction.
I have a ship moving from the lower right corner of the screen to the upper left.
You can see an example of what I would like to accomplish on a video here: example. It is the white flash at the end of the video.

can you post a link for the non-Trekkies so we can see how the effect should look?

I have edited the question to include an example.

I would simply add a small circular shape layer with feathered edges, possibly with the size and shape of the path animated. Then I would add a vertical directional blur with animation on the size of the blur, then duplicate of the layer with a horizontal only blur and more with angled blurs until you get the right "star" effect. Depending on the effect you want you might need each blur on a separate layer, or you can stack the effects on a single layer. You might need to precomp them all and add curves or levels to adjust the brightness and colour of the whole thing.
Or if you want a one-stop-shop Red Giant's StarGlow does this very well (it's a paid plugin).

All that looks like to me is a simple lense-flare that got its opacity and scaling keyframed. Startrek used very cheap methods for vfx due to the limited budget, so I believe that you can find assets such as these online quite easily.

I took a look at Red Giant's StarGlow, as suggested by stib and it does look good. However, after some consideration, I decided to avoid buying another plugin and went for the quick and dirty solution - I reused the effect from a video I found online and since it was on black background, I had no trouble compositing it into my scene without problems, simply using the Add blending mode.


text:
FFmpeg identify non-IDR frame (I frame) as keyframe
It's a mov file. We use FFmpeg/FFprobe to process this file. There is a frame which is shown 'keyframe' (flags=K) in this file, but we found this frame is a non-IDR frame (only is I frame) using 264 stream analysis tool. Is it a bug of ffmpeg? How could we ensure the IDR frame?
3450 is that frame.

This is a brief info from ffprobe.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '***.mov':
    Metadata:
      major_brand     : qt
      minor_version   : 537199360
      compatible_brands: qt
      creation_time   : 2015-08-05 14:23:07
    Duration: 00:07:36.69, start: 0.000000, bitrate: 6400 kb/s
      Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080p [SAR 1:1 DAR 16:9], 6009 kb/s, 29.97 fps (default)
      Metadata:
        handler_name    : Apple Alias Data Handler
        encoder         : H.264
      Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 192 kb/s (default)
      Metadata:
        handler_name    : Apple Alias Data Handler
      Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 192 kb/s (default)
      Metadata:
        handler_name    : Apple Alias Data Handler

What did the analyser report? It could be a recovery point. Can you share the file?

Hi, I add two pictures from stream analyser.

Can you share the file?

What do you mean by “ensure” the frame? To what end? Why is this a problem? Can you just parse the nal header?

Hi, SlimSCSI. Because I'd like to use '-ss' parameter. FFmpeg seeks to this frame which is I frame not IDR frame, and try to decode from this frame. But obviously, FFmpeg can't decode from this frame.

Hi, Gyan. Sorry, I can't share this file because of license.

It is probably a bug, I have reported the issue and found the cause:
https://trac.ffmpeg.org/ticket/9523


text:
Best codes for different video formats
Is there a list somewhere on the internet to give a basic idea of what codecs are best for different video formats, for example, what codecs are best for MP4, MPEG, FLV etc?

Codes or CoDecs?

I am assuming you are referring to codecs.
This is to board, there are codecs for different things. That is the point of having different ones. Some parameters can be:

Best Video Quality
Lossless compression
Compression speed
Decompression speed
Compatibility
The resolution, bit depth, etc.

But I must say that in general terms H.264 with audio AAC is the most universally accepted for full HD and mp4 container.
On AVI a good codec that deserves some attention is XVID. which uses a slightly different library than h.264 called x264.
H.265 is the next format intended for higher resolutions, 4K for example, and there it is an open format called x265.
But there is the VP8 and VP9 codecs that are getting traction, and probably will be used more than h.265
There are other codecs meant to be as production codecs, with very little data loss, they are for video editing, like ProRes.
But things are not that simple, because the quality also depends on the configuration of the codec.

I would recommend that you forget about the FLV video container.


text:
show the process in a football feint or motion
I am a football coach and need to make some videos over some exercises.
Here I would like to have some kind of "line" through the movement itself.
If you look at this little 5-6 sec. clips from 1 min and 40 sec. then it's something like what I think on CRAZY STRONG FITNESS MOMENTS - Youtube.

I agree that it is a clip where you have then taken some frames, which must be shown layer-on-layer from the tail and then removed when the video reaches the actual "movement" but are there any who can confirm this or know tutorials on how-to?

You would do this kind of thing in After-Effects or a similar compositing program (like Nuke or Fusion). Simply duplicate your video as many times as you want the move to be repeated, then offset the layers in time, and lastly roughly mask out the person from every shot except the very bottom layer.


text:
Is there a platform where I can automate creating multiple versions of an explainer video?
I work for a company that connects various software to each other. We want to create an explainer video for each software we connect to. The videos will be almost identical with the only difference being different logos shown in the video (corresponding to the software for that video).
The problem is we connect to dozens of different software, and down the line no doubt we'll want to make changes to the video e.g. when we build a new feature. We don't want to have to manually create dozens of videos, never lone go through editing each one every time we add a new feature.
So ideally we want to find a platform that easily produces multiple versions of the same video with small variations. Is this possible?
Many thanks,
Bryce

As Noah suggests, using project templates in editing software is probably the most common, and most accessible solution to your question.
The downside is that it still requires manual input, which can grow more cumbersome as your catalogue expands.  For a more hands-off approach, look into automation via scripting.  DaVinci Resolve is a full NLE which supports scripting via Lua, Python2 and Python3.  Likewise, Adobe's Premiere Pro supports scripting via ExtendScript, an offshoot of JavaScript.
Of course, the disadvantage of a hands-off approach, is that there's less human oversight, and mistakes are less likely to get caught.  YMMV.
Here's an example of how you might script Resolve to create Instagram-formatted videos from YouTube-formatted videos:  TonyTeachesTech. The same process works in Premiere.
It's also possible to ditch the GUI altogether and automate video creation with the command line.  For this, FFMPEG is usually central, and other elements are added based on your specific requirements.

Most video editing programs will allow you to duplicate a project. Then you can just swap out the old logo image for the new logo image in the timeline, check/fix the scaling, and export it. You can keep all the projects so that if you need to make other changes, you can keep those changes in the project as well.


text:
Simple program for trimming video
I have a video of a concert, and a list of timestamps (5:06-15:49, 17:56-29:14...) that correspond to songs I would like to make into separate videos. Can anyone recommend a simple program I can use to do this? The one built into windows is troublesome to use and I can only make one clip at a time.

Hi - it might help if you say what file format your original files are in?

Depending on the format you have your video, one option is VirtualDub2.
It is a free linear editor, but it is good to trim a video without recompression.
Go to the Video Menu and choose direct stream copy. Do the same with the audio.
You need to do it one by one. Make a backup first. Open the video, cut the end of it first so you do not need to recalculate the timing and then cut the start of it, and save with a different name.
If you want to automate it and you are fine with command lines, try FFmpeg.
https://www.google.com/search?q=ffmpeg+batch+trim+video
If you need to do a bit more, like adding fade in and out, and control a bit more the trimming, you can use a free nonlinear editor, but most of them will recompress the video. Davinci Resolve, Hit Film Express, Open Shot for example.

If you re-encode them, you might lose quality. Is there any software for video that allows splitting of a video file without re-rendering? For mp3 audio you can use mp3direct to split mp3 files without re-encoding. The resulting files will be as good as the original was.

The quickest, dirtiest way of doing this would be using Windows Movie Maker. The program is easy to use, free and terrible, but totally fit for what you're trying to do.
If you're looking for (free) alternatives, try:

test version of Sony Vegas
test version of Adobe Premiere
test version of Camtasia (eugh)
free version of Davinci Resolve (a bit more advanced)

windows movie maker doesnt really exist anymore as far as i can tell. thanks for the help though!

Jeez, really? Damn I feel old :D

I will second the free version of DaVinci Resolve. It can seem a little overwelming but there are plenty of tutorials on You Tube to get you started. Blackmagic Design also provides very low cost and in many cases free training resources.


text:
Program that uses grayscale images to make transitions
I remember some old video editing programs used a grayscale image to be used as a transition pattern.
Basically what they did was using the different levels of a grayscale image as a step for the transition.
Here is an example. Given the first image, when the program was analyzing the gray level marked with the red line as a threshold, the transition would look like the image below.

Do you know if that can be done in a free program like Davinci Resolve, Hit Film, probably Blender?
And a tip of how can be implemented?
images by pixabay

What you want is called a Gradient Wipe in Premiere Pro or a Luma Fade in Davinci Resolve.
Just make sure your gradient image is a 3rd layer as long as your transition, and is selected as the 'gradient layer.'
(This should be a comment but I don't have enough karma to comment in this forum. Hope this helps :) )

No, in fact this is an answer, :o) Let me explore it and come back. Thanks.

I'd be interested in seeing a solution to this using FFmpeg. There is a way to merge two videos with a png mask and I'd assume it works with a video mask, but you'd still need a way to convert the single gradient image into an animated mask.


text:
How to move foreground objects forward and the background backward in the picture?
How to move foreground objects forward and the background backward in one picture? I would like to recreate something similar like this in gif video. I use Adobe Aftereffects 2022. I do notice that the effects used only two pics on those two scenes but I didn't know how they were able to move foreground objects forward and the background backward in their picture. I never knew they were possible.
How can I do it? A simple example would suffice.

Thanks!

You can do this in After Effects and Photoshop.
Bring the original image into After Effects.
Duplicate the layer.
Name one 'foreground' and the other 'background'
Hide the background layer for now.
Isolate the foreground layer. This can be achieved using a number of different tools:  Use rotobrush to isolate the foreground layer, or a mask around it manually, or use Photoshop to isolate it (eg using the Quick Selection or Object Selection tool).
Hide your foreground layer, and un-hide the background layer, so you can work on the background.
Use the same mask inverted to isolate the background layer, by inverting the mask or matte you used to create the foreground layer.
Use Content Aware Fill (either in Photoshop or in After Effects) to fill in the gaps inside where the foreground layer was. It doesn't matter if it doesn't look perfect, as most of it won't be seen.
Enable both layers.
Use keyframing on the Scale variable to slowly enlarge the foreground.
Do the same on the background layer, but start with it slightly larger than 100% and slowly reduce it in size.
Isolate some colours, on the foreground or background using the Lumetri plugin - the tools you need are in the 'HSL Secondary' controls.  Keyframe the saturation in the Secondary controls to zero, then slowly increase to 100% over time.

I would call this parallax-dolly-in effect, (you can combine it with Ken Burns)
Let me make an illustrated quick tutorial.
1. Take your photo (A) and make a version without the background (B). There are new AI tools to remove complex objects.

2. Now you can add both layers into actually almost any video editing software. You do not need AE.
Animate the scale of the transparent layer as you want. One important thing is to define the center of the element (green cross) (C) so the object remains covering the original location.

3. If the center of the animation is not working, for example, you have two people, and the "zooming" reveals the previous persons or objects, (like the hair in this example)

you need to retouch the background. Use some content-aware removal tool on Ps
or the clone tool to "remove" the objects (D) if your software is primitive (like mine).

4. Now you can zoom with the center on a more natural-looking location (E). Keeping the center at "the center" makes the dolly in effect more natural.

You can add "drama" also animating some blurriness when the planes move away, (but that is more software specific) n_n
You can also animate the background, it does not need to stay at 100% scale.
You can also play with the panning instead of scaling or using both.
Zooming & Panning is the Ken Burns variation.


text:
Improve video quality by lowering framerate
I have recorded a short movie using GoPro camera 1080p / Wide / 60fps. The video is really blurry, despite the fact that it was a quite good weather outside (middle of the day, partially cloudly). Is it possible to make the video sharper by lowering the framerate? All I need is 25% of speed, so 15fps. I'm just wondering if some video editing software can use the information from skipped frames to improve the video quality.
Here is the sample frame: https://i.sstatic.net/5uCBy.jpg

If your individual frames are blurry, cutting down the frame rate won't help. I assume that you mean you'll be converting the 60 fps footage to 15 fps in real time (cutting out 3/4 of the frames rather than keeping all the frames but slowing it down to appear 15 fps).
Think of it this way: changing the frame rate doesn't change the actual frames. If you slowly scroll through your footage frame-by-frame and it's blurry, then it will be blurry at any speed or frame rate.

I understand this clearly, but I believe that there is a possibility to blend unused frames with actual frames to make them less blurry.

Temporal noise reduction is a technique whereby image data from adjacent frames can be used to reduce sensor noise.  It tends to work best when the camera and the subject are both static.  But as @John Barton says, this does nothing for blurriness.  There is a technique called "convolutional deblurring", but it requires very hands-on intervention to get a decent result.  If you are trying to solve a crime and you have 15 blurry frames, you might hire an expert to pull whatever detail they can to create the one magic frame that will help you identify a suspect, but not practical for video.

Yeah, if every frame is blurry, you're out of luck. Best-case scenario, if exactly every 4th frame isn't blurry, dropping down to 15 fps would solve your problem perfectly. However, if you have any frames at all that aren't blurry, chances are, they're not going to be perfectly placed every 4th frame. Manually going through and picking out the "perfect" frames would remove all blur but the timing wouldn't look right at all.

Theoretically it IS possible, and there are working, practical, proof-of-concept research on the subject.
A couple of examples:

Learning to Extract Flawless Slow Motion from Blurry Videos
Blurry Video Frame Interpolation

The picture below is from the second paper.

However, as of this writing, I couldn't find any feasible-to-use, (commercial or otherwise) software to achieve that.
You could actually use the techniques above to apply it to your video, since they even offer the code on Github, but it would be a great effort, you'd need to basically build a video processing pipeline script/software for that.
It probably would also be somewhat computationally intensive (slow).

This issue on the VidStab project GitHub also tackles the same issue:  https://github.com/georgmartius/vid.stab/issues/24

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Why to use lower case "1080p" and "1080i" but not capital "1080P" and "1080I"?
I'm curious about why we mostly use and see "1080p" and "1080i" over "1080P" and "1080I"? (and the same on 720/480/360) Does anybody know any professional reason of that?
I've seen some capital ones, but mostly with lower case, I'm wondering the reason why, but didn't find an answer.
For example,

Wikipedia uses 1080p and 1080i，there is no single 1080P or 1080I in these two pages
European Broadcasting Union use 720p, 1080p, 1080i in their tech doc
Netflix uses 1080p, 720p in the Help Center(Resolution under Netflix Features)
Youtube uses 1080p in their Help Center
Apple Supports also uses 1080p in their doc, HDV use 1080i / 720i on the logo
Google and DuckDuckGo prompts keywords with only 1080p even I input 1080P!

For above examples, I refer to some huge companies or organizations, but to be honestly I didn't browse all their public materials, so I'm not so sure they do only use "1080p" but not "1080P", just want to show the resolve I found.
Really appreciate if somebody can resolve my question, many thanks.

Why should they use capitals? The p and i are supplementary, not the most significant info in the description.

Welcome! It is only an educated guess, but I think engineers made lower case the de facto convention because of the potential for confusing an upper case i with a 1 or lower case L. One outlier to the convention: ITU-R Rec. BT.709-6 uses upper case. If I'm reading the version history right, that wasn't added in to the standard until well after the lower case convention was already entrenched.

@MichaelLiebman I've looked into BT.709-6 but only see some 60/P 30/P in it but didn't see 1080P or 1080I, so I didn't mention this one, as it's still a little bit different IMO.

@DrMayhem one designer told me it's about the visual balance, the alphabet and the numbers. I don't think we should use capitals, but I didn't have a strong reference says we should use lower case in it.

Also PsF. Who cares, really, it is just a convention. As long as you don't confuse "M" with "m" and "B" with "b" you are good ;-)

Here are my starting premises.

In the scientific community, There are some standards in the assignation of letters for units.
Normally a capital letter is assigned if the unit cames after the last name of a person, like Kelvin or Newton, and a lowercase letter in the case of just words like the case of a meter.

In the case of the liter, where it is not based on the last name of a person, the usage of capital L is permitted to avoid confusion with the number 1.

There are also some conventions on the usage of acronyms, where you should use Upper Case letters, for example, PPI.

And there are some more on the usage of abbreviates, where lower case letters should be used.

My assumption is that convention 1 and 2 are the most important in this case.   Although in this case, they are not units, the reasoning could apply.
p and i, in my opinion, are not acronyms, so the capital letter would not override the first 2 conventions. They can also derive just from an abbreviation so premise 4 would also apply.

Regarding the K in a 4K resolution, according to one note in the wikipedia it is just an informal way to say thousand, but with an implied unit, in this case the implied unit could be a pixel, 4kpx. It is based on the idea of the kilo but does not use the standard notation.
But something curious is that it is the common practice to denote a Kilobyte and not kilobyte. Probably to make it more uniform with some other prefixes in Uppercase, like Megabyte and Terabyte.
One idea about prefixes was that lowercase prefixes were used to define smaller than the base unit, and Uppercase to define greater than the unit... but the kilogram has a really strange history. Add that the unit for temperature is a big K.
It could also be just a gimmick. We were used to see the capital M (based on the standard prefixes) regarding resolution, for example, "a 24Mpx camera". Using a lower case letter probably has less impact than using a capital letter.
"Goodbye to the old 1080p, Wellcome the 4k"
"Goodbye to the old 1080p, Wellcome the 4K"

Thanks @rafael! Does the pattern also fit the terms 4K/8K? As I noticed they are using capital "K"? Sorry that this may not looks like part of the original question but I think they are related and can help me or the others understand the conventional properly, thank you again.

I added some notes about the K.

@curious The K in 4K stands for kilo, as in 1000×. 4K video is about 4000 pixels across. What will be interesting is if they keep fudging as panels increase resolutions. 4K is actually 1920×2 pixels wide, 3840. 8K is 1920×4 pixels wide, 7680. You see the problem, much like my 1TB thumbdrive actually having only 930GB, a significant loss in storage. But I guess the asterisk on all the packaging makes it honest [smh].

I would have gone with 4X, since it's 4 Full HD resolutions in a 2x2 grid. That highlights that it's "4 times better, 4 times clearer", etc.

I'm neglecting that in film, 4K is a bit wider, breaking the 4000 pixel mark. Consumer tech marketing kind of hijacked the term. There's no such thing as 8K in film.


text:
What causes audio sync drift when digitizing VHS?
In the process of digitizing family VHS tapes, amateur video producers often encounter audio drift or skew where the audio track becomes out of sync with the video:

It slowly dawned on me that the audio and video weren’t simply offset — they captured at different rates. They diverged more and more throughout the tape. To keep them in sync, I’d repeatedly have to adjust the audio manually every few minutes of tape.
https://mtlynch.io/digitizing-1/

What causes audio drift when digitizing analog video such as VHS tapes?
How can audio drift be avoided at record-time when digitizing analog video?
Common advice across the web is to use an advanced VCR with an integrated Time Base Corrector. Does using a TBC do anything to correct audio drift?

I don't have an answer. I don't think there are timestamps on video and audio contents in the VHS tape;  my speculation is the analog to digital software.

Audio drift can have a couple of causes, dropped frames (which a TBC can help with), and unstable clocks, where the audio isn't recorded at quite the precise rate it should be, causing drift, as Michael correctly pointed out.
Dropped frames caused by tape dropouts are a problem if the device skips a frame, without skipping the corresponding frame of audio. A TBC helps with this, as it will ensure the vertical sync pulse is there for each frame, even if the tape has quality issues - it will ensure your capture device always sees a frame. LOTS of older PC capture devices I tried were impacted by dropped frames. The most reliable method I found was using a dedicated HDD/DVD recorder unit, all the ones I used would always maintain the correct frame rate (without input via TBC), and the audio would always be in sync. I also sometimes used a MiniDV deck to achieve the same, which has no choice but to always record a frame, and therefore keep audio/video in sync.
Doing it via PC, I've only had success with 1 device, a "Dazzle DVD Recorder HD" that I bought in 2011. It came bundled with a copy of Pinnacle Studio HD, and it all runs on an old Windows XP machine I keep for that purpose. I don't know if it is the hardware or the software (or maybe the combination), but this device has worked for me in transferring tapes and keeping things in sync, and I've not had to buy another device since coming across this one.
If you can find a combo VHS/DVD recorder unit (I'm pretty sure they are no longer manufactured), they are usually the most reliable solution to doing this without a lot of effort. A DVD Recorder (with analog inputs) will also do the job, mine had a HDD which you would record to first, and then output those files onto a DVD. I stopped using the unit when the DVD drive eventually failed. Otherwise you are stuck just trying the various analog USB capture devices on the market, which like I've said, I've found to have mixed results, and only come across one device so far that does the job reliably.

No, a TBC won't solve an audio-video sync problem. Most likely the sync problem is coming from a shortcut in the capture device or driver that samples the audio and video with separate and/or unstable clocks. A TBC built into a "prosumer" VTR like the one in your link will give you slightly better video quality. So would using the S-Video out instead of NTSC/PAL composite, if your capture device supports it.

A TBC will definitely solve the audio-video sync problem. I started with cheap Amazon/Ebay sourced transfer devices from China doing countless edits to get the audio right. A Blackmagic Intensity for good colour representation along  with a professional quality VCR with inbuilt TBC is the best way to go for a faultless transfer. Been doing this for years with no problems since.


text:
How to play/back-up PAL/SECAM VHS tapes?
I have a few old VHS tapes that are in PAL/SECAM format, and I live in Canada. I was wondering what would be the best way to back-up/play these tapes?
Hunt for a PAL/Secam VHS player? (Could be expensive) Or ask for a service that does it for you?

Welcome to video production.

The answer to this question will depend on your priorities to some extent — what sort of quality are you looking for in the transfer, how important the content of the tapes are to you / the world, what sort of budget you have, how much time you want to spend on the project — as well as other variables such as what condition are the tapes are in, and whether you want to play them in domestic equipment and risk destroying them if something goes wrong (e.g. if they've got sticky-shed they could end up being chewed).
That said, you could probably pick up a VHS player for nothing if you ask and look around enough — ask on social media, or get your friends to ask their parents, there are still plenty out there. You won't have much control over the quality of the machine, and so you probably won't get one with such things as a timebase corrector that you get on professional machines (or later model high quality domestic machines). An old VHS machine from someone's lounge room may also not be in the best condition, so the output may be less than optimal. However, if you aren't concerned with getting the absolute best possible transfer, and are happy if it just plays the tapes so you can see a picture this is probably the way to go.
Once you've got a machine that plays them you should digitise them on the first viewing — if they are fragile they will lose quality every time they are played. You'll need a video capture card and software to run it. There is a huge range from cheap and cheerful USB gadgets that cost less than $20 on ebay to broadcast level cards that cost a couple of thousand. Once again, your priorities and budget determine what you need.
If the tapes are really valuable to you you could investigate getting an agency to transfer them. If you are concerned that the tapes might be in poor condition and they are irreplaceable you might want to find someone who deals with archival transfers. You could talk to the state film archives for your region if they exist, they may have advice for you. The Australian National Film and Sound Archive have a good page of advice here: http://www.nfsa.gov.au/preservation/care/caring-for-video/

Thank you some much for your answer!
I'd ideally want to pick up a VHS player, as getting services for digitizing seems expensive. That being said, I live in North America (Canada), so asking around for a PAL/SECAM VHS player seems tough, since they seem to be mostly available in Japan/Australia
The quality isn't the most important thing, they're baby videos that we would like to retain for memory.

Ah I didn't pick that up, being from Australia there are PAL VHS machines literally littering the streets (on hard rubbish days at least). Quite a few of the later model PAL machines would also play NTSC, I'm not sure if it works the other way around though? If you find a good, late model machine it might be worth giving it a try - the tapes are physically compatible so you won't damage them, you just won't get a picture if it doesn't work.

There are cheap VHS->DVD shops.  Usually it's not the only thing the business does, it's just one service.  Probably they just have a machine that does it fully automated, so they just plonk your tape in and it burns a DVD.  I had a couple NTSC VHS tapes done that way at a shop in Halifax.  One of them came out 352x480, the other 720x480.  They were pretty old tapes, so I don't think resolution or MPEG2 were the limiting factors.  Lots of VHS color artifacts...

Anyway, there are probably shops that have machines for PAL.  There's a sign for PAL->NTSC conversion at an Indian grocery store in Halifax, I think.  Immigrant-specialty shops are a good place to look, if google doesn't find anything fast.  I was going to do the capture myself, but I kept putting it off since I didn't have an ideal VCR, and my capture card was in an ancient computer that stopped working, etc. etc.  If you only have a couple tapes to do, just take them to a shop if you don't already have some capture stuff set up.

You can buy a VHS Player, it will be much cheaper than an agency and there are plenty of PAL/SECAM units on ebay, most if not all will ship to Canada. Some are brand new. Check for the voltage - you might need a 220V to 120V transformer. Any analog TV card should be able to convert the VCR output to USB - AFAIK they all support PAL, NTSC and SECAM. The whole thing should cost less than $100 CAD.