text:
Trim a segment of live, still-encoding H.264/FLV with ffmpeg
I am encoding a video with ffmpeg into H.264 stored in an FLV container. I would like to be able to trim segments of this video out as it is still encoding. The video contains no audio.
I am encoding the video like so:
ffmpeg -i recording.mp4 -c libx264 output.flv

And I'm attempting to trim the video with:
ffmpeg -i output.flv -ss 00:00:00.000 -t 00:00:01.000 -c copy output2.mp4

While the video is still encoding, I see this error when I try to trim:
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Also while encoding, using ffprobe, I get information like the following:
Duration: 00:00:26.96, start: 0.080000, bitrate: 126 kb/s
  Stream #0:0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr, 1k tbn, 50 tbc

How can I go about trimming this file while it's still encoding? I am willing to change container formats from flv to something else if needed. Ultimately, I need to be in mp4, but I don't mind doing some container shuffling to allow me to trim out portions while still encoding.

Works here. Which ffmpeg version?

2.8.14. From the official Ubuntu 16.04 repos

Get a binary from https://johnvansickle.com/ffmpeg/ and check.

I just did. However, now it trims without error, but the resulting file has a length of 0 and 0 frames are in it. I used the exact same command as above, but used the build you linked to. I tried both the release and the git builds. Are you using a publicly available sample video I could find somewhere and try myself?

Do you get the same behaviour if you cut a longer segment?

Yes, same behavior on a longer segment

Keep FLV but trim using demuxer seek and duration.
ffmpeg -ss 00:00:03.000 -t 00:00:01.000 -i output.flv -c copy output2.mp4

Also, skip -ss if it's 0 i.e. stream start.

Skipping -ss for the start is what fixed it for me. It seems like the file was really starting at 0.080. How would I know that if I were writing a script to trim a file?


text:
I want to compare two video files using FFPLAY
One of those videos lower resolution, another one is higher
ffplay.exe -i [PATHTOFILE][org] -i[PATHTOFILE][enc];\
[org][enc]blend=all_mode=difference"enter code here

but i got error
    No such filter: [filename1][org][filename2][enc];
[org][enc]blend=all_mode=difference: Invalid argument

I Just want to compare my videos utilizing FFPLAY with many inputs to save some memory.

ffplay is designed to play a single input. So, a workaround is needed.
ffplay -f lavfi "movie=org[a];movie=enc[b];[a][b]blend=all_mode=difference"

A filtergraph is created and movie source filters used to open the files, then blended.

I got error Argument [filename]  provided as input filename, but [filename][a]; "  was already specified.

Add report to command and share report.

https://pastebin.com/bZdu5GL0 - report

The command has to be in the form in my answer: ffplay -f lavfi "movie='C\:/Users/Lover/Desktop/video.wmv'[a];movie='C\:/Users/Lover/Desktop/video - Copy.wmv'[b];[a][b]blend=all_mode=difference"

great! That works, is there any way how to create 2 ffplay windows to compare side by side? This blend mode doesn't help too much in my case. I can tell they different in terms of pixel peeping but i need full range of colors.

Instead of blend=all_mode=difference use hstack

I was aiming for! Thx a lot

source: Stack Exchange

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

sort: votes


text:
How to copy markers and regions between projects in Vegas Pro
If I have one or more Vegas Pro projects, sometimes I want to combine them, but just copy and paste on the timeline, even with auto ripple selected, doesn't copy the markers and regions. How can I copy all the clips, markers, and regions from one Vegas Pro project to another?

It's a little counter-intuitive that Vegas Pro will not copy/paste markers and regions, but this is doable and it's not too difficult.
Here are the following steps to merge project A with project B into a new project C, copying all clips, markers, and regions:

Copy all the clips from project A timeline.
Turn on auto ripple on project B. Make sure to select "All Tracks, Markers, and Regions" in the drop down.

Paste the clips from project A (copied in step 1) at the beginning of project B. All project B clips, markers, and regions should have been shifted to the right. All project A clips are at the beginning of the timeline on project B, but the markers and regions have not been copied.

Save project B as a new file, project C.
In project A go to View > Window > Edit Details or type ALT+6.

In the Edit Details, select Markers or Regions, whichever you want to copy, in the "Show" drop down.

Select all the items by clicking the empty space on the header row in the first column.

Type CTRL+C to copy the items.
In project C go to View > Window > Edit Details or type ALT+6.
Select Markers or Regions, whichever you copied from project A in steps 6-8.
Select the first empty row, then type CTRL+V.

Repeat steps 6-11 as needed, to copy all markers and regions, whichever you haven't done yet.
project C now contains all clips, markers, and regions from project A and project B. Don't forget to save your work.

Optionally, you can re-order all the markers and regions in project C. Simply select all the rows by clicking the empty space on the header row in the first column, then type CTRL+X then CTRL+V.

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


text:
Loseless conversion from IphoneX HEVC for PC - PPro
Looking for a ffmpeg command that would convert IphoneX HEVC 4K 25fps videos to any format that will work on PC - PremierePro and keep it lossless.

Why not just directly import the HEVC file into Premiere Pro?

Conversion always will involve some loss, only copy (-c) is lossless.
There are some suggestions for "lossless" encoding in this Q&A, but I can't test them on my phone. There are UpVoted and have an accepted answer: the intermediate and output file will be uncompressed, and huge.
You can minimize loss when converting your existing videos by choosing an excessively high bitrate, since it's a cellphone video it will be of a limited length and thus only expand so much.
The ffmpeg H.264 Video Encoding Guide claims to offer lossless encoding using the -crf 0 command. It also mentions that you should expect incompatibility problems with some programs.
The section: Choose a CRF value says:

The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. Consider 17 or 18 to be visually lossless or nearly so; it should look the same or nearly the same as the input but it isn't technically lossless.

Using '0' isn't so much a "conversion" as it is a decompression and wrapping up the uncompressed video, the so-called converted video isn't recompressed.
You can correct the problem at it's source (in future) by:
On your iPhone, go to Settings > Camera > Formats > change "High Efficiency" to "Most Compatible".

so-called converted video isn't recompressed --> it is. The error residuals simply aren't quantized,

Link to source?

http://x265.readthedocs.io/en/default/lossless.html

@Gyan - Thanks for providing a link. That link is for MulticoreWare's x265 and not ffmpeg's implementation. On our site SuperUser a user reports a +3x expansion of input vs. output, if you obtain a tiny bit of compression over raw that doesn't help much when the end result is +3x bigger (for that particular example). Here's a second example, also bigger.

The 0 CRF value you're referring to is for x264. x265 started with x264's codebase. There is no ffmpeg implementation of x264 or x265. They use those encoders via a wrapper. Lossless compression is always in reference to the uncompressed full raster frames. Any historical compressed version of those images are irrelevant. The result turns out bigger because much of the lossiness shows up as 'noise' during prediction and the lossless encoder can't throw those differences away, unlike lossy compressors.

Using High efficiency as it can record up to 40% more footage on iPhone vs h264. On desktop I do not mind any file size after conversion. Please write a command to test it out. HEVC from iphonex is around 24000kbps.

@AzzKawa - Both links in the answer have commands described at length.


text:
Handbrake x265 Optimal settings for ripping DVD
I want to rip DVDs(MPEG2) to MKV using Handbrake for viewing on PC, and currently i am not sure about the settings of the x265 encoder.
Can anyone suggest the optimal settings for:

CRF : 19 ? 23 ? 25 ?
8-bit or 10-bit (Main or Main10) (Has 10-bit any advantages for low-res like DVD ? )
Encoder tune - none / SSIM / Grain ?
bframes or other parameters ?
CFR or VFR ?

Also i am open to any suggestions for tuning of an other parameteres.
I have searched by google but all guides are not specific enough for the case of DVDs.
The resolution is 700x574 , source MPEG2 bitrate is 3Mbps
Additional question - are there any good guides for general parameter tuning x265 like bframes ?
Thank you very much.

Summary response for summary question :)

CRF 20 will look really nice
8-bit (no advantages over 10-bit)
No tuning. Grain tuning is for grainy source (old content). SSIM is for testing.
No additional parameters needed.
VFR (same as source)

I could really, really, reallly go down the rabbit hole with a more detailed answer, but I'll leave it at this for now.

What does optimal mean to you? Smallest size and time to finish an encode does not matter? If so then pick the H.265 MKV 576p25 profile (apparently you have PAL content) set "optimal for source" under dimensions to not stretch or modify the picture in any way. Set the refresh rate to "same as source". CRF 20 should be good enough for most DVDs, you will know when you compare a CRF 17 encode of the same source and cannot make out the difference, if you can try the numbers in between or going even 3 steps further down. 10-Bit won't hurt, but won't benefit much either regarding picture quality, if it would and you're doing lots of filtering, you could even go with 12-Bit (I have it available on Ubuntu, the choice of filters though is limited and won't improve picture quality dramatically I'd say, nor would it justify changing the subsampling if it is availabe). Change the preset from slow to slower if you have no problem waiting for the encode to finish, this is one of the more important settings as it controls all the other setting depending on the profile, level and picture size. Disabling bframes was only imporant for older devices which had trouble decoding H.264 streams with bframes, since you said you care mostly about the result when watching H.265 content on a PC this shouldn't be of any concern.
Simply put, if the resolution is not greater than 1080p60 and playback on current mobile devices is not considered to be important then I choose H.265 with slow or slower on Main10 and 4:2:0 subsampling. That's optimal regarding of what most desktop computers can handle today, some may require video acceleration though to display noisy 1080p 60fps content (e.g. performers dancing in front of big LED displays). That's may experience so far and I never touch the encoder tune setting, I expect the default to be good enough when I'm already throwing this much CPU time at it that the tune may be negligible.

With optimal i mean a balance of quality vs size and encoding time. For example if an setting improves quality without much storage or encoding time i consider that setting optimal.

To put it in simple terms: you control the bitrate/size with CRF, with the preset you control how much effort the encoder can spent to compress content (thus making better use of the bitrate but also slowing down the encoder). The difference between 10-Bit or 8-Bit should be negligible regarding encoding speed so CRF20 and preset slow should be a good starting point. I converted a stack of DVDs last fall, it took way longer than x264 but resulting quality and size were worth it, I used several computers though.

Oh, this one is important: check for interlaced content, this is quite common and you should apply the best deinterlacer available, this will slow encoding down, but also minimize nasty artefacts the best way possible, ffmpeg as several filters, but handbrake only offers decomb, the "standard" selection seems to do the job well.

A thing about 10-bit encodes that wasn't mentioned elsewhere in this Q&A, is that they give smaller files at equal perceived quality, and produce encodes that are less likely to introduce banding, which is a typical problem with 8-bit encodes at lower bitrates (which re-encodes of DVDs and BRs are). The reason, as I understand it, is that with a 10-bit gamut, estimations, discarding of info, and inherent rounding errors introduced by the compression are, by nature of the wider gamut, less perceptible (or even less wrong?). 10-bit encodes have been a favorite among Anime fans for these reasons.

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


text:
How to cut out corrupted parts of DVD-video extracted from disc so file can be played?
I have some unique footage that I unfortunately only have a corrupted DVD copy of. I have been able to use gddrescue on Linux to extract most of the footage, but when I play the video in vlc it stops playing at certain points, and vlc returns to the playlist view. If I manually skip to the part where vlc stopped playing and skip a little forward, say a few seconds, I can play the file again and it works.
Is there a tool that I can use to automatically cut out the non corrupted parts of the video file so that I can play it without problem?

What causes this problem, what's technically wrong with the DVD-files?

Remuxing it will probably help, as the apps are generally smart enough to detect random crap and skip over it, as well as fix the timing information.
You didn't mention if it's a ripped as in copied direct MPEG-2 file or one ripped using HandBrake or something else.
Either way, use ffmpeg, avconv, or mkvmerge to remux them.
  ffmpeg (or avconv) -i source.mpg -codec copy dest.mkv
  mkvmerge -o dest.mkv source.mpg

Will test this at the next occasion!

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


text:
Progressive vs Upper
Recently been working on a TV Commercial and they asked for it as upper field first rather than progressive can any one explain the difference between the two and why upper field first is requested for TV?

Upper field first is a form of interlacing. Interlacing divides each frame of video into two fields, with each field containing half of the scan lines of the frame. One field contains the first, third, fifth, and so on lines while the other frame contains the second, fourth, sixth, etc. lines. That alternation of lines is what makes it interlaced.
Different coding methodologies define whether the field that contains the first line of video is described first or second. Upper field first means that the field that contains the first line of video is sent first in a frame. Lower field first sends the field with the first line of video second in the frame.
Progressive video does not divide a frame into fields. Every line of video is described every time a frame changes.
The region and the specifications of the individual broadcaster will determine whether they want a progressive, top-first interlaced, or bottom-first interlaced vide. In general, HD video is always upper field first. SD video is usually lower field first, but it depends on the exact standard being used. These settings are true whether you are delivering to an over the air broadcaster, a cable service provider, or just playing your video on a TV.


text:
ffmpeg stops exporting images when using overlay
I am using ffmpeg to stream first 35 seconds of a movie over udp ..
in the process of showing a preview of this movie while streaming i reached this command
ffmpeg.exe -re -t 00:00:35.000 -i input.mp4 -i overlay.png -filter_complex "[0:v]scale=1200:720[scaled];[1:v]scale=150:-1[overl],[scaled][overl]overlay=main_w-overlay_w-10:10[logo]" -map "[logo]" -map 0:a -c:a copy  -c:v libx264 -f mpegts udp://224.2.2.1:1234 -vf fps=4 -s 320x240 -update 1 -y preview.jpg

the problem is .. if i don't use the overlay i get my preview.jpg perfectly, but when i do .. ffmpeg streams ok but without creating the jpg image ..
any idea ?? please.
thank you.

Do you want the preview with the overlay?

Yes and with all the applied filters like subtitle and banner and so...

The final processed stream has to be cloned and mapped, so for the given command,
ffmpeg.exe -re -t 00:00:35.000 -i input.mp4 -i overlay.png -filter_complex "[0:v]scale=1200:720[scaled];[1:v]scale=150:-1[overl];[scaled][overl]overlay=main_w-overlay_w-10:10,split=2[logo][preview];[preview]fps=4,scale=320x240[preview]" -map "[logo]" -map 0:a -c:a copy  -c:v libx264 -f mpegts udp://224.2.2.1:1234 -map "[preview]" -update 1 -y preview.jpg

(The issue corrected here has nothing to do with the updating of a single image).


text:
Is there any way to avoid losing a generation of quality when re-exporting an .mp4 after making changes to it?
I have previously made an .mp4 video file in Adobe Premiere Pro. I don't have any of the original files (or the project file) still. I've now noticed a very small mistake that really bothers me, but if I were to import the .mp4 file into Premiere, cut out the split-second mistake (it's an unwanted sound that I for some reason didn't catch when I made it) and then re-export/encode it, it would "lose a generation" of picture (and sound?) quality.
This is unacceptable to me.
I want to export the exact same video minus the split-second mistake. Zero changes in video/audio quality. Note that I cannot export it losslessly, because then it's no longer an .mp4 and will take a HUGE amount of storage space.
Is there really no way to accomplish this? It's so annoying that I will have to suffer serious loss of quality unless I keep all the lossless source files around forever for everything. It's just not practical, and I frankly see no reason why it couldn't allow us to do this.

Nope, no way for that to happen. This isn't just a feature feature that wasn't included in Premiere, it is an inherent property of the math of lossy codecs. FWIW, most professionals don't usually keep losslessly encoded source files. However, they do usually keep lossy encoded source files, either using the original acquisition codec or an intermediate company standard format called a mezzanine format.

But... Since "the math" for the algorithms has already been performed once, couldn't it "reconstruct" all the parts except the small part that I want to remove, and then "splice" them together again, without actually re-encoding?

No. H.264 is a lossy codec, which, as the name implies, losses information in the encode process. You can "reconstruct" a close approximation of the original, but you will always lose quality because you are starting from less information than you originally had. That will always introduce artifacts because of the additional generation. A lossless codec, on the other hand, does exactly what you are describing. Math that saves all the information to make the file smaller on encode and the opposite math to get back the exact original on the decode.

Do you just want to remove a sound or the corresponding part of the video as well?

In this case, the audio would do, but in other cases, also the video.

@user2248 is on the money. The only software I know of that can do this sort of thing is ffmpeg. I'll expand on his answer:

Import mymovie.mp4 into Premiere Pro, or audition or whatever.
Do your sound edit, and export just the audio to myfixedaudio.wav (or .aiff).
Now comes the scary command line stuff:

ffmpeg -i mymovie.mp4 -i myfixedaudio.wav -c:v copy -map 0:v -map 1:a myfixedmp4.mp4

Wow, a whole line of typing, that's going to take forever. Seriously, it might seem that it's mysterious and difficult, but it's actually less work than doing it with the GUI. let's break down that command so you can see what it's doing:

-i mymovie.mp4 -i myfixedaudio.wav import the movie, and the audio. FFMPEG numbers from 0, so mymovie.mp4 is source 0 and myfixedaudio.wav is source 1
-c:v copy set the codec for video to copy, aka completely lossless copy of the original encoded video, copied bit for bit. We don't need to set the codec for audio because it sets the appropriate audio codec for mp4 by default (aac).
-map 0:v -map 1:a map the video from the first source and the audio from the second source to the first and second streams of the output. I.e. the output now has an identical video stream to the original movie, and a re-encoded audio stream from the fixed version in the wav file.
myfixedmp4.mp4 ffmpeg uses the first thing it sees as a filename without a -option in front of it as the output.
if you wanted to preserve more audio quality, you could muck around with the audio settings, you'd do that before the output name.

Compare that to what you'd do in Premiere:

import the movie and the audio
create a new timeline
add the just video to the timeline by deactivating the audio and then dragging the video into the timeline, or by selecting the original audio track from the movie and deleting it
add the new audio
export the movie, after adjusting the export settings

Same same, only you do it with a lot more clicking and dragging and keystrokes. Not to mention that it can't actually do what ffmpeg can.
This will not preserve your audio losslessly, but nothing will. It will however avoid a generation loss with your video, and it is the only way I know of that will.

Thanks. I used your method for this, and then verified that the video is identical to the last pixel afterwards. So it worked. However, it really bothers me that the audio couldn't be identical as well for all the non-cut parts. Also, when I was done, I compared all three versions' audio track and noticed heavy differences in both volume and when they start. Very unexpected. And frustrating. No idea why it changes where it starts. Also, I tried to upvote your solution, but this site wouldn't let me because it's a POS.


text:
H.264 slow scrubbing and playback performance
I have two videos, both roughly the same spec:
A: H.264/AAC 1920x808 24FPS ~3015kb/s
Using Quicktime player I can scrub through this movie smoothly and with fine detail. Jumping from one position to another, playback will happen immediately.
B: H.264/AAC 1920x1080 25FPS ~3662kb/s
This video can’t seem to handle the scrubbing as well. Dragging the playback head hangs constantly, I keep getting a beach-ball when jumping from one position to another.
I realise that the data rate on B: is higher, but is there anything I can do to improve it’s performance other than re-encoding at a reduced data rate?
Are there any tools available other than VLC/Quicktime media info, that will show me more detailed encoding options so I can further optimise B: based on A: if I have to re-encode?

GOP size, no of refs, reordered frames in file storage are what come to mind. Need to see mediainfo properties of both files to verify.

I have read a bit about ref's, or B-frames, in the handbrake UG. Do you know if there is a tool that tell me these stats?

I found the free program Media Info for macOS that does exactly what I'm after. It displays a movie's codec details incl:

H.264 Profile setting
H.264 Encoding string

Usually in these situations I'd say maybe you have a bottleneck from your storage media. But with those bit rates any Ssd or hdd should be fine unless the files are really large. Thus it sounds to me that you have either a bottleneck with your GPU, Cpu, or Ram. All are equally important for smooth playback. I'm guessing the issue is the increased resolution of the second clip.
Without knowing more about your specs I would say your best options are to create low res Proxies. In premiere it's pretty easy, you just have to modify your project ingest settings. You might as well create Proxies for all the files, it won't matter anyways as it will relink on export.

Both videos are stored on an internal ssd. I'm using a maxed out MacBook Pro 2015 2.8 i7 16GB.

As Alex suggested: work with low resolution proxies. Then relink to your original media. H264 really is not a codec that's made to edit with. It's for client reviews, web-exports, etc.

Just had to deal with this today myself. The h.264 profile level is likely causing the issue. The lower level profiles used with HD+ footage seems to cause a buffer/playback issue.
You can check your current profile level with ffprobe -show_streams input.mp4
Look for the profile level. If it's less than 5, that's probably the issue. You can re-encode the video to solve the issue. Here's a sample ffmpeg command that will do that for you.
ffmpeg -i in.mov -movflags faststart -acodec copy -c:v libx264 -crf 1 -tune fastdecode -tune zerolatency -vprofile high -pix_fmt yuv420p -vlevel 6.2 out.mov; done
That command pretty much completely solves the issue with any troublesome footage on my machine. You might be tempted to use -crf 0, but that will result in the profile level not being changed. -crf 1 is functionally identical for h.264 purposes (eg. you're likely not trying to color grade h.264).


text:
How to get camera settings from video file shot with Nikon D3300 DSLR?
I have videos shot with Nikon D3300 like DSC_0027.MOV. I tried using ffprobe program but it does not give camera settings. I am looking for settings like focal length, fstops, what mode the camera was like Manual, S or Landscape etc. in which the video was shot. How can I get such info?

You can extract all the available metadata using a free Exif Tool which you can read about here. You need to bear in mind that you're less likely to extract as much Exif data from video as you are with photo.
This is due to things like ISO, shutter and aperture changing all the time during the recording of video, and therefore is not logged to a specific value/setting like it is with photo. However, you're likely to find just about all you're able to using this tool (and many of the others just like it).
A highly recommended tool known for extracting more data than others is Exif Tool by Phil Harvey


text:
Can camcorder Sony HDR CX455 record videos in MP4 at 1920 x 1080i to be uploaded to YouTube?
The specs of the camcorder Sony HDR CX455 states that it can record videos in the following formats:
1920 x 1080p at 24/30/60 fps (50 Mb/s XAVC S)
1440 x 1080i at 60 fps (5 Mb/s AVCHD)
1280 x 720p at 30 fps (3 Mb/s MP4)
It also says that "The HDR-CX455 records 4K and HD movies in the XAVC S format, which uses MPEG-4 AVC/H.264 for video compression and linear PCM for audio compression, while saving files in a MP4 wrapper which allows for extensive record times and easy editing. Additionally, you can chose to record HD in AVCHD (ideal for HDTV and Blu-ray disc burning) or MP4 (ideal for sharing over the internet)."
(Please note the part in the paragraph above that says "MPEG-4")
Now, unless I am mistaken, YouTube does not take the format XAVC S and AVCHD. Instead, YouTube does take the MP4 format.
But, I don't want to use the format MP4 at 1280 x 720p, which is a low resolution.
If I use this camcorder, can I record videos in the MP4 format at 1920 x 1080i so that I can load the videos to YouTube ?
Thanks.
PS: The specs of  Sony HDR CX455 can be found at this link: https://www.bhphotovideo.com/c/product/1211907-REG/sony_hdrcx455_b_hdr_cx455_full_hd_handycam.html

Finally, I got the official answer from Sony Customer Service as follow:
Yes, You can record MP4 at 1920 x 1080p. Please be advised that the video format for the XAVC S is in MP4, while the AVCHD is for m2ts files. And please make sure that the File Format that is set in your camcorder is XAVC S HD:
- Press Menu.
- Select Image Quality/ Size.
- File Format (film icon) and select  XAVC S HD.
http://helpguide.sony.net/cam/1610/v1/en/contents/TP0000945876.html


text:
Zoom in/out transition in Blender
Does anyone know hot to create this zoom transition in Blender? I don't know how to create directional blur.

Directional Blur is a feature of the VSE (video sequence editor), aka compositor.  When you open up Blender, select Video Editing as the Screen Layout.  Make one window a Node Editor (where you will introduce your directional blur node), and choose the Compositing view. Open another window as a Video Sequence Editor (where you will put your clips) and view it as a Sequence.  Then, either enable Backdrop in the Node Editor (so you can see your rendered result) or open a third window as a UV/Image Editor displaying Rendered Result.  You might have to set your render resolution to get 100% of your image (because the default is to render at 50% resolution, and while that just shrinks things for 3D worlds, it crops things for the compositor).
At the first frame, set the number of iterations to 1 and set a keyframe (right click).  Set the zoom factor to 0 and set a keyframe.  At the last frame, set the zoom to 1.0 or 2.0 or whatever you consider to be a maximum.  Tune up the number of iterations to whatever makes it smooth (could be 10, 20, whatever).  Keyframe those.
With your second clip (that you are zooming to), set the first frame of the effect to the same zoom and iteration numbers that you used for the last frame of your first clip.  Keyframe those.  For the last frame of the effect, set the iteration count to 1 and the zoom amount to 0.0 and keyframe those.  Then cross fade between the two.
In the middle you should have two very zoomed images that, when blended 50/50, look like they could logically belong to either image (because it's mostly just blurred pixels).
The above was checked with the latest release of Blender: 2.79b.


text:
How to set an image height & width on a video in ffmpeg
I have many videos and I need to put an image in them for about 20 seconds, I am adding them manually and it works fine if only the image is small in size....
please, help me out to set height and width on the image
The original command is this
ffmpeg -i in.mkv -i 3.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -pix_fmt yuv420p -c:a copy tout.mkv pause

But it give me output as these image below
Image - 1
Image - 2

See answer - especially 2nd method - at https://superuser.com/q/1100368/114058

You can add a scale filter. This will scale the image to 50x50:
ffmpeg -i in.mkv -i 3.png -filter_complex "[1]scale=50:50[b];[0][b] overlay=25:25:enable='between(t,0,20)'" -pix_fmt yuv420p -c:a copy tout.mkv pause

If you want to scale the width or height and maintain the aspect ratio, use -1. For example, this scales the width to 50 and the height according to the aspect ratio.
scale=50:-1

Conversely, this scales the height to 50 and the width is adjusted by aspect ratio.
scale=-1:50


text:
ffmpeg lutrgb to create zebras
I'm trying to display zebras (colorize totally black pixels one color and totally white pixels a second color) on a selected frame from a video using ffmpeg.  Using an rgb lookup table expression I'm getting a workable solution:
lutrgb=r='if(eq(val,0),0,val)':g='if(eq(val,0),153,val)':b='if(eq(val,0),254,val)',lutrgb=r='if(eq(val,255),254,val)':g='if(eq(val,255),102,val)':b='if(eq(val,255),0,val)'

The problem with this expression is that it's testing each pixel for clipping by color, then modding only if that color component = 0 or 255.  My video is largely black and white, but a slight pixel level color shift results in a two toned zebra pattern.  You can see the two shades of blue in this sample zebra frame:

If I could test for the maxval for clipping into 0 and minval for 255 I would think this problem would be solved, but this code below doesn't work:
lutrgb=r='if(eq(maxval,0),0,val)':g='if(eq(maxval,0),153,val)':b='if(eq(maxval,0),254,val)',lutrgb=r='if(eq(minval,255),254,val)':g='if(eq(minval,255),102,val)':b='if(eq(minval,255),0,val)'

The if/then code for filters is poorly documented on the ffmpeg wiki.  Any LUT experts out there?

My guess is that minval and maxval are set for the given codec, not the minimum and maximum values of a given RGB triple.  I would suggest using 'ge' (greater or equal) and 'le' (lesser or equal) instead of 'eq' (equal) and let the inequalities rule whether you deliver black or white (or interpret black or white to a given color).

maxval and minval describe the storage ranges for the pixel format and color space. i.e. 0-255 or 16-235/240 for RGB and YUV respectively.

The lut filter only allows one-to-one mapping i.e. r expr can only reference input r values. But a pixel can have 0 component without being black i.e. (0,25,44). You need to use the geq filter, which allows cross-referencing. I'll provide a sample invocation if you wish.

a sample geq would be great, thanks for the input.

FWIW, I think a simple solution to this problem is to just test and modify the blue for black clipping and test/change the red for white clipping: lutrgb=r='if(eq(val,0),0,val)':g='if(eq(val,0),0,val)':b='if(eq(val,0),254,val)',lutrgb=r='if(eq(val,255),254,val)':g='if(eq(val,255),0,val)':b='if(eq(val,255),0,val)' ...but no customizable zebra colors =(

@Gyan I'd love to see a sample invocation using geq if you have time.

Assuming your input is full range RGB when fed to the filter, then something like
geq=r='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1R,C2R))':
    g='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1G,C2G))':
    b='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1B,C2B))'

Here the two colors are (C1R,C1G,C1B) and (C2R,C2G,C2B). with each component range being 0-255.
The 15 and 750 are the thresholds for selecting black and white pixels. The sum of the values of the three components for each pixel is compared to those values.
The st and ld functions are store and load functions with the first argument being the 'register no.'.
You can also try the colorkey filter.

strange, I'm getting a Missing ')' or too many args in 'st(1' error, even though I only see 2 arguments and each parenthesis is appropriately closed.

Color look up functions should be lower-case. Edited.

Thanks, now getting a Either YCbCr or RGB but not both must be specified error.

Share your full command

ffmpeg -i in.mp4 geq=r='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),0,254))':g='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),153,102))':b='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),254,0))' out.jpg

Ah, my answer started with Assuming your input is full range RGB when fed to the filter. Seems it's not. So, add format=rgb24 before geq. That error msg needs to change.

now back to error Missing ')' or too many args in 'st(1'

For your shell, looks like you need to the escape the commas in the exprs. So e.g.  st(1,r(X,Y) --> st(1\,r(X\,Y)

Ah.  Got it, just added quotes  to the -vf command and it works now: ffmpeg -i in.mp4 -vf "geq=r='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),0,254))':g='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),153,102))':b='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),10,755),p(X,Y),if(lt(ld(1),10),254,0))'" out.jpg


text:
How to extract a video frame using NVIDIA card
I want to extract a frame from the h264 video stream using NVIDIA card.
First of all we need to decode this stream via h264_cuvid decoder:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i ...

As I understand currently we can't extract a video frame using only NVIDIA card in FFmpeg as this functional doesn't exist, like doesn't exist a codec like mjpeg_nvenc or something else. Please correct me if I wrong.
I think we should be able to decode a video stream on the NVIDIA card then extract a frame via CPU codec, for example, mjpeg:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i video_source -vcodec mjpeg
  -vframes 1 /tmp/frame.jpg

In this case we will get the following error:

Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
  Error reinitializing
  filters!  Failed to inject frame into filter network: Function not
  implemented

NVIDIA decode video to NV12(by default) or NV21 pixel format and it's not appropriate format for the mjpeg codec. Please also correct me if I wrong.
Let's try to change the output resolution and convert the pixel format via scale_npp to yuvj420p as mjpeg codes support it:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i video_source -vcodec mjpeg
  -vf "hwupload_cuda,scale_npp=w=1024:h=70:format=nv12:interp_algo=lanczos,hwdownload,format=yuvj420p" -vframes 1 /tmp/frame.jpg

I got the same error:

Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
  Error reinitializing
  filters!  Failed to inject frame into filter network: Function not
  implemented

According the FFmpeg documentation format conversation isn't supported: "Note that automatic format negotiation and conversion is not yet supported for hardware frames"
How to decode an input h264 stream via h264_cuvid decoder then convert the decoded video pixel format to yuvj420p and extract a frame via mjpeg codec?  Or please share your thoughts how to extract a frame from a video stream with decoding or decoding and encoding on NVIDIA card to any picture format.

scale_npp supports yuv420p.

@Gyan Thank you for the comment! I tried the following command:
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i video_source -vcodec mjpeg -vf "hwupload_cuda,scale_npp=w=1024:h=70:format=nv12:interp_algo=lanczos,hwdownload,format=yuv420p" -vframes 1 /tmp/frame.jpg
And received the same error: "Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented"

The format in scale_npp needs to be changed to yuv420p

@Gyan Thanks! I changed the formats to yuv420p in the command:
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i video_source -vcodec mjpeg -vf "hwupload_cuda,scale_npp=w=1024:h=70:format=yuv420p:interp_algo=lanczos,hwdownload,format=yuv420p" -vframes 1 /tmp/frame.jpg
Unfortunately, it didn't help and I got the same error.

I don't have a compatible card to test with, but the decoded frames should already be on the GPU, so is hwupload required?

@Gyan Thanks a lot! The correct command with resizing at the decoding step is: ffmpeg -hwaccel cuvid -c:v h264_cuvid -resize 1024x70 -i video_source -vf "scale_npp=format=yuv420p,hwdownload,format=yuv420p" -vframes 1 -y /tmp/frame.jpg Can you please write an answer? I'll accept it.

Since the video bitstream is being decoded on the GPU, CUDA upload isn't required.
Command with format conversion is
ffmpeg -hwaccel cuvid -c:v h264_cuvid -resize 1024x70 -i video_source \
       -vf "scale_npp=format=yuv420p,hwdownload,format=yuv420p" \
       -pix_fmt yuvj420p -color_range 2 -vframes 1 -y /tmp/frame.jpg

Actually we can extract a video frame using only NVIDIA card via thumbnail_cuda filter. For it is necessary to configure FFmpeg with:
--enable-cuda-sdk --enable-filter=scale_cuda --enable-filter=thumbnail_cuda

We can resize frames at the decoding step then not necessary to use scale_npp filter. When we use the thumbnail_cuda filter we can set NV12 as the output format to prevent additional pixel format convertation. NV12 will be converted to yuvj420p without yuv420p in the middle.
The FFmpeg command to perform it for a h264 stream looks as follow:
ffmpeg -hwaccel cuvid -c:v h264_cuvid -resize 120x70 -i video_source \
       -vf "thumbnail_cuda=2,hwdownload,format=nv12" \
       -vframes 1 frame.jpg

If we need to deocde mpeg2, hevc, vp8, etc then we should choose an appropriate decoder from the list:
ffmpeg -decoders | grep cuvid

 V..... h264_cuvid           Nvidia CUVID H264 decoder (codec h264)
 V..... hevc_cuvid           Nvidia CUVID HEVC decoder (codec hevc)
 V..... mjpeg_cuvid          Nvidia CUVID MJPEG decoder (codec mjpeg)
 V..... mpeg1_cuvid          Nvidia CUVID MPEG1VIDEO decoder (codec mpeg1video)
 V..... mpeg2_cuvid          Nvidia CUVID MPEG2VIDEO decoder (codec mpeg2video)
 V..... mpeg4_cuvid          Nvidia CUVID MPEG4 decoder (codec mpeg4)
 V..... vc1_cuvid            Nvidia CUVID VC1 decoder (codec vc1)
 V..... vp8_cuvid            Nvidia CUVID VP8 decoder (codec vp8)
 V..... vp9_cuvid            Nvidia CUVID VP9 decoder (codec vp9)


text:
Illustrator "Release to Layers" but keep names?
Does anyone know of an Illustrator script that does a "Release to Layers", but renames the layers based on their group names?
I'm sure I had one ages ago, but I can't find it now...
It's very useful when importing complex AI layers to After Effects

Since this is about Illustrator (even though the files will go into After Effects), you might get better answers on the Graphic Design stack exchange site.

found the non-script answer:

Select toplevel layer.
select release to layers.
Shift drag sublayers out the top layer.
(from 'learning illustrator')

I use this script from Carlos Canto. After releasing layers it will name new top level layers based on sublayer name. The link to the adobe forum is broken now so I don't think this is accessible through there anymore.
It is a little difficult to figure out how to properly select the layers  to make it work. You must select all the objects and also have the top layer selected in the layers palette, like in this screenshot.

Thanks Carlos for making this way back in 2014!
// carlos canto // 09/26/14
// https://forums.adobe.com/thread/287812
var idoc = app.activeDocument;
var ilayer = idoc.activeLayer;
for (i=0; i<ilayer.layers.length; i++) {
   var sublayer = ilayer.layers[i];
   sublayer.name = sublayer.pageItems[0].name || sublayer.pageItems[0].contents;
}


text:
Equivalent to audio samples in video
I wonder what's the smallest component of a video file.
I know, in graphics, it's the pixel, in sound,, it's the sample.
I also know video is made by frames + audio, so, is it pixels + samples?

I found some more info, here: https://en.wikipedia.org/wiki/Audio_Video_Interleave but I'm still unsure what a "chunk" (term used in the article) does contain (in uncompressed format)

It's a matter of semantics. Both audio and video are expressed as samples, where a continuous analog signal is encoded into discrete chunks. These chunks are expressed as numbers, and the numbers are composed of bytes, and the bytes are composed of bits. But saying that doesn't really give you any deeper understanding of the process.
Audio is encoded in samples where each sample has a magnitude, representing the sound pressure on the microphone at a particular time.
Video is also encoded as samples, where each sample is a representation of the amount of light that falls on a sensor in a certain period. Due to the fact that light is coloured, each sample is usually composed of three components, representing the three visible primaries, red, green and blue (often encoded as YUV, but that's beyond the scope here).
Unlike sound, more than one sample is recorded at a time; an array of them (a grid, aka a "raster") makes up a frame, which is the same as the picture a stills camera would record if it was fired at that particular time. By taking successive still pictures the camera is able to create the illusion of movement due to the persistence of vision. All of the pixels in each picture are recorded at (more or less, search for "rolling shutter" and "interlacing" if you want to dig deeper) the same time.


text:
How convert avi and wmv to mp4 for html video tag?
I want to convert avi and wmv to mp4 for web and I use below code:
ffmpeg -I input.wmv output.mp4
Is that enough?

Yes it is. This will give you the default encoding settings, which are generally fine for web use.
You can specify settings to tweak the size, speed and quality, but you don't need to to get good results. The best guide I know of is the ffmpeg h.264 encoding guide wiki page.
For example, you could adjust the quality with the Constant Rate Factor setting (don't worry too much about what constant rate factor actually means, it's really just the quality setting) using -crf x where x is an interger between 0 (lossless, large file size not generally compatible with web delivery) and 51 (pretty crappy, small file size). The default is 23, which is pretty good, 17 is regarded as visually lossless, and somewhere between 17-28 is a sane value.
Another setting is the speed. If you're using CRF, adjusting the speed won't affect the quality of the output, it will just affect the file size—faster compression basically means the software will spend less time optimising, so the file will be larger. Speed is controlled by using the option-preset presetname, where presetname is one of (in decreasing order of speed / increasing file size): ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo.
The playback devices that you expect the video to be played on is another thing you might want to consider. Setting the -profile:v and -level option (the :v bit means you're setting the profile for the video stream only) means that you can choose between more efficient compression with a higher profile/level, and greater compatibility with older or less powerful devices with lower profile/  level. -profile main is probably wise if you're expecting a general web audience, it's compatible with all iPads, apple tv2 and iPhone4 and their non-fruity equivalents. If your target audience is likely to be using an iPod touch gen 2 you might want to go with -profile:v baseline and if you want to be certain it can be played by as many devices as possibel you could specify the level as well, -profile:v baseline -level 3.0
As @LordNeckbeard pointed out, if you're encoding for web use where the video will be embedded in an HTML5 <video> tag then adding the option -movflags +faststart will allow the video to start playing as it downloads.
Putting it all together, this is an example of how you chain options together in ffmpeg. This is a very basic example, ffmpeg is extremely powerful and your commands can be as complicated as you want them to be. This example will give you high quality, be playable on older/less powerful machines, and chooses smaller file size over encoding speed. It is not a recommended setting, just an example of how you specify the encoding options:
ffmpeg -i thefile.wmv -profile:v main -crf 20 -preset slow output.mp4

I wouldn't use veryslow. That ramps up the refs count to upto 16. Can't be pleasant on underpowered devices. May also add some latency to startup. Stick to slow or add -x264-params refs=4

@stib For viewing via progressive download, such as putting the MP4 on a server and presenting it with the HTML5 <video> element, adding -movflags +faststart is highly recommended. Otherwise the video will need to be completely downloaded before playback can begin.

Thanks. I'll make some edits. I should note that the example isn't necessarily a recommended setting, just an example of how you chain options together in ffmpeg.


text:
Why do one pixel wide lines look like a twisted ribbon on this DLP projector?
This is a bit of an odd application but I figured I'd post here. We have a EIKI EK-623U projector mounted approximately 10 feet from a white glossy surface.  The projector is mounted parallel to the surface and mirror mounted at 45 degrees is in front of the lens.
The projector is plugged in to a Windows PC via HDMI and is set to the recommended resolution of 1920x1200, "extended" display and "landscape, flipped".  Focus, keystone, etc are set via the remote and at this distance when the center of the image is in focus the edges are a bit blurry. The projector is set to rear projection mode to correct for the mirror.

That photo is of a straight, 1 pixel wide line intersecting another.  The lines are white on a black background.  The photo was taken at an angle to reduce glare.
If you look at the lines they appear to be ~2 pixels wide (compared to the "grid" that you can see the projector throwing), however they also appear to vary in brightness along the length of the line, almost like it thinks the lines are on an angle and it needs to dither to present them correctly.

What's going on here?

Since the pixel grid that the projector displays is a rectangular grid of rectangular pixels, how do you display something that isn't rectangular? Think about a pixel where the outline of the line falls half-way across it—half the pixel is in the line, and half out. How does that pixel display?
There are a couple of ways of doing it. You could set a threshold at which the pixel is either on or off and switch between the two. This would create a staircase on the horizontal line, where pixels were close to the point above and below the threshold. This wouldn't look that great unless the projector was extremely high resolution, where the jagginess was too small to see. The projector in the picture is nowhere near that level of resolution, so another technique to smooth out the jagginess is needed.

The technique is called Anti Aliasing. Where pixels are not fully illuminated or fully dark they have an in-between value of grey, proportional to the amount that the line covers them (this is a gross oversimplification, there is a whole science of signal processing behind how it happens in real anti-aliasing techniques).
So a pixel that is half covered by the line might be 50% illuminated. This smooths out the appearance of the diagonal line, meaning that you get the appearance of a higher resolution and smoother image.
However the anti-aliasing is not always exactly right. The variations in response curves for viewing devices (screens, projectors etc) means that sometimes the in-between levels that you see aren't what they are supposed to be in theory, meaning that some of the pixels are slightly too bright or dark, adding artefacts to the result. That's what you're seeing.
To improve the image try adjusting or calibrating the projector or the device it is connected to, particularly the contrast or gamma.

This is a great description - but the above lines were drawn exactly horizontal and vertical in Windows - is it the keystone correction or something similar causing the lines to not follow the pixel grid of the projector?

Oh, ok. It depends on the projector, but it looks like the keystone correction is done in software on that machine, meaning that the image doesn't follow the raster grid.


text:
Is 4K 4.2.0 just HD 4.4.4
I've been reading about codecs lately and found out, that the 4.2.0 codec combines 4 pixels color to one used for all 4 of them, effectively lowering the filesize.
Now how does this compare to a normal HD image with 4.4.4 (which is 1/4 of the image size, but with full resolution)
What is the difference and what gives the better end result?
I assume that the resolution would be the same, however, the 4K having more accurate colors, due to the fact that it had 4x more pixels recording it.

4:2:0 means that only the colour information is subsampled. So while that the colour is at a lower resolution the brightness information is at full resolution. This works because human vision is more sensitive to brightness than colour.
A 4K 4:2:0 image has 3840×2160 luma samples (luma ≈ brightness) and 1920×1080 chroma samples (chroma ≈ colour). So it's still going to have more information than a HD 4:4:4 image which has 1920×1080 pixels of both luma and chroma. What's more, human vision will notice the difference more, so it will look more detailed.
Also it's worth noting that while I've been talking about luma and chroma the information is actually YUV encoded (or more correctly Y,Cb,Cr), where the Y channel is a combination of the red green and blue channels, but it is weighted so that the green channel most strongly influences it (a bit under 60%). This takes into account the fact that human vision is more sensitive to green than red or blue. The U and V channels are the weighted differences between the Y and the Red and Blue channels. This means that more information is recorded for green, and is the reason why video predominantly uses green screen, rather than blue for chroma key.


text:
Applying identical keyframes to identical objects w/variation
I have the following animation, in which a ball goes from the flashlight to the end of the frame. However, how do I create multiple iterations of this animation, except with the ball following the same path, except with some variation? I'm using Adobe After Effects V15.1.1.

I would use a particle engine of some kind to do this.
You set up the Emitter to start from the same position as your torch (in a layer behind it).
You set your particles to look like the ball.
You emit them at an appropriate rate, and use air or wind adjustments to "blow" them across the screen.
After Effects has a built in particle engine called Particle World
https://helpx.adobe.com/after-effects/using/simulation-effects.html
Or you could use Particular from Trapcode
Screen shots below showing roughly how you could do it in Particle World:

An alternative to using particles is to make copies of the layer with an expression that adds some variability to their motion. For example you could add some wiggle by adding this expression to the position property:
wiggle(1, 10);

This will randomly wiggle the layer around its keyframed position with a frequency of about 1 wiggle / second. If you want them all to start in the same position and get increasingly wiggly you could use this:
var wigglyness = 100; //how wiggly
var wiggleFreq = 1;  //how quickly to wiggle
var wiggleStartTime = inPoint; //you could also use a marker etc.
var timeWhenFullyWiggly = inPoint + 2; //seconds until full wiggliness

wiggle(wiggleFreq, linear(time, wiggleStartTime, timeWhenFullyWiggly, 0 wigglyness));

This will ramp up the wiggle from the inPoint of the layer for 2 seconds.


text:
Creating wave interference in After Effects
I want to create a wave interference in Adobe After Effects, such as

. I've already started with a radio wave, as shown below.
However, I'm not sure how to
a) Make the wave interact with other layers, such as those below:

b) Make 2 waves interfere with each other
I'm using Adobe After Effects 15.1.1, and I have Trapcode.

If you precomp the radio waves you can have multiple wave generators using the additive transfer mode and they'll add to each other like real waves would, then use that to drive the trapcode form.

I think this requires a 3D effect rather than a 2D effect like Radio Waves. You might be able to achieve something like this using Trapcode Form.
Adding a bit more detail:
Make a radio wave using a black background and white waves..  Make the white waves quite thick, and have the radio waves start on the left of the screen.
Precomp the radio waves into their own comp
Ini the outer comp, add a blur to make the waves fall off gently instead of being hard black/white transitions.
Duplicate the inner comp in the Project tab, to make a second unique version of the comp
Drag this second comp into your main comp
Edit the origin position of the second radio wave comp, so that the second one starts towards the right of the screen.
You should now have something like this:

Make a new solid layer in your outer comp
Add Trapcode Form to it
Set it up using Strings, using settings as shown:

Key thing is to set the Displacement on the Z axis to correspond to the radio waves pre-comp you've made (and make the radio waves pre-comp invisible).

Hi, I've tried to my best to recreate some interference with Trapcode Form, but it's of no use; I can't get two "forms" to a) interact with each other b) interfere constructively/destructively. If you have another tips that would be great. Thanks!

I've updated my answer

Dumb question, but how do I precomp the waves?

Select the layer you want to pre-compose.  Hold down cmd+shit+C on a mac.. more here:
https://helpx.adobe.com/after-effects/using/precomposing-nesting-pre-rendering.html


text:
ffmpeg png optimization like libpngquant?
The png codec in ffmpeg can result large pngs in certain cases. I know pngs are supposed to be non-lossy but there are libraries such as libpngquant that difference between the pixel and the value predicted by the average filter.
Ffmpeg doesn't seem to support these libraries. It will be great if it could. Does anyone know if this is planned? How easy is it to port libpngquant over to ffmpeg's png encoder?

I'm not aware of anyone working on this.
Is this the library you're referring to - https://pngquant.org/lib/?
This appears to generate a palette and then perform the usual PNG encoding upon the palettized image. If so, this can already be reproduced in FFmpeg.
ffmpeg -i image -filter_complex palettegen[pal];[0][pal]paletteuse,format=pal8 out.png

See docs for paletteuse for dithering options.

If the specific algorithm were to be added to FFmpeg, it would be as a libav filter, not as changes to the PNG encoder. Although given existing functionality, most acceptable way forward is to improve the palettegen/use filters if their quality isn't acceptable.

Thanks for explaining this. Yes that is the site for libpngquant. I’ll compare ffmpeg palletegen with libpngquant and see if it works better.

It works, but PSNR is very bad. command to test: ffmpeg -y -i 1.png -filter_complex "palettegen=reserve_transparent=1[pal];[0][pal]paletteuse=dither=bayer" 3.png 2>&1 | tail -2 ; ffmpeg -y -i 3.png -i 1.png -filter_complex "psnr" -f null /dev/null 2>&1 | tail -1; ls -lh {1,3}.png; open {1,3}.png


text:
ffmpeg : error when added scale
I am trying to encode batch mkv videos which will give a output with a watermark in it.
But when I add the -vf 840:480 or other resolution (like 720p or 1080p),
it don't run but without -vf scale it works fine but I need to set resolution for the video.
Without -vf
for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -map 0 -vf scale=840:480 -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

With -vf
for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -map 0 -vf scale=840:480 -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

Please help me with how to run the command with -vf scale

Use
for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)',scale=840:480[v]" -map [v] -map 0:a -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

All filters acting upon a stream should be within the same filtergraph.

for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)',scale=840:480[v]" -map 0 -codec:v libx264 -preset veryfast -crf 18 "Temp480\%%~nI.mkv"  I tried to change the code and tried to us this but id didn't worked

You need to add -map [v] and change -map 0 to -map 0:a

thanks mana... can you also look into this one https://superuser.com/questions/1335196/ffmpeg-error-when-renaming-batch-files?noredirect=1#comment1996749_1335196


text:
Does FFMPEG benefit from SLI when using h264_nvenc?
I need to pass a very large amount of video through ffmpeg to be encoded to h264.
I've figured out my processing workflow and am happy with the results.
The machine is currently sporting one GTX1070.
I'm wondering if I'll benefit from adding a second card in SLI configuration?
Will it double the performance?
Is there considerable overhead?
Thanks for any input.

There is not necessary to add a card in SLI. Is enough to buy another card to double the performance. By default NVIDIA supports only 2 encoding streams in parallel for consumer level cards. For your goals it should be enough.
You may buy another one GTX 1070, but it's not necessary as you need to transcode a vary large amount of video files in 2 parallel streams.
Will be better to buy another video card on the Pascal architecture. In this case you will safe some money and get very similar result as on GTX 1070. GTX 1050 should be enough, because the NVENC SIP which uses for encoding the same as on GTX 1070, as on GTX 1050.
In FFmpeg you can specify the gpu for encoding via -gpu key like follow:
ffmpeg -i video_for_gtx1070.mpg -vcodec h264_nvenc \
       -gpu 0 -acodec copy -f mpegts transcoded_on_gtx1070.mpg

ffmpeg -i video_for_other_card.mpg -vcodec h264_nvenc \
       -gpu 1 -acodec copy -f mpegts transcoded_on_other_card.mpg

We can use the nvidia-smi tool to find an index for each video card. Also we can check it via other tools like GPU-Z or any afterburner, but nvidia-smi is installing together with the video driver.
About overhead: you will get CPU load by decoding video as the video files be decode on CPU and encode on GPU, but you can keep CPU almost clean if you'll also decode the video on GPU. The same examples with decoding h264 on different GPUs:
ffmpeg hwaccel cuvid -c:v h264_cuvid -gpu 0 \
       -i video_for_gtx1070.mpg -vcodec h264_nvenc \
       -gpu 0 -acodec copy -f mpegts transcoded_on_gtx1070.mpg

ffmpeg hwaccel cuvid -c:v h264_cuvid -gpu 1 \
       -i video_for_other_card.mpg -vcodec h264_nvenc \
       -gpu 1 -acodec copy -f mpegts transcoded_on_other_card.mpg

If we need to decode other codecs then we can choose the appropriate one from the following list:
ffmpeg -decoders | grep cuvid
 V..... h264_cuvid           Nvidia CUVID H264 decoder (codec h264)
 V..... hevc_cuvid           Nvidia CUVID HEVC decoder (codec hevc)
 V..... mjpeg_cuvid          Nvidia CUVID MJPEG decoder (codec mjpeg)
 V..... mpeg1_cuvid          Nvidia CUVID MPEG1VIDEO decoder (codec mpeg1video)
 V..... mpeg2_cuvid          Nvidia CUVID MPEG2VIDEO decoder (codec mpeg2video)
 V..... mpeg4_cuvid          Nvidia CUVID MPEG4 decoder (codec mpeg4)
 V..... vc1_cuvid            Nvidia CUVID VC1 decoder (codec vc1)
 V..... vp8_cuvid            Nvidia CUVID VP8 decoder (codec vp8)
 V..... vp9_cuvid            Nvidia CUVID VP9 decoder (codec vp9)

Please make sure that FFmpeg configured correctly with support nvenc and cuvid. You can find correct configuration parameters on the
NVIDIA site (scroll down)
If you need to transcode a lot of streams|files in parallel then need to buy the video card(s) with unrestricted amount of encoding sessions. You can find the information there.
OR you can go by the hack way and remove the sessions limitation for the consumer level video cards. It's possible as this limitation managed on the video driver level. In this case I recommend you to buy GTX 1060 6GB or GTX 1070 as in this situation the amount of video memory is also very important. You can find more useful info about multiple streams transcoding in
this old answer.


text:
ffmpeg timecode and -r
Following up on this question: ffmpeg drawtext timecode source framerate
I want to change the frame rate of a file, scale it down and burn the timecode in one operation.
ffmpeg -i in.mpg -r 24 -vf "scale=-2:360, drawtext=timecode='00\:00\:00\:00': r=24:" out.mpg
When I do this, the timecode is relative to the source frame rate, not the output. So if my input FPS is 59.94, I get this timecode sequence:
00:00:00:02
00:00:00:04
00:00:00:07
00:00:00:09

How can I tell drawtext to use destination frame numbers instead of source?

Use a filter to reduce the framerate beforehand
ffmpeg -i in.mpg -vf "fps=24,scale=-2:360,drawtext=timecode='00\:00\:00\:00': r=24" out.mpg

Thank you @Gyan! Your answers are fast and accurate.
So now I have a followup question: if I were only changing the frame rate, would there be any difference between -r 24 and vf fps=24?

There was a difference in frame selection logic for the first frame but I believe it was fixed recently.


text:
Frame rate mismatch when converting to raw video
I am trying to convert a H.264 video to rawvideo using the following command:
ffmpeg -r 50 -i test.ts -c:v rawvideo -r 50 -pix_fmt yuv420p -filter_complex "[0:v] setpts=PTS-STARTPTS" -y test.yuv

And here the raw video file is expected to have 50fps:
Output #0, rawvideo, to 'test.yuv':
  Metadata:
    encoder         : Lavf57.71.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 552960 kb/s, 50 fps, 50 tbn, 50 tbc
    Metadata:
      encoder         : Lavc57.89.100 rawvideo
frame=15599 fps=111 q=-0.0 Lsize=21058650kB time=00:05:11.98 bitrate=552960.0kbits/s speed=2.22x
video:21058650kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

But when I check the file with ffmpeg it shows it as 25fps and the duration is double the original duration of the video:
ffmpeg -s:v 1280x720 -i test.yuv

[rawvideo @ 0x55ad594ad840] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'test.yuv':
  Duration: 00:10:23.96, start: 0.000000, bitrate: 276480 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 276480 kb/s, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

Why when I check the raw video file with ffmpeg the frame rate is stated as 25fps and the duration is reported to be double the original duration?

Raw video is just that - a raw dump of video content payload - there is no packetization or metadata.
Output to Y4M for a format with metadata
ffmpeg -r 50 -i test.ts -pix_fmt yuv420p -vf "setpts=PTS-STARTPTS" -y test.y4m


text:
How to remove background from video without using green screen
I've started work at a company doing video work and trying to create videos that are consistent with their previous videos.  However, the more I look at the previous videos, the less I'm sure about one of the techniques, so want some help.  It was an external video company that created them so it's possible they used some fancy techniques.
In the image below, it shows a toolbox: in the video it zooms in on this and it's definitely a video because the perspective changes as it zooms in.  What i'm not sure about is how they clipped the toolbox out so neatly?  My colleagues that worked with the company previously said they didn't use green screen, although they used a white backdrop at times.
The second image is another example, someone picking a worktop off a bench, but background is perfectly keyed out.  I can get it this perfect with a green screen but I don't have any luck in doing it any other way - how would they have cut the products out so well?
(I can provide links to the videos if it's helpful - let me know)

I just did a video explaining video background removal. https://www.youtube.com/watch?v=nyAAX5f9hJU

You can script it using ffmpeg and rembg https://blender.stackexchange.com/a/324809/142292

Looking at your first example, I woul guess green screen, and not a particularly good one. It looks like they really need to increase the spill suppression, judging by the green spill evident on the feet of the bin.
An alternative approach is to shoot in a studio with an infinite white cyc, for example something like this one (randomly selected from a duckduckgo search, not necessarily endorsed). When lit correctly it will look like the second example, though that too could totally have been done with greenscreen—the forearms look a lot like there's spill that's been corrected.

The reason for shooting against green, rather than shooting against white or black is when you want to do background replacement. If you know that the background is going to just be white, then shooting against white is the way to go. But if you want to replace the background and you use white (or black) then any highlights (or shadows) are going to become transparent. It's much easier to keep green out
of your foreground than stopping it having any highlights or shadows.
Another approach is to use rotoscoping. This is where masks are drawn around the foreground to cut it out from the background. While software like After Effects includes tools to automate this task somewhat, it is still a very time and labour-intensive process, and generally the results are inferior to other techniques. I would use rotoscoping only as a last resort, and I don't think I'm alone here.

You can use Unscreen, an AI tool that can remove backgrounds from a video. The free version do have some limitations imposed but it is good enough for small applications. Source


text:
How to Stretch Video Vegas Movie Studio
So I filmed with my Go Pro with a Stretched screen for 16:9 when I resized it to get everything. Is there a way to stretch the video instead of moving the camera to adjust to the 4:3 the video is in a the moment?
I am using VEGAS Movie Studio 15.0 Platinum
If there is another way I can do things that is more efficient I would like to know what as well.

There is a third option which is to stretch the 16:9 event to be taller so that it matches the 4:3 ratio. This must be done at the Track level. Open up Track Motion and disable Lock Aspect Ratio and resize the 16:9 media to fill the 4:3 frame. Everything will be tall and thin but there will be no black bars from letterboxing and no loss of picture data from cropping. (i think it looks bad but some people watch TV like this all the time)

https://forums.creativecow.net/thread/24/976641#976651


text:
ffmpeg - Trouble adding watermark + convert video quality in same command
So I have found this neat guide on converting video quality https://gist.github.com/dvlden/b9d923cb31775f92fa54eb8c39ccd5a9
To convert a video to 480p I run the following
ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 1000k -minrate 500k -maxrate 2000k -bufsize 2000k -vf scale=854:480 intro-480p.mp4

However currently I am doing this to transcode and add a watermark to all our videos in a directory
find /home/video/archive -type f -execdir ffmpeg -i '{}' -filter:v drawtext="fontfile=/root/FreeSans.ttf:text='www.website.com':fontcolor=white@1.0:fontsize=26:y=h-line_h-30:x=w/20*mod(t\,120)" -f mp4 -vcodec libx264 -preset fast -profile:v main -acodec aac -movflags +faststart '/home/video/watermarked/{}.mp4' \;

However I am having trouble combining these two commands into one. Whatever I try the watermark doesn't show, just the quality changes to 480p. How can I achieve both with one command? Also please add it to the command above so I can convert all files in a folder.

Use
find /home/video/archive -type f -execdir ffmpeg -i '{}' -filter:v "drawtext=fontfile=/root/FreeSans.ttf:text='www.website.com':fontcolor=white@1.0:fontsize=26:y=h-line_h-30:x=w/20*mod(t\,120),scale=854:480" -pix_fmt yuv420p -c:v libx264 -preset slow -b:v 1000k -minrate 500k -maxrate 2000k -bufsize 2000k -c:a libfdk_aac -b:a 128k -movflags +faststart '/home/video/watermarked/{}.mp4' \;


text:
How can I batch remove from videos all material that comes before the first all-black frame?
I have many hundreds of videos, each a few minutes long and to which was appended an intro and outro sequence that I would like to automatically remove. There is always an all-black frame immediately following the intro sequence and immediately preceding the outro sequence.
Is there a way to batch (for all videos in a folder, macOS High Sierra) detect and remove all the material preceding the first black frame in a video? (I have the same question for removing the outro sequence, if a workable solution exists.)
Thank you.

You can try using ffprobe scene detection tool to find the black frame time, then use ffmpeg to seek and trim.
I'm not very good at scripting, but here is something you can try. It is very important that the black frame be only a single frame for this to work! Also, ffprobe's scene tool is very picky about file paths, so make sure there are no spaces or special characters in the filename or file path of any of the videos you need to edit.
Copy and paste the following code into a bash or command script file. I'll walk through each step to explain what's happening after.
#!/bin/bash

echo "Enter Source Folder"

read input

cd "$input"

mkdir -p "$input"/output

dir="$input"/output

for video in *; do

if [[ -f "$video" ]]; then

filename="${video%.*}"
extension="${video##*.}"

mkdir "$dir"/"$filename"

dest="$dir"/"$filename"

ffprobe -show_frames -of compact=p=0 -f lavfi "movie="$video",select=gt(scene\,0.9)" -show_entries frame=best_effort_timestamp_time > tmp.txt

sed -e 's/.*best_effort_timestamp_time=\(.*\)|tag:lavfi.scene_score.*/\1/' tmp.txt > chapter.txt
rm tmp.txt

file=chapter.txt
while read line
do
    time+=($line)
done <"$file"

ffmpeg -i "$video" -ss "${time[0]}" -to "${time[1]}" "$dest"/middle-"$filename"."$extension"

rm chapter.txt

fi

done

Breakdown
Determine the folder that contains the videos you want to trim and set it as the working directory.
#!/bin/bash
echo "Enter Source Folder"
read input
cd "$input"

Make output directory
mkdir -p "$input"/output
dir="$input"/output

For each file in the folder do this:

make sure it's a file and not a folder
save the filename and extension as a variable
create a new output directory for each video
for video in *; do
if [[ -f "$video" ]]; then
filename="${video%.*}"
extension="${video##*.}"
mkdir "$dir"/"$filename"
dest="$dir"/"$filename"

Find any frames that are 9/10 different than the frame before and save the time to a txt file.
ffprobe -show_frames -of compact=p=0 -f lavfi "movie="$video",select=gt(scene\,0.9)" -show_entries frame=best_effort_timestamp_time > tmp.txt

Clean up and replace text file.
sed -e 's/.*best_effort_timestamp_time=\(.*\)|tag:lavfi.scene_score.*/\1/' tmp.txt > chapter.txt
rm tmp.txt

Create array variable from the text file times.
file=chapter.txt
while read line
do
    time+=($line)
done <"$file"

Cut video between the two black frames.
ffmpeg -i "$video" -ss "${time[0]}" -to "${time[1]}" "$dest"/middle-"$filename"."$extension"

Delete no longer needed text file and end.
rm chapter.txt
fi
done

Hmm... I'm getting a "mkdir: /output: Permission denied
mkdir: /output: No such file or directory" error. (I will try using my brother - who knows the command line well - to get past this part.)

Since it appears to be a permissions issue, try running it under Sudo


text:
AAC with no global headers is currently not supported
As per ffmpeg bitstream filter documentation, if we use  -bsf:a aac_adtstoasc  then the AAC stream from a raw ADTS AAC or an MPEG-TS container to MP4A-LATM.
https://ffmpeg.org/ffmpeg-bitstream-filters.html#aac_005fadtstoasc
But when i try below command the file is not getting converted or adding the bitstream filter
./ffmpeg -i ~/Downloads/test_audio.aac -c:a copy  -bsf:a aac_adtstoasc aac_try_with_bsf.aac
I have checked the output format with help fo mediainfo binary.
Could someone help me to figure out the issue ?

I assume you're the same poster as at ffmpeg-user who posted this.
.aac stores a raw bitstream and the demuxer has no facility to extract the stream parameters as extradata. So, you can try streaming like this,
./ffmpeg -re -i ~/Downloads/test_audio.aac -acodec copy -vn -rtpflags latm -f rtsp rtsp://shafi:shafi at 192.168.1.135:1935/live/myStream


text:
FFMPEG - Using variables in curves video filer expression
I'm tearing my hair out trying to get this to work, i assume it's a syntax issue.
I'm experimenting with the curves video filter in ffmpeg. When I enter the coordinates in the standard form;
ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/.88 1/1':g='0/0 0.84/0.88 1/1':b='0/0 0.88/0.88 1/1' curves.png;

....I have no issues.
I am trying, however, to use variables vs fixed numbers for the curve points and i cannot in anyway get ffmpeg to accept it.
For example if i simply type;
var3=0.88

and then repeat the code with;
ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/$var3 1/1':g='0/0 0.84/$var3 1/1':b='0/0 0.88/$var3 1/1' curves.png;

it won't work, it's sees $var3 as being 0.000000
also tried;
ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/${var3} 1/1':g='0/0 0.84/${var3} 1/1':b='0/0 0.88/${var3} 1/1' curves.png;

and
ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/`echo $var3` 1/1':g='0/0 0.84/`echo $var3 1/1':b='0/0 0.88/`echo $var3 1/1' curves.png;

I'm out of ideas. Could anyone help in this situation, really need these to be variables vs fixed numbers for my purposes.
Thanks!

Assuming you're using bash or a similar shell, you need double quotes. Single quotes conveys its contents literally.
curves=r="0/0 .83/$var3 1/1":g="0/0 0.84/$var3 1/1":b="0/0 0.88/$var3 1/1"

Thanks so much! I knew it was simple, but i don't think i would have figured that out for days :)


text:
Transverse Waves in After Effects
I'm trying to create a transverse wave in Adobe after effects, much like:

To start off, I've got a Water World animation going, but it's obviously not the type of look I'm going for. Any help on this matter would be appreciated.

You could use an image or vector of a sine wave and move it to the right, with the second keyframe at exactly the distance between the zero crossing of each cycle, cropping the sides so it looks like the waves are travelling. Use the loopOut() function on the position channel to have it loop continuously.
Then for the nodes you could use shape or image layers. Apply an expression to their position channel like this
var wavelength = 100; //the width of the sin wave in pixels
var magnitude = 120; //the height ""
xPos = value[0];
yPos = value[1];
[xPos, Math.sin(time*freq + xPos/wavelength)*magnitude);

the first line could use the distance between the two keyframes of the sinewave like:
var wavelength = thisComp.layer("sine wave layer name").transform.position.key(1).value[0]-thisComp.layer("sine wave layer name").transform.position.key(2).value[0];

Thanks. I ended up using a gif of a transverse wave and using some cuts to adjust it.


text:
Fast blur is marked as Legacy in CC 2018. What's the best (and/or fastest) equivalent to use now?
Fast blur is marked as Legacy in CC 2018. What's the best (and/or fastest) equivalent to use now?

Gaussian Blur is now GPU accelerated, and it's the one that they suggest as the successor to fast blur. They've even included a script to update old projects to use the new blur, look for it in file>Scripts>UpgradeLegacyBlurs.
If you want one that uses the same maths as fast blur, i.e. is the most visually similar, then I think Box Blur is the one.
The official announcement is here.

Gaussian Blur is now GPU accelerated, and it's the one that they suggest as the successor to fast blur. They've even included a script to update old projects to use the new blur, look for it i


text:
How to choose the right bitrate, H.264 profile and level for Web Video presentation?
I want to start producing videos and looking around the internet for usual bitrate ranges (VBR) and H.264 profiles and levels for Web Video exports.
I found some guides with Vimeo and YouTube and construct my own export settings, based on the previous mentioned guides.
I am producing the videos mostly within the EU, so I am shooting my videos in either 25p or 50p to reduce the light flicker effect due to the power frequency (50 Hz).
I came up with the following settings for HD-ready, Full-HD, (true) UHD, and (true) 4K.

1280×720p25.000,     5-10 Mbps,  H.264 High Profile Level 4.0,   HDp25
1280×720p50.000,     10-15 Mbps, H.264 High Profile Level 4.2,   HDp50
1920×1080p25.000,    10-20 Mbps, H.264 High Profile Level 4.0,   FHDp25
1920×1080p50.000,    15-25 Mbps, H.264 High Profile Level 4.2,   FHDp50
3840×2160p25.000,    40-60 Mbps, H.264 High Profile Level 5.1,   UHDp25
3840×2160p50.000,    60-80 Mbps, H.264 High Profile Level 5.2,   UHDp50
4096×2160p25.000,    40-60 Mbps, H.264 High Profile Level 5.2,   4Kp25
4096×2160p50.000,    60-80 Mbps, H.264 High Profile Level 5.2,   4Kp50

The container format will be MP4, with the moov atom at the start of the file (fast start). I will introduce the moov atom as a post process (ffmpeg), since my primary transcoding software does not support the moov atom at all.
The audio is AAC-LC, stereo with 96 KHz and 320 kbps.
My question is: Are those settings suitable for better quality Web Video presentation? Did I miss something while merging the various guides on how to setup the transcoding process?
I would like to point out again, that the above mentioned settings are for the Web Video exports only. When I author Blu-ray releases, I will do much higher bitrates etc.. However this question is only about the Web Video presentation.

Are you hosting the videos yourself, or uploading to YT..etc? Which transcodng s/w?

This is for YouTube and Vimeo only. I also host them in my own servers with "original" settings (much higher). I use Adobe Media Encoder CS4

As long as the quality looks good, doesn't matter. Profile/level are relevant when your output is being played. YT and Vimeo always transcode.

If you are looking to get the best possible quality, encode at the highest bitrates you can factoring file size / upload time.
Regardless of what you bitrate you transcode at; nearly all streaming platforms - YouTube and Vimeo included, will re-transcode the files using their own settings for Various Resolutions. Youtube for instance will take a 1080 file and transcode it into 1080, 720, 480, 360, and 240 versions for people who have slow connections.
Your original file on both Vimeo and YouTube will remain available for download later from your Video's Setting Page. I am not sure if you can make that public, but they do retain it if you wish to pull the file back at a later date.


text:
I want to find video effect
I need a video effect to show a big count of video on my youtube channel.
I want to show a grid of small 64 videos (or more). The camera will start with one video in the center and will be moving away, increase the scale, more and more videos will fall to the scope of the camera.
How can I find such a video effect and buy it?
I tried on https://videohive.net but do not have success with it.
In what film or video I can find such an effect? I saw it in some films, but do not remember where.

Try to look for "Multi Video" on VideoHive. It gives me some results similar to what you are looking for.

My first port of call was to look on videohive too. But in the end i ended up creating the grid of videos then using the parent tool to assign all videos to the central video as the parent and just apply a scale to that video which controls the scale of the rest.

An alternative method would be to use a 3D scene, with the videos in a grid and moving the camera away.


text:
Is it safe to use the yuva420 pix_format option with ffmpeg to encode webm videos?
I am encoding png image sequences to both webm and mp4 formats using ffmpeg. My goal is to achieve perceptually lossless videos, with the smallest file size I can reasonably achieve.
The webm videos I produced worked fine and were playable in many browsers, until I switched to a later version of ffmpeg, which I compiled from source. (The reported ffmpeg version is N-91380-g46fb150, whatever that means).
The output webm videos still played fine in VLC, but browsers like Chromium and Opera would display them with the colors totally messed up. It seems like the blue in the video is mostly replaced with green - anyway it looks really weird.
I checked the color mode with ffprobe on the videos produced with old and new versions of ffmpeg:
The old ffmpeg webm videos that worked everywhere:
vp9 (Profile 1), yuv444p(tv)
The new ffmpeg webm videos, which work in VLC, but have messed up colors in browsers:
vp9 (Profile 1), gbrp(pc, gbr/unknown/unknown, progressive)
The ffmpeg command I was using didn't specify any pix_format - and I'm pretty sure it was something like this accross old and new ffmpeg versions:
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -i my_audio.flac -c:v libvpx-vp9 -b:v 0 -tile-columns 2 -crf 18 -c:a libopus -b:a 128k -r 30 -g 300 -y my_video.webm
I read somewhere about pix_format and tried this (note the yuva420p option):
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -i my_audio.flac -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -tile-columns 2 -crf 18 -c:a libopus -b:a 128k -r 30 -g 300 -y my_video.webm
I chose yuva instead of yuv in the hopes it would enable the alpha channel, because my input png images have transparency. It seemed to work... the videos now play fine in browsers, like with the old version of ffmpeg. Compared to the old ffmpeg result with default pix_format, ffprobe shows a slight difference. It reports:
vp9 (Profile 0), yuv420p(tv, progressive) and alpha_mode: 1
Interestingly, the output webm file size using yuva420p is smaller than if I omit the pix_format option. With yuva420p it's about 2/3 the size of the output file that uses the default gbrp mode and messes up colors in browser playback.
So it seems like pix_fmt yuva420p is the way to go. But since I really have no idea about color spaces / pixel formats, my question is: What color mode / pix_format option should I choose, given I want high quality webms, small'ish file size, and compatibility with many browsers? Are there any drawbacks with using yuva420p instead of the default gbrp, or another pix_format option?
And for bonus points ;) if yuva420p is OK, why would ffmpeg change the default pix_format value away from yuv to gbrp?

YUV color encoding with 4:2:0 chroma subsampling is the only widely safe pixel format for web playback, although for certain codecs, other pixel formats may be supported.
FFmpeg auto-selects the pixel format for the output as not all encoders support all pixel formats. It will select the pixel format which best preserves the source bit depth, chroma sampling scheme and the color encoding scheme, from among the formats supported by the encoder. PNGs have RGB pixel format and until two years ago, ffmpeg did not support encoding RGB formats for the VPx encoders, so it would select a YUV format with full chroma (4:4:4). Since RGB became supported in FFmpeg for VPx, it will select a RGB variant like gbrp.
Auto-selection is overriden by manually specifying -pix_fmt.
YUV streams can be more efficiently compressed than RGB.

Thanks Gyan... your comments make enough sense so I'm accepting this answer, even though I find ffmpeg's default choice of chroma subsampling for PNG to VP9 encoding rather unhelpful and confusing.


text:
Is it possible to use 2-pass encoding to create vp9 / webm videos from an image sequence?
I'm currently creating webm videos using ffmpeg to encode an image sequence. My command is:
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -i my_audio.flac -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -tile-columns 2 -crf 18 -c:a libopus -b:a 128k -r 30 -g 300 -y my_video.webm
The webm VP9 encoding guide only seems to list examples of 2-pass encoding with ffmpeg. And for image sequences, their example doesn't even seem to use ffmpeg.
So I wonder, is it possible to do 2-pass encoding of image sequences using ffmpeg and libvp9? If so, what would be the equivalent to my single-pass command? Is there any advantage in using the 2-pass approach instead of a single pass in this scenario?
References:
webm wiki > FFmpeg > VP9 Encoding Guide: http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide
webm wiki > HOWTOs > Convert PNG frames to WebM video: http://wiki.webmproject.org/howtos/convert-png-frames-to-webm-video

You would use
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -pass 1 -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -tile-columns 2 -crf 18 -r 30 -g 300 -y -f null -

and then
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -i my_audio.flac -pass 2 -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -tile-columns 2 -crf 18 -c:a libopus -b:a 128k -r 30 -g 300 -y my_video.webm

In FFmpeg the container format or encoding of the input is, in itself, irrelevant in terms of using encoder features like two-pass.

Thanks Gyan. What's the effect of the trailing dash in your first pass command? Is it required? I'm assuming the -y is not required in the first pass because of where you sent the output...

The trailing - stands for stdout so the destination is a pipe which isn't redirected anywhere so NULL.  -y can be dropped.

Interestingly, the trac.ffmpeg.org 2-pass encoding guide for x264 retains the -y for the first pass, even though output goes to /dev/null. Not sure why, but I guess they have reasons. I accepted you're answer, as it's fairly direct and is a very close equivalent to the command in the original post... though I get better results with the command I posted.

Will get that changed in the wiki. You only asked about syntax, not optimal commands for encoding :)

is it possible to do 2-pass encoding of image sequences using ffmpeg and libvp9?

Yes, it is possible to do 2-pass encoding from a PNG image sequence using ffmpeg and VP9.

If so, what would be the equivalent to my single-pass command?

Gyan's answer provides a close equivalent to the single-pass command used in the original post. An alternative command is listed below, which is likely to yield better results in terms of compression, while maintaining at least as good visual quality and potentially improving on it.

Is there any advantage in using the 2-pass approach instead of a single pass in this scenario?

Here are three advantages of the 2-pass approach rather than a single pass for the VP9 codec specifically:

Certain codec options only become possible with 2-pass encoding and these can impact quality. For example auto-alt-ref to enable the use of alternate reference frames, which can enhance visual quality. (See webm project's VP9 encoding guide for details)
Potential for better compression, meaning smaller output video file. See tests results below, where I get about 10% improvement using 2-pass.
The ability to control your target bitrate, which might impact you in a VoD/streaming scenario, since you'll likely have specific bandwidth constraints.

There may be other advantages/reasons to do 2-pass encoding with VP9, depending on your use case. So far, 2-pass with VP9 works well for me. In fact, as long as I have the time for a 2-pass encode, I wouldn't even consider using a single-pass encode now.
Note: I generally don't use 2-pass encoding for x264, but for VP9 it seems to be recommended over single-pass.
Alternative 2-pass command for the OP's single-pass
ffmpeg -framerate 30 -f image2 -i frames/%04d.png                  -c:v libvpx-vp9 -pass 1 -pix_fmt yuva420p -b:v 0 -tile-columns 6 -frame-parallel 1 -row-mt 1 -crf 18 -threads 8 -quality good -speed 4 -r 30 -g 300 -an -nostdin -y -f webm /dev/null
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -i my_audio.flac -c:v libvpx-vp9 -pass 2 -pix_fmt yuva420p -b:v 0 -tile-columns 6 -frame-parallel 1 -row-mt 1 -crf 18 -threads 8 -quality good -speed 0 -auto-alt-ref 1 -lag-in-frames 25 -c:a libopus -b:a 128k -r 30 -g 300 -nostdin -y my_video.webm

The difference in flags compared to the original post and Gyan's solution are as follows:

-frame-parallel 1 : Per webm project VP9 encoding guide, can enable multi-threaded decoding
-row-mt 1 : Enable row-based multi-threaded encoding for VP9
-threads 8 : Per webm project VP9 encoding guide, bump encoding performance
-quality good -speed <integer> : This is the quality preset I want, and I'd use speed 4 on the first pass, and speed 0 on the second if you have the time to wait. Speed 1 or 2 for the second pass give reasonable results as well.
-an : Explicitly tells ffmpeg to ignore audio on the first pass. It may not actually matter whether this flag is present, especially given the PNG-only input on first pass
-nostdin : I run ffmpeg in a loop in a script. This is one way to stop ffmpeg from reading from stdin and choking itself in that scenario
-auto-alt-ref 1 -lag-in-frames 25 : Per webm project VP9 encoding guide, turns on VP9's alt-ref frames... can enhance quality

Test results using 2-pass instead of single pass
I performed a test on a video of about 2 minutes length, with the content being just a screen recording at 720p with a few very simple visual effects. I used the above command to do a 2-pass encode, but the second pass speed was set to 1. Then I did a single pass encode, using exactly the same settings where possible, such as CRF, quality, speed 1, tile columns, etc. I used the same low-spec machine for each encode.
The output video for the 2-pass encode was smaller by about 10% of the single pass result. But the 2-pass encode time was significantly longer... about 160% of the original, or roughly 10mins vs 6mins.
References
webm project VP9 encoding guide: http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide
webm project VP8 encoding options: https://sites.google.com/a/webmproject.org/wiki/ffmpeg
ffmpeg VP9 codec options: https://ffmpeg.org/ffmpeg-codecs.html#libvpx


text:
What cable do I need for this connection
I have a monitor with 2 connections labeled as output. CVBS1 and CVBS2 look like This. Looking at them I'm not a hundred percent on what kind of cable I need to use.
After trying to search online I'm fairly sure its a coaxial cable with a BNC connector, but I would like to find out for sure before I order a cable.

Yes, it is a BNC connector.

@MichaelLiebman Thanks! Such a strange connection to have on a monitor.

It is standard for industrial and professional video.

It is a composite signal being output via BNC connection.  This connector is used in most professional applications as it is heavier duty and can lock to the connector so that it does not accidentally come detached.  I'm not 100% certain if this standard is compatible with RCA connectors (I started working with BNC with component video and mostly with SDI, so I'm not that familiar with composite on BNC), but it may be possible to run this in to a normal component video input (the little yellow RCA connectors on VCRs for example) via an adapter.


text:
How to recreate this motion?
Recently saw this motion graphics on Instagram which reveals a Malayalam letter. I assume it is created using After Effects.
How could I create something similar like this?

The author in the comments says it was made using Cinema4D.
It looks a lot like this tutorial:
http://cgterminal.com/2017/08/10/cinema-4d-hyper-realistic-3d-acrylic-paint-stroke-tutorial/


text:
How to create “diagonal wipe” effect in FFmpeg?
Is it possible to create "diagonal wipe" effect in FFmpeg between two videos? An example: the first video is playing and after some time the second video is replacing the first video starting from the right upper angle. On images below, blue color means the first video, green color means the second video.

Basic syntax is
ffmpeg -i old.mp4 -i new.mp4 -filter_complex
       "[1]format=yuva444p,
           geq=lum='p(X,Y)':
           a='st(1,(1+W/H/TN)*H/D);if(lt(W-X,((ld(1)*T-Y)/(ld(1)*T))*ld(1)*T*TN),p(X,Y),0)':
           enable='lte(t,D)',setpts=PTS+D/TB[new];
        [0:v][new]overlay" wipe.mp4

This will unveil the new video over the old starting from the top-right.
What this basically does is add an alpha plane to the new video and then manipulate transparency so that when overlaid a wipe is effected.
Two of the variables will need to be replaced with numbers by you.
D is the duration or the wipe, in seconds.
TN is the tangent of the acute angle between the wipe frontier and the vertical. This is the ratio of the horizontal wipe speed to the vertical wipe speed. So, TN = 1 represents a wipe at 45 deg and TN = 2 represents a wipe at atan (2) = 63.4 deg.

Also, in my case [old] had to be [0:v]. Thanks for this example. This is great.

This is extremely helpful, thanks Ryan! Is there a way to tell the filter when to start? I have two 10 second mp4s and the transition always seems to start 2 seconds in. It'd be great if I could start it in the middle of the two, or to start at a specific time. Is that possible with this FFmpeg filter?

Use the xfade filter: specifically the diagtl, diagtr, diagbl, and diagbr transitions.
xfade is newer than FFmpeg 4.2, so use a build from the current git master branch (or FFmpeg 4.3 or newer whenever it becomes available). See FFmpeg Download for links to pre-compiled executables.
Also see FFmpeg Wiki: xfade for more examples.

Video input example
ffmpeg -i input0.mkv -i input1.mkv -filter_complex "[0][1]xfade=transition=diagbl:duration=1:offset=4.5,format=yuv420p" output.mp4

duration sets the duration of the transition effect. In this example it is 1 second.
offset sets the time to wait before the transition occurs. In this example it will wait 4.5 seconds before applying the transition. Then input1.mkv will play.
Note that the second video will start from its beginning. For example, if you want it to start at 3 seconds instead of the very beginning then add the -ss input option, such as … -ss 3 -i input1.mkv …, or alternatively use the setpts filter.

With audio crossfade
Using the acrossfade filter:
ffmpeg -i input0.mkv -i input1.mkv -filter_complex "[0:v][1:v]xfade=transition=diagbl:duration=1:offset=4.5,format=yuv420p[v];[0:a][1:a]acrossfade=duration=1[a]" -map "[v]" -map "[a]" output.mp4

Image input example
ffmpeg -loop 1 -t 5 -i 1.png -loop 1 -t 5 -i 2.png -filter_complex "[0][1]xfade=transition=diagtr:duration=1:offset=4.5,format=yuv420p" output.mp4