text:
How to sync audio with kmsgrab video stream?
I am trying to sync audio from the pulse stereo output with the video from kmsgrab. If I use the video stream as stream one the video is choppy. The command that works best a the moment is:
ffmpeg -nostdin \
    -avioflags +direct -fflags +igndts -fflags flush_packets -fflags discardcorrupt \
    -fflags nofillin -flags low_delay -fflags nobuffer -frame_drop_threshold 1.0 -async 0 \
    -f pulse  -thread_queue_size 256  -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor \
    -avioflags +direct -fflags +igndts -fflags flush_packets -fflags discardcorrupt \
    -fflags nofillin -flags low_delay -fflags nobuffer -frame_drop_threshold 1.0 -async 0 \
    -f kmsgrab -framerate 25 -thread_queue_size 512 -i - \
    -vf hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12 -c:v h264_vaapi \
    -compression_level 1 -b:v 4M -profile:v 578 \
    -map 0:a -map 1:v \
    -bsf:v h264_mp4toannexb -c:a aac -ab 96k -ar 48k -ac 2 -bsf:a aac_adtstoasc \
    -f flv -listen 1 -rtmp_flush_interval 4 -rtmp_buffer 3000 -rtmp_live live \
    -rtmp_subscribe out rtmp://0.0.0.0:1935/live/out

The only problem is that the sound is retarded by about 3 seconds. Also the video stream is delayed by about 2 seconds, so the delay of the audio stream in absolute values is 5 or 6 seconds.


text:
Nomenclature for a selecting a temporal window?
I would like to know the proper term, so I can Google how to reduce the duration of a video with ffmpeg.  For example, assume a 3600 second video that reduced in size by selecting the 2nd and third minute of the video.  This temporal window of time would be from t1=60 to t2=180.
I suspect that cropping would be the correct term because common usage refers to a spacial and temporal reduction of the video.
What is the correct term (i.e. from Google search standpoint) to indicate the said idea of a temporal window?
I would like use this search keyword with ffmpeg to [temporally slice up a video / audio][1].

Usage in video editing contexts is trimming.

"trimming" is correct, and connotes a reductive edit.  "marking a range" means simply selecting it by defining the desired beginning and end or "in/out" marks.  Not sure if FFMPEG uses that terminology, but most NLE's do.

source: Stack Exchange

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

sort: votes


text:
Is it illegal for me to download DaVinci Resolve 17 just because I don't work for a company?
Is it illegal for me to download DaVinci Resolve 17 just because I don't work for a company? The website is asking me to fill out a company that I am affiliated to but I am just a lone guy who want to do things for fun. Is it okay to download this?

Yes, it’s ok*, as long as you’re downloading the free version (not the one that says “Studio”) of Resolve and not trying to circumvent their copyright protection.  When you download the software, they ask that you provide some information about yourself so that they can understand their market demographics.  If you don’t work for  a company, just put that, “self-employed,” “hobbyist,” “none,” or similar.  Even if you accidentally download the Studio version (happens all the time, and vice-versa, because both versions are similarly-named), you won’t be able to use it without paying for a license.  You are required to agree to their EULA to use either version.  Ultimately, it’s your responsibility to read it before you agree to it.  Trying to use the Studio (paid) version without paying for it would get you in trouble.  When you do pay for the Studio version, Blackmagic doesn’t require all of the demographic info, although I think you’re required to register the software before they’ll give you tech support over the phone.
*I’m not a lawyer.

I think the company field in the registration form is optional because all required fields are marked with an asterisk but company is not.

Also worth mentioning that (I think) if you buy some of their cameras, they throw in a version of studio for free? Or at least they used to?

@tomh good point.  Pretty sure all of the current camera lineup still includes a free copy, and so does the speed editor keyboard, as of April 2021.

@Matt Yes.  Thank you.  I knew some were optional, but I wasn't around my laptop to check.

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


text:
How to make a Premiere project save faster
I'm working on a big project. It's on a fast SSD.  All good..
But it's starting to take ages to save.
What do you do to speed this up?

Ditch old edit versions?
Unlink After Effects comps that you've rendered?
consolidate and save as? (seems a bit drastic and might take forever... and does it still crash all the time?)
something I haven't thought of?

What has the most effect on saving speed in your experience?


text:
imported a movie now it has two audio tracks
ok, so i ripped a dvd with handbrake, converted it to an mp4, i import the mp4 to kdenlive and kdenlive is doing this thing where it's giving me two audio tracks, so at first i thought it was a right ear audio track and a left ear audio track, and i was experimenting around and i deleted 1 audio track and it still sounds fine so it's weird it's not like there's a left ear and right ear track it's like they are both mono, now the issue is i just don't want there to be two tracks  because it just makes more work even if that work is only 1 step to delete the extra track, so i have no clue what's going on or how to merge the tracks, any ideas? how can i be able to import this video with only one audio track instead of two? thanks

You need to verify if your videos only have a single audio stream as you believe them to have. It sounds like for whatever reason your videos have two streams that sound the same and so to you there should be no reason for them to show up twice.
Maybe something like either VLC or MediaInfo


text:
How to import Quicktime screen recording in PP or AE?
I know how to import other content with normal specs but these QuickTime screen recordings from my Macbook has weird FPS data. When I import these .mov files in AE or PP I get weird glitches on the screen while I am scrubbing the timeline. I am assuming it's due to the fact that I want to work in a 60fps timeline but these .mov files have off FPS data.
What is the proper way of importing files like this? I have already tried the "interpret file" option in AE but that didn't do anything either.

I'm experiencing the same with After Effects, very weird. Have you figured something out? I don't want to have to encode every screen capture before I can use it in AE.

I made a QuickTime screen recording to check and it's recorded at 60 fps. So, I don't think that may be the issue.
I've found that some programs become quirky with MOV container, and changing it to MPEG-4 (.mp4) container often helps. Since there's no re-encoding happening, this is quite simple and fast to do.
With ffmpeg, you can use the following command to quickly change the media container of media file:
ffmpeg -i input.mov -c copy output.mp4

(Note: Works properly only if your video stream is encoded in H.264 or H.265 format. QT screen recordings are in H.264 so your use case should cause no errors).
If you aren't comfortable with the command line, AviDemux is another fantastic simple media editor and converter with a GUI that you can use. All you have to do is open Avidemux, and open the .mov video file in it. Then click the output format dropdown menu and select MP4 Muxer in it. Make sure Video Output and Audio Output is set to Copy mode and then just click the save button (or File > Save).
Once the media file container has been changed to MP4, try opening it with AE and see if the issue persists.

I would try transcoding them in Media Encoder using a format useful for editing (eg ProRes or something similar) to (for example) 60 fps if they are at a variable FPS close to that, and see if it looks better.
Or try transcoding them to the frame rate you're planning to deliver at.
If you are capturing the screen recordings using ScreenFlow, there is an option to specify the frame rate. I don't think Quicktime has this.


text:
Low latency on SRT stream
I am new to this and wondering, how can I get the lowest latency sending an SRT stream? I can’t seem to get under six seconds. Using, latency=10000


text:
Automating Video Editing in the Cloud
I have a few classes that I teach over Zoom that I need to edit every week. The edits are very simple: trim the beginning of the video and add an animation of our logo at the beginning. Basically, trim 2 minutes, and add another video at the beginning.
Any ideas if there is a website that can do this automatically, or at least automates part of the process in the cloud? It only takes me about 20 minutes per video but it is very tedious and the rendering takes hours.


text:
Why is my video file so large when there isn't any video?
Background
I am using Final Cut Pro X on a new M1 MacBook Pro (16gb of RAM) on AC power, and I have noticed that when I export the video project (share) the resulting video file is so much larger than what I would expect from my knowledge of the PNG photo format.
I created a "video" that is actually just my attempt to present a recorded phone call. So video quality doesn't matter. In the image below you can see that I created a static title card that lasted 60secs with an audio track (size 36mb) that lasts 30mins. I chose the export settings based on what I thought would be the fastest encoding and smallest video size. However encoding took 12mins and the resulting file size is 51mb.

Overall Question
What do I not understand about my chosen export settings and video codec that would cause such a large file size and a long time to export?
Secondary Questions
What settings should I have chosen instead?
Is there a specific codec that would be good to use when video doesn't matter in a video?

This is similar to https://video.stackexchange.com/questions/18147/techniques-for-compressing-a-slideshow-presentation-video and https://video.stackexchange.com/questions/32172/best-export-settings-for-still-image-with-audio/32177#32177 - this question has been asked a few times, I'm still yet to see any Variable Frame Rate encoder that's available to the general public to do this specifically, but these techniques may help.

51Mb is not a large audio track. If I have an audio track with no video at all I would expect upwards of 50Mb anyway.

You have 37 minutes and 14 seconds of audio, so it's going to be at least as large as the original audio file (36Mb) plus one image and a few bytes for each frame saying "the image has not changed". You have some 67,000 frames if you build a 30 fps video.
So it will look larger than the input audio file. It could be that the settings are such that the tool you're using adds full frames every now and then, like say once every second. These full frames are called key frames and allow one to start the video midway without having to replay everything from the start. So that could easily add a few Mb of data in a 37 minutes video. A 640x480 frame is about 1Mb uncompressed, probably about 0.01Mb once compressed (since it's just text). Your video has about 2,234 seconds, that would mean 0.01Mb x 2,234 = 22 Mb of key frames only and 36Mb + 22Mb = 58Mb.
Some tools can remove all the key frames. I've used ffmpeg and generated mp4 without key frames. I don't know that the tool you're using would be capable of doing such, though.

If a video does not matter on a video... you could use an audio file like mp3.
But let us assume you are uploading it on a video platform like youtube. Then the video format should be accepted by the platform.
If you want to use it on your website, the most commonly used container is MP4, so use that.
But what you want to change are the video parameters. For example, if you have only one static image, you can change some options:

The keyframing every, let's say, 5 seconds?

The FPS, try something really low, like 1 FPS

The resolution, you can use a small file like 480P

The aspect ratio. Try using a square video format. 480x480Px

The bit depth. Use 8 bits.

The codec, either h.264 or x.264

And now choose an audio codec. The most common is ACC. Use it to maximize the compatibility across players.


text:
Where/what to check in Openshot to see why GPU render doesn't work?
I've been using OpenShot for a while on Fedora Linux from 27-33 and mostly not much problems.  I did notice occasionally that Render via GPU didn't work, but then I restarted the App, and was compiling again.
I have laptop with NV GTX 1500 TI with RPFusion nvidia drivers on, and since an update and install of cuda.  Openshot stopped working.  It gives me a message
Sorry, there was an error exporting your video: error while writing raw video frame

If I try to use ffmpeg with h.264 or h.265 directly it does encode normally.  So I'm not sure where to even look for detailed error info and howto go about solving this problem.

This seems very likely to be a bug or incompatibility of Openshot to the newest version of the driver/or CUDA and should be reported to the people who maintain this software. I doubt we can help you here.

Thanks @Matt, I was thinking if there was some debugging option or any other way to get more specific error.


text:
how to output the origin filename when the inputs are images in ffmpeg?
ffmpeg -pattern_type glob -i '*.jpg
' -vf select='gt(scene,0.4)' out_%d.jpg
In this command, i just want to select the separation frame from image sequences. But how can i make the output image filename same as the original image filename? Thx a lot.
for example:
1.jpg
2.jpg
3.jpg
4.jpg

commmand

I want the result is:
2.jpg
instead of out_1.jpg


text:
Testing DaVinci Resolve on the cloud
My computer is too old to run DaVinci Resolve, which hangs upon installing. I want to try the Chroma key feature of DaVinci and found this tutorial for launching a AWS EC2 instance running CentOS and installing DaVinci, TigerVNC, connecting to S3, etc. It seems too complicated for what I want, which is simply upload a clip, chroma key the green screen, and export. This case study sets up cloud post-production for a feature film and seems even more complicated.
What is the easiest way to test DaVinci Resolve on the cloud, with any cloud provider?

You might be better off using a dedicated command line program like ffmpeg if you want to do it in the cloud.

I already use FFMPEG command-line on a Pine64 micro-computer. I do want to test DaVinci Resolve in particular.

Cloud setups for Resolve are no joke.  The admins and support staff on the BMD support forums regularly advise against it, and as Seth’s article points out, the devs seem to go out of their way to make it difficult, for whatever reason.  Maybe it’s hard to police the licenses?

Seth Goldin and others discuss it more here https://forum.blackmagicdesign.com/viewtopic.php?t=119546

Actually before starting all the mess for the cloud, I'd get  a new computer (the cloud to take with you all the time ;-))

I would find a cloud provider that can offer full VNC access to dedicated hardware... Even so, your experience is going to be pretty unpleasant unless you've got a really fast connection. Latency is going to make it really fiddly to go frame by frame, and most VNC connections reduce the colour depth to a point where it's hard to tell what's going on.  I guess you can render and look at shots, but it's going to be laborious.

I should add - I've never actually tried Resolve over a VNC.  But I have tried to use Blender over one, and it was no fun... (except for the lack of fan noise when rendering - and the speed).


text:
Audio from Motiv video file is offset wrong in Davinci Resolve
I am using an iPhone (iOS 14.6), Shure Motive Video (1.5.0.229) and Davinci Resolve (Mac, 17.2 Build 11) to capture video. When I play back the video file in Quicktime (Version 10.5 (1086.4.2)), the audio and video are in sync, but when I drop it into Davinci Resolve, the video is several seconds ahead of the audio, despite the audio and video timelines looking like they are in sync.
The video file in question is here: https://drive.google.com/file/d/1adRm1rZRs-GKwFfnsw3YE9pMc8xVmIBM/view?usp=sharing
Strangely, if I open the file in Quicktime and export it as "4k", the offset problem goes away and empty audio is inserted at the beginning of the audio timeline, but this means I have to pre-export every source video file.
Is there a way to fix the audio sync problem without opening and exporting from Quicktime?

In the system settings->user tab->UI Settings, check the “delay viewer by x frames” box, and progressively raise the number of frames until the audio and video match.
Sometimes, external audio processing can cause delays which bring the audio out of sync.  Running your sound through a Dolby sound system is one example; a high latency plugin would be another.  I’ve used “normal” computer speakers which introduced significant delay.   If other audio isn’t delayed, then it’s probably the extra overhead incurred by Fairlight overburdening your sound card. The “delay video by x fames” feature is built for such occasions.
Sometimes the external delay isn’t consistent, though.  This is often the case with Bluetooth devices. Delaying the video by a consistent amount will never completely eliminate sync mismatch in these cases, and it’s therefore best to eliminate the source of the delay, if possible, i.e., never edit with Bluetooth headphones.


text:
Tool for searching for a video's frame by an image file
I've been searching for a tool that would take an image--a screenshot of a frame from a movie--and search every frame of one video from that same movie for that same image and give me either the frame number or a timestamp.
I've seen similar queries on this forum and there were ffmpeg command-lines that would do the job, but that hasn't worked out for me.  Here is one command-line I've found there from 2016:
Find Position in a Film/Video by a Frame
ffmpeg -i input.ts -loop 1 -i image.png -an -filter_complex "[0]crop=w:h:x:y[a];[1][a]blend=difference,blackframe=90:32" -f null -

And this is the error message I got:
Input #0, mpegts, from 'input.ts':
  Duration: 02:04:46.06, start: 4200.000000, bitrate: 2037 kb/s
  Program 1
    Stream #0:0[0x1011](und): Video: h264 (High) (HDMV / 0x564D4448), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Input #1, png_pipe, from 'image.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgb24(pc), 953x398 [SAR 3779:3779 DAR 953:398], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (h264) -> crop
  Stream #1:0 (png) -> blend:top
  blackframe -> Stream #0:0 (wrapped_avframe)
Press [q] to stop, [?] for help
[Parsed_crop_0 @ 0000028b59bfac00] [Eval @ 0000009124dfe6d0] Undefined constant or missing '(' in 'w'
[Parsed_crop_0 @ 0000028b59bfac00] [Eval @ 0000009124dfe6d0] Undefined constant or missing '(' in 'h'
[Parsed_crop_0 @ 0000028b59bfac00] Error when evaluating the expression 'h'
[Parsed_crop_0 @ 0000028b59bfac00] Failed to configure input pad on Parsed_crop_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

Here another ffmpeg code I got from [here in 2018][1]:
ffmpeg -i "input.ts" -r 1 -loop 1 -i image.png -an -filter_complex "blend=difference:shortest=1,blackframe=99:32" -f null - 2>&1 | grep blackframe | sed 's/.*frame\:\(.*\)/\1/'

And here's the error message:
'grep' is not recognized as an internal or external command,
operable program or batch file.

The version of ffmpeg I'm using is from December of 2020.
I also have Adobe's After Effects.  Perhaps there's a plug-in of the tool I'm looking for.

What operating system are you on? It's strange that you don't have grep. Maybe you're on Windows or something else like that.

The second ffmpeg command you posted works fine. The error message suggests that you are running the command on a non-unix-like system such as Windows. Just remove the part of the command after 2>&1 and it should work fine on windows.
Here is the full command without unix/linux specific stuff:
ffmpeg -i "input.ts" -r 1 -loop 1 -i image.png -an -filter_complex "blend=difference:shortest=1,blackframe=99:32" -f null -


text:
editing video (overlaying text) using AVfoundation is resulting weird behaviour in video
Whenever I move the pointer you can see video getting weird pixelation.

Complete video showing how it behaves in quicktime player: https://jmp.sh/TMaknmp
I am just applying overlay using AVVideoCompositionCoreAnimationTool in AVFoundation.
Video is being created using h264 codec, on iphone 12 device.
I have tried changing codec to hevc but that had no effect.


text:
ASS subtitle - Different alignment at block and inner level
I am trying to achieve an ASS subtitle that aligns the rectangular bounding block at the horizontal center of the window, while maintaining left-justification inside that block for multiline subtitle entries. Below is an ASCII art illustration,
+---------------------------------+
|           This is               |
|           what I want           |
+---------------------------------+

However, either specify Alignment in Style definition or using \a switch inside a piece of subtitle results in either entirely left-justified or centered line in the container.
+---------------------------------+
|Entirely left-justified          |
|        Entirely centered        |
+---------------------------------+

My apologies if I missed something obvious in the specification. I am also open to other text-based subtitle format that is capable of this and supported by ffmpeg.

If you're familiar with an ass file, you can position your text by using \pos(150,250).
Example:
Dialogue: 0,0:01:00.00,0:01:15.00,Default,,0,0,0,,{\fad(500,500)\pos(150,250)}{\i1}{\b1}Your Text

The first number is from the left, and the second one is from the top of the video.
An easier solution, rather than write each line yourself, is to download Aegisub to make the ass files for you.
Using Aegisub, you can drag the text lines to the position you need.

I know that it is possible to individually position the entries. Nonetheless, I want to know if there is a generalised way to do this :) Doing it one by one would be tiring (imagine positioning thousands of entries for a movie) and error-prone (hard to be exact, need to redo in case resolution changes). I can write a script to automate it but it just does not feel like the right way...


text:
Is there a way to "Pan Behind (Anchor Point)", but with the "Transform Effect"'s anchor point?
I need to skew an image, so I am using a Transform Effect rather than the regular layer's Transform. I'm finding difficult to position the skewing origin without the Pan Behind tool, as that changes the layer's regular Transform, not the Transform Effect. Is there a way to have the tool to change that instead?

In the transform effect, pickwhip the position property to the anchor point property within the same transform effect. You can then move the anchor point using the regular selection tool without repositioning the layer.


text:
CyberLink PowerDirector: Is it good for game footage?
I have downloaded a free version of CyberLink PowerDirector but is it good for editing video game footage especially from video files from multi emulators? I just want to some of my videos 720p for Youtube but I do not want to upload the video directly from PowerDirector.

I've used PowerDirector for a couple of years - it's primary strength is relative ease of use.  You won't find a ton of fancy here, but if that's okay for you, you should be fine.


text:
GoPro creation metadata on Google Photos different for photos and videos (timezone offset?)
If I take a video and a photo at the same time (both also have GPS tags in metadata, BTW) and upload them on Google Photos, the video will be wrongly sorted in the album because its creation time is thought to be  +2 hours GMT. in Mediainfo.exe the creation date is correct (in UTC) and same as in the EXIF of the photo.
If I convert it with ffmpeg with -map_metadata 0 the problem persists.
Does it makes sense to raise a bug for Google Photos or GoPro or it's something I am doing wrong? (I did a whole lot of research but did not find anyone struggling to find a fix for exactly this issue)
Is there a ffmpeg parameter to shift the creation_time back 2 hours so my album is aligned?
something like this bat file would suffice
c:\gopro\ffmpeg" -i %1 -vcodec copy -acodec copy -metadata creation_time="+02:00:00" "%~n1.remux.mp4

i also found about mp4box but did not find such option in command line / bat file
my research that did not help 1 2 3 4

Just to verify, the time that MediaInfo shows for the mp4 is the exact same time as in the jpg?  So for example, both the mp4 and the jpg would show 2021:06:08 12:00:00 ?

Assuming that the timestamp shows the exact same value for both the images and video, then that is the source of the problem.  Video timestamps in MP4/Mov files is supposed to be set to UTC.  Image files, on the other hand, are assumed to have the time set to the local time where the image was taken.
Google Photos (as well as Windows and Mac) understand that the timestamp for video files is in UTC and will adjust it to the local time when displayed.  Side note, Adobe programs such as Photoshop/Lightroom, do not properly adjust the time in video files.
For MP4/Mov files, Exiftool would be better for adjusting the timestamp, as it will not remove any GoPro specific metadata, such as any GPS tracks.  You could use a command like this to subtract two hours from the video's main timestamps
exiftool -CreateDate-=2 -ModifyDate-=2 /path/to/files/
There might be other timestamps in the file, such as stream specific timestamps.  If you wish to adjust all the timestamps, you could use
exiftool -Time:All-=2 /path/to/files/
This command creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories.


text:
Duplicate layer multiple times automatically, and randomize position/start time of each copy, in After Effects
I've seen this done in many programs. For example in the 3D world you can create a branch out of a single leaf, and a tree out of a single branch, automatically, by randomizing position and start of animation.
Can After Effects do anything like that? I have a simple animation I want to repeat hundreds of times, like tiles, and in a pseudo random pattern, sort of like noise. Naturally, since it's hundreds of copies of the same animation, I want to avoid placing them manually one by one, for obvious reasons!

To randomise the position apply an expression to the position property using the random() function. This takes two parameters, the minimum and the maximum, and returns a random number between the two. Normally it returns a different number every time the frame gets rendered, which is not what we want, so we need to 'seed' it with a value and set it to timeless with the seedRandom() function. We also need to return a two dimensional result because we need an x and y coordinate.
Putting that together:
seedRandom(index, timeless = true);
[random(12, 34), random(45, 67)]

Where 12, 34, 45, 67 are the values for the left, right, top and bottom minimum and maximums. Hard coding them is annoying if you want to be able to change the values later, so we'll set up a better system.
Add a null to the comp and apply the slider effect to it (effects>expression controls>slider) name the slider "left", then duplicate to make 3 more, called right, bottom and top. Make sure they're all visible in your timeline.
Now, in your layer's position expression, at the start type
let left =

Then grab the expression pick-whip and drag it to the left slider. It will auto-fill something like
let left = thisComp.layer("null 1").effect("left")("slider")

I'm on my phone so I can't remember if this is exactly right, but as long as you select the slider with your pick whip you're golden. Add a semicolon at the end of the line because that's how we roll in JavaScript.
Now repeat, changing left to right, bottom, and top, and pick-whipping the appropriate slider each time. The word left here and the words right, bottom, top are variables (we could have called them anything, like fee, fie, foe, fum, but you want your code to be readable). We'll use those variables instead of the hard coded values.
One last detail. Random is good, but it returns a random number that is evenly distributed between the minimum and maximum, you probably want something that clusters toward the middle, so that the leaves are denser near the branch. The gaussRandom() function does that, so swap it for random.
Now we have:
 let left = thisComp.layer("null 1").effect("left")("slider");
 let right = thisComp.layer("null 1").effect("right")("slider");
 let top = thisComp.layer("null 1").effect("top")("slider");
 let bottom = thisComp.layer("null 1").effect("bottom")("slider");
seedRandom(index, timeless = true);
[gaussRandom(left, right), gaussRandom(top, bottom)];

Copy this expression to all your leaf layers and you'll have a cloud of leaves the size and position of which is controlled by your sliders. It's a DIY particle system.
To make the animation offset, apply the time remap effect to the layer, then use another expression. In this we generate a timeless random number between 0 and the length of the layer, and add that to the time remap value. To loop it back to the beginning at the end,  we use the modulus operator ٪, which returns the remainder of the first number divided by the second. Apply this to the time remap property:
seedRandom(index, timeless = true);
let myDuration = thisLayer.outPoint - thisLayer.inPoint;
(value + random(myDuration)) % myDuration;

In the seedRandom() function you'll notice we're using index as the first parameter. index is the index of the layer, so for each different layer it returns a unique 'seed' for the random() function, like spinning the roulette wheel each time. Also note that if you only give random() one parameter it assumes that you want random numbers in the range 0 to that number.

If the animation is going to be relatively small in size on screen, but repeated a lot, I would look at using a Particle engine to repeat the pattern. You could use the built in ones in After Effects, or something like Red Giant’s Trapcode Particular or Form. It is possible to randomise the position of the repeats, and also to randomise the time within each animation as it repeats.
Example of using a leaf to create many leaves using Trapcode Particular:


text:
Displaying High Framerate Content on a Low Framerate Display
What are the best practices for scaling down framerate of a static video. For example, consider some footage captured at 360 FPS from a videogame. How would one scale this down for a 60 Hz display or a 30 FPS YouTube video? Is it possible to mix several frames into one in a way that a person watching the video would find satisfying or does throwing away the extra frames give the best possible result?

There are only two options to see every frame; play it slower, or get a display that can show it at its native frame rate.  The only other way, is to ignore the excess frames.
And the second option only works if all of the components in the signal chain can handle such a high frame rate.  For example, if YouTube doesn’t support 360 FPS, you’ll only be able to see the max rate they support.  In fact, they’ll probably downconvert it to preserve bandwidth.  You don’t have any control over what processing YT applies to your uploads.
For the first method, in most NLE’s, you would change the “Clip Attributes” (Resolve nomenclature) from interpreting the clip at 360 FPS, to your system’s maximum output rate.  If that’s limited by a 60hz monitor refresh, then 60FPS.
This will slow down the clip enough for your system to show every frame. The amount of slowdown depends on the rate of original capture vs your systems max rate.  For example capturing at 360, but displaying at 60 is 60/300, or about 17% of the original speed.
So another easy way to balance the equation closer to real-time is to limit your capture rate to the same as your display rate.  In other words, if all you can display is 60FPS, then capture at 60FPS if you want 1:1 playback.
There is one scenario where capturing more frames than you need is practical, but it’s used more in VFX pipelines than video game streaming.   Capturing high frame rates with high-end cameras yields less motion blur than typical frame rates.  This makes tracking, keying, and rotoscoping for VFX more accurate, and the results can be blended together to re-create natural(ish) motion blur.


text:
Is my MP4 file size too big?
I am working on a film, which I'm editing, and I rendered the one-hour long video to MP4, and the file size is 64,8 GB, and I think it's absurd, when google says the typical file size for MP4 is 700 MB per hour. What did I do wrong? The video uses the H265 codec, and its 4096x1716 pixels, 24 fps, the bitrate is 148267. For audio, the bitrate is 195kbps, stereo, and the sample rate is 48.000 kHz.

Resolve’s default bitrates err on the side of caution.  For most use cases, it’s ok to reduce the default bitrate significantly, but an exact amount is subjective, and depends largely on the source footage and your intended delivery target.  If you care more about file size than artifacts, and especially if there’s not much high-frequency detail and not much camera movement, you can get away with a tenfold reduction for h.264.  H.265 will require some experimentation, especially if you’re trying to deliver HDR.  Audio has a negligible effect on file size vs video bitrate.


text:
Vegas Pro Chroma Key not working properly
After I start doing chroma key with the following image

With black blackground it gets well

But when I try to make the background white

After I tune it, it starts to be blue

What am I doing wrong?


text:
Color, font and text does not change in some parts
I cannot edit and change color, font, text/numbered values of the layers at all on some sections of the project template am working on (They are animated) it just types in the background of the text/numerical values but nothing changes and it just types blank with nothing to see and the layer characters do not change.
This also happens on other sections of the project, the color selects but it never changes.
Any ideas why this is and workarounds?
I found this but didn't help resolve the issue: https://harshvardhanart.com/cannot-change-colors-shape-layer-after-effects/?currency=USD
Am using after effects 21.

I suspect the controls you are trying to change have Expressions applied to them.  This means they are being controlled by a line of code instead of in the usual way.
You can see whether the thing you are trying to adjust is controlled by an expression or not by looking at the controller.  If there is a blue equals sign next to the value, then it's being controlled by an expression.

You can disable the expression by clicking on the blue equals sign.  But the expressions are probably necessary for your template to function correctly, so you may need to either figure out how they work, or use something else.


text:
Techniques for merging two separate and moving camera shots
'The Man From U.N.C.L.E.' (2015) contains a neat break-in scene that shows a special force team arriving and infiltrating an industry area. A few seconds of this scene really got me and I wonder how it was shot:
At around 1:30 there is a moment when both protagonists are captured by separate cameras, from separate angles and with even some shaky motions applied. The screen is split and shows those two shots at the same time. The cameras are turning and lining up and finally the black bar (that were separating the frames) gets removed. The "third" shot (fullscreen, now both actors) continues a free hand kind of movement.
YouTube: 'Invasion' scene at mentioned time stamp
How was this achieved or could have been achieved?


text:
How do I animate a clip's scale in FCPX?
I am trying to decrease the size of a clip by having it shrink over the span of a few seconds and disappear into the center of the frame. I couldn't find an answer elsewhere online but perhaps I didn't word it correctly in my search. Any suggestions/instructions would be appreciated. Thank you.
-A

You need to use keyframes.

Select the clip.
Place the playhead where you want the animation to
start.
In video inspector, go to Transform->Scale(All)
Adjust Scale to the starting scale size.
Click the add keyframe button on the right of the Scale parameter.
Repeat process for the ending scale keyframe.


text:
Is it possible to modify text in a video without the source file ? (just mp4)
I know it's possible with after effects, but is it possible to modify existing text in a mp4 file, without the original source file ?

With only an MP4 (movie container file often using H.264 codec), you cannot edit the text as text, only as an image. In the MP4 file, the text is now pixels (compressed, keyframed, digitized, whatever --  but still ultimately just image data, not text.)
MP4 files can have a subtitle stream, which could be separated from the image. But you mentioned text, so I assume you mean text overlaid within the image frame, not subtitle text.
One strategy would be to block or mask the existing text and replace it with new text superimposed over the image. I've had to do that to change captions on industrial videos.
You can also try to crop out the text, using only part of the frame and enlarging or letterboxing it to give you a new video without the text.


text:
Correct way to normalize two audios before using filter_complex amix
I am trying to use ffmpeg to merge two audios, in.mp3 and out.mp3, like this:
ffmpeg -i in.mp3 -i out.mp3 -filter_complex amix=inputs=2:duration=longest -c:a libmp3lame res.mp3

But the final output res.mp3 has different volume levels.
When I run ffmpeg 'volumedetect' it gives these outputs:
1. For in.mp3
ffmpeg -i in.mp3 -af "volumedetect" -vn -sn -dn -f null NUL

Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
size=N/A time=00:02:07.17 bitrate=N/A speed= 344x
[Parsed_volumedetect_0 @ 00554a00] mean_volume: -22.3 dB
[Parsed_volumedetect_0 @ 00554a00] max_volume: -0.3 dB

2. For out.mp3
ffmpeg -i out.mp3 -af "volumedetect" -vn -sn -dn -f null NUL

Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
size=N/A time=00:02:07.17 bitrate=N/A speed= 434x
[Parsed_volumedetect_0 @ 00441100] mean_volume: -22.5 dB
[Parsed_volumedetect_0 @ 00441100] max_volume: -3.5 dB

Given the differences in Hz, speed, mean/max volumes - what is the right way to normalize the two audios before merging them with amix?
THANKS!

I used this and it worked:
ffmpeg -i in.mp3 -i out.mp3 -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge" -c:a libmp3lame res.mp3

One way to make the volume levels consistent is:
ffmpeg -i in.mp3 -i out.mp3 -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge" -c:a libmp3lame res.mp3

But this may not be the best way. Please let me know if there are better ways, and what are the pros and cons of the above method. thanks.


text:
Combine mp4 video and a RTMP stream into 1 RTMP output stream via ffmpeg
I need a ffmpeg command to first feed a mp4 video into a RTMP output stream, then followed by a RTMP input subsequently; what should be the parameters to get it working?

You can do something like this:
ffmpeg
-i intro.mp4
-i rtmp://second-input-server:port/input-id
-filter_complex "concat=n=2:v=1:a=1[merged_video][merged_audio]"
-map [merged_video] -map [merged_audio] -f flv rtmp://final-output:port/merged

We are taking two inputs, one from a local file (intro.mp4) and one using an rtmp address (rtmp://second-input-server:port/input-id).
We are using the concat filter here, specifying that it has 2 segments to concant (n=2), each segment having 1 video (v=1) and 1 audio stream (a=1).
We are labelling the concatted streams as merged_video and merged_audio, and muxing them into flv format, before sending that to the output rtmp server (rtmp://final-output:port/merged).

This assumes that you have the two inputs having same number of streams (1 video and 1 audio), same frame rate, same dimensions etc. If you don't, you may need to add additional filters (e.g. scale, fps) and stream selectors (e.g. [0:v:0], [1:a:1]) above to first make the two streams have the same characteristics, before feeding those to the concat filter.


text:
Adobe Premiere Pro no H265 export option?
I am using the trial version of Adobe Premier Pro (also tried Elements) and I noticed that there is no option to export as H265. Is there something i should do in order to enable this functionality? Seems really strange that this is not supported, especially for such a suppoded high-end video editing application.
I am running the following specs:

OS: Windows 10
CPU: i7 11700K
GPU: RTX 3070
RAM: 32GB DDR4 @ 3200mhz

It should be there, "HEVC (H.265)", selectable under format. If it's not there the codec may not be installed on your system. Adobe describes how to check and install it here: https://helpx.adobe.com/in/premiere-elements/using/hevc-decoding-on-windows.html

I have the same issue - no HEVC export option, and the codec is installed on my system. It also happens that the decode works just fine, as my source videos are HEVC. But there doesn't seem to be an HEVC Format while exporting.


text:
Standard software for producing video with AR effect
What is a standard tool to make videos that contain AR effect?
I am very impressed with this movie because (a) it tracks the camera position of 3D coordinates smoothly and (b) gadgets of Mac OS are clearly placed with nice look.

I think AR is the future in front of us, so, eager to produce this kind of video by myself to feel how we see with it!

There are a couple of ways to obtain such a result. You can record a video and add these objects using editing software like after effects or blender. This software can track the surfaces and you can add any 3d objects. The second way is to build an AR app using unity or an unreal engine. This method is good and you can use this with any surfaces, unlike the first method. You can find out more from here


text:
Are video encoders specialized for certain resolutions?
I have wondered if the encoders used by tools like ffpmeg and hardware encoders like NVENC are more efficient for common resolutions like 1920x1080. I've done a few informal tests with a variety of resolutions and I haven't seen 1080p to be any faster than any other nearby resolution. The documentation for NVENC gives max resolutions supported, but no indication that any are specialized. AVC has different levels specifying maximum frame size and bitrate, but again nothing indicates one resolution optimized for specifically.

Sometimes there are restrictions or recommendations, e.g. the resolution should be divisible by 8 because the encoder works better then. Since I don't work with non-standard resolutions that's all I know about that.


text:
Export DCP from Adobe premier pro
Hey guys I’m struggling to export feature film  2hour 20 min long DCP from premier pro.
1.I already exported 422 Hq.
2.Made separate project with new sq.
3.Using Adobe encoder as well.
4.Every time my Mac frozen at 13%.
All movie we shot on IPhone
1920*1080
My Mac
16gb
3.8 ghz intel core i7
1Tb hard drive
For editing I using regular external hard drive on 4tb.
Do you have any suggestions how to solve this?

Here's a few things to try. I've never experienced any export getting stuck, so my advice is a bit generic.

Enable "Preview while Encoding" in Media Encoder's preferences. But it should be on by default.
Using the preview, find the clip in the sequence where the export gets stuck.
Find out what is different with this clip compared to the earlier clips or portion of the sequence.
Disable all effects on that clip and try exporting again. If this works replace any problematic effect with something equivalent.
Otherwise, replace the footage with a transcoded version of the clip, use something like ProRes with constant frame rate. There are some issues with variable frame rate footage in Premiere and After Effects and I assume your iPhone recordings use variable frame rate.
Try exporting on another system or try another DCP exporter plugin.
Contact Adobe for support if nothing else helps or find a service provider that creates the DCP for you.


text:
Adding a static overlay logo into ffmpeg video stream and switch another which maintaining the logo
I intend to add a logo and loop a set of pictures on top of a RTMP stream, my current command is as follows:
ffmpeg -i rtmp://127.0.0.1:1935/live/xxx -i logo.png -f image2 -loop 1 -i prod.jpg -filter_complex [0:v][1:v]overlay=x=30:y=10[vt];[vt][2:v]overlay=x='if(lte(-w+(t)*100,200),-w+(t)*100+100,230)':y=10 -framerate 25 -r 30 -ar 44100 -c:a copy -b:a 20000k -movflags +faststart -preset medium -crf 1 -tune zerolatency -maxrate 20000k -vcodec libx264 -fflags nobuffer -g 60 -max_muxing_queue_size 1024 -f flv pipe:1
however I notice when it loops to a new prod.jpg file, the logo would disappear.
Thus I need some clues on command to loop the product pictures but maintaining the logo.

I assume you are updating the prod.jpg file. If yes, do all the images have the same parameters i.e. dimensions, format ..etc?

yes, I'm updating the prod.jpg file...they do hv same format and dimension

Replace -loop 1 with -stream_loop -1 -reinit_filter 0

no luck, the logo still disappeared after updated the product image file...;(

actually it complains about invalid parameter -1 (I guess it points to -1 after -stream_loop); when I removed change '-1' to '1', it says 'Could not open file : 1'.

Show your full modified command.

/var/lib/snapd/snap/bin/ffmpeg -threads 1 -i rtmp://127.0.0.1:1935/live/$key -i /home/apache/$key/logo.png -f image2  -stream_loop -1 -reinit_filter 0 -i /home/apache/$key/prod.jpg -filter_complex  "[0][1]overlay=x=30:y=10[v1];[v1][2]overlay=x=main_w-overlay_w-5:y=10[v2]" -map "[v2]" -map 0:a -framerate 25 -ar 44100  -c:a copy -b:a 20000k -movflags +faststart -preset medium -crf 1 -tune zerolatency  -maxrate 20000k -vcodec libx264 -fflags nobuffer  -g 60 -max_muxing_queue_size 1024  -f flv pipe:1

Which ffmpeg version?

ffmpeg version n4.3.1

I cant seem to find -reinit_filter option in ffmpeg documentation.

Wasn't documented when it was added a decade ago. Did so, now.

-stream_loop -1 is actually an acceptable parameter according to document, wonder why it still complains about it...any syntax error in my command?

i tested with -stream_loop -1 again, and it works now; but the first image still disappeared after i changed the product picture.

Apply it to both images.

yup, did that, and it works now....;)...thanks!


text:
Very weird behavior of video dimensions
I have a video (for some testing), when I check dimensions in properties, it says 640x1136 pixels.

To cross check dimensions, I played it in VLC media player and took a snapshot from there, which also had same dimensions.
But here comes the issue which I couldn't solve in last 2 hours.
I created a sequence in Premier with 1280x1136 dimensions. So it should fit 2 videos of same size side by side right? But isn't working as intended.
It is cropping a bit the 2nd video (preview from Premiere):

I exported the video and imported in Photoshop to cross check, and I saw same preview. But Photoshop document properties also says:

So it made me wonder how it can be possible.
What seems here is video is more wider actually than 640 pixels. I manually *measured left side of video preview, which showed approximately 703 pixels in Photoshop and hence the canvas is a bit narrow for fitting both videos.
But I just don't understand why is it happening? Could it be some problem with video itself? Could it be true that real dimensions of this video are 703x1136 and it is showing 640 by some mistake?


text:
In After Effects, how do I enable the handles of the bezier curve in the graph editor, for "Position" in a "Transform" effect?
I am unable to use the handles of the bezier curves with a Effect > Distort > Transform's Position, whereas I can do that just fine using the layer's Transform. Does anyone know why?

Weird.. you're right. Maybe a bug?

Is it because you can't “Separate Dimensions” in the effect?


text:
What causes the 1080p version of a video to be blocky but the 4k version look perfectly fine?
I'm a complete beginner in all things photography, video compression and YouTube uploads so please bear with me. I recently uploaded a 4k 30fps video to YouTube, and when I select the 4k option it looks reasonably similar to the video on my PC (i.e. pretty clear, no visible artifacts or blocks). But when I switch to the 1080p, it starts looking a lot worse, even though I don't have a 4k screen.
Now, I know videos on YouTube can be heavily compressed and the more moving objects are in the video, the worst it will look. What I don't understand though is why the 1080p looks so much worse and blocky while the 4k one is almost crystal clear. If this was because of the movement in the video, I would expect the compression to affect the 4k version similarly (even if it has a higher bitrate, it has to be spread over a lot more pixels). I've watched other 1080p YouTube videos with a lot more movement in it and it looks better than mine, and the difference between their 4k and 1080p version is barely noticeable on a 1080p screen. So I assume I'm doing something wrong.
I've seen a few theories of what might be happening but I haven't seen anything convincing enough. Some people say that the encoding keeps working in the background even hours/days after the 1080p option becomes available, so it should be better in a few days. Some people say using 60fps and a higher bitrate would fix it, but it doesn't seem to be necessary for other 1080p 30 fps videos with fast movement that I've been watching.
What should I be doing different to make the 1080p version look more like the 4k and limit those artifacts?
For reference, here is a random capture of the same frame in 1080p and then in 4k (more noticeable when opening in fullscreen):

As far as I know YouTube always re-encodes the videos you upload. Sometimes this can introduce a larger degradation, especially if the video you upload is already a pretty compressed format. You could try to create a ProRes file and upload it, hopefully this reduces the issue a bit.


text:
Blackborders on video edited on kdenlive (only on Phone not in Laptop)
I edited a video using Kdenlive in my laptop. I played the video. It was fine .So I transferred it to my Phone. But when i played the video on my phone, it has a 1cm thick black border.
Why is this happening?
And why only on phone?
Can someone please suggest a fix for this?

Is the aspect ratio of your laptop is different from the one on your phone? If so, then you probably see pillarboxing or letterboxing. See https://en.wikipedia.org/wiki/Pillarbox or https://en.wikipedia.org/wiki/Letterboxing_(filming)

What media player are you using on your phone? Some players, like VLC IIRC, have the option to either play video in actual resolution or scaled to fit the screen. On desktop for interface reasons this doesn't typically happen but on mobile you could be that your phone app is showing at actual resolution instead of at actual ratio (scaled up to fill the screen)


text:
ffmpeg to convert .avi to .mp4 results in error: Could not find tag for codec dvvideo in stream #0, codec not currently supported in container
I'm trying to convert .avi files to .mp4 using ffmpeg, as lossless-ly as possible.
I tried this command:
 ffmpeg -i filename.avi -c:v copy -c:a copy -y filename.mp4

and received this output:
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.101 / 59.  1.101
  libavformat    59.  3.100 / 59.  3.100
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.102 /  8.  0.102
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, avi, from 'Filename.avi':
  Metadata:
    TAPE            : Filename
    TCOD            : 653986667
  Duration: 00:01:54.01, start: 0.000000, bitrate: 30411 kb/s
  Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28779 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
[mp4 @ 000001d0ca8a1480] Could not find tag for codec dvvideo in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

It outputs an .mp4 file with an error message that the file can't be played and the error code 0xc10100be.
Can anyone interpret what is happening? What command would you recommend here?
Thank you very much!

You are trying to include a codec (dvvideo) into a container (mp4), which doesn't support it (at least in ffmpeg). See difference between codec and container. You better use a codec supported by mp4, say H.265 using libx265 and try converting. See the docs for additional options you may want to apply. Here is the extensive list of codecs supported by mp4, but all of them may not be supported by ffmpeg. Here are  some popular codecs.
Also, pcm_s16le is a raw audio format, convert it to aac.
Try
ffmpeg -i filename.avi -c:v libx265 -x265-params lossless=1 -c:a libfdk_aac -b:a 128k -y filename.mp4

It has H.265 lossless encoding and uses libfdk_aac, which is of better quality than native one.

Thank you very much for this helpful information!

Most welcome @stars.in.the.sky, If this solution works for you, you may mark the answer as accepted.


text:
Can't find long-duration nature videos in 4K
I'd like to purchase long-duration nature videos (30mn or even 1hr), in order to use them for a personal musical project, and then share on YouTube.
So, basically I also need to buy a license for that.
Until now, the thing is that I only found "short" 4K nature videos (a couple of seconds long, several minutes at most). I can't believe long-duration videos are not available, for sale or even for free, I just didn't find relevant websites.
Can anybody help?
Thank you

Stock videos are typically quite short. They cannot be long because they wouldn't sell well as the probability that you find a person, who needs exactly this video, plummets dramatically for longer videos. That's why you can't find anything. I can't rule out that there's some corner of the web where you can find such videos, but long stock videos are definitely rare.
I see a couple of options:

hire somebody to shoot the custom video for you, but this will be expensive
get a couple of clips and assemble them to make a longer video. You could use cross-dissolve transitions to gradually go from one clip to the next. Pretty much every video editor software can do this or ask somebody to do it for you.
create a slideshow video from a number of photographs
loop a short clip
evaluate if video is really required for your project. The simple fact that you're trying to find long videos on the web feels odd to me. When I come across a long music clip with no interesting video, like 1 hour of waves rolling onto the beach, I stop looking at it after a minute. The video serves no purpose for me.

I can't recommend any option in particular, nor do I know if they could wok for you, because I don't know the details of your project.


text:
hoping to time-shift existing closed captions on a Vimeo file
I'm hoping to time-shift existing closed captions on a Vimeo file.
Last month, my office helped produce a college graduation which was livestreamed on Vimeo, with live closed captioning.
The livestream started well before the event, running a simple logo with the event name. So let's say the livestream started at 9:35. The event then began at 10:00 and went off without a hitch.
In hosting the resultant video, the production company lopped off the first twenty-five minutes of footage (the simple logo). The end result is that the captions, which I assume were time stamped, are now a half-hour out of synch.
For another reason, I already plan to download the video and upload it to another Vimeo account, so I'm especially interested in solutions that take advantage of that process.


text:
document cameras vs webcams
Is there any practical difference between a webcam on suitable mounting and a document camera or visualiser?
This is a well worn topic but laced with less helpful information from manufacturers who are ultimately aiming to shift product.
To my mind a document camera is just a camera on a mount allowing it to give a top down view. At minimum it needs to stay in focus on paper enough that you can read or photograph it.
I think you are just paying for the mounting arm letting you get a top down view and otherwise using a often quite low quality camera.
But perhaps someone more enlightened can re-educate me.
I realize this is a hard question to answer objectively but is there any reason to have a dedicated document camera rather than a plain old webcam or phone on an adjustable mount?
What are the competing considerations that could turn this from a subjective question to something more objective?
For example, A webcam aims to show your face for teleconferencing and focus on that and its movement.
The focal length and depth of field requirements could be different enough to justify specialisation.
The internet rumourmill also has it that webcams are well behind smartphones and digital SLRs in terms of quality due to the nature of the market. SLRs aim for quality and mobiles are competing with each other in a faster moving market and so allegedly improve more quickly.
Put it another way if you already have a decent webcam and a spare mounting arm would you be better off purchasing a document camera / visualiser or a second webcam for the 'overhead' work?
Consider a content creator who wishes to make a mix of face to face exposition anddemonstrating experiments handicrafts or music.
What are the critical features that a camera should have to make it good in each field?
Are there any fundamental trade offs?
The aim is to avoid guessing in the form of buying cameras and sending them back if they don't have good results. Its not good for you, the planet or the manufacturers unless that is the specific aim of your videos of course. While there are plenty of reviews of webcams and document cameras there are not so many that review one for use as a the other.

Why downvote without reason?


text:
How do I use the transitions in Davinci Resolve 17?
This program stands in stark contrast of the simple but effective Windows Movie Maker of old, Davinci is not as 'simple' and it seems like it very 'complex' at times. One of the things that I liked about Windows Movie Maker is the ability to put in transitions on a timeline. While it is simple to do in Windows Movie Maker, it is not as easy in Resolve as Resolve is much more complex program. How do you put in transitions on a timeline? Can anyone explain this to me? I am not used to programs like these.

You drag the transitions from the Toolbox in the Effects Library (Click the Effects Library at the top left of the Resolve interface if you don't see the Toolbox) over the two video clips.
One thing to keep in mind is that if you try and put a transition over two full clips (un-trimmed) Resolve won't allow it to be dropped. You can overcome this by trimming the end of the first clip and the beginning of the second clip.
Once they are clipped enough for resolve to do the transition you should be able to drag and drop the transition between the clips.

Also, Command/Ctrl-T will apply the default transition.


text:
FFMPEG fails on pipe to pipe video decoding
I'm trying to decode a video from raw bytes using ffmpeg -i pipe: -f rawvideo -pix_fmt bgr24 -an -sn pipe:, while the command exits with code 0, the stdout is empty and stderr contains the following message:
ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2_4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa862816a00] stream 0, offset 0x2c: partial file
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:06.28, start: 0.000000, bitrate: N/A
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1080x1920, 50546 kb/s, 29 fps, 29 tbr, 14848 tbn, 14848 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> rawvideo (native))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa862816a00] stream 0, offset 0x2c: partial file
pipe:: Invalid data found when processing input
Output #0, rawvideo, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1080x1920, q=2-31, 1443225 kb/s, 29 fps, 29 tbn, 29 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.91.100 rawvideo
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Any hint would be appreciated, as I don't have much experience with FFMPEG.
I can probe the same video without problem with ffprobe -show_format -show_streams -of json pipe:

As it says, "stream 0, offset 0x2c: partial file".  Generally, you can't pipe in a MP4/MOV. MPEGTS is the typical container for piping.

Thanks for the quick reply. Does that mean, that if I have an MP4 file, I would first have to convert it to a different format that can be piped? Or is there any other alternative?

No, you will have to remux it to a workable container like MPEG TS.

Actually, I found a solution that works when you can control the files (see answer).

The goal of the above question is potentially impossible, because:

You generally cannot pipe mov (or mp4) files unless you used
-movflags +faststart when encoding or if run tools/qt-faststart
on the input file before piping it. - Carl Eugen

This is, because they store crucial information needed to decode towards the end of the file by default, requiring a full load before being fully processable. However, they are able to store it towards the beginning, too. In that case, piping works.
Since I control the files I am working with, I could simply rewrite the files so that this information is stored towards their beginning and now the command from the question works. I used ffmpeg to do that: ffmpeg -i <ORIGINAL_FILENAME> -c copy -map 0 -movflags +faststart <NEW_FILENAME>.
I've written a small python script to do that for me:
from pathlib import Path
from subprocess import DEVNULL, PIPE, Popen

def convert_video_to_faststart(path: Path):
    tmp_path = str(path).replace(path.name, f"tmp_{path.name}")
    args = ["ffmpeg", "-i", str(path), "-c", "copy", "-map", "0", "-movflags", "+faststart",
            tmp_path]

    process = Popen(args, stdin=DEVNULL, stdout=PIPE, stderr=PIPE)
    _, _ = process.communicate()
    if process.returncode != 0:
        raise RuntimeError(f"ffmpeg error\n\n{err.decode('utf-8')}")
    path.unlink()
    Path(tmp_path).rename(path)


text:
Trouble combining audio and video streams
I have two streams, one audio and the other video. I'm trying to combine them using this command:
ffmpeg -y -i audio.m3u8 -i video.m3u8 -c copy Video.mp4

I found this syntax here:

https://video.stackexchange.com/a/18216
https://stackoverflow.com/a/60663842
https://superuser.com/a/885958

The m3u8 playlists are below.
The problem is that, while the audio in the resulting video is smooth and uninterrupted, the video  is not. ffmpeg seems to have plucked only certain frames from each 5-second video segment and merged them with the corresponding audio segment. In the resulting video, each of these frames displays for exactly two seconds before moving on to the next one. There is no motion in the video.
I can play a given video segment and it works fine (just no audio). I've randomly tested a dozen or so of these.
How can I successfully merge all of these audio and video segments into an mp4 video?

Audio.m3u8
#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:6.059,
nova4806_r-hls-16x9-1080pAudio_2_00001.aac
#EXTINF:5.995,
nova4806_r-hls-16x9-1080pAudio_2_00002.aac
#EXTINF:6.016,
nova4806_r-hls-16x9-1080pAudio_2_00003.aac
#EXTINF:5.995,
nova4806_r-hls-16x9-1080pAudio_2_00004.aac
#EXTINF:6.016,
nova4806_r-hls-16x9-1080pAudio_2_00005.aac

...

#EXTINF:4.117,
nova4806_r-hls-16x9-1080pAudio_2_00532.aac
#EXT-X-ENDLIST

Video.m3u8
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-I-FRAMES-ONLY
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:2.002000,
#EXT-X-BYTERANGE:752@376
nova4806_r-hls-16x9-1080p-1080p-6500k_00001.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:71816@1983400
nova4806_r-hls-16x9-1080p-1080p-6500k_00001.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:44932@3277404
nova4806_r-hls-16x9-1080p-1080p-6500k_00001.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:111296@376
nova4806_r-hls-16x9-1080p-1080p-6500k_00002.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:89300@1748964
nova4806_r-hls-16x9-1080p-1080p-6500k_00002.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:124644@3753796
nova4806_r-hls-16x9-1080p-1080p-6500k_00002.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:107912@376
nova4806_r-hls-16x9-1080p-1080p-6500k_00003.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:83284@1639736
nova4806_r-hls-16x9-1080p-1080p-6500k_00003.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:198528@3142044
nova4806_r-hls-16x9-1080p-1080p-6500k_00003.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:95692@376
nova4806_r-hls-16x9-1080p-1080p-6500k_00004.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:119944@1713808
nova4806_r-hls-16x9-1080p-1080p-6500k_00004.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:167320@3345460
nova4806_r-hls-16x9-1080p-1080p-6500k_00004.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:146452@376
nova4806_r-hls-16x9-1080p-1080p-6500k_00005.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:172020@1739000
nova4806_r-hls-16x9-1080p-1080p-6500k_00005.ts
#EXTINF:2.002000,
#EXT-X-BYTERANGE:135548@3396032
nova4806_r-hls-16x9-1080p-1080p-6500k_00005.ts

...

#EXTINF:0.100100,
#EXT-X-BYTERANGE:564@3384376
nova4806_r-hls-16x9-1080p-1080p-6500k_00532.ts
#EXT-X-ENDLIST

Master.m3u8
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-VERSION:4
#EXT-X-MEDIA:URI="nova4806_r-hls-16x9-1080pAudio%20Selector%201.m3u8",TYPE=AUDIO,GROUP-ID="multiple_audio_tracks",LANGUAGE="eng",NAME="English",DEFAULT=YES,AUTOSELECT=YES
#EXT-X-MEDIA:URI="nova4806_r-captions.m3u8",TYPE=SUBTITLES,GROUP-ID="subs",LANGUAGE="en",NAME="English",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,CHARACTERISTICS="public.accessibility.describes-music-and-sound,public.accessibility.transcribes-spoken-dialog"
#EXT-X-MEDIA:URI="nova4806_r-hls-16x9-1080pAudio%20Selector%202.m3u8",TYPE=AUDIO,GROUP-ID="multiple_audio_tracks",LANGUAGE="eng",NAME="English AD",DEFAULT=NO,AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video"
#EXT-X-STREAM-INF:BANDWIDTH=2629077,AVERAGE-BANDWIDTH=2265370,RESOLUTION=960x540,CODECS="avc1.64001f,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-540p-2000k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=7966199,AVERAGE-BANDWIDTH=6905882,RESOLUTION=1920x1080,CODECS="avc1.640028,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-1080p-6500k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5471302,AVERAGE-BANDWIDTH=4841216,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-720p-4500k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3909956,AVERAGE-BANDWIDTH=3298061,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-720p-3000k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1583840,AVERAGE-BANDWIDTH=1338316,RESOLUTION=768x432,CODECS="avc1.64001e,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-432p-1100k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1108550,AVERAGE-BANDWIDTH=957278,RESOLUTION=640x360,CODECS="avc1.64001e,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-360p-730k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=624245,AVERAGE-BANDWIDTH=565523,RESOLUTION=480x270,CODECS="avc1.4d4015,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-270p-365k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=360807,AVERAGE-BANDWIDTH=334708,RESOLUTION=416x234,CODECS="avc1.4d400c,mp4a.40.2",AUDIO="multiple_audio_tracks",SUBTITLES="subs"
nova4806_r-hls-16x9-1080p-234p-145k.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1030462,RESOLUTION=960x540,CODECS="avc1.64001f",URI="nova4806_r-hls-16x9-1080p-540p-2000k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=3127072,RESOLUTION=1920x1080,CODECS="avc1.640028",URI="nova4806_r-hls-16x9-1080p-1080p-6500k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1349242,RESOLUTION=1280x720,CODECS="avc1.64001f",URI="nova4806_r-hls-16x9-1080p-720p-4500k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1343232,RESOLUTION=1280x720,CODECS="avc1.64001f",URI="nova4806_r-hls-16x9-1080p-720p-3000k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=630297,RESOLUTION=768x432,CODECS="avc1.64001e",URI="nova4806_r-hls-16x9-1080p-432p-1100k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=436976,RESOLUTION=640x360,CODECS="avc1.64001e",URI="nova4806_r-hls-16x9-1080p-360p-730k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=215984,RESOLUTION=480x270,CODECS="avc1.4d4015",URI="nova4806_r-hls-16x9-1080p-270p-365k_I-Frame.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=96159,RESOLUTION=416x234,CODECS="avc1.4d400c",URI="nova4806_r-hls-16x9-1080p-234p-145k_I-Frame.m3u8"

I've got same problem yesterday. Solution is first convert them separately to mp4 files and merge audio.mp4 and video.mp4 into one file afterwards.

Thanks, I'll give that a try next time I run into this. Given that it's been two and a half years, these particular files are long gone from memory, but I'll keep your advice in mind for the future.


text:
How to “re-interlace” a video? How to convert a naïvely deinterlaced 480p video back to 480i?
I have a 480p video that was naïvely created from a 480i original and had no deinterlacing applied. The resulting format is 480p25. Combing is visible and I would like to convert it back to 480i50, so sort of "re-interlace" the video back to its original state.
I have tried the solution from this question: https://stackoverflow.com/questions/22471099/how-to-convert-a-1080p-to-1080i-using-ffmpeg but it did not create the expected output.
I looked at ffmpeg reference here: https://www.ffmpeg.org/ffmpeg-all.html but I could not find a proper option. Tons of filters to deinterlace interlaced videos but nothing to "re-interlace" them.
My expected output would be this:
 ------> time
Input:
Frame 1 (0 ms)        Frame 2 (40 ms)

11111                 33333
22222                 44444
11111                 33333
22222                 44444

Output 1:
Frame 1 (0 ms)  Frame 2 (20 ms) Frame 3 (40 ms) Frame 4 (60 ms)
11111           22222           33333           44444
11111           22222           33333           44444
11111           22222           33333           44444
11111           22222           33333           44444

(Alternative) Output 2:
Frame 1 (0 ms)  Frame 2 (20 ms) Frame 3 (40 ms) Frame 4 (60 ms)
22222           11111           44444           33333
22222           11111           44444           33333
22222           11111           44444           33333
22222           11111           44444           33333

(I'm not sure whether it's top field first or bottom field first, so I'd like to have an option to try both.)
Is this possible?
I'd prefer it to use ffmpeg, but I'm open to trying commercial tools if it's not possible using freeware.

I think all you need is to specify an output which is interlaced. ffmpeg will do the rest for you.

How do I do that? Pretty much every format supports progressive along with interlaced.
Also, I believe what ffmpeg would do is it would take unaltered odd lines from each frame, but interlaced frames with even lines would be generated by interpolating even lines from neighboring frames.

The odd/even may be an issue where you need to swap to even/odd instead. But otherwise the input has 2x the data necessary. For example, ffmpeg will use odd lines from frame 1, then even lines from frame 2, and repeat until done. So there is no need to do anything special to go from progressive to interlaced.

I've been on a 5 week holiday and have had this exact same problem. It has taken me a long time to figure all this out, but I think I've nailed it.
My source was a PAL VHS recorded to HUFFYUV avi. recording top and bottom fields in a frame. i.e. 25p.. 50 fields per second
ffprobe.exe "my input video.avi" returns
Input #0, avi, from 'nov 81 084.avi':
  Duration: 00:00:13.44, start: 0.000000, bitrate: 77673 kb/s
  Stream #0:0: Video: huffyuv (HFYU / 0x55594648), yuv422p, 720x576, 76993 kb/s, 25 fps, 25 tbr, 25 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 1 channels, s16, 768 kb/s

Input is a video marked as progressive, containing two fields.
If VLC is told to deinterlace the video, it does so successfully, the issue is that VLC does not do it by default .
┌----------┐----------┐----------┐
| Frame 1  | Frame 2  | Frame 3  |
| 0.00 sec | 0.04 sec | 0.08 sec |
├----------┼----------┼----------┤
| 111      | 333      | 555      |
| 222      | 444      | 666      |
| 111      | 333      | 555      |
| 222      | 444      | 666      |
└----------┴----------┴----------┘

Numbers meaning in table above:

111 is field recorded at 0.00 sec
222 is field recorded at 0.02 sec
333 is field recorded at 0.04 sec
444 is field recorded at 0.06 sec
555 is field recorded at 0.08 sec
666 is field recorded at 0.10 sec

Background reading:
https://ffmpeg.org/ffmpeg.html for x264 x265 options
https://ffmpeg.org/ffmpeg-filters.html for all the -vf options
https://x265.readthedocs.io/en/master/cli.html#input-output-file-options for x265 encoder options
https://ffmpeg.org/ffmpeg-codecs.html#libx264_002c-libx264rgb for x264 encoder options
I believe the *correct answer, creating an 480i file is my Option 1. and Option 2. below.
The OP Output 1 is created from my Option 3. and Option 4.
The OP Output 2 is created from my Option 3. and Option 4. using -vf field_order bb directly after the -i input.avi

x264 interlaced 25i (50 fields per second) visually lossless
x265 interlaced 25i (50 fields per second) visually lossless
x264 progressive 50p (50 frames per second) YUV420 - for modern tvs - chromecast 2/3
x265 progressive 50p (50 frames per second) YUV420 - for chromecast ultra / google tv

Option 1.
The meta data on the output says it is interlaced top field first, so VLC will correctly deinterlace it on playback. I believe this is the best format to store the video, because it is staying true to the source, with no interpolation (which might improve in 10 years time).
┌---------------------┐---------------------┐---------------------┐
|       Frame 1       |       Frame 1       |       Frame 1       |
| Field 1  | Field 2  | Field 1  | Field 2  | Field 1  | Field 2  |
| 0.00 sec | 0.02 sec | 0.04 sec | 0.06 sec | 0.08 sec | 0.10 sec |
├----------┼----------┼----------┼----------┼----------┼----------┤
| 111      | ---      | 333      | ---      | 555      | ---      |
| ---      | 222      | ---      | 444      | ---      | 666      |
| 111      | ---      | 333      | ---      | 555      | ---      |
| ---      | 222      | ---      | 444      | ---      | 666      |
└----------┴----------┴----------┴----------┴----------┴----------┘

ffmpeg.exe -i "my input video.avi" -field_order tt
  -c:v libx264 -crf 18 -preset veryslow -x264opts tff=1 -weightp none
  -c:a aac -b:a 128k
  "my output video.mp4"

Play around with -field_order tt https://ffmpeg.org/ffmpeg-codecs.html
field_order field_order (video)

    Set/override the field order of the video. Possible values:

    ‘progressive’
        Progressive video

    ‘tt’
        Interlaced video, top field coded and displayed first

    ‘bb’
        Interlaced video, bottom field coded and displayed first

    ‘tb’
        Interlaced video, top coded first, bottom displayed first

    ‘bt’
        Interlaced video, bottom coded first, top displayed first

Results in the following file, my hint I got it right was top first.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'my output video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.16.100
  Duration: 00:15:55.16, start: 0.000000, bitrate: 13099 kb/s
  Stream #0:0[0x1](und): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p(top first), 720x576, 12964 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Option 2.
Has all the same characteristics as Option 1. but it is h265 so results in smaller files. When running ffmpeg, it will give you a warning x265 [warning]: Support for interlaced video is experimental
I have found the experiment to be very successful, the VMAF (below) suggests the content is visually identical.
ffmpeg.exe -i "my input video.avi" -field_order tt
  -c:v libx265 -x265-params interlace=tff -crf 23 -preset veryslow
  -c:a aac -b:a 128k
  "my output video.mp4"

Results in the following file, my hint was the (tv, top first), Meaning the tv is the colour space (16-240) instead of pc 0-255
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '01 nov 81 060 -field_order tt x265-ttf crf23 win64.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.16.100
  Duration: 00:15:55.16, start: 0.000000, bitrate: 5502 kb/s
  Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, top first), 720x576, 5368 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Option 3.
┌----------┐----------┐----------┐----------┐----------┐----------┐
| Frame 1  | Frame 2  | Frame 3  | Frame 4  | Frame 5  | Frame 6  |
| 0.00 sec | 0.02 sec | 0.04 sec | 0.06 sec | 0.08 sec | 0.10 sec |
├----------┼----------┼----------┼----------┼----------┼----------┤
| 111      | 2**      | 333      | 4**      | 555      | 6**      |
| 1**      | 222      | 3**      | 444      | 5**      | 666      |
| 111      | 2**      | 333      | 4**      | 555      | 6**      |
| 1**      | 222      | 3**      | 444      | 5**      | 666      |
└----------┴----------┴----------┴----------┴----------┴----------┘

The video is encoded as progressive, doubling the frame rate, now at 50p.
1** Interpolate the missing fields. Doubler. https://wiki.videolan.org/Deinterlacing/#Doublers
ffmpeg.exe  -i "my input video.avi" -vf format=yuv420p,yadif=mode=send_field
  -c:v libx264 -crf 18 -preset veryslow
  -c:a aac -b:a 128k
  "my output video.mp4"

Results in a progressive file for 50 frames per second from the yadif 2x.
If you find that it looks crap, because it is bottom field first, experiement with addind -field_order xx after the -i filename.avi part
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'my output video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.16.100
  Duration: 00:00:13.52, start: 0.000000, bitrate: 6658 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x576, 6521 kb/s, 50 fps, 50 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Option 4.
Has all the same characteristics as Option 3. but it is h265 so results in smaller files. When running ffmpeg, it will give you a warning x265 [warning]: Support for interlaced video is experimental
I have found the experiment to be very successful, the VMAF (below) suggests the content is visually identical.
ffmpeg.exe -i "my input video.avi" -vf format=yuv420p,yadif=mode=send_field
  -c:v libx265 -crf 23 -preset veryslow
  -c:a aac -b:a 128k
  "my output video.mp4"

Results in a progressive file for 50 frames per second from yadif 2x
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '01 nov 81 084 yadif x2 x265 crf23.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.16.100
  Duration: 00:00:13.52, start: 0.000000, bitrate: 3806 kb/s
  Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv420p(tv, progressive), 720x576, 3667 kb/s, 50 fps, 50 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Objective quality analysis of output
Compare how visually lossy your chosen -crf number was:
ffmpeg -i "my output video.mp4" -i "my input video.avi" -lavfi libvmaf=log_path=output.xml -f null -

I got around 97-96% with my 720x576. However I read that -lavfi thing does its best work at 1080p. https://github.com/Netflix/vmaf/blob/master/resource/doc/faq.md
So scaling both videos to get a true value from Option 1. and Option 2. never got above 88.
ffmpeg.exe -i "my output video.mp4" -i "my input video.avi" -filter_complex "[0:v]yadif=1:0:0,scale=1920x1080:flags=bicubic[main];[1:v]yadif=1:0:0,scale=1920x1080:flags=bicubic[ref];[main][ref]libvmaf" -f null -

yadif=1:0:0 means to go to 50fps https://ffmpeg.org/ffmpeg-filters.html#yadif-1
For Option 3. and Option 4. the yadif filter isn't required.
ffmpeg.exe -i "my output video.mp4" -i "my input video.avi" -filter_complex "[0:v]scale=1920x1080:flags=bicubic[main];[1:v]scale=1920x1080:flags=bicubic[ref];[main][ref]libvmaf" -f null -

This seems to do what you want. il moves the odd lines to the top of the frame, and even lines to the bottom. Then split just creates 2 copies of this. We then crop both copies, to only include the top or the bottom. Finally, framepack will alternate frames from those two streams.
ffmpeg -i input.mkv -c:v libx265 -filter_complex '[0:v]il=l=d:c=d,split[t0][b0];[t0]crop=720:240:0:0[t1];[b0]crop=720:240:0:240[b1];[t1][b1]framepack=frameseq' output.mkv

But usually yadif can fix messed up videos like that, unless they also did something else to it to mess up the pattern too much. And if that's the case, this won't fix it either.

It works inasmuch as the resulting video does have alternating frames that only contain odd and even fields. Judder is visible between frames, so it's clear that it worked.
So far so good.
Any way how to mark that these are actually fields in an interlaced video rather than a progressive video at twice the speed? I copied the incomplete file in progress into another to watch the result and unless there is something meant to be written to the end of file, VLC doesn't seem to recognize the video for what it should be.

I think that's a codec option. -x265-params interlaced=1 or 2.

I found it's -x265-params interlace=tff or bff, while it's -x264-params interlaced=1 or 2. I assume it works, but neither plays correctly. Both are shown at 640x240 at 50 fps with judder visible. I wonder if it's a video player problem now, but I'm using VLC, so it doesn't seem like it should be an issue.

I tinkered a bit with it. It seems that field order is reversed, bottom field is first, which means I changed the command to this:
ffmpeg ... -filter_complex '[0:v]il=l=d:c=d,split[t0][b0];...[b1][t1]framepack=frameseq' -x265-params interlace=tff ...
When I used your command (where it was [t1][b1] and I changed the order), the video was extremely juddery in vertical motion, this judder is gone now.


text:
FFMPEG to make Quicktime reference MOV file from ProRes MOV source
I'm trying to figure out how to use FFMPEG to make a reference MOV from a ProRes MOV source.
I've found commands that will take  reference file and make a rendered ProRes MOV file
ffmpeg -enable_drefs 1 -use_absolute_path 1 -i SOURCE.mov -map 0 -c copy OUTPUTFILE.MOV

But I want to go the other direction. Start with a ProRes MOV and make a reference MOV that points to the ProRes MOV source.

FFmpeg does not support, at present, exporting a MOV or ISO BMFF file with external data references.

Thanks for the info. I guess, we need to request this feature?

Even when implemented. you won't be able to reuse an existing dref.

Is the Quicktime library that is integrated with FFMPEG compatible with Apple Quicktime Reference files?

Not clear what that means.

Just wondering why you say that reusing an existing dref file wouldnt work if references are implemented in ffmpeg?

Because ffmpeg 's architecture does not support editing files in-place or treat media data as a monolith. The metadata of a QT or ISO BMFF file contains tables containing byte offsets for media packets, timestamps, packet sizes..etc. So ffmpeg relays each media stream packet by packet and constructs a new stream + metadata for the output.


text:
Da Vinci Resolve: Troubles zooming out an overlay video
I am working on my very first project in Da Vinci Resolve.
I have created a new project and dragged two videos, one .mp4 and one .mkv, into the Media section of the Edit window. I have then dragged both videos into the timeline. Now, I want to zoom out the size of the .mp4, such that I can have this video be located at the bottom right of the .mkv, which fills the whole screen. To achieve this, I have clicked on the .mp4 video and then navigated to the Inspector. I am changing the zoom inside the inspector, but nothing happens.
I have no clue what might be causing this issue. I have tried this out previously with 2 .mkv files and it worked. Then, yesterday, it seemed to be working for the .mkv, but not for the .mp4. Now, neither the .mkv nor the .mp4 can be zoomed out from inside the Inspector.
I am probably forgetting about something really obvious, but I would appreciate help.

First, the version of Resolve matters.  Older versions don't automatically make the edges of a stacked video transparent.  If I remember correctly, version 16 would, as long as you made some position or scale adjustment to the topmost clip.  I'd recommend updating to at least R17 for best result.
Beyond that, make sure that the image you want on top is sitting on a "higher" track; a track with a larger V# in the timeline.  So, if the .mkv fills the whole screen, place it on V1, then place the .mp4 on V2, scale down the .mp4 by using the zoom and position controls in the inspector.
One thing to be aware of is that if the "Selection follows Playhead" option is enabled in the Timeline menu, it's easy to mistakenly select or de-select a clip by simply playing the video.  An orange outline around a clip indicates which clip is selected, so watch out for unexpected movement of the selection outline because you might not be affecting the clip you intend to affect.


text:
What x264 encoder is better for upscaling pixel art? Is it x264 8bit or 10bit?
I mostly use Virtualdub2 to upscale my videos (although I am looking for other methods) via two resize filters, Nearest Neighbor and Lanzcos3. Recently I am looking at the x264 encoder to encode my videos, I am not sure which is better for pixel art as I mostly deal with pixel art from video game dumps. Can anyone tell me which version x264 is good for pixel art? Which is better at preserving details and which is not?

It depends on the bit depth of the source.  If the source material is greater than 8 bits, then 10 bit will give you more color fidelity and less banding in subtle gradients (if there is any in your “pixel art.” Flat cartoons wouldn’t have any gradient detail to preserve, e.g.)  If the source is only 8 bits per channel, 10 bit won’t give you any extra detail.
Since a bit is binary (base 2), 8 bit is   2^8, or 256 shades of each color in a color channel.  So 256 R * 256 B * 256 G, or roughly 16 million colors.  The human eye can perceive more than that, which is why 10 bit color depth is one of the requirements for HDR.
Most consumer displays are also only capable of displaying 8 bit color, so consider your audience, also.
Most average viewers won’t notice the difference between 8 and 10, even if they’re using a 10 bit display.    Where that difference becomes mostly apparent is when you’re developing the images; higher bit depths give colorists, editors and VFX artists more numeric/artistic headroom, which is the same reason Photoshop artists avoid 8 bit originals.
So, if you don’t plan to do any further processing, 8 bit is fine.

If your source video is 8 bit then there is no meaning to encode them in 10 bit mode, since no extra info is there anyways.
If you do have a 10 bit video source, consider how you want to use the output. Due to characteristics of pixel art (as far as I know, correct me if I'm wrong), lowering bit depth could cause quite visible color banding which is usually undesirable. If you want quality, use 10 bit AVC for a 10 bit video source.


text:
What causes red flashes in Kdenlive rendering output?
In the output of my video there is a short sequence where the whole video is solid red, with some corrupted text visible near the bottom. As usual in video editing software, this probably marks corrupted or missing frames. But why does it happen?
This happens in a location in the video where I put a Kdenlive Title Clip below a still image with a Fade Out effect. It does not happen with all possible combinations of rendering settings. In my case, it happens in a MP4 HD 1920×1080 project if setting it to be scaled to 1280×720 in the rendering settings and with output quality set to 26.
Kdenlive 19.12.3 under Ubuntu Linux 20.04 here.

Not sure if this could be the problem, but I got that exact rendering error from a similar scenario. I had title clips with fades as you describe, but they were on a video track that was above an empty gap in a lower video track. I just made a dummy clip to go beneath and fill that gap, and it cleared up the rendering error.
also, I had version 21.12.3 on Ubuntu 19.10 with the parallel processing on ( by default, didn't know it was an option) and encoder threads 0, also default. Since using a dummy clip was all it took to solve my issue, it means that the parallel processing bug has been fixed for 21.12.3 at least.

Thanks for confirming the issue in that newer version. When you switch parallel processing off, does that fix the issue for you?

Sorry, I wrote my original answer a bit awkwardly. Changed it to describe that the parallel processing is NOT an issue for 21.12.3 at least.

This happens when you use effects that are not compatible with parallel processing. Disable "Parallel processing" in the render options and try again. Also make sure that "Threads" in the render options is set to "0", to choose the number of threads automatically. Otherwise parallel processing might still be done (though I doubt it).
Notably, somebody already reported this issue with the very same video project content:

Switching off parallel processing solved my other problems (corrupt frames (flashes) when using titles with the fade effect and black rectangle). (source)

Also to note, in Kdenlive version 20.08 there is a commit that marks the "Parallel processing" feature as experimental in the UI ("Render widget: avoid misuse of parallel processing").
If somebody can conform this issue in the latest Kdenlive release, please tell. Because then we can report this as a bug.


text:
How to crop just 2 pixels without re-encoding (H264 video)?
I just want to crop 2 pixels (Top) to get identical black bars (now is 138 TOP and 140 BOTTOM) but without re-encoding. I think it is possible with FFmpeg but I'm not sure. I want to do this with one H264 video (m2ts from blu-ray).

This is impossible without re-encoding. Chillax. No-one will die if you re-encode your video.

You can use the h264_metadata bitstream filter.
ffmpeg -i in -c copy -bsf:v h264_metadata=crop_top=140 out


text:
Is there any plugin or effect in After Effects where each of many photo layers turn visible in a random order?
Basically, I want to make a collage of my artworks. All are square images. Let's consider there are 48 photos. So I will make a grid in Illustrator of 8x6. Each photo in a separate layer.
Now I'll import it into After Effects. Then I'll turn opacities of all of them to 0.
Now I want to make them appear (0 to 100 opacity) one by one in a random order. Just like stars appear in evening sky.
So one way to do so is manually. But I guess it will be time consuming and won't be that much random. So is there any effect or plugin for this?

You don't need to use Illustrator to do this - three cheap or free scripts will do it:
Gridder (free) will arrange all the images the way you want:
https://github.com/dokluch/gridder-aftereffects
When you've gridded them as you like, select all the images, and apply a couple of Opacity keyframes on all the layers (to make them go from 0 to 100 opacity at the same time).  You'll randomise and stagger them all in the next steps.
KindaSorta (free) will sort the layers randomly:
https://aescripts.com/rd-kinda-sorta/
ptShiftLayers (pay what you want) will stagger them over time:
https://aescripts.com/pt_shiftlayers/

If you're sure you want to use After Effects, you could try the following expression into the opacity field:
Each image will need to be it's own layer.  For each image layer, alt + click the stopwatch for the opacity to open the expressions editor, then paste in this code:
visible = 2; // how long the layer is visible for in seconds
transition = 0.05; // how long it takes for the layer to appear and disappear

appear = (index-1) * visible;
disappear = index * visible;

fxin = linear(time, appear, (appear+transition), 0,100);
fxout = linear(time, disappear-transition, disappear, 0, -100);

opacity = fxin +fxout;

opacity

This will make the photos appear in the order the layers are in.  If you are looking for a random order, I found a script that lets you randomize layer order:
{
var myComp = app.project.activeItem;
var n = myComp.numLayers;
var myLayers = [];
var myIdx = [];
for (var i = 1; i<= n; i++){ myIdx[i-1] = i; myLayers[i-1] = myComp.layer(i); } var idx; var temp; for (var i = 0; i < myIdx.length; i++){ idx = i + Math.floor(Math.random()*(myIdx.length - i)); temp = myIdx[i]; myIdx[i] = myIdx[idx]; myIdx[idx] = temp; } for (var i = 0; i < myIdx.length; i++){ myLayers[myIdx[i]-1].moveToBeginning(); } }

Sourced from: https://creativecow.net/forums/thread/randomize-layer-order/
Hope that helps.