text:
How to divide the video into four parts at once?
I'm trying to make a custom video wall so i need to split some videos and I'm diving video into N parts at N times using ffmpeg.
There is any way to divide videos at once?

ffmpeg -i coolpron.mp4 -filter_complex "[0:v]crop=iw/2:ih/2:0:0[tl];[0:v]crop=iw/2:ih/2:iw/2:0[tr]" -c:a copy -map [tl] -map 0:a -y 111.avi -map [tr] -map 0:a -c:a copy -y 222.avi

This produces 2 video files at same time, but you can add other parts.
But use it only if you have no other choice for your video wall. Better solution: write your own custom player.


text:
Create an animation of a slider-crank mechanism system
I'm trying to create an animation of a slider-crank mechanism system in After Effects, but I'm finding it difficult to create a move closer to a real simulation.
Would anyone have an idea how I should proceed?
The link below shows what I'm trying to get:
Slider-crank Mechanism System
This was my attempt, but it's getting very strange:

The setup is reasonably simple, built in functions, trigonometry and some Pythagoras will get you there. Have a look at the diagram below:

The orange solid is the crank, with its anchor point shown at the bottom. Its rotation drives the whole thing (you could drive it from the piston, but this is probably easier(?)). In your diagram the crank isn't shown, so you can just use a solid, and make it a guide layer. Attached to the crank is a null called pivot, lined up to the where the crank and piston are attached to each other, with the crank as its parent. I use that to save myself a little bit of maths, The green solid is the piston, its anchor point is at the top, lined up with the blue solid.
Now to find the position of the piston we have to find Yc, x, and Yp. That will also allow us to find the angle ϴ.
First we need to find the position of the pivot. Fortunately we can use the built-in function toComp. That will return the absolute position of the pivot null. If we subtract the position of the crank we're left with [x, Yc].
Since we know the length of the piston—p in the diagram above—and the value of x, we can use Pythagoras' theorem to find Yp, because x² + Yp² = P², then it follows Yp = sqrt(P² - x²).
Putting it all together, plus some offsets to keep the piston lined up with the crank, we get this for the position expression on the piston arm:
var PistonLength = 200; //set this to whatever length your piston is
var crankPos = thisComp.layer("crank").transform.position;
var pivot = thisComp.layer("pivot").toComp(thisComp.layer("pivot").transform.anchorPoint, t = time) - crankPos;
var y = Math.sqrt(Math.pow(PistonLength,2) - Math.pow(pivot[0], 2));
crankPos + [0, pivot[1] - y]

Once we have the lengths of the sides of the triangle we can find the angle using trigonometry. We know that sin ϴ = x / P so ϴ = asin(x / P). Here's the expression:
var pistonLength = 200;
var crankPos = thisComp.layer("crank").transform.position;
var pivot = crankPos - thisComp.layer("pivot").toComp(thisComp.layer("pivot").transform.anchorPoint, t = time);
theta = Math.asin(pivot[0]/pistonLength);
radiansToDegrees(theta)

So in the diagram above these expressions are applied to the green solid on the position and rotation properties respectively.
The blue solid just has to line up with the green piston, but you don't want to parent it, or it will inherit the rotation. So just put this simple expression on its position property (obviously with all these expressions you need to change the names of the layers to match (or change your layer names):
thisComp.layer("piston arm").transform.position

Here's a screenshot of the comp, with all the expressions in place.

if it's not uncomfortable, could you create a GIF animate using my images in your solution?

Sure. Let me know where to send the invoice.

source: Stack Exchange

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

sort: votes


text:
FFmpeg produces high system load when downscaling 1920x1080 to 320x240
I'm downscaling an HD live stream to a little "thumbnail" stream, the command looks like this:
ffmpeg -i pipe:0 -vf scale=320:240 -sws_flags fast_bilinear -an -f mpegts pipe:1

Now I would think fast_bilinear is the fastest possible scaler, but it still takes up about 60% of a single core.
Is there another scaler that might be better suited for downscaling? I'm not too interested in the quality.

neighbor should be faster.  But I can't test for a few days.

If you were wondering zscale doesn't appear to be any faster; although filter=point is somewhat close in speed to flags=neighbor.

As @Mulvya said, nearest neighbor is even faster, but will produce bad quality. Nothing resampled, so you can't get faster operation.
But even nearest neighbor and can cause 100% CPU load, it's depends on how much you pump information through it. If you put very large image or 1000fps, you always will get high CPU usage.
Only one thing you may be interested: colorspace. Try to experiment with different color spaces, like yuv420 or rgb32. Maybe some versions of scaler can be faster.

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


text:
Originally smooth unicolor background shows "steps" in the color gradient when exporting
I am using Abode Premiere Pro.
I am working on a video which has a static background. The background is almost unicolor with a light color gradient. Please see here:

I want to export the video. The problem is that in the rendered video the background gradient is not smooth. The background shows "steps" in the color gradient. This is specially visible during fade in from a black screen/ fade out to a black screen.
The "step effect" is stronger when I use a low quality or low bitrate output fromat. But even when I use very high quality output format the problem is still visible. And with very high quality I get a filesize of 13 gigabytes for a 15 minute video.
Here are some example settings wich gives a filesize of 1.5 GB. The "step effect" is quite visible.

1920x1080
length: 15 minutes
25 fps
H.264
render at maximum depth
bitrate encoding: VBR, 2 pass
target bitrate: 15 Mbps
maximum bitrate: 17 Mbps
Use maximum render quqlity
resulting file size: 1562 MB

How to solve this problem? How do I get a smooth output and acceptable file sizes? What is the best format, the best codec for this?

The choice of codec will largely depend on what you're doing with the material. Your problem is that there just aren't enough colours in 8-bit colour space to give you a smooth gradient over the size of the frame.
Problem is that if you want to deliver it on the internet you're pretty much locked in to h.264 (or I guess webm or ogv, but same deal). You can encode h.264 in 10 bit, but almost no-one will be able to watch it, and certainly not in a browser.
There is a workaround which can help a little, which is to add some noise to your gradient. What this does is to break up the banding so that it's not as obvious. It's called dithering, it was big when 256 colour gifs ruled the earth. See this answer for a bit more detail.


text:
Shortcuts to other videos on YouTube
On YouTube, when the person in the video has another video as a reference to show, in the upper corner is shown a link that directs what they want to show.
This is a example:

I have some videos that I would like to do, but I do not know where to do it on YouTube.
Does anyone know the name of this and how can I add it?

It is in:
Creator studio => Video Manager => (Select Video) => Card (or "End screen & Annotations")
There you select time and click on "Add element" button. Now you can choose, what you want to add.


text:
Why are there so many color spaces available?
Whatever you are exporting, photo or video, you can choose between an enormous amount of color spaces. sRGB, Adobe RGB 98, Apple RGB, and many more. But why there so many different color spaces? Do they affect your photo/video production when rendering? Are there compatibility issues involved? And why is there not just one type of color space?

There are a number of reasons why there are so many color spaces:

Color resolution - sRGB and similar color spaces only cover a portion of the visible spectrum. This means that they can be represented with fewer bits per color channel. (8 in the case of sRGB.) For something like Rec. 2020 or ACEScg, you need 16 or more bits per channel. If you don't have enough bits for each color channel, you'll start to notice banding in displays of gradations of color in the color space. If your hardware is limited, you'll use one that requires fewer resources, whereas if output quality is of the utmost importance, you'll use one that can represent more colors.
Output Devices - televisions and until recently computer monitors are only able to display a portion of the visible spectrum. (Likewise with printers.) If the output device can't display it, what's the point of being able to store and transmit it? Color spaces used for televisions and earlier computers were chosen based on what they could produce. Recently we've started to see wide gamut and HDR displays that can display a much larger portion of the visible spectrum (but still not all of it), so we're starting to see new color spaces for these devices.
Proprietary Needs - various vendors have created color spaces that match the devices and software they sell. The vast majority of photographers and videographers are home users doing it for fun. They don't need high bit depths and wide color gamuts. But professionals do!
Color spaces can also be designed to have certain properties that others don't. For example, some color spaces separate the colors based on perceptual uniformity (colors that appear similar to humans are grouped together), whereas other color spaces separate the color based on display hardware (RGB color spaces are generally used for displays that have red, green, and blue sub-pixels). Depending on what you're using the colors for, you choose a color space that makes working with colors in that way easy.


text:
Creating a cube animating their faces
As a beginner, I'm not sure how to create rectangles that form a cube so I can get something like shown below:

I created angled rectangles in another application and tried to create an idea to show, but I'd really like to use the elements that After Effects provides.

I would also like to know how to control the quality of the corners of the elements created within After Effects.

Anyone willing to help?

You can use the Bezier command that will help you a lot.


text:
Presentation techniques for YouTube
I watched some videos on YouTube and for not being professional in the area, I would like to know how I could denominate the track that shows the name of the presenter?
Is there a technical name for this kind of presentation?

In Russian we have term for them — плашка.
English name I personally don't like — Lower third
I was making them in After Effects. With animations, dynamic text, etc. There is a lot of tutorial (example), how you can make one.
But I believe that without animations you can make them in a lot of other video editing apps. It is basically a type of Title (Premiere Pro). Or art with alpha channel in any software, which allow to compose picture on top of the video.
You can achieve similar result directly on YouTube with annotations. Similar to this answer. It will not look so good, but can contain text information.

I actually use PowerPoint a lot of times in live webcast production

@pojo-guy, How do you add PowerPoint presentation in video? Or you export slides as pictures?

We do live webcast. The output of the poweroint is fed to the inputs of the ATEM switch. We use either chroma keying (green screen) or luma keying (graphic channel + alpha channel) depending on the graphic we are presenting. See https://www.youtube.com/watch?v=N1as_O1hjGQ at 8:34.  You will see a left-quarter luma-keyed panel, The only difference is the graphic for a bottom third.  If I have to do titles in post production I use Premiere Pro


text:
DaVinci Resolve: Blur and fade title on top of video
I am using DaVinci Resolve 14.  Is it possible to have titles on top of video which blur and fade out at the same time?
I know how to fade them, but I cannot blur them. Adding a transition seem to affect not only the titles but also the background video (it will blue the video too). I attempted to apply effects to the title clip, but wasn't able to do so.

@Jason Conrad Can this be done easier now in Resolve 15 with Fusion integration?
(Since I don't post much on SE, it won't let me just comment on your answer, sorry.)

Yes.  It's way easier now in DaVinci 15.  In fact, if you use the Text+ title in the effects library, you don't even need to step out of the edit page.  Just animate opacity however you normally would, then animate the "softness" properties under the shading elements tab in the inspector (it's the icon that looks like a paintbrush).

DaVinci doesn't really have a strong toolset when it comes to working with titles and motion graphics, although given BlackMagic's current trajectory, that may change in the near future.  For now, you'll have more control over graphic element animations in other packages like AE, Motion, or even Premiere or FCPX.  Blackmagic Design also offer their own compositing software, Fusion, which is also fully capable of this type of effect, and has direct ties with DaVinci.
It is possible to animate both blur and fade out in DaVinci, but not gracefully.
The trick is to turn your text clip into a compound clip.  From there, DaVinci will treat it like any other piece of video.  Do this:

In the edit tab, make sure your text layer is the default white on
black.  You can change the color later.
Right-click on the text layer and select "New Compound Clip" from
the contextual menu.
Switch to the Color tab and select the compound clip.  Now you can
affect it with nodes.
Right-click anywhere in the background of the node editor and select
"Add alpha output" from the contextual menu that appears.  You
should see a little blue box appear at the right of the node editor.
Right-click anywhere in the background of the node editor again, and
select "Add node" -> corrector.  Do this twice so that you have a
total of three nodes in the node editor.  Node 01 should be wired at
this point, and 02 and 03 should not.
Unwire the RGB output of node 01 (green circle) and plug it into the
alpha input of node 02 (blue triangle).
Wire the alpha output of node 02 (blue triangle) into the master alpha output that you created in step 4 (far right blue box).
Wire the green master RGB input on the far left of the node editor
into the green input of node 03.  This master should now be routed
into two places, node 01 and node 03.
Wire the RGB output of node 03 into the input of node 02.
Finally, wire the RGB output of node 02 into the master RGB output
 (green box far right).
In the OFX library, drag the color generator onto node 03.  This is
 where you will now control the color of your text.
You may have noticed that everything is inverted.  To fix this,
 select node 02, move to the "key" tab, and invert the key input
 (the black dot in the white box) * edit * This step is no longer necessary in DVR R16.  New serial nodes used to reverse the previous node's alpha output by default.  Now, they do not.
Finally, you should be able to control the blur of your text from
 node 01.  You should be able to animate this parameter just like
 any other color adjustment in DaVinci.  For the fade, you'll have to animate the opacity of the composite on the edit page.

Here's what everything should look like when wired up properly:

Yes, this is a kludgy workaround which suffers from serious limitations (blur radius*, for one).  But hopefully, it's a good demonstration of why this type of operation is best approached from other software.  DaVinci just isn't built for it at the moment.
If you'd like an explanation of how to accomplish this in Fusion, I could add to this answer.
EDIT 01-24-2020
Blur radius is no longer a limitation.

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


text:
Rotating the 3d object with the blueprint background
I have some 3d objects that I want to show using After Effects.
With these objects I can create various types of extensions, like: IGS, SAT, OBJ, STL, ...
I would just like to rotate them on the screen with a blueprint background, as in the figure below:

With blue background and with grids.
The object need not be solid, just highlight the outline as in the image...
I searched for something on the internet, but found nothing.
I do not need an explanation. If someboby find any link where I can learn the technique would be very interesting.

In this video does not appear as create showing only the outline, but it is already possible to have an idea of how to import the 3d object.
How To Import 3D Model In After Effects CS5

Could you briefly describe the steps in the video in case it becomes unavailable?

In the video I found you should model using 3dStudioMax or other of the genre.
How to Import 3d Model in After Effects CC


text:
Does increasing the framerate while not changing the content affects compression quality?
This question has no practical importance for a regular video production pipeline, but nonetheless it's something I find fascinating because it would imply video codecs use temporal sub-sampling methods in order to reduce bitrate, and those methods are controlled by the frame rate at encode time. So, here it goes:
Suppose I have a set of lossless images (like scanned frames on a film strip) I want to encode with a certain video compression algorithm, such as H.264. Assuming that the frames inside the newly compressed video stream will be later decompressed and played back at their correct speed by means of extracting the raw frames and not playing them back over a regular player, the specified framerate in which I encode those images shouldn't matter at all to overall quality of every individual frame, given a constant quality setting. Or, is it?
It makes sense to think that modern codecs would use some form of coarser temporal estimation when frame rates are higher, due to the fact that the jitter effect of the motion compensation could be smoothed out over several frames, as opposed to a low framerate video where motion and quantization artifacts would become much more noticeable.
Were this false, this would also imply that, if I wanted to convey more data / higher quality over a bitrate-constrained medium, such as YouTube, I could simply re-encode my video with half the framerate and ask users to play it back at twice the speed, since the bitrate limit would then be doubled over the regular speed video (minus any audio issues).
I haven't done any scientific tests yet, but before digging into the data analysis (and trying to find a lossless video corpus to do so), I'd like to ask the community if any experiments have been made about this.

This depends on the specific encoder, and the compression standard, by itself, may not have anything to say about it.
x264, which encodes to H.264, takes frame duration, into account, in its ratecontrol algorithm.
From the source code (my emphasis):

Ratecontrol lowers relative quality at higher
  framerates and the reverse at lower framerates; this serves as
  the center of the curve.

where this refers to the frame duration for the default fps of 25.
This is further compounded by the setting of buffer sizes, important for network streaming or hardware players, and which are defined in terms of media duration, not frame count.

So there is correlation between framerate and individual frame quality, at least in x264's case. Does the H.264 standard has nothing to say on the subject and this decision is entirely left up to encoder implementations, or is this even prescribed on older (MPEG-2) or newer (H.265, VP9) standards?

The H264/5 standards are primarily concerned with bitstream syntax, which is relevant for parsers and decoders. Encoding algorithms are not addressed. I suspect the same is true of VPx codecs as well.

@MVittiS I think that x264 won't reduce the quality much if you are still within range of the specified bitrate. If you were already at the bitrate limit at say 30 fps and now you want to generate 60 fps, then you all of sudden have to put 2x the data in the same stream. Quality is probably going to be visibly impacted in this case since you need to compress each frame to half its original size. So the encoder is not the only culprit. You can double the bitrate when you double the frame rate, though. Then it should remain close.


text:
Proper command to remux mpeg-ts to mp4 with FFmpeg?
Should I just use plain command like this:
ffmpeg -i C:\video_input.ts -c:v copy -c:a copy -bsf:a aac_adtstoasc C:\video_output.mp4

but I have seen many using -copyts to it, why is this needed I do not completely understand it's documentation?
ffmpeg -i C:\video_input.ts -c:v copy -c:a copy -bsf:a aac_adtstoasc -copyts C:\video_output.mp4

and also every time I use -copyts there is an added delay before the first frame starts, so to fix this is it safe to use -start_at_zero or it breaks the point of copyts to some degree (if that makes any sense)?
ffmpeg -i C:\video_input.ts -c:v copy -c:a copy -bsf:a aac_adtstoasc -copyts -start_at_zero C:\video_output.mp4

Thanks!

Unless you know you have a specific need to preserve timestamps, there's no need to use -copyts. MPEG-TS, being a format, used for remote viewing, will have some start time offset, by default, to allow for buffering at the player's side. MP4 for local playback, doesn't need that, copyts will preserve it.

but what is the difference between no -copyts and -copyts + -start_at_zero? Is there any need of it, why does it exists?

start_at_zero is relevant if you're seeking into the input i.e. -ss 10 Ordinarily, the first sought frame has its TS reset to zero. With s_a_0, its TS will now be 10. If used with copyts, that TS will be conveyed to the output.

I thought you meant if I -ss 10 a .ts file, it will actually ss @ 11.4 (1.4 delay from ts), but if I do use -ss 10 with s_a_0, it will actually start at 10?
When I checked, this doesn't make sense as it is not what is happening.
The original .ts file had start: 1.4, when going under -ss 10, that same one had a start of 0.0480, same if I added start_at_zero to it, or both copyts and start_at_zero.

Let's say your MPEG-TS has start time of 15 and duration of 10s., and your codec is intra-coded, so we don't have to worry about GOP. With -ss 3 -i in.ts -c copy out.mp4, first sought frame has PTS of 0 after the demuxer stage, and out.mp4 has start time of 0. With -ss 3 -copyts -i in.ts -c copy out.mp4, the first sought frame has PTS of 18 after demuxer, which gets carried over during mux in out.mp4. With -ss 3 -start_at_zero -copyts -i in.ts -c copy out.mp4, first sought frame has PTS of 3 after demuxer, which gets carried over during mux in out.mp4.

thank you for the further clarification. Now to wrap it up, following your original answer - In what exact case where I just want to remux a file, from .ts to a .mp4 container without losing any quality, there will be a need of including -copyts? And if I do need it in certain situations, isn't it always better to include s_a_0 if I do not want to have that "buffering" to my new .mp4 output?

You should never need copyts when copying into a MP4. Let ffmpeg generate new timestamps. Timestamps have no impact on video/audio quality.

what about audio/video sync? Or that is (iirc) only after the 26 hour:something:something mark?

Not an issue normally, but I don't know the current state of how ffmpeg handles PTS rollover at the 26 hr mark. Update: apparently, not well.

so taking in consideration what one of the people said in the comments on your link, back to one of my questions, is there anything wrong or anything negative about using both -copyts and -start_at_zero on any .ts file always when dealing with a remux .ts to .mp4? Sorry for being so annoying with the questions, but thank you very much for being even more consistent with all the answers, really.

All copyts + sa0 will achieve is that the start time of the MP4 will represent the offset of the trimmed portion within the source file, but the identity of the source file, or the command used to generate it won;t carry through. Unless you know you need to, why bother?

well I was not sure, I have recordings of streams, twitch.tv mostly that are in .ts format so I was not sure if it would cause any problem, but yeah, if you say so, I will just remux them all from .ts to mp4 with -c:v copy -c:a copy -bsf:a aac_adtstoasc without -copyts or sa0. I was very interested in the behind the scenes aspect, does not using copyts generate approriate new TS by itself, can it go out of sync before 26h, and all those stuff which I had no idea of!


text:
Each media segment file for MPEG-DASH is a full (.mp4) instead of fragment mp4 (.m4s)?
I'm wondering if I can just make every media segment files as a full MP4 file instead of fragmented MP4 for a DASH264-compliant player?

After studying the DASH spec, I'd say the fragmented MP4 is the must for media segment files. Therefore, it is not possible to use a full (or non-fragmented) MP4 in DASH.


text:
What is the drone for a low budget production
Hi I'm wanting to do a overhead shot of a bike on the road. i'm wanting to know what the best drone is on a budget. I'm wanting the best blend of quality yet affordability

https://www.youtube.com/watch?v=kW2AgmSXVwQ

Just a heads-up that you might want to check the laws concerning unmanned aerial vehicles in your country if you're going to be doing this professionally.

Currently DJI is pretty much your go-to for this.  They have a great mix of price range to performance ranging from the $500 Spark (which is actually a bit more if you want a physical controller which would be very helpful for what you want to do), up through multi-thousand dollar rigs that can fly a Ronan with a Red Epic or Arri Alexa on them.
Personally, I'm an FAA certified remote pilot and currently fly a Phantom 3 Professional.  The quality of the footage is very good, especially when using an ND filter and lens shade to avoid issues with shadows from the props on the lens.  The biggest limitation is that complex shots can be difficult as I have to fly both the drone and direct the camera, which can make work in tight spaces very difficult.
If you need to pull off advanced shots that require careful maneuvering of the drone itself, I'd highly recommend a two man configuration of an Inspire or Inspire 2 if you have the budget for it.  The quality of the camera on the Inspire and Inspire 2 can be substantially better and the dual operators allows for one person to focus on getting the shot while the other person focuses on maneuvering the aircraft itself.
If this is out of your budget, an older Phantom or a Mavic is a great midrange option that offers solid performance for the price.
The Spark is on the low end, but is a relatively cheap entry point in to automated drone space though it is also a much more limited platform compared to the Mavic or above.
Also, be aware that total cost of ownership extends beyond just the drone itself.  You will likely need a few extra batteries to be able to get shots done and possibly extra chargers to stay up and running.  This alone can add hundreds of dollars to the total price tag.
Additionally, for commercial work, many localities require certification or licensing.  In the US for example, part 107 remote pilots have to pass a $150 licensing exam and a TSA background check after which they get a two year license for commercial operations.  While it's possible to self-study, online courses are very helpful and typically in the $125-$250 range.
Also, if you need liability insurance, you'll likely need drone specific insurance which runs a few hundred dollars a year to a little under a grand a year depending on your options for a drone in the price range you are looking at.  (This also covers your liability if you crash the drone in to something or someone.)
Ultimately, if you only need a few shots, your best bet is probably to find a qualified operator in your area and contract out to them for those shots specifically.  They will already have everything they need and will allow you to avoid the cost and learning curve associated with buying and learning to fly a drone well enough to get the shots you desire.

The DJI Mavik is one of the most affordable ready-to-fly drones with enough quality (4K) for expert-looking video production.
Alternatively, you could strap an action camera, like a GoPro, to a non-camera drone. You'll likely have to heavily stabilize your footage in post.
In the lowest of budget situations, if you just need a top-down aerial shot, simply rig a phone to some tethered, helium filled balloons. This has worked well for me in the past.
In any case, there are a few extra steps you can take do to improve the footage.

Buy a lens filter kit including Neutral Density and Polarizing filters for the camera.
After importing the footage, correct the wide angle lens warp in After Effects.
Color grade your final cut


text:
subtitles: show timed-fragments of the same text line
Note: this is all about editing .ass (or Advanced SSA) subtitles.
I just happen to download Death Note series with chapters in mkv format, and found what seems to be a new subtitling method being used; instead of the usual line after line, it grabs the entire sentence and shows portions of it over-time.
Example of usual method:

N-No! It can't be!

Example of this new method:

N-
  N-No!
  N-No! It can't be!

The sub is always centered and uses the same space for the end sentence, in all the sequences, therefore N- and N-No! won't center themselves.
Another detail: with MPC player I always force the font into default style (Arial) instead of the one that comes with the mkv file, and it still works perfectly, so apparently this method works with any font besides the one provided.
Does this method have a name so that I can get started learning about it?

Examine the ASS file and check. They are plaintext so all styles are setup using tags.

After suprisingly open the mkv with Aegisub itself, I found out that to achieve this effect, it uses a tag called alpha (like so:{\alpha&HFF&}) that changes the transparency of the text.
To do this effect, you need to duplicate the same line as many times as you need (no need to cut the original transcription), then use the alpha tag to make the text invisible afterwards, like so:
N-{\alpha&HFF&}No! It can't be!
N-No!{\alpha&HFF&} It can't be!
N-No! It can't be!

To achieve this:
N-
N-No!
N-No! It can't be!

Bear in mind that putting the tag before a comma or a dot could cause some trouble with text positioning (it is supposed to be centered). Instead I recommend use this after the comma or dot.


text:
Use Ffmpeg to Add Music Intro and Outro to Video
I'm trying to add a music intro and outro to a video. When the music is playing, a particular image should be shown as well, both before and after.
If I could overlap x seconds of the music with the video as well, that'd be even better.
I've done this sort of thing with only an audio file, but not sure how to do it with video.
So example, let's say I have a 30-second intro and a 30-second outro, each of which I wish to overlap by 10 seconds with the video.
So for 20 seconds, the image should show. Then the video should start for the last 10 seconds of the intro.
Then the first 10 seconds of outro will begin during the last 10 seconds of the video, and for the final 20 seconds of the outro, the image will appear.
Any help would be appreciated.

Step 1 Get the duration of the main file.
ffprobe main.mp4 -show_entries format=duration -of compact=nk=1:p=0 -v 0

This will print out a single value, like this
61.600204

which is the duration in seconds.
Step 2 Perform the concat
ffmpeg -i main.mp4 -i intro.mp4 -i outro.mp4 \
  -filter_complex "[1]trim=0:20,setpts=PTS-STARTPTS[pre]; \
                   [2]trim=10,setpts=PTS-STARTPTS[post]; \
                   [pre][0][post]concat=n=3:v=1:a=0[v]; \
                   [1:a][0:a]acrossfade=d=10[a1];[a1][2:a]acrossfade=d=10[a]" \
  -map '[v]' -map '[a]' out.mp4

Since the video and audio from the intro/outro are treated differently, in terms of duration, we perform two separate concats.
First, the intro video is trimmed to leave out the last ten seconds. The outro is trimmed to leave out its first ten seconds. Then those two trimmed segments are sandwiched with the main video stream in the first concat.
For audio, the crossfades are performed in two stages. First, the intro with the main audio. Then, that result with the outro audio. Duration of crossfade is 10 seconds.

In case, the intro/outro music and image are separate files, use
ffmpeg -i main.mp4 -i intro.mp3 -i outro.mp3 \
       -loop 1 -framerate X -t 20 -i pre.jpg -loop 1 -framerate X -t 20 -i post.jpg \
  -filter_complex "[3][0][4]concat=n=3:v=1:a=0[v]; \
                   [1:a][0:a]acrossfade=d=10[a1];[a1][2:a]acrossfade=d=10[a]" \
  -map '[v]' -map '[a]' out.mp4

Here, X should be replaced with the framerate of the main file. The images should be of the same resolution as the video.

Really awesome, thanks. Just a few things that are a bit off:

Sorry submitted too soon. So basically the audio of the video isn't being mixed with the audio of the last X seconds of the intro. So the intro plays, ends, then the video starts playing from that many seconds in. The other issue, I want to know if it is possible to set the bitrate of the intro/outro. The bitrate of the video's audio isn't great, so right now it's I think the intro/outro is matching that bitrate. The intro/outro are actually wav files.

Here's the command I'm using. I actually needed the intro to overlap at 36 seconds, and the outro at 49 seconds. The duration of the video is 1977 seconds, so I'm using 1977-49 = 1928...let me know if this is wrong.
ffmpeg -i "$video" -i "$intro" -i "$outro"
-loop 1 -framerate 25 -t 36 -i $logo -loop 1 -framerate 25 -t 49 -i $logo
-filter_complex "[3][0][4]concat=n=3:v=1:a=0[v];
[0:a]atrim=36:1928,asetpts=PTS-STARTPTS[amain];
[1:a][amain][2:a]concat=n=3:v=0:a=1[a]"
-map '[v]' -map '[a]' out.mp4

Modified commands to mix the audio streams. Input codecs don't affect the result of the output. Of course, if the input sample rate, bit depth or quality is low, then output can't sound better than that; only match it, at best.

Thanks. Testing that now. Final question: will the first 10 seconds of the video stream appear? I only want the logo for the first 20 seconds, before the video begins. I'm visually impaired so I can't see what the visual output is, only hear the audio output. Just wanted to verify. Thanks for your help :)

Yes, both commands preserve the entire video of the main input.

Thanks @Mulvya. One more request. The crossfade is also troublesome because I'd rather the video audio come in at full volume, or at least not be a slow fade-in. I'd prefer for the intro/outro music to simply be in the background while the video starts/ends. The reason is that the video is an audio lecture of sorts, so if it takes 10+ seconds for the audio to fully fade in, part of the speech will be missed. Hopefully that makes sense.
I'm thinking of more like what you see in podcasts sometimes, where the intro music plays in the background while the host starts speaking.

You can specify interpolations for the audio transition: acrossfade=d=10:curve1=dese:curve2=exp. curve1 applies to fade-out of the first input and curve2 to fade-in of the 2nd. See curve section at https://ffmpeg.org/ffmpeg-filters.html#afade-1 for possible curves.

Thank you. Is there a way to do it without crossfade though? My intro's overlap is 36 seconds, and the outro's overlap is 49 seconds. This method would work for shorter intros/outros I think, but for this it just makes the speech sound like it is very slowly fading in, which is not the effect I want at all. I want an overlap but without the speech starting out soft, or fading out at the end.
I've had success when doing this for my podcasts with adelay and apad. But not sure how to get something like that to work here since video is involved as well.

This is what ended up working for me. Accepting your answer since you got me most of the way there.
ffmpeg -y -i "$video" -i "$intro" -i "$outro"
-loop 1 -framerate "$framerate" -t 36 -i "logo.jpg" -loop 1 -framerate "$framerate" -t 49 -i "logo.jpg"
-filter_complex "[3][0][4]concat=n=3:v=1:a=0[v];
[0:a]adelay=$start[a1];
[2:a]adelay=$end[a2];
[1:a][a1][a2]amix=3[a]"
-map '[v]' -map '[a]' out.mp4


text:
ffprobe/ffplay/ffmpeg command for checking audio/video sync
I'm working on a script that live streams 3 hours of video to several servers. Is there a command (or tool... maybe using something else like wireshark?) that I could run on each of the streams to automate a check for glaring audio/video sync issues?
If so, at least please point me to the relevant reading materials/documentation. Thanks in advance!

What kind of stream and what is your budget? There are some options for SMPTE 2022 or SMPTE 2110 at the network level. There are also options if you can insert a fingerprint. I'd also seen a product a few years back that was using facial recognition to detect mouth shapes to see if they lined up with the sounds in the audio. But all of those require a not insignificant budget.

Michael, I'm focusing on rtmp at the moment. Also, the script is using ffmpeg to launch the streams. I don't think I need anything quite that fancy. Is it possible to use ffmpeg to encode some sort of tag (perhaps at intervals of say, every 10 minutes) into the stream's audio and video that I can use as a sanity check?

This tool is impossible. Almost.
To check sync of audio/video, you need something what appeared in both streams, what can be used as sync points. In old days used Clapperboard during film shooting. In television there was hidden timecode at border of frame, in zone of overscan which not displayed on TV
If you writing professional software, include timecodes to both streams. If not, just stream your video and audio in a single container, it enough.


text:
Side by side videos in shapes
I have a basic After Effects question, but I don't know the right words for it to find what I need.
I have a composition that consists of three side-by-side videos. But, for now, it's just three layers on top of eachother. I created three skewed rectangles (Shapes). I want each of the layers to be shown on top ONLY of one of the shape layers. So, I want footage A to be shown on top of shape A, footage B on shape B, footage C on shape C. There is also some whitespace, between the shapes, so the background video is shown as well.
How would I accomplish this?

The easiest way would be to use the shapes as track mattes for the video layers.
Put the Footage A video layer directly beneath the Shape A layer and in the Modes column choose Alpha Matte "Shape A" from the Track Matte drop-down. Repeat for Footage B and Shape B and Footage C and Shape C

What track mattes do is use the alpha (transparency) or luma (brightness) of a layer to set the transparency of the layer directly below it. The Alpha Inverted option reverses wht is visible or invisible.
There's always at least two ways to do anything in After Effects, so I should just mention that other ways to do the same thing include copying the shape paths and pasting as masks on the video layers, or using the silhouette alpha mode on the shape layers and pre-comping. All methods have advantages and disadvantages. Read the page here for more.


text:
Exporting h.264 from Premiere Pro resulting in black screen on Windows 7
We have multiple reports of our h.264 video playing audio-only in IE11 on Windows 7. The video screen stays black. I can reproduce the problem.
Here is an example video that exhibits the problem. Downloading it and playing it in Windows Media Player also reproduces the problem.
Visiting https://www.youtube.com/html5 indicates that html5 and h.264 are supported by my Windows 7 test machine, so my thought is that the problem has to do with the particular settings I used to export the video from Premiere Pro (current CC version for Mac).
Has anyone run into this before? Are there known "safe" settings for exporting h.264 from Premiere so that it will play back properly on Windows 7?
Thank you!

h.264 has different "levels" of compression.  These levels have to be supported by the particular playback engine.  Windows 7 supports up to level 5.1 via it's Media Foundation library, however your video is encoded with level 5.2.  Since Windows 7 does not natively have support for this version of h.264, it is unable to play the video component.
You can either re-encode with a lower level or you can suggest that viewers either install a codec pack to provide support or use a third party viewer that includes built in support.

Thank you @AJ-Henderson. That is exactly the kind of information I was looking for.


text:
How to use (or should I use) time code/user bit feature on Sony FDR-X3000 action cam
In the Sony FDR-X3000 action cam user manual, it says:
About time code: Time code is a useful function for advanced image editing, which records hours/minutes/seconds/frames on the image data.
About user bit: User bit is a function that can record information (8-digit hexadecimal numbers) such as date/time/scene number. This function is useful for editing movies created using two or more cameras.
That's all it says.
For time code to be useful, don't multiple devices have to be synchronized, as with a master and slaves? Is the Sony X-3000 able to synchronize multiple cameras somehow? What would the benefit be of using this time code vs. just lining up multiple clips in my editing software (as with a hand-clap audio cue, for example) and cutting away?

No, they don't have a way to keep it in sync.  This is why the timecode is clock based.  The idea is that if the clocks are reasonably close, you'll be able to line up multiple cameras across multiple shots once and note their offset.  You can then use this as a starting point on other shots that are done at the same time.  Clock drift is likely to require minor corrections though, but it can at least get you close.
In professional settings, there is a system called genlock where the frame timing is based on an external clock signal that keeps all cameras exactly in sync and it's even possible to provide an external timecode such that all cameras have exactly matching timecode that doesn't have to be based on real time, but can be based on shooting time instead.
The user bit information is for capturing other additional data about the shot that isn't caught in the timecode.  Date isn't generally included in timecode and scene number certainly isn't.  This meta data is helpful for sorting out clips in post production and is basically a digital version of the information seen on a slate at the beginning of production shots.
More advanced cameras support additional meta-data.  My Ursa Mini for example can record the name of the project, director, camera operator, various lens and shooting conditions, scene number, reel number, take number, whether the take was good or not, if it was shot inside or outside, day or night, etc.


text:
Can ffmpeg overlays be combined into a single output stream?
I am using ffmpeg to create a composite video with multiple overlays onto a static background. I notice that ffmpeg creates a separate output stream in the output mp4 file for each overlay. Ideally, I would like these to be 'flattened' into a single stream. Is it possible to do this?
Here is simple example of what I mean - in this case I have a background 'logo' video onto which is being overlaid another video which is scaled to be a half the size of the background and is positioned in the top left corner of the output:
ffmpeg -i LOGO.mp4 -i VIDEO.mp4
       -filter_complex "[1][0]scale2ref=iw/2:-2[scaled];
                        [0][scaled]overlay=x=0:y=0[composite]"
       -map [composite]
       -y OUTPUT.mp4

The resulting video has two video streams as shown by the output from ffmpeg:
Output #0, mp4, to 'OUTPUT.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.89.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.89.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

scale2ref consumes two inputs and then emits them both.. In your command, the output of the reference input isn't provided a label, nor connected elsewhere, nor fed to NULL output, so ffmpeg automatically maps it as output.
Use
ffmpeg -i LOGO.mp4 -i VIDEO.mp4
       -filter_complex "[1][0]scale2ref=iw/2:-2[scaled][ref];
                        [ref][scaled]overlay=x=0:y=0[composite]"
       -map [composite]
       -y OUTPUT.mp4

The ref is now consumed by overlay and isn't left 'dangling' for ffmpeg to map.
As to your general query, just label the output of one overlay and feed it as the input to another, and you can combine them.


text:
How to make YouTube video with screen projection in background?
I want to know, how we can create YouTube videos like this channel:

In here we can notice that the Daniel Shiffman's laptop screen is projected in the background, but it doesn't look like a Projector projecting on the wall behind him.
Any suggestions?

I don't think you can achieve this on a live webcast with only a laptop. You will want either:

a dedicated PC with an I7 or better CPU, appropriate video hardware (Blackmagic capture card or comparable) and software switch (Wirecast or comparable), or
a hardware video switch (Blackmagic ATEM 1 M/E or comparable).

Having purchased both types of systems in the past few years, the two options come out to about the same price, and I'm partial to the hardware solution.
Once you have the hardware and software in place, you can greenscreen the entire room, which creates lighting issues, or only a section behind the lecturer and use picture-in-picture to minimize the amount of space that the green-screen requires (and the lighting problems that go with it).
After that, the output of the laptop is just an input to the capture card or ATEM switch.

I am inclined toward using Laptop based solution and not separate Hardware. Is there a free software that can give me the desired output? Also, can you link some detailed video or blog tutorial to set this up?

Short answer,  not on a live webcast. Live video takes lots of dedicated processing power.

I agree. But my question is not for live webcast. Can you tell me about free software and also any detailed tutorial link or youtube video to follow to achieve this?

In post production any mid level or better video editing software will do this. Premiere pro is inexpensive to lease through creative cloud, a months rental being comparable to a single nice meal at a restaurant. Im not familiar with the free alternatives to make a recommendation.  This tutorial should get you started with the technique. .. https://m.youtube.com/watch?v=uwnlASSHaEY

It's a green screen, otherwise known as chroma keying.  Blue is also used, especially for blonde subjects, or people in green clothing/ costume.  It's not being projected behind him.  If you were standing in the room, you'd just see a green wall.  But it is possible to key footage live, and even to stream a live chroma key.  You just need the right hardware and/ or software.

Any link to the details of how to create this magic at home will be highly appreciated. I am looking at some sort of DIY video link where I can stream a live from my own laptop which is also in the same video, just like this Youtube link i shared in this question?

If you want to stream live, Wirecast provides luma and chroma keying options. My studio used Wirecast for many years before upgrading to a Black Magic ATEM 1 M/E, at roughly the same total cost as a PC and hardware capable of handling Wirecast.

If you're happy doing this in post production, Adobe Premier pro, Sony Vegas Pro, and other mid- to pro-grade software all support luma and chroma keying. Google "youtube chroma key demo" to get about 668,000 results

https://www.blackmagicdesign.com/products/ultimatte

@JasonConrad cool device (I want!), but a little pricier than the average home user can manage


text:
FFMPEG - Use drawtext and complex filters
I have a ffmpeg command that plays several videos from a folder to a live stream, but I would also like to add text overlays over it. The problem is that I used complex filter to concatenate the videos, and -vf to drawtext, but ffmpeg says I can't use complex filters and -vf in the same time. I can't use another method for concatenation, so how should I do ? (I don't mind about using several commands, as long as everything is done live and can be streamed directly)
By the way, here's an example command I use :
ffmpeg \
-i video1.mp4 -i video2.mp4
-filter_complex "[0:v:0] [0:a:0] [0:v:1] [0:a:1] concat=n=2:v=1:a=1 [v] [a]" \
-vf "drawtext=text='SOME TEXT':x=(w-text_w):y=(h-text_h):fontfile=OpenSans.ttf:fontsize=30:fontcolor=white" \
-map "[v]" -map "[a]" -deinterlace \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
-f flv "$YOUTUBE_URL/$KEY"

The problem only comes from the -vf because it works well without it.

Just chain the drawtext, at the end.
ffmpeg \
-i video1.mp4 -i video2.mp4
-filter_complex "[0:v:0] [0:a:0] [0:v:1] [0:a:1] concat=n=2:v=1:a=1 [v][a];
[v]drawtext=text='SOME TEXT':x=(w-text_w):y=(h-text_h):fontfile=OpenSans.ttf:fontsize=30:fontcolor=white[v]" \
-map "[v]" -map "[a]" -deinterlace \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
-f flv "$YOUTUBE_URL/$KEY"

Ah ok I tried just appending the drawtext and it didn't work, but I didn't know the [v] before and after were needed. If I want to draw multiple texts, do I have to seperate them with [v];[v] or can I just seperate them with a coma?

If a filter consumes the output of the immediately prior filter, then just a comma will suffice. If a filter's output is consumed by another filter afterwards, then the output need not be labelled. In the case here, concat spits out two outputs, and the drawtext only wants the video, so the chain is broken. A semi-colon has to be placed after the concat, and the drawtext filter input should be explicitly labelled, in this case [v].


text:
How to use DJI Ronin MX in adverse weather
Hi has anyone ever used a DJI Ronin MX in the rain? if so how have you protected it?

There are numerous simple solutions including shoulder mounted umbrellas and rain shields, or even ones mounted on the Ronin itself.
Obviously, in a complete downpour you may need to consider a waterproof camera bag. These are pretty cheap anyway.


text:
What is the maximum length of Portable Recorder to Camera cable that is safe to use?
I'm about to record still videos, mostly of people sitting and talking to the camera. And I would like to use internal microphones of a portable recorder with a camera and I do not want to place the recorder on top of the camera using a shoe adapter cause I'm afraid it will record a noise coming from the camera and an operator. I also don't want to use XLR microphone, cause it means additional expenses for me and additional gear to carry. So my idea is to place the record in front of the speaking person. Since there is a distance between the person and the camera, I would need quite long audio cable that will connect the recorder with the camera. So my question is - are there any issues with using long cable, like latency, quality drop or something I'm not aware of and what is the optimal cable length I'm safe to use in this case?

Without more detail this is not directly answerable. The short answer is, the shorter the better, but the long answer depends on many factors.

The amount of electromagnetic noise in a room will impact how much the cable picks up noise by working as an antenna.
The type of cable being used will impact how much shielding prevents cross talk (between conductors if shooting stereo) and acting as an antenna.  Features like balanced signaling will also greatly reduce the amount of noise picked up over the length of the cable.
The signal type coming out of the recorder also matters.  If the signal is low power (mic level) then it will be more susceptible to noise, but less susceptible to cross talk.  If it is powered (line level) then it will be more susceptible to cross talk but will be much further above the noise floor.

Conversely, for just about any case, the impact of cable length is unlikely to be as significant as the quality loss expected for sound dissipating through the air, so getting as close to the subject as possible is pretty much always ideal.
For a long cable run, the wired solution will always be lower latency than a shorter one.  Latency is introduced primarily by processing or by signal dropouts on a digital signal that supports retransmission.  Analog signal on a cable is going to move at the speed of light while the sound waves themselves will have to travel at the speed of sound, so if your camera is in the back of a large room, the sound from the mic coming over a wire will likely actually get to you before the physical sound waves reach you.
There may be some exceptions to the noise level rule if the room is extremely EM noisy and you don't have the option of using balanced and shielded cabling with a line level signal, however sound drops off in strength EXTREMELY quickly as the pressure waves spread in all directions and lose power at an inverse square level. (Inverse square law).  The closer you are, the more signal you have to start with and it's difficult for a cable to lose signal that quickly.

Thank you for such a detailed explanation. I will keep this valuable information in mind.

To add a rule of thumb to this, the limit for analog audio on balanced cable is around 150 ft. If your talking head is far enough away that you need to worry about that, you should probably rethink your setup.

@Michael Liebman - I've used snakes longer than 150ft before without issue, but it really does depend on how noisy the room is.  Lots of EM means you'll have a bad day at that length.  I suppose a snake is probably better shielded overall too though.  I've never done a 150+ ft single XLR run for carrying analog audio, just in snakes or single cable DMX runs on DMX cable, which is completely different signaling and one more conductor.

I was offering the OP a rough guideline, not a substitute follow thorough engineering. The point being that for a talking head situation, cable length is not likely to be an issue in and of itself.

Thank you guys, but in my case, it's not an XLR cable, it's baisc 3,5 mm male - male AUX cable that connects the portable recorder and the camera. Does it make any difference?

@Mike - a lot of difference.  Without being balanced, it will pick up much more noise the longer it is.

You may want to consider looking into another alternative as well: double-system sound. The (old school) idea being that since you have a separate recorder, you don't need a connection between the camera and recorder. Instead you can record both separately and then sync them in post-production. If you do this, it's highly recommended to use a clapper board or even just clap your hands in view of the camera and near the microphone to make the syncing process easier.
There is also software, like Pluraleyes and some NLE software, that can make the process easier even without clapping, by matching and aligning the waveform of the audio on the camera with the one from the recorder.
This option may not be applicable to you, but since you didn't describe your circumstances (distance, environment, etc), I thought I would mention it as a possibility.
Finally, one other thing to consider when using a long cable that I don't think anyone else has mentioned so far is physical safety. In other words, preventing people from tripping on the wire and falling down or knocking equipment (like your camera) down.

Yeah good catch about the safety concern, forgetting about it was quite a gaf... (sorry, I couldn't help myself :) )


text:
Fractional ffmpeg timecode in draw text
I got a frame rate under 1 and can't seem to get ffmpeg to stamp the time code
Doesn't work
ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"

with an error
[Parsed_drawtext_0 @ 00000283dbab5f00] Timecode frame rate must be specified
[AVFilterGraph @ 00000283dbab58c0] Error initializing filter 'drawtext' with args 'fontfile=DejaVuSans.ttf:timecode=00\:00\:00\:00:timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Works as expected
ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=1:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"

In one case timecode_rate=0.28571 and in the other timecode_rate=1
So, how do I stamp in the correct, 0.28571 frame rate?

The timecode_rate value is rounded and then applied, so 0.2857 gets rounded down to 0, which is considered invalid. That error message should be refined.
Since you seem to want timecode value to increase by 0.2857 after each 32 frames, you can supply a custom text value
text='%{e\:0.2857*n/32}'

Remove the timecode and timecode_rate options.


text:
How are frames in 59.94 drop-frame timecode dropped?
The pattern for dropping frames in 29.97 drop-frame SMPTE timecode is well documented (2 frames at every minute except when minute is a multiple of 10).
I was wondering how it works with 59.94 fps drop-frame timecode? I guess it needs to be twice the amount of frames dropped, but what is the exact pattern?

Apparently, the frames are dropped at the same cadence, but with double frequency.
From FFmpeg's timecode drop function,
if (fps == 30) {
    drop_frames = 2;
    frames_per_10mins = 17982;
} else if (fps == 60) {
    drop_frames = 4;
    frames_per_10mins = 35964;
}
....
d = framenum / frames_per_10mins;
m = framenum % frames_per_10mins;

return framenum + 9*drop_frames*d + drop_frames*((m - drop_frames)/(frames_per_10mins/10));

and the string is
ff = framenum % fps;
ss = framenum / fps      % 60;
mm = framenum / (fps*60) % 60;
hh = framenum / (fps*3600) % 24;

Great idea. So from that code it really looks like the pattern of dropping every minute excepts tens of minutes is the same but dropping 4 instead of 2 frames.


text:
Blackmagic UltraStudio 4k Extreme recording through SFP
The Blackmagic UltraStudio 4k Extreme has some SFP ports.
Is it possible for that device to record to a network location like a NAS or SAN directly using a fibre connection?
Or is the fibre connection just used as another way to connect to a Mac or PC which would then do the recording?

According to the B&H details, the SFP cages are for 12G-SDI over fiber. They can only be used for baseband video I/O, not for an interface to a computer or network.


text:
Writing to multiple memory cards on a canon 5d mark iii whilst filming
Hi i have a canon 5d mark ii and it has 2 slots for memory cards one cf and one sd.I'm planning on doing some filming outdoors so was wondering if the CF card is full will it automatically start writing to an SD card or am i better off using multiple cf cards?

As far as I am aware it will write to both cards at the same time (dual redundancy), I dont think you are going to be able to write from one card to the next.
Using 2 cameras would always be a better option as you will then have multiple angles and or if you have a failed recording on one camera you still have a backup

Yeah i thought this would probably be the case


text:
Best codec for playing unfinished files with VLC
I am writing stream into video files with ffmpeg. Each file about 15 minutes. I want to be able to play finished and unfinished files with VLC (program using MetaVLC to be more precise). Which codec will best suit for this scenario?
I tried raw h264. Vlc can play them with option "demux=h264" but it unable to seek or change current time of playing. They play only from beginning.
I tried flv, but VLC can't play unfinished file.

Any header-less containers: .mjpeg (mjpeg raw streams, just concatenated jpeg images), .dv, .ts, .mpg (mpeg elementary stream, mpeg program stream), .h264 (annex b for raw h264 streams) and maybe other few.
You can edit video in these containers by direct byte manipulation. Sometime without knowledge where exact frame starts. You can build NLE video editor with bash and dd.
FLV is most simple container, this is stream format, you don't need to patch any bytes at finishing, but it have a small header (just few bytes). You can try to write it manually while opening file for writing.

You can use H.264 in MPEG-TS.
ffmpeg -i in -c:v libx264 out.ts

In Potplayer, I can play as well as seek. In VLC, as well, but timestamps are missing. Limitation is that you can only seek to keyframes. If you select a non-keyframe, then the video output will be frozen or corrupted till the player reaches a keyframe. Audio will work in any case.


text:
Highlighting buttons in a program
Sorry if this question is out of content.
I'm creating tutorials on a program where I will have to highlight the location of the buttons, their functions and make it enjoyable for anyone to watch.
I use After Effects to edit my videos.
I would like the answers to be suggestions on how to achieve those goals.

You can use shapes around that icon and animate it. Like enclosing the icon by a circle and animating the circle to reveal in clockwise or anticlockwise manner.
For description of that icon you can use some nice looking lower thirds and edit the the text of that lower third to describe the content.
You can search for lower thirds pack online and download for free. There are plenty of them available for free online.


text:
Doubts about color spaces and chroma subsampling
Hy everyone, I have some questions about color spaces and chroma subsampling that I haven't been able to solve just by searching the web.

Are YUV and YCbCr the same thing? When I take a look at the information of a random MP4 video file with ffmpeg or MediaInfo, I see that the color space is indicated as YUV. Is that actually YCbCr since we're talking about a digital file?
It doesn't make any sense to say RGB 4:2:0, right? Because chroma subsampling only applies to the YCbCr color space, taking the (Cb, Cr) components, and deciding how many of them should be but in a 4x2 pixels region. Is that correct?
When ffprobe outputs that a video has a bits_per_raw_sample (or bit depth) of 8 bits with a yuv420p pixel format, what does it mean? What is the "raw sample" here? Is the 8 bits value referred to the number of bits used for each component (Y, Cb, Cr) before doing chroma subsampling? In that case, how should I calculate how many bits per pixel (or per 4x2 pixels region [?]) are used after chroma subsampling?

I hope it's ok to have multiple questions in the same post. Thank you.

Please split this up in to three questions.

Are YUV and YCbCr the same thing? → strictly, no. The former is applied to analog signals, and the latter to digital. But media apps (like Mediainfo) use YUV as the designated term.
It doesn't make any sense to say RGB 4:2:0, right? → Not theoretically incoherent, but I haven't seen any codec that implements subsampling for RGB pixels except for Bayer RGB streams possibly. Don't know its details.
What is the "raw sample" here? → a stored single value of a pixel component i.e. any of R,G,B,Y,U,V (or alpha).
Is the 8 bits value referred to the number of bits used for each component (Y, Cb, Cr) before doing chroma subsampling? → it is the resolved bits per individual sample i.e. a 12-bit value has to be stored as a 16-bit datum, so 12 bits is the raw sample size and 16 bits is the coded sample size. 4 bits are for padding.
how should I calculate how many bits per pixel → in terms of luma/chroma resolution, it's the raw sample size. In terms of storage space for a raw uncompressed stream, you sum up the counts in the sampling scheme and divide by maximum count. Multiply by (no. of components x coded sample size).
So, for 4:2:2, that's
(4+2+2) / (4+4+4) = 2/3 and then 2/3 x (3 x 8 bits) = 16 bits per sample

Thank you. Just one thing: when you say that a 12-bit value has to be stored as a 16-bit datum, where does the 16 bits value come from?

Multiple of 8. Memory I/O and data operations are more efficient when working with byte-sized data.

So when we talk about 10-bit video, the actual sample is stored with 16 bits. Do you have any external resource about this you can point me to? Thanks

This is applicable for a raw uncompressed video stream. Strictly only true for raw streams in planar format. Packed formats (R, G and B values for each pixel are stored one after another) will also be padded if the total size of each pixel does not end on a memory access boundary. Doesn't apply to encoded data as those coded words don't map 1-to-1 to raw samples. Authoritative source is to look at source code of apps which encode and decode raw streams e.g. ffmpeg. Look in libavcodec/rawdec.c

2nd question: RGB JPEG can use all kinds of subsamplings, including 4:2:0 with "center" G, B siting. It makes little sense, since we have better vision in green.


text:
ffmpeg error "Error initializing complex filters"
I use ffmpeg like this:
ffmpeg -i MyOwnSwordsman01.avi -filter_complex "drawtext=fontfile=c:/Windows/Fonts/simsun.ttc: text='第01回 %{pts\:gmtime\:0\:%M：%S}/43：20': x=5: y=466: fontsize=16: fontcolor=yellow@0.9: box=1: boxcolor=blue@0.6" -c:a copy -c:v libx264 -map 0 stamped/MyOwnSwordsman01.avi

It went wrong:
[Parsed_drawtext_0 @ 00000000025fae80] Cannot find a valid font for the family Sans
[AVFilterGraph @ 0000000000e3a160] Error initializing filter 'drawtext' with args 'fontfile=c:/Windows/Fonts/simsun.ttc: text=绗?1鍥?%{pts\:gmtime\:0\:%M\\:%S}/43锛?0: x=5: y=466: fontsize=16: fontcolor=yellow@0.9: box=1: boxcolor=blue@0.6'
Error initializing complex filters.
No such file or directory

So what's the matter? I have confirmed there is a simsun.ttc in C\ disk.
Thanks a lot!

Font paths have to be escaped:
fontfile='c\:\\Windows\\Fonts\\simsun.ttc'

I have tried this, but still went wrong with the same error.

Quote the path.


text:
Overlay intro video
I'm trying to replace the first few seconds of a video with a different one, while retaining the audio from the first.
This didn't work for me (the last frame of the overlay is retained after it finishes) https://stackoverflow.com/questions/35269387/ffmpeg-overlay-one-video-onto-another-video
I also tried doing it in multiple steps:
INTRO_TIME=$(/usr/bin/ffmpeg -i intro.mkv 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//  )
rm temp1.mkv temp2.mkv
/usr/bin/ffmpeg -i $1 -i intro.mkv -filter_complex "overlay" -shortest -c:a flac -c:v libx264 -crf 18 -t ${INTRO_TIME} temp1.mkv
/usr/bin/ffmpeg -accurate_seek -ss ${INTRO_TIME} -i $1 -c:a flac -c:v libx264 temp2.mkv
DIR=$(pwd);
/usr/bin/ffmpeg -f concat -safe 0 -i <(echo file ${DIR}/temp1.mkv; echo file ${DIR}/temp2.mkv) -c copy $2

But this appears to be corrupted after the intro ends (the audio plays but the video doesn't. N.B. both temp files look ok)
Ideally I'd like the last frame of the intro to be frozen and then faded out to reveal the original video underneath.
Also, the original video(s) can be quite long, so if there's a way to do it without re-encoding the bulk of the original video, even better. (I realise re-encoding may be necessary for the duration of the intro, and maybe a few seconds beyond that)

You need to use overlay=eof_action=pass to keep the overlay input from freezing on top after its runtime, and drop the shortest=1. Re-encoding just the affected portion of the main video is possible but it is tedious to get it right.

sorry, can you put that into a full command? I tried a few things but can't figure out how to applyit

A command of the form below will do it:
ffmpeg -i main.mkv -i intro.mkv
   -filter_complex "overlay=eof_action=pass[v]"
   -map "[v]" -map 0:a -c:v libx264 -crf 18 -c:a copy out.mkv

If your ffmpeg build is recent, you'll need to add another option:
overlay=eof_action=pass:repeatlast=0

That works great, thanks.
Now I need to figure out the fadeout...


text:
How do you do a "Video Algorithm"?
Facebook generate these anniversary videos which they allow you to share. The video has your Facebook avatar (along with certain friend's avatars) imposed onto certain objects. For example, it can put your avatar on an album cover.
This made me wonder how you do this on a mass scale like Facebook does?
Surely there is some kind of "video algorithm" that does this? What is this technique called and how can I do it?
I would imagine it would be a laugh for my friends if I could take pictures of them and impose them effortlessly onto landmarks, where their pictures are perfectly warped and tracked to the surface each time.
Before you answer I should mention that my attempt at this would be to film a template which had some well placed markers on a flat surface and then track a plain 'placeholder' texture on top of the surface. When the time comes to render a video I would just change the texture with a friend's face or something.
However that's the long way of doing it. I am more curious if there is a way for me to set this up so that I could type into a terminal prompt:
root@root:~$ myCoolVideoProgram.o pictureToImpose.jpeg

and in a matter of seconds (or however long the rendering takes) I have my funny video, without having to go through a GUI in the video editing software of my choice.

This is effectively what every professional editing software in existence does at its core.  Video editing is always done non-destructively in any professional and most consumer contexts.  What that means is that when you are editing a project, you are not actually making changes to the source files, but rather making a series of decisions about what changes should be applied to get the desired output.  When it comes time to make the final rendered output, the instructions are run by the editing software on the original sources and the output is recorded to a new video file.
This series of instructions can be saved off in a variety of different formats such as EDLs (editing decision lists), Final Cut XML files (which are supported by more than just Final Cut) or any number of other formats that include the series of instructions that need to be applied.  These files can be used to move editing projects between completely different editing software.
It is also possible to change the inputs that go in to these instructions.  As long as they are the same size and placement, then it should carry through consistently for different inputs.  This is why proxy workflows work.  In proxy workflows very large and difficult to work with files (such as 4k RAW video) are replaced with easy to work with files (such as much smaller compressed 1080p video).  This makes it easy to work through the edit and then only swap out with the high quality, difficult to work with footage at the end of the project.
The same principle can be applied to swapping photos or videos in to a particular spot in an overall video template.  All the various effects and edits will be applied to the new source just like they were to the old, you just need a render engine capable of doing the rendering and swap automatically.
There are some commercial options available for this, but much is done with custom solutions.  Depending on the complexity, it may also be possible to do it with an ffmpeg script that could be easily run by a command line, though ffmpeg would be considerably more manual to develop the template for.


text:
Selecting and extending multiple image durations simultaneously
So, I'm not sure I'm even doing this the right way or not but I've got a video and I'm overlaying that with multiple images (up to 20 some in some area's) which pretty much stay on screen throughout the whole video, but alter at certain points, changing places, sizes and rotations etc.
Some of these don't alter and I've grouped those up into compound clips, but the vast majority all remain free, which is a massive pain in the backside when I progress a few minutes through the footage and then need to drag the end duration point of fourteen or fifteen images up to bring everything back onto the screen to see if everything is aligned!
Is there a way to select multiple images and drag the end point of them all together?  I've googled this and can't find anything that works at all...

Select the images - use the select tool (A) to rubber-band them - and hit Control-D. Amend the duration and it'll be applied to all the selected images.

awesome thanks for this! you've saved me years!

no probs - shame it's been a month since the original post!


text:
FFmpeg text overlay add sensor values into video stream
I'am using external camera with ffmpeg to acquire underwater live stream. Now I want to add some dynamic values (text overlay) over video stream and restream that to some external provider like youtube live... My values are from different sensors (temperature, oxygen, salinity etc..) and those values must be embedded into video stream.
What is the righ or "best" or "right" way to do this?

Since this has to be done on a live stream, use multiple drawtext filters reading from individual (updated) textfiles with the filter set to reload those files.

Why doing it on the hard way 'I didn't test this method yet' but you can use .m3u8 file contins lets say two picture that will force ffmpeg to continusly load these picture , so you can change/replace/update these pictures file and ffpmeg will load them fast

This question a bit similar to I'm trying to add guitar tabs to a music video, do you know any software to do it?
At first, in which format your data, which protocol used from your sensors? I guess, here some closed-source software and proprietary protocol for there sensors? Obviously, you need software which can read this data format/protocol. If you creating own system with micro-controllers, try to find usable and open protocol for data. It very hard to find open protocols with needed functionality.
At this point I guess, you found any appropriate protocol. For example, JSON with custom fields. Now try to find/write software, which will be use it.
One possible way: write web-application, which will display video stream in your browser, loads data from sensors and display funny overlay. Then just grab video from your screen and broadcast to youtube or any other service. This is "dirty" way, but it will work.
Other way: write custom filter to ffmpeg. You can use ass-renderer for reference how to add text on image. Just add reading data from your sensors and your task completed.

Writing fast and dirty video filters
Sometimes we need to somehow filter the video, maybe put some text or graphic on top. Write a full application that decompresses the video stream, imbues the image with new elements or changes the image itself, and then compresses the stream anew, somewhat difficult. Today we will learn how to quickly and dirty make such applications without knowing how to encode the video in general.
To begin with, remember that the images consist of rows and columns of points, which are called pixels. Each point consists of 3 or 4 components, usually Red, Green and Blue signals, and sometimes there is an Alpha channel. Therefore, to change 1 point of the image, we need to change 3-4 components (this is usually 3-4 bytes). So, to change the entire image, we need to change all the rows and columns, in each of 3-4 elements and somehow modifying them, save back. For example, if we have a picture of 256x192 pixels in RGB24 format, then it will have 49152 pixels and 147456 color components (bytes).
Therefore, we just need to read pieces of 147456 bytes, somehow modify them and write them back! It's all! No complicated libraries or algorithms are required! Where do we get these bytes? And we can get them with wonderful utility ffmpeg and its equally wonderful rawvideo mode, the exhaust of which we will give to stdout and receive in stdin your application!
Let's write the simplest application that will slightly change the image:
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

int main () {

// allocate variables and buffer

uint8_t *pixels = malloc (147456);
uint8_t *pix;
int q;

while (1) {

// read frame
if (fread (pixels, 1,147456, stdin) <= 0) {break;}

// process image
pix = pixels;
for (q = 0; q <49152; q ++) {
*pix++ = *pix * 2; // multiple red to 2
*pix++ = *pix + 120; // shift green channel
*pix++ = *pix + q / 10; // lines in blue channel
}

// write frame back
fwrite (pixels, 1,147456, stdout);
}

return EXIT_SUCCESS;
}

Yes, that's all! Of course, here all the constants are hardcoded, never do so in real projects!
Now, run this and upload a video here:
ffmpeg -i video.mp4 -s 256x192 -f rawvideo -pix_fmt rgb24 - | ./a.out | ffmpeg -s 256x192 -f rawvideo -pix_fmt rgb24 -i - -y out.mp4

And we get the following result:

Let's analyze what parameters in this line participated:
ffmpeg -i video.mp4 -s 256x192 -f rawvideo -pix_fmt rgb24 -

Here we read from the file video.mp4, resize the picture to 256x192 (if your video is already 256x192 in size, then you can not do this), then we specify that it should be converted to rgb24 color space (if it is not already in it, what for can spend quite a lot of resources), and the result we need in the form of uncompressed video rawvideo, the result we record in -, i.e. in stdout.
| ./a.out |
And this is our application. Vertical "tubes" mean that it will take data from the previous application and transfer it to the next
ffmpeg -s 256x192 -f rawvideo -pix_fmt rgb24 -i - -y out.mp4
Here we indicate that the input of this ffmpeg will be uncompressed video in rawvideo format, size of 256x192 and in the rgb24 color space. It is also may need to specify fps, as it is lost from such conversion. We will write output to out.mp4, and even if such file already exists, the -y parameter is responsible for this
Here is a very simple example of changing the image, but you can overlay text, other pictures and anything else. Of course, it's better to write a full-fledged application, or at least patch the already existing filter to the desired state, this will be a more correct solution. But if you need a working solution, while you do not want to write a lot of code, this is the solution for you.

I can use JSON or XML to pass my sensor data.. or any other format. The problem I have is only how to pass data to ffmpeg..

have found here the example: https://s55ma.radioamater.si/2017/08/04/foscam-camera-rtsp-to-youtube-live-streaming-with-ffmpeg-drawtext-overlay/

Here you must write your text in file every... frame! Yes, this can work, but it pretty dirty for me. I don't like such tmp files and wasting cpu. So, I suggest write a simple filter for it.

Have tested with Java. Have made a simple Thread process which writes some values into file.. When the file is closed I execute Files.move method with StandardCopyOption.ATOMIC_MOVE.. I know it's dirty but have no much experience on how to make some plugin (If you have some good reference (link) please help me ..  The other option is to use OBS studio but I must check If can be executed from command line (terminal) (without GUI)..

You have any experience with C or C++? You can write own filter on pipes, like ffmpeg -i _SOURCE_ -f rawvideo -pix_fmt rgb32 - | ./your_app | ffmpeg -f rawvideo -pix_fmt rgb32 -i - rtmp://broadcast.to.server/. This will pass frames to your app via stdin, then you can draw on it and pass bitmaps to stdout, where new instance of ffmpeg will encode it and save to file/broadcast.

Will like to try but first need to see some example or blog about it. (Have done some project also in C/C++ (past)).. ;)

Today-tomorrow I will write one

Thank you!  please inform me so I can check your code.. For now the only way I have is to use FFmpeg with drawtext from file which is updated from java.. Or to use OBS studio (https://obsproject.com/download) but need to check if I can run it from terminal window (without gui)..

I created example with C, it very simple.


text:
It is better to have more B-frames or more P-frame for video streaming?
I'm trying to re-encode (H.264) some videos from my movie library in order to put them on a NAS and stream them to a smartTV through WiFi.
In order to do so, I'm using HandBrake on MacOS and – among my experiments – I noticed that it promotes more B-frames.
If I have understood correctly, those B-frames needs more CPU time and a larger buffer in memory in order to be properly elaborated and I'm not sure if a device such as a general smartTV (of few years) can take advantage of that (with 1080p sources, I used the 4.1 high profile).
Here is an example plotted from FFprobe on the same video source (1080p) before and after re-encoding (and a little filter to reduce noise) at the target bitrate (2-pass VBR):

What do you think or suggest ?
I ask because the resulting file size is very similar and I can't really notice a difference (apart from the noisier frames).
Thanks in advance!

"Q: Is it better to have more B-frames or more P-frame for video streaming?".

From: https://en.wikipedia.org/wiki/Video_compression_picture_types

The three major picture types used in the different video algorithms are I, P and B. They are different in the following characteristics:
I‑frames are the least compressible but don't require other video frames to decode.
P‑frames can use data from previous frames to decompress and are more compressible than I‑frames.
B‑frames can use both previous and forward frames for data reference to get the highest amount of data compression.

So for the sake of better compression and equal quality: B Frames are better.
In your case better means that your TV better be able to decode and properly play your videos after spending hours/days transcoding them.
So try one video using B-Frames, if there are glitches or you can't rewind properly use P-Frames. Be careful using a large number of B-Frames as that will use more Buffer.
The "CPU time" you refer to applies on your computer, for the TV's Hardware decoding ASIC it shouldn't be a problem. As for Memory the reverse is true, your computer will have enough memory for many B-Frames but your TV might only have enough memory for a few.
Blu-Ray uses 3 B-Frames so your TV ought to accept that many.


text:
Final cut pro cropping at an angle
Is there any way in final cut pro to crop a video in a different angle to the original video?
In my case I have recorded some footage of something within a frame, some dice rolling in a box, but the angle of the box is slightly off to the camera, and I'm trying to work out if I can rotate the original footage while cropping in the previous dimension, to re-square the box, if that makes sense..?  rotating the video seems to rotate the crop are as well :/

Use the Draw Mask effect. You can essentially crop with curves, or polygon shapes

this is exactly what I needed, thankyou!


text:
Intersecting Shapes in After Effects
I've received an aep file and there's the following thing that drives me nuts:
There are obviously two overlapping shapes that where only the exclusion is filled:

Nothing special so far, but there are no masks included and also no Merge Paths:

So there are only two paths included (one for the circle and one for the rotated, overlapping rectangle), so which settings were used here to achieve the exclusion?
I personally would have used Merge Paths to achieve this result, but this is obviously not the case here.


text:
Natron node reroute
In Natron, is there a reroute node to split connection into two nodes? Blender has this feature. It is called reroute node.

Figured it out.
Hold Ctrl and yellow points will appear in the middle of connections.
Click on one where you would like to create the reroute.
You can now move it around and connect nodes to it.
This apparently works on "arrow connections" only, which makes sense.
You can also use the left toolbar (or throught a node - right click) and under "Other", you can find the "Dot" node.
Thus, in Natron it's called "Dot".


text:
Kdenlive - cut on point
In Kdenlive, is it possible to cut track on current frame? In Blender I would use "k".
I am able to use the cut tool and click on the current frame position, but it usually involves some offset.
I would like a precise solution.

Figured it out.
The shortcut is "Shift+R".
It's located in top options > timeline > current clip > cut clip.


text:
Kdenlive - how to export audio only?
Is there a way to export (render) audio only in kdenlive? Maybe a custom profile? Shotcut has this ability. As they're both built on MLT, I assume it should be possible in kdenlive too. Am I right?

Figured it out.
Go to "render" and under "destination" select "audio only".
Choose a profile and tinker the settings.

If you want to export in an undefined format, such as FLAC, you can create  new profile.
Go to "render", under "destination" select "audio only" and click on "create new profile".

You will now use this as parameters:
f=flac acodec=flac ar=48000 ab=384k vn=1 video_off=1

Fill it so it resembles this:

"group" and "profile name" are up to you, however I'd say these are the best as they are semantic.
You can of course define your own format, codec, bitrate, etc., to suit your needs. The parameters "vn=1 video_off=1", however, must remain.
Here you can find some interesting presets you can use to create profiles. They're intended for use with Shotcut, nevertheless they should work here as well as both Kdenlive and Shotcut are built on MLT framework.


text:
In Kdenlive, how to select an area for render?
In Kdenlive's render settings I can choose the option to render "selected zone".
How do I select the zone?
"Shift + left click" enables a box selection. However it only selects whole clips, so this approach does not work.

Use the keys "i" for "start" and "o" for "end" to create the selection. They use the current frame position.

Example:
Move the playhead to frame 190 and press "i". Move it to 390 and press "o".
This creates a selection with beginning at the frame 190 and end at 390.

Thanks a lot, we searched this for way too much time ^^" Isn't there a more intuitive solution?

Part of the issue is that kdenlive uses many video editing jargon terms.  In this case, i and o are mnemonic, representing a video's "in" and "out" points.

The same function is available from the menu under "Monitor → Set Zone In" and "Monitor → Set Zone Out".

Thank you! Such a time saver!

another approach that uses mouse is:
https://i.sstatic.net/kyMZc.jpg
in other words, when you only need to adjust the zone out, you can drag this UI element or drag the middle.
Sorry, I cannot make the mini video viewable inline.

This is hardly usable on a long project when we don't even know where it's located


text:
Natron - automatically adjust render frame range
How do I set the frame range to automatically adjust to current video input?

Explanation:
I did some color correcting in Natron and I wanted to reuse the project for other video files so I changed the reader input destination. However, the second video was rendered with the frame range of the previous video. This resulted in, in this case, wastefully long render process as the original video was longer, flow of errors and practically useless output.

Go to the writer properties and change the "Frame Range" value from "Project frame range" (or less probably "Manual") to "Union of input ranges".
This, as the name indicates, determines the frame range as the union of inputs you pass to the writer.


text:
How to map streams to specific output streamIDs
I'm trying to map specific streams to specific output indexes. The command I'm using is more complex but it can be reduced to this simple example
ffmpeg -i input.mkv -y -map 0:0 -c:5 copy -f mp4 out.mp4
I expected this to copy stream 0 from input.mkv into stream 5 of out.mp4. The issue is that it copies it into stream 0 (I guess it's using a counter?). Why is that and how can I force it to assign it a different index number?
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

It's using a counter! To get it to be stream #5, map 5 streams before it :)
That said, mp4box will allow you to set a custom track ID.
mp4box -set-track-id 1:5 file.mp4

This changes existing track with ID 1 to 5. Use mp4box -info file.mp4 to get existing IDs.
However, this will still show up as stream 0 in ffmpeg. But mediainfo and mp4box will show it as having ID 5.

I think the command should fail(i.e. Error<5 higher than the number of total streams>) instead to fallback to various counters. Basically -c:5 param is ignored.

Actually I have found that -c:$ID provided is not used regardless of the number of streams. Even if you just want to copy the streams in reverse order (i.e. first stream to become the 2nd and the 2nd stream to become the first) ffmpeg ignores this and writes them in the same order(first stream from input to first stream from output and same for the 2nd stream)  ffmpeg -i "input.mkv" -y -map 0:0 -c:1 copy -map 0:1 -c:0 copy  -f mp4 x.mp4   results in Stream #0:0 -> #0:0 (copy)   Stream #0:1 -> #0:1 (copy)

Sequence of streams in output is determined by order of map assignments. Stream specifiers for other options like -c only set the value for that output stream # for that option. So, -map 0:1 -map 0:0 will place 2nd input stream first in the output.

Its the order you pass the mappings.
-map 0:3 becomes stream 0:0
-map 0:1 becomes stream 0:1
  ffmpeg -i  2plp0.ts -map 0:3 -map 0:1 -c copy -y out.ts

   Stream mapping:
  Stream #0:3 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)


text:
Leaving white balance for post-processing. Is it a bad idea?
I am new to video. I have a HandyCam (CX405). I don't like trusting in the auto-white balance because it is variable and unpredictable, but changing manually between indoor/outdoor or doing re-calibrations with a white paper can be a real pain in the neck because in that camera everything must be done through one single small button that can be pressed or pushed in four directions to navigate menus.
My idea is leaving one fixed setting (either indoor or outdoor) and then doing the white balance in the post-processing stage in blender.
I know that some things must be done right at the recording stage and if you screw up there is little you can do afterwards, e.g. using a wrong shutter speed. And I know there are some other things that are done internally on the recorded footage inside the camera and you could do them equally well in the post-processing stage manually, and I think white balance may be well be one of them because essentially consists on a numerical multiplication of the values stored in the C_R and C_B components of the video that the CMOS has already recorded. So, probably, you will not loose any information if you do the white balance later in your editing software instead of doing it in the camera.
Is that wrong? Will I regret it later?

Don't do white balance in post, you will regret it. The problem is that the footage your camera records is compressed. That means the sensor information is not stored in RAW, but encoded using lossy compression. The encoding algorithm uses the White Balance setting to determine the encoded color values. The problem is, the original luminosity values that are measured by the CMOS sensor aren't stored in the compressed video, only the rendered color values.
Your camcorder uses the H.264 codec, which means the encoding uses spatial (intra-frame) and depending on your recording settings temporal (inter-frame) compression. This means that some information on pixel-level is dropped as well to achieve a smaller file-size.
To be able to set the White Balance in post without losing any quality, you will need a camera with RAW-capturing capabilities. Unfortunately, for video cameras, those are still very expensive and are pretty much exclusive to professional/commercial movie making.
So yeah, set the White Balance before you start shooting. I would also recommend you set the White Balance manually instead of using the automatic white balance adjustment, especially if you are just starting out. This has a couple of benefits:

The white balance will remain consistent for the entirety of each shot and between shots (if you don't change it too often). AWB will adjust your white balance even while shooting, so if you have some warm or cold light source moving through your image, you might get some unwanted color shifts in your recordings.
In time you will learn to recognize how warm/cold a given lighting situation is, which is a valuable skill to have for a videographer. This will also in turn allow you to estimate what White Balance setting you need in every situation.
You will become more conscious of the light sources illuminating your shots, as well as their temperatures. This will be helpful for your video making in general.
Finally, you will naturally transition to using warmer/colder lightsources and White Balance settings for dramatic effect. The AWB will always try to achieve a neutral grey, which doesn't always work, but even if it does, it's still only neutral grey. Depending on what scene you're shooting, you may want to go for a warmer or colder look to convey different emotions. You can achieve those looks using different lightsources or White Balance.


text:
How to remove a rectangular region at the centre
I want to remove a portion of the video between say coordinates (x,y) and (m,n), where (x,y) are the upper left coordinates while (m,n) are the lower right ones. Is there a ffmpeg command I could use?

Do you want to overlay an opaque box on top?

Basically yeah!

You can use the drawbox filter to umm. draw a box on top of the video.
Basic syntax is
ffmpeg -i in.mp4 -vf "drawbox=X:Y:M-X:N-Y:c=black:t=fill" -c:a copy out.mp4

where X, Y are replaced with top-left co-ordinates of box. M-X and N-Y are width and height of the box. The value fill for thickness will make a solid box. This value was very recently changed, so if you have an older version of ffmpeg, use max instead.

Thanks! Can I simply replace fill with max or does max have a different syntax, sorry I'm very new to this.

Yes, simply replace fill with max.


text:
FFMPEG How to use FIFO to solve a "buffer queue overflow, dropping" error?
I got this code to append an intro and an outro to a video, along with an overlayed logo but I'm getting the error “buffer queue overflow, dropping” on Concat, I've been searching around and it's apparently caused by a matter of filters not requesting the frames fast enough and the recommended solution is to add FIFO to the script, could you please explain to me why this happens and how can I use FIFO to solve this? I'd like to learn more about FFMPEG but the guides I've stumbled upon are quite basic and don't get into droppings.
for %%I in ("C:\Users\Administrator\Desktop\work\*.mp4") do ffmpeg.exe -y -i "%%I" -i logo.png -i out1.ts -filter_complex "[1:v][0:v]scale2ref=iw/6:ih/18[logo][0v];[0v][logo]overlay=W-w-3:H-h-1,scale=hd720,setsar=1[vl];[2:v][2:a][vl][0:a][2:v][2:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -r 20 -c:v libx264 -preset fast -crf 18 -ar 48000 "C:\Users\Administrator\Desktop\Completed\%%~nI.mp4"

pause

This is a regression. For now, use an older binary.

Thanks a lot, I'll try going back, is there much difference in them? Like if I go back to a year older binary, would it impact that much? I know some things changed like '-vcodec' to '-c:v' but not much otherwise

Use a binary barely older than Dec 18 2016, if you can. -vcodec is an alias and still works, as should -c:v

I went back to a 2016 FFMPEG build and it works fine again.


text:
Final Cut Pro 10 Change clip appearance of some clips in timeline
Is it possible to change the appearance of some clips in your timeline and not others?  Basically sometimes I only care about the main video and want to shrink any overlay pictures etc I may have to be as small as possible to save space, can I do this somehow?

This question is unclear to me. Do you mean if you can tread some clip different from others when you export a project?

No sorry, maybe if I give an example that will help.  I have my main video which generally I like to have larger, then lots of images overlayed which if possible I'd like to have at the smallest display setting/not show any audio track for etc.

I am pretty sure you cannot change the clip hight for a certain timeline independent. What might help a bit is when you give your stacked clips different Roles and then click the 'show subroles'. What will move the audio to the bottom under the main timeline and will leave you with the clips only. Now click the 'Focus' button for your main timeline. Then all other audio tracks will get minimized to a narrow line. However, this does not help with the clip high.