text:
4:3 video has 720x480 resolution
I was trying to do some video editing and encoding. I have a so-called SD video that should supposedly be in 4:3 aspect ratio. But instead of 640x480, it is 720x480. Interestingly, when I play it with a media player, what I see is 640x480- it is not played as 720x480!
What is going on?! How could it be possible?

What should I do when someone answers my question?

There are 2 different things:

The real width and height of frames (in pixels) – see the green part of the following picture.
The displayed width and height (during the playback) – see the blue part of the same picture.

The problem arose in old bad days, when the resolution of devices (number of pixels in the image) was very low, but the required ratio of width to high for the playback was 4:3.
The solution (in those days) was the invention of non-square pixels.

For the sake of simplicity let's suppose (theoretically) very low dimensions:

required: 4×3 pixels (i.e. 12 pixels) per frame.
real possible (for the acceptable price): 3×3 (i.e. 9 pixels).

The solution was non-square pixels with the pixel aspect ratio (PAR) 4:3, as here:

So the pixel aspect ratio (PAR) is the ratio of sizes of every one individual pixel:
Every blue pixel in our image has PAR 4:3, and every orange and every green one has PAR 1:1.
Now our whole (blue) image is displayed correctly, as we wanted - e.g. as 12 cm x 9 cm – so its Display Aspect Ratio (DAR) is 12:9, or 4:3.
In spite of it, it's saved as 3 × 3 pixels – so the Storage Aspect Ratio (SAR) is  3 pixels : 3 pixels, or 1:1.
Hint:

pixel aspect ratio (PAR) is micrometers : micrometers
display aspect ratio (DAR) is centimeters : centimeters
storage aspect ratio (SAR) is pixels : pixels

Consequently, the relation between these 3 values is

DAR = SAR × PAR
The important note:
Sometimes is PAR (Pixel Aspect Ratio) called Sample Aspect Ratio – as in FFmpeg*. Unfortunately, the abbreviation for it is then SAR, which is very confusing, because – as we saw – it's also the abbreviation for Storage Aspect ratio.

The main problem:
Nowadays all devices have pixel aspect ratio 1:1 (square pixels), and many media players, mainly for small devices (cell phones, tablets), rely on it, fully ignoring the DAR value stored in video streams.
So you may encounter the situation when the same video (made from all sources) is played back correctly in your desktop or laptop computer, but incorrectly (narrowed) in your smartphone. Or even on the other media player on the same computer or device.
In our example, the frames may be wrongly displayed as a square (see the green part of the image above).

The solution of this problem in FFmpeg:

resize the problematic video, then
set the SAR of it to 1, and
the DAR has very likely the correct value, but you may set it to be sure.

In our (unreal) example you may use the filtergraph
-vf scale=4:3,setsar=1,setdar=w/h

where w is the width of (just scaled) frames in pixels, h is their height. FFmpeg will substitute the appropriate values automatically.
The result will be the orange part of the above image.

In your case, your video has (from your info)

DAR 4:3 (640:480),
SAR (Storage Aspect Ratio) 720:480 = 3:2, and – consequently –
PAR = DAR / SAR = 8:9. (In the FFmpeg terminology it is **SAR – Sample Aspect Ratio).

So to avoid problems with media players ignoring the DAR value (and play back it in the proportion 720:480, you may consider converting it with the command
ffmpeg -i your_input_file -vf -scale=640:480,setsar=1 -c:a copy your_output_file

Problems with pictures with non-square pixels:
With pictures, the situation is even much worse:
Almost all Picture Viewers/Editors and Internet Browsers simply ignore images SAR and DAR, supposing that all pictures over the world have SAR 1:1.
The honorable exception is (interestingly and surprisingly enough) Microsoft Windows Photo Viewer, which displays all pictures correctly.
You may become convinced of it e.g. by the The Pixel Aspect Ratio Acid Test - all 9 pictures there should be displayed correctly in your browser, but – highly likely – they aren't.

well described. Thanks! Both are correct. Once the number of ups gets higher, will update the best answer.

525/60 digitized SD video according to Rec. 601 is indeed 720 pixels wide, 480 pixels high, including some blanking on the sides. Digital equivalent of 625/50 is 720x576. In both cases, frame aspect ratio is 4:3, this simply means that the pixels are not square. See https://en.wikipedia.org/wiki/D-1_(Sony)
To make matters more complex, only a subset of the frame has 4:3 proportions. I believe, only the 704x480 (for 525/60) and 704x576 (for 625/50) has 4:3 proportions. See discussion here: https://lurkertech.com/lg/video-systems/
So, 480 pixels are 10/11 in proportion, 576 pixels are 59/54 in proportion. Also see here: https://en.wikipedia.org/wiki/Pixel_aspect_ratio And do not forget, that both 480-line and 576-line formats can also be widescreen (16:9) yet having the same number of pixels per line! Plus, numbers like 59/54 are not easy to work with. All of this caused that for 576-line format pixel aspect ratio has been chosen as 12/11 for 4:3 screen aspect ratio, and as 16/11 for 16:9.
Square pixels became the norm starting from VGA video adapter I believe, and then from HD specs for 720-line and 1080-line video. By the way, there are some HD formats that record 1440x1080 or 960x720, yet having 16:9 frame aspect ratio, they also have non-square pixels. Square pixels are relatively recent development and should not be automatically expected.

Thanks for the description. I'm playing around with FFmpeg for some experiments (to see if the two have same scene-cut lengths). So since the playback is the same, should I assume from ffmpeg, the 640x480 and 720x480 are identical?!

ffmpeg, (not ffplay) never rescales videos to the display aspect ratio, so filters and encoders will only operate upon the raster data, which is 720x480, in your case.

non square pixels would probably require you to re-sample the video, the worst kind of transcoding known to mankind, in order to fix it.


text:
Final Cut: Youtube 4K Upload directly or by file
For 4K video, Is better upload direct to YouTube or Is better to export in ProRes (or another) in hard disk and then upload the file to Youtube?
I record usually amateur football matches and upload to youtube. But when you select "upload youtube" option the file size is stimated at 8Gb for 1hour in 4K. It is usual? It is drastically decreasing the quality?
The same project exported in ProRes generate a 40Gb file.

We cannot tell by the information you're giving. The "upload to youtube" function uses some sort of container and some sort of codec with some sort of bitrate that we don't know, however, 8Gb for an hour in 4K is a very small file. I remember exporting a shortfilm at about 24 Minutes in 1080p and having a 15Gb file.
Youtube converts your file after you upload it, so rendering in a semi-okay codec will force youtube to make an even worse file out of your rendering. If you want to be absolutely sure, just render your file as a ProRes 4444 XQ and derive all conversions from there.

source: Stack Exchange

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

sort: votes


text:
Errors in converting mp4 to ts with FFmpeg
I was trying to convert a caption-embedded .mp4 file into a .ts file. Only command found after some search was this which uses FFmpeg:
ffmpeg -i 1559066401592889640.mp4 -c copy -bsf h264_mp4toannexb 1559066401592889640.ts

But when running, I get this error:
Codec 'ac3' (86019) is not supported by the bitstream filter 'h264_mp4toannexb'.

What is going wrong? How to fix it?
I'm using latest FFmpeg:
ffmpeg version N-93649-gd0ca749adb Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414

a) -bsf h264_mp4toannexb applies the filter to all output streams but it has to be applied to only video streams.
b) In any case, newer versions of ffmpeg, like the one you have, will automatically apply bitstream filters so you don't need to.
Use
ffmpeg -i 1559066401592889640.mp4 -c copy 1559066401592889640.ts

Quick and simple. Thanks!

I'm facing a problem. Once I convert the .mp4 file to .ts, the caption looks different. Look at 00:34", you see GARBLED CAPTION INSERTED in the original. But that's not there in the converted ts. What's happening? Here is the sample .mp4 file: https://www.dropbox.com/s/697c7tuqgkc0bv0/test.mp4?dl=0

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


text:
FFMPEG: Transparent background with 'showwaves' or 'showspectrum'
I am trying to render a video spectrum of music using showwaves ... I need it to render with a transparent background (i think this is called an alpha channel?)...
I tried yuva420p but it's still rendering a black background... here's what I'm doing:
ffmpeg -i music.mp3 -filter_complex \
"[0:a]showwaves=s=1920x1080:mode=line:colors=white:draw=full,format=yuva420p[v]" \
-map "[v]" -map 0:a output.mp4;

Can anyone help? I know I'm close...

The default codec for MP4 is x264 which does not support alpha channel. Use PNG.
ffmpeg -i music.mp3 -filter_complex \
"[0:a]showwaves=s=1920x1080:mode=line:colors=white:draw=full,format=rgbap[v]" \
-map "[v]" -map 0:a -c:v png output.mp4;

i actually found another method with qtrle and colorchannelmixer that works too ... still learning ffmpeg and not sure there's a significant difference since it gives me the output i want (although the files MOV files created by qtrle are HUGE!)

@AK, thank you here = voting up (click on the upper triangle) and / or accepting the answer (click on the check mark).

done so :) ... just learning the ropes

Answering my own question after hours of research... this also works to give me a transparent background:
qtrle and colorchannelmixer got me there on my own:
ffmpeg -i music.mp3 -filter_complex \
"[0:a]showwaves=s=1920x1080:mode=line:colors=white:draw=full,colorchannelmixer=1:0:0:0:0:1:0:0:0:0:1:0:0.3:0.3:0.3:0" \
-map 0:a -c:v qtrle -an outputWaves.mov;```

The ccc filter is not necessary. Add format=rgba instead.

while this is absolutely correct, i'm bringing the files into screenflow which apparently can't import the rgba format. I had to use qrtle to get them to import properly.


text:
Closed Captions missing when converting from mp4 to ts
This is a follow-up question from my previous question HERE. I'm trying to convert a caption-embedded .mp4 video into a .ts file, simply changing the container format. But once I convert the video, the caption looks different. Not sure what's going on.
Here is the sample .mp4 video. At second 00:34" for example, you see the caption says GARBLED CAPTION INSERTED. But that's not there in the converted .ts file.
What's happening? Any clues?!

The subtitles in the MP4 is a mov_text (tx3g) stream which isn't supported in MPEG-TS.
MPEG-TS support either DVD subtitles or DVB teletext. The former is a bitmap subtitle format and ffmpeg can't convert text to bitmap. FFmpeg has no encoder for the latter. Your best bet is to burn the subtitles but this means re-encoding the video.
ffmpeg -i in.mp4 -vf subtitles=in.mp4 -c:v libx264 -c:a copy out.ts

what is the caption format for a regular .ts file viewable on VLC? For example: https://www.dropbox.com/s/u1unlmyketqnv1e/test.ts?dl=0
The format is different from the one created from your command.

My command makes the captions part of the image. In your sample, the captions are embedded as an element within the video bitstream. ffmpeg can't convert subtitles from a separate stream into those.

I see. Got it. Tnx.


text:
Is it worth it to buy a 50mm 1.8 lens if my camera has a 1.6 crop factor?
I was looking to buy a Canon EF 50mm f/1.8 STM Lens.
But my Canon 7D has a crop factor of 1.6, that would make the 50mm lens look like 80mm. I am a filmmaker, not a photographer, so keeping that in mind, should I still buy it?
Thanks!

No one besides you can answer this question.
A Cinema Prime Set pften constists out of a 18mm, 25mm, 35mm, 50mm, 85mm Primes (On Aps-C). It now depends on what you want to shoot. If you mainly shoot interior wides, the lens won't be of much use.
But a 50mm f1.8 is often a great - cheap option to get into blurrier shoots.


text:
Formula / Calculate how much to slow video down to match audio?
scenario:
I have video matched with audio (song).
I slow the audio (song) down (eg from 120 bpm to 115bpm ie, I know exactly how much slower the new audio is than the original video)
How do I calculate how much to slow down my video by (in Final Cut I have the option of slowing down from 100% speed right down to 1%) so it matches the slow(er) audio?
thanks.

(115bpm / 120 bpm) * 100 = 95.83% (approx, to 2 decimal places)
Speed change percentages are always confusing.
Final cut expresses speed changes as:

If you change the speed to 50 percent, your clip becomes twice as long
  [...]
  If you change the speed to 200 percent, the clip becomes half as
  long

So if you go from 120 bpm to 115 (a slower tempo), you are looking for a longer clip, so your percentage should be lower than 100%.

That should be (115bpm / 120 bpm)

gah... told you it was confusing :) thanks


text:
Snapping all clips together in Adobe Premiere
Usually when I speed up a set of clips, their duration changes in the timeline.

Is there a quick way to snap them all together?

If you have a recent version of Premiere you can use the close gaps function, found in  Sequence > Close Gap.
For previous versions (pre 2018), try the method in this video: Deleting multiple Gaps in Premiere Pro all at once, where you add a matte layer, then drag the existing clips over it to cut it into chunks where the gaps are, then ripple delete it. Works in any version of PP.


text:
Why is CCD still alive?
I have met my dreams in a camera called PXW-X500
I thought CMOS had killed CCD after cheapness, global shutter revolution and years of advancements? Why is CCD still a thing?

The main reason is that while CMOS has made great strides in overcoming it's limitations, there are still some advantages that CCDs hold.  I wasn't able to find anything completely up to date, but this article from 2017 has a few examples.
There's more ability to get consistent results from each pixel and get higher quality analog to digital conversion with less amplification necessary on the CCD.  The cost is much higher obviously as CCD has always been a more expensive option, but it still holds some specialty advantages.  If you need those advantages and have the money, it's still worth buying.
Looking at the difference between that camera and the next model down, you can see that the CCD does have a low light performance advantage over the closest equivalent CMOS camera in that line.

How big is the low light advantage? 2 times?

@JonathanIrons that depends how you measure it, what does 2 times mean?  No, it isn't 2 times by any measure I can think of, it's a small advantage, but low light also probably isn't the only advantage CCD still has.  Both CMOS and CCD have gotten very very good at low light and CMOS noise filtering has gotten very good as well, so both technologies can go very, very low light, but when you are buying a $5000+ camera, you are looking for very small optimizations, otherwise you'd be buying a $500 camera.


text:
Compile FFmpeg example code
I was trying to compile an FFmpeg example code HERE that illustrates how to use filters using it's C APIs.
I compiled the code (throuh a universal make). As the usage suggests, I'm doing this:
./filtering_video test.mp4
But it produces some jumble output on the screen. I was expecting it produces an output .mp4 file that can be played.
How to run it correctly?
And does it work with any given video filter that is passed to FFmpeg through -vf, if I simply change the filter description specified?
const char *filter_descr = "scale=78:24,transpose=cclock";

It does not produce any output file.
After filtering, display_frame() is called, which simply outputs to the console.
/* Trivial ASCII grayscale display. */
p0 = frame->data[0];
puts("\033c");
for (y = 0; y < frame->height; y++) {
    p = p0;
    for (x = 0; x < frame->width; x++)
        putchar(" .-+#"[*(p++) / 52]);
    putchar('\n');
    p0 += frame->linesize[0];
}
fflush(stdout);

yeah I saw characters. How can I display it visually? e.g. passing to ffplay, storing as a file, etc?

does the code work if I simply pass any filter description?

See the transcoding example

I changed the description to freezedetect=n=-60dB:d=8. But this filter produces metadata, not frames (like lavfi.freezedetect.freeze_start: 10.01). How can I show these data instead?


text:
Sony Vegas Pro 12 - 4/3 video wrongly considered as 16/9
I am digitalizing Super 8 film with a dedicated Somikon scanner.
It outputs H264 - MPEG-4 AVC films in 4/3 (1440x1080).
When I open these films directly with VLC, there are displayed in 4/3, which is fine.
Then I add them in Sony Vegas Pro 12 to edit/modify them, but Vegas Pro believes that they are 16/9 clips: although the Project [Projet] and Visualization [Visualisation] fields are in 4/3, the Display [Affichage] is in 16/9 (600x338) by default:
I have to uncheck the Simulate the peripheral image ratio [Simuler le format d'image du périphérique] item to get back the original 4/3 aspect ratio:

When I render the project, Vegas generates a video in 4/3 with the right resolution (1440x1080), but the video player sofwares (VLC for example, see capture below) believe it should be displayed with a 16/9 aspect ratio.

In conclusion, the resolution is good all along, but the default aspect ratio is wrongly set to 16/9 by/in Vegas Pro.
Is there a way to avoid that in the first place?
Or is there a way to correct it afterwards (once the rendered file is created)?

I did not manage to solve the source problem, but I found how to overcome the consequences.
It is indeed possible to edit the aspect ratio of the rendered video using ffmpeg:
ffmpeg -i <INPUT_FILE> -aspect 4:3 -c copy <OUTPUT_FILE>

I re-wrap containers all the time so my fussy Vegas install will play nice with them. This command moves really fast, right? So that makes it a good solution.


text:
Does Adobe Media Encoder support network encoding?
I've noticed After Effects has a render engine that works over the network: two computer run the engine at the same time on the same LAN, they have access to the same project and off they go.
I had a quick look at Adobe Media Encoder and couldn't find any info/command line arguments (like aerender does). Does it support encoding the same video with two different computers on the same LAN or not ?
What would be the most efficient way of rendering an After Effects projects to H.264+AAC using two MacBook Pro laptops on the same LAN ?

The most efficient way is to use the command line renderer in multi machine mode. That will mean each machine will render the next un-rendered frame independently. You need to set the output module to a frame sequence, like png sequence, JPEG sequence, etc. and you need to make sure that "skip existing frames" is on. Then in a command prompt, type /path/to/aerender -project ~/path/to/your/project.aep where /path/to/… is replaced with the path to the aerender executable, and your project (dragging the files onto the terminal is the easiest way to find the correct path). On my machine the executable is C:\Program Files\Adobe\Adobe After Effects CC 2019\Support Files\aerender.exe on a mac it will be /Applications/Adobe/Adobe After Effects CC 2019/aerender.
Alternatively use the render engine and set up a watch folder. This is slower than the CLI renderer, but doesn't involve any CLI use.
Media encoder doesn't do multi machine rendering. Probably because if you need rendering speed enough to use multiple machines you don't want to be rendering with it anyway. It's about 20% slower than the CLI renderer.

Thank you for the detailed answer(+1). I've got no problem using CLI.
The ideal scenario would be aeproject rendered to H.264 using multiple computers somehow. The CLI option sounds like aeproject rendered to image sequence on multiple machines then encoded from image sequence to H.264, correct ?

Yes, to use multiple machines the only way is to render image sequences. If you're good with the CLI, then it's trivial to automate ffmpeg to compress the image sequence to h.264 afterwards - basically you do if /Applications/Adobe/Adobe After Effects CC 2019/aerender -project ~someproject.aep; then ffmpeg ~/renders/imageSeq_%05d.png ~/myMovie.mp4; fi

This is a good workflow, BTW, aside from the multi-machine (or multiple instances on one machine - see https://blob.pureandapplied.com.au/finally-managed-to-peg-my-cpu ) rendering this way means you get a master that you can spin off other copies of, e.g. you need an IGTV or Farcebook version at a different aspect ratio, or you spot a typo and you need to delete part of it - just delete the offending frames and re-render.

Apologies the delay and thank you so much for the detailed aexplanations :)


text:
How to re-order the .wav file channels
I need to change the order of channels in .wav file. for example if .wav file contains 16 channel like

"1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16"

then need to change this order to

"14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13"

You can use the channelmap filter for this,
ffmpeg -i in.wav -af "channelmap=13|14|15|0|1|2|3|4|5|6|7|8|9|10|11|12" out.wav

Channel index starts from 0.


text:
Is it possible to customise Krita’s FFMPEG render?
As Windows 10's native media players still don't support the YUV444p pixel format, which seems to be FFMPEG's default format, is it possible for a Krita user to easily (or relatively easily) reconfigure Krita’s FFMPEG command line to specify, say, YUV420p?
While downloading the VLC Media Player is, of course, an option, as is ‘simply’ collecting Krita’s PNG file render output and running FFMPEG against them manually, life would be a lot easier if Krita’s render workflow was seamless at this point.
While I don’t mind tinkering around at the command prompt, it’s not ideal for people who’ve grown up in a GUI environment. So. Any helpful suggestions or workarounds, anybody?

You do not want your master file be anything other than 444 Otherwise you just throw pixels out. So its very very problematic if you set your default to something less than this. Anyway add a codec to your windows codec repository for the yuv444

As per the code, you need to set the profile in Video Export Options to high and Krita will force the pixel format to yuv420p. There also appears to be a Custom Options field where you could fill -pix_fmt yuv420p but if the profile is incompatible (like high422), ffmpeg will bail out.


text:
How to manipulate video codec errors using ffmpeg
I want to create a video full of codec errors like this:

How can I manipulate ffmpeg parameters to create an output video like that?

The effect you're looking for looks like datamoshing. Give that a quick google search - it might be what you want.

Thank you. I've seen some examples either through python script link or through Hex Editing link


text:
What happens if you uncheck key frame distance in Premiere Pro CS6
The default is 72 which is in frames I suppose. However what happens if I simply uncheck it? Does it work like AVC Intra where key frames doesnt exist and every pixel in every frame is processed like in MJPEG?

AVC intra and MJPEG are intra frame (keyframe) encoding only, each frame in your video will be encoded as a whole. Distance between key frames is a parameter for inter frame compression, where some pictures are encoded either as a whole (i-frames a.k.a. keyframes), and pictures between keyframes are encoded in reference to other frames either before (p-frames), or before & after (b-frames).
If you uncheck custom distance between key frames, you essentially tell your encoder that you don’t care about it, and it will chose to add a key frame whenever it needs to, mostly depending on the amount of motion in the scene, and encoder implementation details. The more keyframes in your encoded video, the heavier the average bitrate / file size.
AVC intra is actually based on h264, but uses only keyframes, and no inter frame compression. MJPEG is basically a sequence of jpeg muxed in a video container.

Welcome to the video production stackexchange. Is there a way to force h264 into using intra frame compression only ?

That depends on the encoder. The H.264 standard doesn't impose limits. If you can specify KF distance, set it to 1.


text:
Trim audio stream to video stream length
I have an mp4 file (converted from an mkv file) that has a longer audio than video stream. This file doesn't play back nicely in my media streaming app (or MPC-HC) when I reach the end of the file.
Example output from mp4info:
File:
  major brand:      mp42
  minor version:    200
  compatible brand: isom
  compatible brand: iso2
  compatible brand: avc1
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   1553152 ms
  time scale: 1000
  fragments:  no

Found 3 Tracks
Track 1:
  flags:        3 ENABLED IN-MOVIE
  id:           1
  type:         Video
  duration: 1524398 ms
  language: und
  media:
    sample count: 36549
    timescale:    90000
    duration:     137195807 (media timescale units)
    duration:     1524398 (ms)
    bitrate (computed): 8508.739 Kbps
  display width:  1444.000000
  display height: 1080.000000
  frame rate (computed): 23.976
  Sample Description 0
    Coding:      avc1 (H.264)
    Width:       1444
    Height:      1080
    Depth:       24
    AVC Profile:          77 (Main)
    AVC Profile Compat:   40
    AVC Level:            40
    AVC NALU Length Size: 4
    AVC SPS: [674d4028eca02d8113cf2e02d404040500000300010002bf200f183196]
    AVC PPS: [68cb8132c8]
    Codecs String: avc1.4D4028
Track 2:
  flags:        3 ENABLED IN-MOVIE
  id:           2
  type:         Audio
  duration: 1553152 ms
  language: eng
  media:
    sample count: 72804
    timescale:    48000
    duration:     74551296 (media timescale units)
    duration:     1553152 (ms)
    bitrate (computed): 125.679 Kbps
  Sample Description 0
    Coding:      mp4a (MPEG-4 Audio)
    Stream Type: Audio
    Object Type: MPEG-4 Audio
    Max Bitrate: 125678
    Avg Bitrate: 125678
    Buffer Size: 0
    Codecs String: mp4a.40.2
    MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
    MPEG-4 Audio Decoder Config:
      Sampling Frequency: 48000
      Channels: 1
      Extension:
        Object Type: Spectral Band Replication
        SBR Present: no
        PS Present:  no
        Sampling Frequency: 0
    Sample Rate: 48000
    Sample Size: 16
    Channels:    2
Track 3:
  flags:        2 IN-MOVIE
  id:           3
  type:         Text
  duration: 1524356 ms
  language: ```
  media:
    sample count: 5
    timescale:    1000
    duration:     1524356 (media timescale units)
    duration:     1524356 (ms)
    bitrate (computed): 0.001 Kbps
  Sample Description 0
    Coding:      text

Specifically, the "Movie" duration is 1553152ms (25:53.152), which is too long. The duration of the video stream is 1524398ms (25:24.398), which is correct. The duration of the audio stream is 1553152ms (25:53.152), and seems to be driving the "Movie" duration.
I want to set the "Movie" duration to the video duration value without re-encoding. It seems like this would be an easy thing to do, but I can't find any solution.
I've tried:

ffmpeg -i file.mp4 -shortest -codec copy out.mp4 - doesn't have any effect (other than removing the mp4 faststart, which I want to keep).
mp4box -add file.mp4 -new out.mp4 - also doesn't fix the duration.
Remuxing the original mkv file using MkvToolnix.

ffmpeg with the -t option may work, but I've got a few thousand files to go through and I don't want to manually type a different command for each one.

More details:
I have a bunch of BluRays that I ripped a couple of years ago with MakeMKV 1.10.4. The MKV files themselves have the same problem: the segment duration is 25:53.088, with a track 1 movie DURATION tag of 25:24.397875. The track 2 (audio) movie DURATION tag is 25:53.14133333. Re-ripping the BluRays is an acceptable solution, if this problem has been fixed (I haven't pulled the BluRays out of storage and tried it).
I converted these MakeMKV mkv files using HandBrake into h265 mkv files. These files also have the segment duration vs movie DURATION tag mismatch.
When playing the MKV files, my media streaming app (and MPC-HC) correctly determine the length of the file from the movie DURATION tag. There's no problem there, even though the mkv file durations are wrong.
What I want to do is enable several older players by encoding to h264 mp4s with faststart. I believe my media streaming app will then be able to serve the files directly instead of re-encoding to h264 or remuxing (depending on the client, it always does one or the other right now).
I have HandBrake all set up with my new h264/mp4 settings and would like to continue using that application to re-encode the MakeMKV source files.
An ideal solution would be to fix the mkv segment duration in the MakeMKV source files. Fixing the mp4 files after the fact would also be acceptable, but at that point I don't want a re-encode.
Versions are current on everything except MakeMkv since I ripped these a couple years ago:
ffmpeg 4.1.4
mp4info 1.3.4 (Bento4 1.5.1.0)
MKVToolNix 35.0.0
MP4Box 0.8.0-rev47-gbafe4cd3-master
MakeMKV 1.10.4

One should use the avformat library flag to stop muxing with the shortest stream.
ffmpeg -i file.mp4 -map 0 -c copy -fflags +shortest -max_interleave_delta 1G -movflags +faststart out.mp4

This ended up doing some kind of partial truncation on the mp4 file. I'm not sure what was going on. However, this approach did work to correct the mkv file, so I have a proper source from which to encode my mp4. Many thanks!
Final command line: ffmpeg -i file.mkv -map 0 -c copy -fflags +shortest -max_interleave_delta 0 out.mkv

@StephenCleary: Annoyingly the shortest logic also applies to subtitle tracks, which are usually shorter than both the video and audio :(  I had to strip off the subtitles in the initial shortening re-mux: ffmpeg -i original.mkv -c copy -sn -fflags +shortest -max_interleave_delta 0 trimmed-no-subs.mkv, then glue the subtitles back in afterward: ffmpeg -i trimmed-no-subs.mkv -i original.mkv -map 0 -map 1:s -c copy trimmed.mkv


text:
Why are these flickering lines appearing during a fade to black in my Premiere render?
I am working on documentation of a performance/musical instrument design project I completed in the springtime. The footage I received from my cameraman was shot on a GH5, and it's technical specs are 23.976 fps, 1920x1080, and H.264 10 bit 4:2:2.
I have completed my edit in Premiere and used a couple of "Dip to Black" effects as transitions between different moments of my performance. Everything looked great and I rendered the project out. After watching the render, I noticed that on every fade to black transition, a bunch of flickering lines would appear on the white wall behind me.
Here is an example of the problem: https://vimeo.com/346004760 (the password is "help")
Does anyone have any clue as to why these flickering lines are appearing during fade to black transitions? How could I get rid of them?
I've spent the past two days trying to find a solution, to no avail: the problem continues to appear. Aside from countless hours of Googling, here is a list of things I have tried:

Switching from GPU to Software renderer
Removing all effects except dip to black i.e just Dip to Black on pure raw footage
Using opacity keyframes from 100 > 0 > 100 instead of dip to black
Rendering the project in every imaginable way i.e .avi, very high bitrates, CBR, playing with every encoding settings
Cleaning media cache
Installing an older version of Premiere, downgrading the project, and rendering out of the older version
Rendering the same footage on a Macbook (I usually work on a PC)

I did learn that I can replicate the issue just by setting In and Out points on the timeline and rendering inside Premiere i.e by going to Sequence > Render In to Out. The flickering lines then appear when I preview the timeline. They do not appear if I haven't pressed "Render In to Out". This cut my troubleshooting time down considerably, as I didn't have to keep exporting footage.

I could not see any flickering. If you are watching it on an external monitor via HDMI cable, I suggest changing the cable.

Welcome! Are you talking about the banding around the person? That looks like it might be quantization error, though I don't know what the cause is.

Thanks @MichaelLiebman! Yes, I'm talking about the banding around the person. I was unaware of this term before and I think it is the proper term for what is happening. I'm going to take a look around online now.

That looks like banding. Banding is where subtle gradients run into the limits of the bit-depth in the codec, often amplified by artifacts from compression.
Imagine that you have a gradient of tones from the brightest possible white, to the darkest black. In 8-bit image (we'll use a greyscale example to simplify) this means the black pixel is at 0, and the brightest pixel is 255 (28 = 256) with 254 possible values in-between.
If your gradient is more than 256 pixels long on screen, then there aren't going to be enough possible values to give each pixel a unique value. Imagine that the gradient went over the entire screen. In a HD picture this would be 1920 pixels that you have to colour with only 256 possible colours. So the colours will have to repeat - roughly 8 pixels will have to share each value. This means you get bands of colour 8 pixels wide, which will be obvious to viewers (making matters worse is the fact that there's an optical illusion that causes human vision to exaggerate steps in a gradient).
Why you notice it even more during fades to black is explained by thinking about what happens to our 0 - 255 gradient as it gets faded out. Halfway through the fade the brightest pixel will be half as bright as it was, meaning our gradient now only goes from 0-128. So now the bands will now be 16 pixels wide, and as the levels get crushed down towards 0 they keep getting wider. This is a fundamental limitation of digital imaging.
What can be done?

Shoot in 10, 12 or 16 bit, if you can. This usually means using a more expensive camera, and doesn't help for final delivery where you often need to compress to 8-bit 4:2:0.
Using log profiles can help cheat some extra depth in mid tones at the expense of loss of detail in bright and dark areas, and an increase in noise and compression artifacts.
adding noise. This is counterintuitive, but what noise does is to break up the hard edges of the bands making them less noticeable. This technique is called dithering, and will be immediately recogniseable from the days of 8-bit computer graphics, where full-colour images had to be represented with only 256 colours.

Thank you for such an in-depth answer! Your explanation is the most detailed and accurate, and I believe sums up what is happening with my footage. In the future I'm going to make sure my cameraman is shooting at a higher bit depth.

It's still a limitation of the delivery format most times when you are delivering on the web, and most streaming service. It's like the days when you had to deliver on VHS and you couldn't use bright reds or thin horizontal lines. Yes, I'm that old.

I believe what you reference is called "artifacts".
Those phenomenons are a result of compression. Vimeo does not use the raw file you upload as playback. Instead, the file is converted and compressed for storage-purposes mainly. This might be one reason as of why this is appearing.
The second possibility is that your footage was not recorded at a deep-enough bitrate, and so it seems from the information you gave. h.264 is always a lossy codec, which means that you're gonna throw away a chunk of data when writing a file in h.264. I know that the gh5 is able to record in avchd, which would be a far better choice in terms of image quality compared to mov h264 or mp4 h264. Try recording in that format.
Lastly, using a flat profile could safe you some extra-information in those parts that get compressed could help you. The gh5 has a vlog-L profile as well as a Cinelike D one. These are so called "flat profiles" which will lower the contrast and saturation at first, but give you the ability to adjust contrast and brightness afterwards. Recording in a flat profile captures more information in very bright or very dark areas, which would otherwise get lost. Trying this might also improve your results.
However, Vimeo, youtube, Clipfish, hell what ever Streaming-Service you use - compression will take place, which means that your video will look worse there than in the original file. Depending on what you're planning on the long run (for example sending a video to a client) it might be a better idea to straight up upload the prores4444 or DNxHR or similar near-lossless codec and send the link to the client (for example via ftp-server) so he/she/it can download it directly without the use of 3rd-party streaming-services.
Hope my answer was helpful, happy filming!

AVCHD uses h.264 compression, it just puts it into a different container format IOW: It's the same slop, just in a different bucket. On some cameras using AVCHD means that they shoot at a higher bitrate, but h.264 is quite capable of higher bitrates than the limits imposed by AVCHD.


text:
ffmpeg: Second lower third does not appear
On a video I am producing, I am overlaying a digital on screen graphic on the lower right corner (branding logo).  I am overlaying an 11 second two-tiered lower third at the beginning of the video (Speaker's Name with their title below their name).  Later in the video a second speaker is introduced and I am trying to add a second two-tiered lower third for the second speaker.  I do this on a weekly basis and everything before the second lower third works like magic.  However, the second lower third never appears.  Here is the code I am using:
ffmpeg -hide_banner -loglevel 56 -report \
    -ss 00:25:00 \
    -i 00005.MTS \
    -i ./constants/edu_logo.svg \
    -i ./constants/name_animation_dr_johnson.mp4 \
    -i ./constants/name_animation_dr_halmilton.mp4 \
    -filter_complex "[1:v]scale=400:122[logo]; \
    [0:v][logo]overlay=x=main_w-overlay_w-80:y=main_h-overlay_h-80[v-l]; \
    [v-l][2:v]overlay=x=0:y=0:enable='between(t,0,10.5)'[v-l-a]; \
    [v-l-a][3:v]overlay=x=0:y=0:enable='between(t,15,25.5)'[v-l-a-a]" \
    -vcodec libx264 -preset fast \
            -flags +cgop -pix_fmt yuv420p \
            -b:v 2M -movflags +faststart \
    -map "[v-l-a-a]" -map 0:a -t 30 my_test.mp4

What do I need to modify to get the second lower third to appear?
Ubuntu Studio 18.04.2 LTS
ffmpeg version 3.4.6-0ubuntu0.18.04.1
i7-2600k @ 3.4GHz
8 Gigs of RAM
GeForce GTX 970

The overlay filter syncs by timestamps i.e. it overlays 2nd input's frame with timestamp X on main input's frame with timestamp X.  Barring certain circumstances like the use of -copyts, timestamps start from zero. So, when your 2nd lower-third overlay enters its active timeline, there are no corresponding frames from the secondary input.
Solution: offset the input's timestamps to start from overlay start time.
ffmpeg -hide_banner -loglevel 56 -report \
    -ss 00:25:00 \
    -i 00005.MTS \
    -i ./constants/edu_logo.svg \
    -i ./constants/name_animation_dr_johnson.mp4 \
    -itsoffset 15 -i ./constants/name_animation_dr_halmilton.mp4 \
    -filter_complex "[1:v]scale=400:122[logo]; \
    [0:v][logo]overlay=x=main_w-overlay_w-80:y=main_h-overlay_h-80[v-l]; \
    [v-l][2:v]overlay=x=0:y=0:enable='between(t,0,10.5)'[v-l-a]; \
    [v-l-a][3:v]overlay=x=0:y=0:enable='between(t,15,25.5)'[v-l-a-a]" \
    -vcodec libx264 -preset fast \
            -flags +cgop -pix_fmt yuv420p \
            -b:v 2M -movflags +faststart \
    -map "[v-l-a-a]" -map 0:a -t 30 my_test.mp4

the magic has returned.  Your answer is perfect.  I truly appreciate your help and expertise.  Thank you!


text:
AE Keyframe Control through checkboxes
I have a position animation with four keyframes, two for a intro, two for a outro. Also I have a Master where you have two checkboxes "Intro" and "Outro".
The idea is to override the keyframe values so that there won't be any intro animation when the checkbox for it isn't checked (same for outro).
Sadly I only can override all values, so when I uncheck one of the checkboxes, there is no animation anymore. How can I change only the value inbetween the keyframes I need?
var x=thisProperty[0];
var y=thisProperty[1];
var headIntro=thisComp.layer("MASTER").effect("HEADLINE | Intro")(1);
var headOutro=thisComp.layer("MASTER").effect("HEADLINE | Outro")(1);

if (numKeys > 3){

    var t1 = key(1).time;
    var t2 = key(2).time;
    var t3 = key(3).time;
    var t4 = key(4).time;

    var v1 = key(1).value[1];
    var v2 = key(2).value[1];
    var v3 = key(3).value[1];
    var v4 = key(4).value[1];

    if (headIntro==false){
        y =linear(time,t1,t2,v2,v2);
    }

    if (headOutro==false){
        y =linear(time,t3,t4,v3,v3);
    }
}
[x,y]

Thanks for the help

If you look at the part where you have

if (headIntro==false){
    y =linear(time,t1,t2,v2,v2); //this is calculated first
}

if (headOutro==false){
    y =linear(time,t3,t4,v3,v3); //this is calculated next, overwriting previous value
}

when headOutro == false is true, the value for y will be calculated using the value returned by the second linear expression, so no matter what it was previously calculated to be it will always return y = linear(time, t3,t4,v3,v3);.
change it to
if (headIntro==false && time < t2){
    y =linear(time,t1,t2,v2,v2);
}

if (headOutro==false && time > t3){
    y =linear(time,t3,t4,v3,v3);
}

so now the linear expressions will only be calculated when the time is in the intro or outro sections respectively.

Oh wow, that was simpler than I thought. Thank you stib!


text:
What exactly is D-Cinelike?
My DJI Mavic Air drone has the ability to shoot video footage in either standard mode or “D-Cinelike”.
Is D-Cinelike just a flatter colour profile with less contrast (to capture more detail in shadows and highlights)? What caveats should one be aware of when shooting in this mode or working with it in post-production?

“Is D-Cinelike just a flatter colour profile with less contrast (to capture more detail in shadows and highlights)?”

Yes.  It's closer to log color rather than linear.  The big thing to be aware of in post production is to make sure you grade it to where you want it to be and possibly use their LUT to convert back towards Rec 709 depending on what you are looking for.
If you don't want to have to work on your color, don't shoot D-Cinelike.  If you want the best recovery in highlights and more ability to adjust the tone, shoot D-Cinelike and spend the time to apply a color grade to your liking.  (D-cinelike isn't so great in shadow unfortunately).
Personally, I always shoot D-log on my Mavic 2 Pro, which is similar in concept to D-Cinelike, though it has better shadow recovery and a bit more balanced, though slightly less cinematic looking without more effort to tweak it, but last I knew, D-log isn't available on the Mavic Air.
If you want to see some good samples, this youtube video seemed like it had relatively good comparisons of the 3.

Here’s what I have learnt so far about about D-Cinelike:

It appears to be a DJI proprietary colour profile used on Osmo and Mavic drones. It is similar to a log profile, which flattens colours for greater dynamic range and flexibility when colour grading, although the range is not as wide as log.

Being not as wide as log has pros and cons: compared to log it captures less extremes (bright whites and dark blacks) although you will get more detail in the midrange.

Compared to normal mode, it can be a little harder to determine if you're exposed correctly, since the picture looks less natural and “washed out”

I found that it’s possible to lower the contrast setting even further (such as down to -3) to get a little wider dynamic range (extra highlights and shadows)

I’m not an expert colour grader, but from what I’ve discovered thus far, the best way to grade D-Cinelike footage (as with log) is via S-curves or highlight/shadow adjustments. You can use LUTs but they tend to be preset for particular scenarios and I find they often don’t fit well with my footage.

This YouTube video compares D-Log with D-Cinelike:

(the summary: it depends on your situation)


text:
h264 (Constrained Baseline)/(h264 (native) vs h264 (libx264)
I am recording a video using OBS Studio with the following settings:

With these settings, OBS is consuming 55 to 60 MB storage for a minute long recording. Considering that my recordings span across multiple hours, a 2-hour recording ends up consuming as much as 4 GB space.
So I tried to transcode the recorded videos with FFMPEG with this command:
ffmpeg.exe -i [RecordedVideoFileName.mkv] [OutputVideoFileName.mkv]
The transcoded video consumes just 5-6 MB per minute in comparison to 55-60 MB per minute as consumed by OBS. The logs of the command are here.
While going through the logs, the following statements statements caught my eye:
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))

So I had the following questions:

What is the difference between h264(constrained), h264(native) and h264(libx264) encoders?
Does transcoding from one to another (as in my case) result in degraded video/audio quality?

Let me clarify what a stream mapping line such as the one below, indicates.
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Stream #0:0 indicates that the input stream is from the first file #0:0 and is the first stream in that file #0:0
-> #0:0 indicates that the input stream is sent to the first stream of the first output file.
h264 (native) means that the detected codec of the input stream is H.264 and that ffmpeg will use its native (builtin) decoder to decode the stream.
h264 (libx264) means that the codec of the output stream will be H.264 and that ffmpeg will use the libx264 encoder to generate this stream.
"h264(constrained)" usually seen in the input file dump e.g.
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive)...

indicates that the input stream codec is H.264 and the stream profile is Constrained Baseline. A profile defines the kind of methods that an encoder can use to generate streams and also a set of methods that a decoder is expected to perform, in order to decode the stream.
With your ffmpeg command, libx264 is re-encoding your video stream with CRF 23 and profile High. If the output looks fine to you, there's nothing to do further.
To experiment, you can use
ffmpeg.exe -i [RecordedVideoFileName.mkv] -crf X [OutputVideoFileName.mkv]

where X can go from 0 to 51. 18 to 28 is a good range for good quality and file size. Lower is better quality and larger size.

Thanks for the explanation. I've upvoted your answer but it'll only reflect when I reach 15. I had a clarification to ask, though. Since FFMPEG is using a CRF of 23, does it mean that the output video is somewhat inferior to the original input and that whether my naked eye can find out the difference is another matter? I ask this because the transcoded video didn't seem to be inferior to the input video.

Yes, modern video lossy codecs make use of psychophysics - the result is mathematically inexact but acceptable for subjective use.

Thank you for the explanation once again, Gyan!


text:
Where is video color vector scope in Apple Motion?
Color vector scope views are very useful for grading color more objectively. I can find it easily in FCPX 10.4.6, but where can I find it in Motion? (currently using 5.4.3)

I don't think there is a vectorscope in Apple Motion but in FCPX vectorscope comes in with the Color Grading tools. Apple Motion is not intended for this purpose, so I guess they did not require to add the vectorscope. I use version Apple Motion version 5.4.2

The same might be also applicable to Adobe After Effect, it doesn't have a vector scope either as far as I remember.


text:
Some MP4s have keyframes on scene changes. Others seem to have random keyframes, or keyframes every X seconds. What causes this discrepancy?
Some MP4s have keyframes on scene changes; others have keyframes seemingly randomly placed, or placed every 5-10 seconds. I prefer the former, both for ease of editing and because, unless I'm misunderstanding the mp4 codec, it's the most efficient.
How would I force one behavior or the other in ffmpeg or Avidemux? (Specifically I would like to force the former, although I would like to know what causes the latter just out of curiosity.)


text:
ffmpeg script encoding only few inputs
I'm using this to create a video from multiple sources. But, the output has only until frames/300100.PNG. What should I change to make it encode all my inputs?
ffmpeg -i body.mp3
    -framerate 60 -loop 1 -t 16.368 -i frames/000000.PNG
    -i 1.mp4 -framerate 60 -loop 1 -t 3.959 -i frames/100100.PNG
    -i 2.mp4 -framerate 60 -loop 1 -t 6.574 -i frames/200100.PNG
    -i 3.mp4 -framerate 60 -loop 1 -t 5.134 -i frames/300100.PNG
    -i 4.mp4 -framerate 60 -loop 1 -t 4.559 -i frames/400100.PNG
    -i 5.mp4 -framerate 60 -loop 1 -t 5.351 -i frames/500100.PNG
    -i 6.mp4 -framerate 60 -loop 1 -t 4.390 -i frames/600100.PNG
    -i 7.mp4 -framerate 60 -loop 1 -t 8.950 -i frames/700100.PNG
-filter_complex "[1][2][3][4][5][6][7]concat=n=7:v=1:a=0[v]"
-map "[v]" -map 0:a -pix_fmt yuv420p out.mp4

You have to feed all inputs to the concat filter, and set the correct number of inputs in n. FFmpeg input index starts from 0. So the fifth input has an index of 4 and would be fed as [4] in the concat filter.
ffmpeg -i body.mp3
    -framerate 60 -loop 1 -t 16.368 -i frames/000000.PNG
    -i 1.mp4
    -framerate 60 -loop 1 -t 3.959 -i frames/100100.PNG
    -i 2.mp4
    -framerate 60 -loop 1 -t 6.574 -i frames/200100.PNG
    -i 3.mp4
    -framerate 60 -loop 1 -t 5.134 -i frames/300100.PNG
    -i 4.mp4
    -framerate 60 -loop 1 -t 4.559 -i frames/400100.PNG
    -i 5.mp4
    -framerate 60 -loop 1 -t 5.351 -i frames/500100.PNG
    -i 6.mp4
    -framerate 60 -loop 1 -t 4.390 -i frames/600100.PNG
    -i 7.mp4
    -framerate 60 -loop 1 -t 8.950 -i frames/700100.PNG
-filter_complex "[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15]concat=n=15:v=1:a=0[v]"
-map "[v]" -map 0:a -pix_fmt yuv420p out.mp4

You probably contradict yourself: [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15] or [0][1][2][3][4][5][6][7][8][9][10][11][12][13][14]?

@MarianD the answer is correct. [0] is not to be fed to the concat filter. See OP's last Q.

Oh, you're right (as almost always). My inadvertence. :-(

This is not a new answer — this is only the summary of the Gyan's answer:

You have 16 inputs (16 times -i options) but you enumerated only 7 of them in [1][2][3][4][5][6][7] (and declared only 7 of them in concat=n=7...,, too):

-filter_complex "[1][2][3][4][5][6][7]concat=n=7:v=1:a=0[v]"

So you effectively excluded the first input -i body.mp3 with index 0 (which you wanted, because you used it as a background music), but another 8 with indices 8 to 15, too (which you don't wanted).

The result is that the accepted inputs for the concat filter are only from your lines
-framerate 60 -loop 1 -t 16.368 -i frames/000000.PNG
-i 1.mp4 -framerate 60 -loop 1 -t 3.959 -i frames/100100.PNG
-i 2.mp4 -framerate 60 -loop 1 -t 6.574 -i frames/200100.PNG
-i 3.mp4 -framerate 60 -loop 1 -t 5.134 -i frames/300100.PNG

(7 inputs; the first input -i body.mp3is omitted.)
It is in concordance with the statement in your question.

Thank you for the detailed explanation. Could you also explain what v=1:a=0[v] does? I'm trying to add one more .mp3 as an input. Edit: I'm not looking to overlay the audios.


text:
Resize video while live streaming with ffmpeg
My server uses this command to stream a video (1280x544):
ffmpeg -re -i c:\ffmpeg\This.mp4 -vcodec copy -acodec copy -movflags faststart -f mpegts tcp://192.168.1.82:1234?listen

Now, I would like to reduce the original resolution while streaming. I tried this:
ffmpeg -re -y -i this.mp4 -vf scale="480:-1" this480.mp4 -vcodec copy -acodec copy -movflags faststart -f mpegts tcp://192.168.1.82:1235?listen

but the resolution does not change.
Can this be done or I am asking the impossible? Thanks.

You wanted to resize your video (-vf scale="480:-1"), and at the same time you wanted don't to use a video codec for encoding such resized video (-vcodec copy).
It's impssible — video codec copy means no decoding, no encoding, no filtering - simply copying without any change. It is not a real codec.
Try omitting -vcodec copy to enable FFmpeg to choose an appropriate codec.

OK thanks. Based on your comments, I was able to resize and to live stream using:
ffmpeg -re -i this.mp4 -vf scale="480:-1" -movflags faststart -f mpegts tcp://192.168.1.82:1235?listen


text:
Unknown coaxial cable female end. smaller than RCA or BNC. White rim
We have a 10+ year old ASL MR safe long range optics eye tracking system that sends a video of the eye to a control unit. The eye camera output port is standard BNC, but the female (?) input on the control side is not. A cord extends from the unit with an end that is much smaller, resembling a 5V power supply connection more than BNC or RCA. The tip of the connector has a white rim.
The cord is annotated 75 ohm coax 1030 AWM 1378 200
The documented ("camera in", pg14) port on the control unit (at the other end of our mystery cord) looks proprietary.
Any idea what this connection is or what to use to adapt to BNC?

you could cut off that plug and crimp a BNC plug onto the cable. Save you some fiddling round making an adapter, and would be superior electrically.

That's a barrel connector, as you say most often used for DC power connections. I doubt that it has an ideal impedance profile for 75 ohm video connections, but that probably doesn't matter in your case.
Get the inner and outer dimensions using a micrometer, match it to one of the standard sizes like type N etc, and you can easily build your own adaptor. I don't think you're going to find anything off the shelf since the use is proprietary / non-standard.


text:
Merging two videos with hstack and play them back sequentially
I am merging two mp4 files using hstack. I am using amix to merge the audio. Everything works perfectly.
Now I want that the hstacked videos should play sequentially, that is one after the other. Here is what I have done
ffmpeg -i left.mp4 -i right.mp4 -filter_complex [0:v]setpts=PTS-STARTPTS[l]; [1:v]setpts=PTS-STARTPTS+14/TB[r]; [l][r]hstack=inputs=2[stacked]; [0:a][1:a]amix=inputs=2[a] -map [stacked] -map [a] -c:a aac -preset superfast result.mp4

In the above example, I tried to delay the play back of the video on the right by 14 seconds (which happens to be the length of the left video). In essence I want the left video to play first and after it finishes the left video should play.
What I am getting instead from the command is, the left video remains still for 14 seconds with only displaying the first frame (the audio plays) and after 14 seconds the right video plays.
I am at my wits end trying to figure it out. What am I doing wrong ?

The h/vstack filters are designed to pair frames so they will hold the first frame of an input if the other input isn't active. Use the tpad filter to add blank frames for the required duration.
ffmpeg -i left.mp4 -i right.mp4 -filter_complex [0:v]setpts=PTS-STARTPTS[l]; [1:v]setpts=PTS-STARTPTS,tpad=start_duration=14:start_mode=add:color=black[r]; [l][r]hstack=inputs=2[stacked]; [0:a][1:a]amix=inputs=2[a] -map [stacked] -map [a] -c:a aac -preset superfast result.mp4
If you don't have the tpad filter available, a slightly longer approach is to use the drawbox filter with ffmpeg 4.0+.
ffmpeg -i left.mp4 -i right.mp4 -filter_complex [0:v]setpts=PTS-STARTPTS[l]; [1:v]setpts=PTS-STARTPTS,split[rb][rv];[rb]trim=0:14,drawbox=t=fill:c=black[rb];[rb][rv]concat=n=2:v=1:a0[r]; [l][r]hstack=inputs=2[stacked]; [0:a][1:a]amix=inputs=2[a] -map [stacked] -map [a] -c:a aac -preset superfast result.mp4

I believe this should work. I am using this in android environment, but my ffmpeg build 3.3.4 is saying no such filter 'tpad'.

You'll need v4.2

I have another library with ffmpeg 4.0 compiled. Is there any other way, this can be achieved ?

added workaround

Thank you so much, it is time, I upgrade to 4.2, will build ffmpeg 4.2 and get back to you. Meanwhile I am accepting your answer.


text:
ffmpeg/x265: fixed-GOP, IDR only keyframes, repeating headers
I need to transcode a video to another one with the following properties:

GOP size is always fixed at a given value
Only IDR frames are used as key-frames (not I-slices)
SPS/PPS/VPS frames are repeated every time before the IDR frame.

Is there a way to do this with ffmpeg?
Also, it would be great if you can also tell me of a simple way of verifying all this (perhaps using ffprobe?).

Which output format?

H.265 output format.

As in,  a raw bitstream?

Frankly, doesn't really matter. I can fix the container if I need to, later. But the raw stream is what matters to me.

Minimal command line, for a GOP size of 2 seconds:
ffmpeg -i input -force_key_frames expr:gte(t,n_forced*2) -c:v libx265 -x265-params open-gop=0:scenecut=0:repeat-headers=1 output.hevc
Verification:
ffmpeg -i output.hevc -c copy -bsf:v trace_headers -f null -

After each line containing key frame e.g.,
Packet: 18115 bytes, key frame, no pts, dts 2319977, duration 40000.

You should see the VPS/SPS/PPS. The first Slice Segment Header that follows should have a NAL unit type of 20 which is IDR_N_LP.
ffprobe can't invoke bitstream filters.

The seems to be working. Thanks. The verification command doesn't work for me though ("Unknown bitstream filter trace_headers"). Also, not that it's a problem, but there is a "supplemental enhancement information" NAL after VPS, SPS and PPS which wasn't there before. Could you tell me why this particular command causes that to appear?

Oh, and also, the expr:gte(t,n_forced*2) part of the first ffmpeg command needs to be quoted. I'd suggested you edit that in the interest of the future copy-pasters!

So maybe I was wrong. I tried this with another video and looks like it does not always work. Keyframes frequently happen before the 250 frames (10 seconds) that I set is up (I'm assuming the n_forced*2 determines GOP size and I changed it to n_forced*10). I tried adding min-keyint=250:keyint=250 to the x2675 params. No effect. I also tried the -g option of ffmpeg. Still the same thing happens.

if your source is a container with VFR stream and/or fps < 25, then there may not be 250 frames in a 10 second interval. You can change t to n and the value to a frame distance

The FPS I'm sure is 25 (or so ffprobe says). I'm not sure about VFR (that's variable frame rate, right?), but I think it's unlikely. I think the problem is that whatever we do libx265 seems to not honor min-keyint. Your force_key_frames option does work and it fixes my main issue, but x265 right at the beginning says that Keyframe min / max / scenecut       : 126 / 250 / 0 even though I've set both min-keyint and keyint to 250.

If scenecut is 0 then x265 may insert non-IDR I-slices - those aren't keyframes.


text:
Sync picture in picture clips in Davinci Resolve
I'm trying to transition from Lightworks to Davinci Resolve. My question here is about the right way to sync 2 video clips and show them simultaneously.
In my case I have a video of a sporting event and another video of the game clock. I want to crop the clock video and show it in the corner of the game video. Obviously getting them synced is important.
I've seen how Davinci Resolve makes it very easy to create a Multicam clip and sync the angles. However that seems to work to show just one angle at a time, and I want to show both at the same time.  How do I accomplish this?
Bonus question - I want to cut out some spans of time in the game (timeouts, etc) which creates a challenge with the clock (at least in LW).  In LW I would sync both clips, then cut out time with them together so they stay synced. How do I do this in DR?
Thanks!

I've seen how Davinci Resolve makes it very easy to create a Multicam
  clip and sync the angles. However that seems to work to show just one
  angle at a time, and I want to show both at the same time. How do I
  accomplish this?

It does only show one angle at a time.  The way you accomplish it is to create two tracks on the timeline, drop an instance of the multicam on V1, duplicate that instance by alt/option dragging upwards to V2 (add shift after you start dragging to constrain the movement vertically, and to keep the clips synced temporally).  Then switch the angle of either one of them, so that V1 is showing angle A and V2 is showing angle B, for instance. Then adjust the transform and crop parameters on the topmost clip (V2) to expose the one underneath.
As for the bonus question, you can either be careful how you blade by making sure you have either both or neither clips selected when you hit command/control-B, or you can lasso-select the two clips, right-click, and select "Link Clips", then make sure clip linking is on by toggling the chain link icon (cmd/ctrl+shift+L).  Clip linking lets you move clips as groups, blade them as groups, and displays a red frame offset badge if the clips accidentally loose sync.  I'm not sure how lightworks works, but it's very similar to Premiere and FCP7.

Thanks, this works!  Lightworks is... very different.  Switching to Davinci Resolve means learning to think very differently about the project

The above answer is not technically wrong, but it's probably not the right way to think about solving the problem.  The general idea of a multicam clip is that you want to switch from one view to another view to another view.  Each camera is a valid view and interchangeable with one another AS A VIEW.  Cutting back and forth between a player and the clock is a great example of switching views.
The general idea of a compositing digital video editor is that you can build a final image from layers of video, text, graphics, etc.  And you can even use such things for controlling effects like keys, transitions, etc.  Very cool!
If the idea is to have one clip function as a picture-in-picture view of a clock, then the idea of using a multicam clip as the source for that clock is kinda wonky: why have a multicam clip whose job is merely to select precisely a single view?
If your footage of the event is continuous (and even multi-camera), then that would make for a good baseline track, such as Video Track 1 (V1).  Place the footage of the clock on V2, aligning it so that it is synchronized with the video in V1.  Initially, V2 will completely cover the video of V1, giving you a very exciting view of just the clock for the whole duration of the game.  Using the Inspector in the edit window, scale the clock to the size of the picture-in-picture view you want (using the Zoom controls), but don't adjust its location with Position X and Position Y.  Rather, adjust its location with Anchor X and Anchor Y.
When you have the clock where you want it to becreate a compound clip consisting of the clock clip and the action clip (which might be a multicam clip if you have a multicamera recording crew).  Now you can edit the compound clip, cutting out all the boring parts.  You might decide that you don't want the clock on all the time, only at certain times.  You can edit the compound clip, making cuts to define the regions where you don't want the clock to show.  Or making cuts where you want only the clock to show--full size.  If you want a full-sized clock, make cuts so you can select the part of the clock clip you want to be full-sized.  Set the zoom factor to 1.0 and the clock will magically fill the screen in the center (because you used the Anchor XY instead of Position XY controls).

"why have a multicam clip whose job is merely to select precisely a single view?"  Because a multicam clip IS a compound clip, with extra functionality built in for synchronization.  You can prove it to yourself by customizing the CC's "decompose in place" keyboard shortcut, and then using the shortcut on a MCC.  Although, the MCC's equivalent is "FLATTEN in place," the custom shortcut will work on both.  I agree that using MCCs per OP requirement is nonstandard, but why waste sync functionality if it's there?  Because the clock will never change to not-clock?  Bit narrow perspective, IMO.

Also, why are you offering unsolicited advice about position versus anchor controls?  Especially when there are clear cases when using the anchor control is the wrong choice.  For animation, anchor point keyframes can't be smoothed, for instance.


text:
After Effects CS6 not recognizing GTX 1050 Ti GPU
I have a laptop with Intel i5 chipset and GeForce GTX 1050 Ti GPU. Due to some work related reasons I still use Adobe After Effects CS6. Right now I am facing an issue with Raytracing in AfterEffects as it doesn't recognize my GPU. The GPU option is greyed out and I couldn't select it.
Things I've tried so far :

Updated the Optix.dll file into a newer version(4.1).
Added GPU name in raytracing supported cards list text file.

Updating the Optix.dll to Optix.1.dll version 3.9.1 worked.


text:
ffmpeg: How to fix `Unsupported channel layout "1 channels (FL)" error`, when I convert the source containing separated FL/FR audio streams?
Problem
I want to convert the MOV file containing the separated FL/FR audio streams to MP4 file, transcoding the video to h264 and the audio to AAC.
However, it fails with the following error:
[aac @ 0x7ff515000c00] Unsupported channel layout "1 channels (FL)"
The source video and command what I used is as the following section.
How To Reproduce
Download ticket1474.mov as the source from https://trac.ffmpeg.org/ticket/1474,
this source contains the following streams:
(The streams in issue are #0:1 and #0:2)
    Stream #0:0(eng): Video: mpeg2video (Main) (xdvf / 0x66766478), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 34801 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2012-06-19T21:18:43.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : XDCAM EX 1080p30 (35 Mb/s VBR)
      timecode        : 00:00:00;00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1 channels (FL), s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2012-06-19T21:18:43.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1 channels (FR), s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2012-06-19T21:18:43.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:3(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2012-06-19T21:18:43.000000Z
      handler_name    : Time Code Media Handler
      reel_name       : Untitled
      timecode        : 00:00:00;00

Then run the following command:
$ ffmpeg -i ticket1474.mov -b:a 128k -map 0 -y sample.mp4

You'll get the following error:
(snip)

Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
  Stream #0:2 -> #0:2 (pcm_s16le (native) -> aac (native))
  Stream #0:3 -> #0:3 (copy)

(snip)

[aac @ 0x7ffbd203e400] Unsupported channel layout "1 channels (FL)"
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

ffmpeg Version
$ ffmpeg -v
ffmpeg version N-93875-gc2771bbf81-tessus

Note: Stable version (ffmpeg-4.2) also fails.
What I Tried (Converting FL/FR streams to dual mono channel)
I guessed the problem can be solved if I could convert FL/FR streams to dual mono streams.
But I couldn't find the appropriate usage of ffmpeg for such scene.
The command I have tried is the following which also failed:
$ ffmpeg -i ticket1474.mov -b:a 128k -filter_complex '[0:1]pan=mono|FC=FL[mono];[0:2]pan=mono|FC=FR[mono]' -y sample.mp4

(snip)

Filter pan has an unconnected output

Any ideas?

No need to use pan filter, you can reassign channel layout using the channelmap filter.
ffmpeg -i ticket1474.mov -af channelmap=0 -b:a 128k -map 0:v -map 0:a -y sample.mp4

See docs for channelmap filter.
I've skipped mapping the timecode track. ffmpeg will set it as metadata in the input file, and the MP4 muxer will pick it up from there.


text:
Play is sometimes very slow and other times it's very fast in After effects. Why?
I've just installed after effects and I would like to learn it.
When I click the play button, it seems like it starts to render so the frame rate is very low ( one frame per many seconds) and the the whole interface is laggy.
After rendering few frames, I don't remember what I really did but I clicked the play button again and the video was played smoothly.
I clicked the play button again and it became laggy one more time.
I think the preview process should be different from the rendering process in After Effects (just like 3D max or any other similar software. There is a 3D view port that doesn't render the exact materials and lighting). The two processes are separated to make the play/pauses fast.
I would like to know how do people use after effects with this mixed (Rendering & Preview) processes? Of course, I know that there is a method to get around it and I'm missing it. I would appreciate it if you give it to me.

You've answered your own question; when you preview in After Effects it renders first, then plays back. The default setting is that if you hit numpad-0 to initiate a preview it will render the frames it can until it either fills up the available RAM, gets to the end of the preview area (work area or end of comp), or you hit numpad-0 again, at which time it will play back from RAM, theoretically much faster.
In recent iterations of the software, the playback performance has got significantly worse. I don't know why AE can't easily play back even UHD previews from RAM or even from disc at real time or faster, just like every other free media player app can. You get better playback performance if you have a comp dynamically linked in Premiere, it makes no sense. Unfortunately that's just the way it is, and the only thing you can do about it is learn Nuke, Fusion or Blender.
Some tips for better real-time playback: updating the UI seems to take an inordinate amount of processing power. So having things like the graph editor, Lumetri scopes or even just the timeline visible while previewing will slow it down. I work on two monitors, and if I can't get real-time playback I will maximise (~) a window that doesn't get refreshed during playback, like the tools window, so that it fills the entire monitor, and that improves performance dramatically. Also making sure the comp window is zoomed to 100% will help, and if that doesn't work, lowering the preview resolution ctrl / ⌘shiftj to half or quarter ctrl / ⌘shiftaltj will speed things up.


text:
How to distribute multiple clips on the timeline, by Date and the time of the first one?
I have an existing project in Adobe Premiere 2017 and I would like to import multiple clips in it.
I already have the primary camera in sync with the Audio, and I would like to bring the secondary camera consisting of multiple clips which are not continous (there are time gaps between them).
By knowing that the video 123.MOV created at 1:39 PM should be at minute 7:55 on my timeline, and after making sure it is in sync with the audio, I want the other ones to be set in sync as well, adding the timestamps between the Created Date on the timeline.
I am not sure if Timecode helps here, but I am wondering if there is a way to import them in the project with the time gaps between them and then I will be able to select them all and sync them at once.
How can I do that?

In Davinci Resolve, I would solve this problem by creating a multicam clip using Timecode as the method for synchronization and keeping clips organized by camera.  This will create a multicam clip with only a single camera, but each clip spaced out according to its timecode.  If you like, the multicam clip can then be decomposed in place and converted into a compound clip, preserving the spacing between the video clips.  You can then place the single compound clip to start at 7:55 and all the rest of the clips inside the compound clip (or multicam clip if you didn't convert to compound clip) should line up as expected.

I tried using the Timecode multicam sequence, but I didn't have much success with it and ended by placing them manually. It could be the created at is not interpreted correctly...

When I do event recording, there's an audio track that runs through the entire event.  That long-running track provides a timecode reference against which the video clips can be placed.  Resolve is also not exactly happy to merely place clips in space against an abstract timeline that starts at 00:00:00:00 and runs through 23:59:59:23 (or whatever).


text:
ffmpeg: keyframe extraction with pts
I have an ffmpeg newbie question, I am extracting keyframes from streams using this command:
ffmpeg -skip_frame nokey -i {0} -vsync 0 -r 30 -f image2 keyframe-%09d.jpeg
However, instead of an auto-incrementing counter, I would like to save by frame pts. for example keyframe-0003456.jpg as the pts. How can I mod the command?

Use
ffmpeg -copyts -skip_frame nokey -i {0} -vsync 0 -r 1000 -f image2 -frame_pts 1 keyframe-%09d.jpeg

This will print the pts as milliseconds in the filename.


text:
DaVinci Resolve 15 view multiple tracks at once
So I have been looking for an answer for long and have not found any. I want to view multiple video tracks separately. The idea is that I have video sources from multiple cameras, I want to sync them in the timeline, each one in separate track, but then I want to see them all at the same time for me to decide which clip from which camera I use in the final product. I would like to use it for 2 to 4 cameras.
Currently running Resolve 15 and I am aware of Resolve 16 having new "Cut" workspace but I have not tested it.
If you have any ideas how to do this in Resolve I would be very grateful. However, a working, easy to use, third party program would be also appreciated.

This is what the Multi-Cam feature is for. You can see this Tutorial: How to use Multicam in Resolve in it, you can preview all cameras at once. Keep in mind that this is quite perfomance intensif. Make sure to use Proxy to improve performance.

Thanks a lot!!! I was looking for it but did not know how to name it.


text:
Camera flash produces unwanted artifacts on the video
During frame by frame watching of some video taken via Instagram app one noticed strange unwanted artifacts on the video caused by camera flash. Please, consider below several sample image frames taken from the video:

Here we clearly see three cases:

No camera flash.
Camera flash: expected camera flash effect.
Camera flash: unexpected camera flash effect (artifacts: the left side is brighter than the right side).

The questions:

Why this happens at all? How this is related to the physics of the filming process: camera flash speed light, image acquisition by the image  sensor at 24..25 fps, video compression/decompression (guess the H.264 was used by Instagram app, video was taken at the end of 2018), etc.
How to avoid such an artifacts next time?

Thanks in advance for the explanation.
Direct link to the full video: https://scontent-ort2-1.cdninstagram.com/v/t50.12441-16/45731449_1983300578418249_711802823897524155_n.mp4?_nc_ht=scontent-ort2-1.cdninstagram.com&oe=5D7924B5&oh=b2ddf05b200a10ababd105c8b23d7f23&dl=1

A simple solution is to use a camera with CCD sensor, which has global shutter. These are increasingly rare, you may find a used one that shoots 1080p but not higher resolution.

This is actually a collateral effect of the concept of rolling shutter. Most video devices do not expose all the frame area at once. They expose starting from one side and (up or down) and move from there. (The example has the camera rotated 90° so the effect is on the sides of the frame).
This can be either a mechanical element that moves or rotates or an electronic system.
As the flash of a camera is a really fast burst of light, it can sometimes be captured in one zone of the frame, by the time another part of the frame is streaming the data, the flash burst is over, so this zone of the image is transmitting the non-illuminated scene.
On still frame photography, this is the reason you have a minimum sync speed.
Frankly, it is really hard to avoid this situation in an environment such as the example posted, because you can not sync your camera to that flash.
On a controlled environment, like lighting in a movie, you could add the lighting in post-production, making one full frame white, and probably some other just a bit exposed.
Another way to control it is by using a slower burst of light. Rather than using a flash that lasts about a thousandth of a second (which disappears really fast), you use some system that flashes on tenths of a second. This way the burst of light has time to be captured by the shutter of the camera.

re the last point: you could also use a higher shutter speed if that doesn't produce other unwanted artefacts.

Also, on the last point, don't forget about infinitely slow "flashes"; i.e., continuous light sources such as video lights or sunlight.

@stib, I actually want to simulate different shutter speeds to compare the effect, slower and faster than the 180° rule.

Excellent answer, thanks! The @Rusty Core is right: the simple solution to reduce or eliminate unwanted image artifacts is to use a sensor with a global shutter.


text:
What kind of footage is this and where can I get it?
Can someone help me identify what kind of stock footage is this, I wish to swap out the text and the image on the stage for someone else. Is it green screen footage or an opener?
Where can I get similar footage? I have had a google and to be honest I dont know what to google green screen stage footage?
Any help would be greatly appreciated :)

It is an "intro", but if you want to personalize it you can not look it as footage.
Footage has all the elements fixed. You need to look for a template, where the elements, like the text, can be actually edited and then rendered again into a clip.
Examine the example, the perspective is actually matching the camera movement, so the template needs to be a 3D template.
You could make your own in Blender the best free 3D program, but this requires time.
You can look for some projects using these keywords: blender 3d intro template
If you have the adobe's subscription plan, look for "After effects 3D intro template".
There can be as other answer posted a Cinema3D template, but the program itself is quite expensive. It also has some monthly plans.

There can actually be some "footage" with some green screen areas, but the look would be different, for example the green area could be used to reveal a background, but this is not the case.

Thank you, I managed to find a template for AE cheers :)

It's a (to be honest, quite old looking) 3D-Animation. I believe that looking into something like 3dsmax, Maya, Modo or Cinema4D might be the best bet for you. Otherwise you can search for "talent show display opener" as a Cinema4D template.

Well you could change the screens simply by using any effects editor (ex: Adobe After Effects) that has tracking, which will allow you to pseudo 3D map the screens with motion but one major problem is the spotlight going over the screen.  You'll have to just fake it by putting a mask over the light and filling it colored or white.  With more work you might be able to recreate it.
You can find many tutorials on YouTube such as this one:


text:
Adjusting sequence square frame size for large screen size
I am trying to make a square size video of 6:5 ratio for LED display screen. The size of the screen is 12feet x 10feet in pixels it's 13824x11520p.
Do i need my frame size to be this big to make it fit into this large screen OR how do i calculate the ratio to make sure my video will fit perfectly without weird pixelation.
PR ver: CC 13

If you don't want your video to be up-scaled then you need to output at the native resolution of the screen. The physical size doesn't matter, what matters is the pixel dimensions.
However, if the footage is not shot at the native resolution (and I don't think there are many 14K cameras around) you're going to have to resize it to fit. Whether you do that in your edit, or use whatever mechanism the screen has for up-scaling footage depends on a couple of factors:

can the screen / playback device do its own interpolation, and if so how good is it?
do you have graphics etc that you want to be crisp? If you're relying on the resolution of the screen to display small graphic elements crisply then you'll want the video that you deliver to be as high resolution as possible.
can the playback device handle a 14K video stream? Filesize is going to be an issue unless the playback device is pretty fast, and decoding it is going to be taxing for even a powerful machine.

Best bet: ask whoever is in charge of the screen. For a screen that large there's going to be an AV person who knows what they're doing. Ask around until you find who can give you specs for what you have to deliver.

Wait, stop.

I am trying to make a square size video of 6:5.

Is your video square or is your video already 6:5?

The size of the screen is 12feet x 10feet

The screen has a 6:5 ratio, so your video will fit.
But if your video is really square, let's say 1000x1000px, you simply need to crop it.

pixels it's 13824x11520p.

No, do not resample any video.
@stib already mentioned it. You would need a very powerful computer to playback that. But there are some other elements.
A screen of 12x10 feet is meant to be watched at a distance. Here is an example. You are in a movie theater. The screen can be bigger in size than 12 feet, and you do not use a humungous resolution because you do not need it, not at all. A 4K image is more than enough. Actually a Full HD image is probably good enough. Not even an IMAX laser projector has the resolution you are talking about.

Any resampling you make will produce... a resampled video. You will not introduce any sharper detail or anything, you will simply turn your video in the exact same video but a heck lot bulkier. The resampling needs to be done in the hardware of the screen. It will probably simply multiply the information to be projected into the different zones of the screen.


text:
Crop a video with a different ratio
I have recorded a 1920x1080 video, it looks like the follows in imovie:

I want to crop the left half side of the screen. But when I click on crop, it always keeps ratio.
In Final Cut Pro, it is the same.
I just cannot understand why it is so difficult to crop a different ratio.
Could anyone help?

In PremierePro, DaVinci Resolve, Final Cut X or any other decent NLE, create a sequence that has the ratio you're looking for, such as 1:1, or 4:3, or whatever you want your final video to have. So it could be 720×720 for a 1:1 ratio, for instance, or 720×1080, etc.
See Aspect Ratio Calculator.
Import your 1920×1080 (16:9 ratio) video file in your project and slide it on your timeline. Your image will be cropped according to the timeline ratio. At this point, start zooming in and out of your image, and/or move the image along the X and/or Y axis to properly frame your 1920x1080 image within the timeline ratio.
Export. You're done.

Try using masks, adding a black rectangle with a transparent zone, or switch to a composting program.
If you are using Premiere you can also use After effects, or you can try Hit Film Express that has a pretty decent compositing mode, and it is free. Also, Davinci Resolve has a compositor.
On why? I can not say.


text:
Breaking the 180 degree shutter rule when stabilising footage
I usually record in 24 fps or 30fps using the 180 degree shutter rule for smooth motion blur.
On a recent trip I was recording hand-held footage of landscapes in high wind, which resulted in quite a lot of camera sway. I found that Resolve did a good job of stabilising the footage, but the resulting clips looked quite soft because of the motion blur left-over from the camera movement.
This left me thinking: if the main source of movement is likely to be camera shake (that will be stabilised in post) rather than motion of the subject, would results be dramatically improved with a faster shutter speed?
Are there accepted best practices on this?

Nice question...

I would invite you to experiment a bit and to answer your question yourself.
But yes, I can think in several cases where you should shot at higher framerate where this motion blur is actually a problem.

The first case is the one you describe. The camera shake will produce blur on directions we do not want.
Another case is time-lapse. You can have objects moving in different directions and different rates. Some programs process the images to produce different artificial blurs, so you could experiment on different shutter speeds-lapse ratios. If you want a cartoonish look you can simply shot at a fast velocity, for example, to give you a stop motion effect.
When you are shooting on a green screen to be composited later. A blur on a green screen is a pain to remove. Shooting at a higher speed will produce sharper edges on moving parts that will be easier to extract.

It is always easier to add blur than to remove it.

In my opinion, the best practices are the ones works for you.


text:
How can I copy-paste audio effect to other audio clips in VideoPad?
I took quite an effort to specify an Amplify audio effect with changing levels (in and out). I have more audio clips there for which I would like this effect too. Is it possible somehow copy-paste the audio effect to those audio clips?
I know it is possible to set the effect for multiple clips at once, but it is too late, the effect is already specified for only one clip now.

Ah, found it!

Click the disquette icon: "Save template" to save the audio effect template.
In the clip(s) you want to copy the effect to, click the green plus icon to load the template.

The effect will be then added to the clip(s) with all its settings.


text:
Include portion of youtube video
How do I add a portion of a youtube video in my project? An answer could be for any video editing software because I am curious about how the answer will differ from software to software.

Do people use screen recording? If they do, will that include sound?
Do they actually download whole youtube videos to disk just to get a quote or something on 2 seconds included in their project?
Do they just input an url and select a start and an end and then have it automatically added to the timeline (being able to drag start and stop timestamps afterwards)?

It depends on the software you're using. NLEs like Premiere and FCP won't take a URL as an input, you'd ahve to download the video. You could use a screen recording if you're happy with the associated quality loss. The licensing issues are another matter.

Do people use screen recording? If they do, will that include sound?

Definitely not in a professional setting. If you're making an amateur production, and you only need a few seconds or so, a screen capture would be fine to cut a bunch of work time. If the vid is only a few minutes long, downloading it is probably just as fast. Many screen capture programs can record system sound, so you're covered there.

Do they actually download whole youtube videos to disk just to get a quote or something on 2 seconds included in their project?

In a professional production, yes, every time. Always work from the closest you can get to the source file, despite file size or download times. That's just a pain of the industry. There's several good tools available, but done of them are spammy and on the ad/malware side of things. Use your best judgement before you install anything. YouTube-DL is good, but it's a CLI, so you might find the learning curve frustrating. Some videos can be download via YouTube settings, but it's an opt-in option, so it's rarely available. I don't have this need pretty much ever, so I'm not up to speed on the best way to rip internet videos.

Do they just input an url and select a start and an end and then have it automatically added to the timeline (being able to drag start and stop timestamps afterwards)?

I don't know any video editing programs that can do this, but I bet there's a few. However, consider what the program had to do behind the scenes. It downloads the videos anyway, so this would only be a slight convenience over downloading yourself.

I'll reiterate the other answer's legal concerns. Every jurisdiction I know has a "fair use" law for exactly things like this. Short quotes to build on your own work is understood virtually everywhere as legal. My rule of thumb has always been 30 seconds or less.


text:
Replace all completely black frames with interpolated frames
Due to a bug with Nvidia Shadowplay, I have a bunch of videos that look like this.  A bunch of random frames have been replaced with pure black frames.
I'd like to fix one of these videos to remove the flickering.  I saw an answer here which suggests the following ffmpeg command:
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less -vsync cfr -c:a copy out.mp4

However, this replaces all the black frames with the most recent non-black frame, which makes the video look like a slideshow.
Is there any way to use a similar ffmpeg command (or any other tool) to use motion interpolation to fix the missing frames?

After poring over the documentation all weekend, I figured out how to use the minterpolate filter to do motion interpolation.  The full command is
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,minterpolate=mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1:me=fss -c:a copy out.mp4

These were the settings that gave me the best-looking results.  If these are too slow for you, you can try something like
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,minterpolate=mi_mode=mci:mc_mode=obmc:me_mode=bilat:vsbmc=0:me=tdls -c:a copy out.mp4

which went about 3x as fast in my testing.  You can find the documentation on the different minterpolate options here.

After removing the black frames, you can insert the framerate filter to fill the gaps with blended frames.
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,framerate=fps=60000/1001 -c:a copy out.mp4

See docs for framerate filter. The filter will produce a CFR stream so vsync is not required.

This appears to fade out the previous frame and fade in the next one (either that or the motion interpolation algorithm is extremely poor).  While it's definitely better than just holding a still frame, the results are still not great.  I'll accept this if no one finds anything better...

The filter performs blending, so no motion interpolation. You can try the minterpolate filter instead of framerate but it will be slow.

Thanks for pointing me to minterpolate! It works better than the 'framerate' filter, except in areas with fast movement or lots of consecutive missing frames.

Not sure about FFMPEG, but it wouldn't hurt to try the free version of DaVinci Resolve.  From page 1351 of the user manual (yes, quite TLDR):

RepairFrame, Tween
The Tween and Repair Frame nodes are different from
standard optical flow nodes because they have the OpticalFlow analysis
and motion vector generation built in. Tween will compare two frames
and create an in-between frame, which is good for recreating a missing
or flawed frame. Repair Frame will look at frames on either side of
the current frame and repair scratches, dust marks, and so on. Because
these nodes work with flow values between non-sequential frames, they
cannot use the optical flow stored in the input image’s
Vector/BackVector channels, but rather must regenerate the flow of
each frame, do their processing, and then destroy the flow channels.
This being the case, these nodes are computationally expensive. For
more information on Tween or Repair Frame see the Nodes Reference
guide.

It seems "RepairFrame" has been renamed to "Remove dust and scratches" in the latest version?  I tried it but it didn't work at all.

Works fine for me.  It's not called dust and scratches.  It's in the fusion tab.  Type shift+spacebar with the node editor active, and start typing "repairframe" or check under the "optical flow" subcategory of "tools" in the Effects Library.  If you don't see it there, it's a paid version only feature, in which case, I apologize for sending you on a wild goose chase.  It's hard to remember which things are and which aren't.  There isn't much that you can't do with  the free version, but every once in a while, you run into something.


text:
Vegas Pro 15.0 Fade In/Out

Hi everyone! Unfortunately, I have no idea how to search for a solution so I will try to explain what my problem is. For some reason, on some video, I cannot add fade in/out, because it is overlapped by another one. Is there any way to fix this instead of leaving a small gap between videos?

Indeed, Vegas sometimes does not allow to fade the clip when there is another one on the same track, and I could not find logic to this. The simplest choice is to move it into a separate track, where fade always works.

Well... You could try to place the clip that you want to fade in/out on top of the other clips. If that does not work, you will have to split all of the clips at the same place and make them all fade in/out. If doing this will ruin the whole project video because you have other effects on it, then I suggest rendering the video without adding any fade in-/outs and then opening a new project and adding the video you made, then making it fade in/out wherever you would like to. I hope this helped!


text:
Can you encode intra-frame videos from inter-frame without loss?
I'm aware of the differences between intra and inter, but I'm not the most savvy about reencoding them after the fact.  Is encoding with intra from an inter-coded video the same as if you originally used intra to begin with?  Or does it need to be kept as intra from the start to preserve complete images?  Maybe I didn't search well enough, but I'm surprised I couldn't find info on this anywhere.

An encoder receives and works upon uncompressed frames and does not know or care about the encoding of the source stream.
To avoid any information loss, you have to set lossless mode. For x264, this is by done by adding -qp 0 to your ffmpeg command. But for most purposes, strict mathematical losslessness is not required. See What's the difference between "visually lossless" and real lossless and what does this mean for future encodes?

I am not referring to lossy encoding. Perhaps I should've specified mathematically lossless video. Intra and inter can both be lossless (although one could argue that inter isn't "pure"). Assuming lossless inter-frame, would reencoding as intra produce the same output as starting with intra?

Yes, as long as the source stream's integrity is intact and the decoder is conformant, the source encoding does not matter.

Thank you, that's what I was curious about. My goal is to use inter lossless for live recording and reencode to intra for intermediate editing afterwards.


text:
Video Quality Measurement test tool
I need to measure streaming video from various different codecs and be able to tell which one is better.
What will be the best metrics to look for?
Is there a free tool that can help with this.

There are a number of comparison algorithms available beginning with PSNR through SSIM/SSIMPLUS to VMAF. VMAF is implemented as an ffmpeg filter.

Thanks Michael, kindly can you please also suggest a free tool that can help in the process. Thank you

@user75464, what do you mean "help in the process?" I'd already suggested ffmpeg as it is able to run the VMAF algorithm. Are you looking to do something else?


text:
How do make a layer visible only when overlapping other layers in After Effects
How do make a layer visible only when overlapping other layers in After Effects.
Below are the layers:

I want the shadow from the bow to only be visible when over the verticle lines.
Below are the layers in the pre-comp:

Above is the semi-transparent stroke as the shadow if the bow and a repeated verticle stoke. I want that shadow layer to only be visible over the verticle lines. How can I achieve this?

You can use a Track Matte. If your vertical lines aren't already precomposed, precompose them. Duplicate the Precomposition in your main composition. Place the shadow layer between the two precomps. Set the shadow layer's TrkMat setting to Alpha. (If you can't see the Track Matte [TrkMat] dropdown press the Toggle Switches/Modes button at the bottom of your screen).

Thank you, it worked and definitely helps to sell the illusion of 3d.


text:
Can't apply "fade in" after "fade out" (FFMPEG command line)
I'm debugging the command
ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=**5**:d=2" ./output-file

But if I try to run a new fadein, after the fadeout, it won't work. The sound doesn't come back.
ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=**5**:d=2,**afade=t=in:ss=**10**:d=2**" ./output-file

What's the right way to achieve this? Thank you.

What a fade out does is fade the volume from input level to 0 and then keep it at 0 for the rest of the track. Similarly, what a fade in does is fade the volume from 0 to input level and it mutes the volume from the start of the track upto the fade in start time.
When you applied the fade in after the fade out, the 2nd fade filter is working with a muted track, so the fade is from 0 to 0.
What you need to do is apply timeline editing to each fade filter so it operates from the start of its transition till the start of the next fade transition.
So,
ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=5:d=2:enable='between(t\,0\,10)',afade=t=in:st=10:d=2:enable='gte(t\,10)'" ./output-file