text:
How do the super resolution filters in FFmpeg work?
I need to incorporate a small amount of 1080p HD shots in a 2160p 4K composition. I'm not impressed by default upscaling techniques like lanczos/bicubic/trilinear; it seems like my television does a better job of upscaling 1080p in real time. It may be time to learn some new tricks.
The FFmpeg manual mention a technique called Super Resolution, and it comes in two forms:

SRCNN: Super-Resolution Convolutional Neural Network model
ESPCN: Efficient Sub-Pixel Convolutional Neural Network model

Usually I can find many online sources for figuring out how to do something with FFmpeg. But I can't seem to find any tutorials on how to use this. I don't really understand it. I need to train (how?) a model (from what?), or get a pre-trained model (where?). I'd like to know how to get from 1080p to 2160p using this technique, assuming I know nothing about it.

I realise this question is pretty old now but it still comes up quite high in search results so I would like to document how I got the "sr" to work (August 2020) in case it can help someone else. Before proceeding it is worth saying that I was not overly impressed by the result. I felt on my test videos that lanczos did an ever so slightly better job. Bear in mind that my test was upscaling from 640x360 flv file to 1920x1080 mp4. I have not tested many other videos and I also have quite a lot to learn about SR like if I feed it different training material will I get a better result.
What you will need

A CUDA enabled GPU with a capability of at least 6.0. I worked all
the way through this once with a GeForce GT710 (capability of 3.5)
only to get to the final ffmpeg upscaling for it to tell me I needed
a capability of 6.0. It did proceed to use the CPU but was very slow.
I then went through it again with a GeForce GTX 1050TI 4GB card and
saw a noticable performance gain.
At least 70GB free disk space. The training scripts download about 42GB worth of videos and 9GB worth of images. The rest is used up generating the model.
Patience. Generating the datasets took a good few hours and training just one model took nearly the whole day.
I had a couple of spare computers (one server and one pc) so I was able to build this from scratch and let it run. First I tried it on Ubuntu Server 20.04 and 18.04. Final run through with the new GPU was on Xubuntu 20.04. The only reason I went with Xubuntu in the end was because I was also investigating a new USB capture device for VHS but the instructions below will work with Server.

Setup
THIS GUIDE IS OFFERED AS IS WITH NO GUARANTEES IT WILL WORK FOR YOU. PLEASE TAKE CARE AND ONLY FOLLOW IF YOU KNOW WHAT YOU ARE DOING.
My starting point is a fresh install of Xubuntu 20.04. I have a GeForce GTX 1050TI GPU that is not my main GPU and there is no monitor connected to it. I do not think it should matter though if it is your main GPU or if there is a monitor connected.
FROM https://www.tensorflow.org/install/gpu
Add NVIDIA package repositories
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.1.243-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1804_10.1.243-1_amd64.deb
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt-get update

Install NVIDIA driver
sudo apt-get install --no-install-recommends nvidia-driver-450

REBOOT, then check that GPUs are visible using the command: nvidia-smi. Do not proceed if you do not see a table output. If you have a message saying there is no device then you need to troubleshoot this stage. For example in my first build the BIOS was set to use the onboard graphics card first and changing it to use the offboard card got it working. I didn't have this problem in the last build on a different PC.
Install development and runtime libraries (~4GB). Here we are installing both CUDA 10.0, 10.1. The training scripts and filter are a couple of years old now and we therefore need to accommodate them.
sudo apt-get install --no-install-recommends \
    cuda-10-0 \
    libcudnn7=7.6.5.32-1+cuda10.0  \
    libcudnn7-dev=7.6.5.32-1+cuda10.0

Install TensorRT. Requires that libcudnn7 is installed above.
sudo apt-get install --no-install-recommends libnvinfer6=6.0.1-1+cuda10.0 \
    libnvinfer-dev=6.0.1-1+cuda10.0 \
    libnvinfer-plugin6=6.0.1-1+cuda10.0

And now the 10.1 versions
sudo apt-get install --no-install-recommends \
    cuda-10-1 \
    libcudnn7=7.6.5.32-1+cuda10.1  \
    libcudnn7-dev=7.6.5.32-1+cuda10.1

sudo apt-get install --no-install-recommends libnvinfer6=6.0.1-1+cuda10.1 \
    libnvinfer-dev=6.0.1-1+cuda10.1 \
    libnvinfer-plugin6=6.0.1-1+cuda10.1

FROM https://www.tensorflow.org/install/pip#system-install
The guide above suggests to install venv here but this was not a concern for me so I left it out. If you are familiar with Python then go ahead and use venv.
sudo apt install python3-dev python3-pip
sudo pip3 install --upgrade tensorflow

Add some libraries temporarily to LD_LIBRARY_PATH. We will make this permanent a little later.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/cuda-10.0/lib64:/usr/local/cuda-10.1/lib64:/usr/local/cuda-10.2/lib64:/usr/local/cuda/extras/CUPTI/lib64

You will notice I am adding cuda 10.2 here as well but we did not install it. For some reason one of the library files (libcublas) when installing 10.1 is taken from 10.2.
We can verify with the below (check for errors). There is a lot of output, mainly information and you want to check that it has seen your GPU and has successfully opened all the libraries.
python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

Add LD_LIBRARY_PATH to ld.so.conf.d
sudo vi /etc/ld.so.conf.d/cuda-additional.conf

Add the lines
/usr/local/cuda/extras/CUPTI/lib64
/usr/local/cuda-10.2/lib64

The other 2 paths are automatically added for us during install.
FROM https://ffmpeg.org/ffmpeg-filters.html#sr-1
Install the TensorFlow for C library. If you follow the link given at the above it shows you Tensorflow version 2.3.0 (or later), however, as mentioned earlier the filter code is old and requires version 1.15.0. So:
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz
sudo tar -C /usr/local -xzf libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz

FROM https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Now we fetch and compile ffmpeg. So install some dependencies first:
sudo apt-get update -qq && sudo apt-get -y install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libgnutls28-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  yasm \
  zlib1g-dev

mkdir -p ~/ffmpeg_sources ~/bin
sudo apt-get install nasm libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev libunistring-dev

cd ~/ffmpeg_sources && \
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
tar xjvf ffmpeg-snapshot.tar.bz2 && \
cd ffmpeg && \
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs="-lpthread -lm" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-gnutls \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-libtensorflow \
  --enable-nonfree && \
PATH="$HOME/bin:$PATH" make && \
make install && \
hash -r

Notice that I have left out libaom and added libtensorflow. This has created new binaries under ~/bin and added it to your profile and path so it can be called from anywhere. If you do not want to replace your existing ffmpeg then be sure to change the bindir and paths as required.
Reload our profile
source ~/.profile

FROM https://github.com/XueweiMeng/sr/tree/sr_dnn_native
So now we are almost at the stage where we can start to generate and train the models, however, the scripts are old so we need to modify them somewhat. Get them first (you can specify any path to download it to or get it manually with GUI:
cd ~
wget https://github.com/XueweiMeng/sr/archive/sr_dnn_native.zip
unzip sr_dnn_native.zip
rm sr_dnn_native.zip
cd sr-sr_dnn_native

Now edit all python files that have "import tensorflow as tf", i.e.
datasets/prepare_dataset.py
datasets/prepare_div2k_dataset.py
evaluate.py
generate_header_and_model.py
models/model_vespcn.py
models/model_espcn.py
models/image_warp.py
models/model_srcnn.py
models/model.py
models/dataset.py
models/model_vsrnet.py
train.py

After the imports in each script add the line:
tf = tf.compat.v1

For example using datasets/prepare_dataset.py:
import os
import argparse
from tqdm import tqdm
import cv2
import numpy as np
import json
import tensorflow as tf
from PIL import Image

tf = tf.compat.v1

class SceneChangeDetector:

There is one other depreciated function we need to take care of and that is imresize.
Edit the file datasets/prepare_dataset.py
Replace line 8: from scipy.misc import imresize
With: from PIL import Image
Replace line 127: frame_lr = imresize(frames[k], (lr_h, lr_w), interp='bicubic')
With: frame_lr = np.array(Image.fromarray(frames[k]).resize(size=(lr_h, lr_w)))
We can finally start generating. Install some dependencies.
sudo pip3 install Pillow tqdm opencv-python

Generate (expect it to take a good few hours and you will likely see a lot of information output and warnings of almost depreciated functions, these are ok):
sh generate_datasets.sh

This will download 11 videos totalling around 43GB and images totalling around 9GB and can take a few hours to run depending on hardware.
And now for the training (expect these to take about a day each). The models after this will be found in the extracted ~/sr-sr_dnn_native folder if that is where you saved the Git zip file to:
SRCNN
sh train_srcnn.sh
python3 generate_header_and_model.py --model=srcnn --ckpt_path=logdir/srcnn_batch_32_lr_1e-3_decay_adam/train

ESPCN
sh train_espcn.sh
python3 generate_header_and_model.py --model=espcn --ckpt_path=logdir/espcn_batch_32_lr_1e-3_decay_adam/train

Once the training is complete you can use the filter. It seems as though ESPCN only upscales by a factor of 2 whereas with SRCNN you can specify 2, 3, or 4. I moved the models generated into the same folder as my videos for ease of use but you can simply point to the models wherever they are.
e.g.
ffmpeg -i <input_video> -vf sr=dnn_backend=tensorflow:scale_factor=3:model=srcnn.pb -q 15 -preset slow <output_video>
ffmpeg -i <input_video> -vf sr=dnn_backend=tensorflow:model=espcn.pb -q 15 -preset slow <output_video>

Here is an interesting video of this in use and was probably one of the only places I have seen anyone use this. In it he suggests it can only work on a single plane but I did not find that to be the case. His results actually appear to be quite good:

This is the ffmpeg command he refers to in the video at 14:44:
ffmpeg -i my_video_540p.mp4 -filter_complex "format=pix_fmts=yuv420p,extractplanes=y+u+v[y][u][v];[y] sr=dnn_backend=tensorflow:scale_factor=2:model=espcn.model [y_scale];[u] scale=960:-2 [u_scale];[v] scale=960:-2 [v_scale];[y_scale][u_scale][v_scale] mergeplanes=0x001020:yuv420p [merged]" -map "[merged]" -c:v libx264 -crf 18 -pix_fmt yuv420p my_video_1080p.mp4

I am happy with your extensive write-up, and I have accepted your answer after reading this. Also I'm a bit sad that you made a lot of effort yet still observe results similar lanczos at best.
Great first contribution! Thank you.

Thank you. I am not giving up on it just yet because looking at "datasets/prepare_dataset.py" from line 166 and also in "train.py" there are many options that we can play with (passed in as parameters) and I believe with the right training I could achieve better results. I'll post back if I manage to get something amazing.

Using a linux box with an old nvidia driver (418), I decided to install to a docker image nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04. This meant skipping everything until libtensorflow installation and installing libtensorflow 1.12.3 rather than 1.15.0 (see https://www.tensorflow.org/install/source#gpu). Additionally, HighVoltageRocknRoll's repo is more up to date than XueweiMeng's, so I used the former, and since libtensorflow was precompiled for higher compute capability (6) than my GPU (5), I compiled it via tensorflow/tools/ci_build/linux/libtensorflow_gpu.sh from the Tensorflow repo.

I really wish this were a container image

@mikebabcock Mikuláš and I have prepared a Docker image, see my answer.

Is there any google colab available?

Thank you for this. Hopefully as the technology matures the results will get better.

Since Google Summer of Code 2018, FFMpeg has supported the sr filter for applying super-resolution methods based on convolutional neural networks. However, as you have discovered, few super-resolution tutorials exist, and compiling FFMpeg with proper libraries and preparing models for super-resolution requires expert knowledge.
To make super-resolution in FFMpeg easier, Mikuláš, Dirk and I have taken the excellent answer of Mark, and we used it to prepare a Docker image with FFMpeg and Libtensorflow. We also wrote a tutorial that explains step-by-step how to use the Docker image for super-resolution in FFMpeg: https://github.com/MIR-MU/ffmpeg-tensorflow#ffmpeg-with-libtensorflow.
After installation, super-resolution in FFMpeg becomes as easy as this:
$ wget https://media.xiph.org/video/derf/y4m/flower_cif.y4m
$ alias ffmpeg-tensorflow='docker run --rm --gpus all -u $(id -u):$(id -g) -v "$PWD":/data -w /data -it miratmu/ffmpeg-tensorflow'
$ ffmpeg-tensorflow -i flower_cif.y4m -filter_complex '
>   [0:v] format=pix_fmts=yuv420p, extractplanes=y+u+v [y][u][v];
>   [y] sr=dnn_backend=tensorflow:scale_factor=2:model=espcn.pb [y_scaled];
>   [u] scale=iw*2:ih*2 [u_scaled];
>   [v] scale=iw*2:ih*2 [v_scaled];
>   [y_scaled][u_scaled][v_scaled] mergeplanes=0x001020:yuv420p [merged]
> ' -map [merged] -sws_flags lanczos \
> -c:v libx264 -crf 17 -preset ultrafast -tune film \
> -c:a copy \
> -y flower_cif_2x.mp4

Compare upscaling using Lanczos (left) with the ESPCN super-resolution model (right):

Although Mark has provided great answer, you don't need to train models from scratch, all Super-Resolution models that ffmpeg supports have pre-trained checkpoints:
https://github.com/XueweiMeng/sr/tree/sr_dnn_native
all you need to do is to convert it to frozen graph (.pb) file and then use it in ffmpeg.

Upvoted. Could you elaborate the "all you need to do" part so that from reading the answer alone, the reader will know what to do?

Sure, no problem.

Download repo with models https://github.com/XueweiMeng/sr/tree/sr_dnn_native
Install all requirements using pip install, for me it was only tensorflow and numpy packages.
Run script to generate model you need: python3 generate_header_and_model.py --model=espcn --ckpt_path=checkpoints/espcn/
2 model files will be generated - espcn.model and espcn.pb (you can check that model works by evaluating .pb model in tensorflow)
Use one of these models in ffmpeg with sr filter (or dnn_processing filter), as stated in documentation.

Note: you might need to install TensorFlow C library and configure ffmpeg if you want to use tensorflow dnn_backend.

@Alex Very interesting! We provide a Docker image with precompiled tensorflow-capable FFMpeg and .pb files in https://github.com/MIR-MU/ffmpeg-tensorflow. However, I haven't found much documentation about these .model and .pb files. Are there sources that you would recommend for reading up on the common formats for storing computational graphs?

@Witiko Well, it's just a specific format for saved models:
https://stackoverflow.com/questions/51278213/what-is-the-use-of-a-pb-file-in-tensorflow-and-how-does-it-work

These guys have ~70 Mb prtrained tflite model , they claim it is optimized to work better with different resolutions. They tiled GAN I guess.
Once I tiled ESR-GAN it doesnt show any difference in speed or quality however it introduces some blurred lines at tiling border. So be careful
https://www.collabora.com/news-and-blog/blog/2020/09/21/open-source-meets-super-resolution-part-1/

If all you need to do is superscale an image, going through the trouble of training neural networks is re-inventing the wheel.  By all means, if you're studying computer science and are interested in AI/ML, I'd encourage you to look into it, but to just superscale an image, you don't need to train a neural network.  There are tools available.
In DaVinci Resolve, for instance, all you need to do is right-click on a clip in the media pool, select "clip attributes...," then at the bottom of the "video" tab, change "Super Scale: None" to 2x, 3x, or 4x.  I'm not sure if this feature is available in the free version, but I wouldn't be surprised if it is, because all they've done is integrated the open source ML bits of FFMPEG for you, trained the models for you, and bundled it as a feature.  I'm sure Adobe has an equivalent feature, though I haven't used it.

I don't mind using a pre-trained model, but I would like to know how to do this using ffmpeg exclusively so I can incorporate it in a pipeline (e.g. kdenlive). No commercial software.

According to this it's not in the free version (which is DaVinci Resolve, as opposed to DaVinci Resolve Studio). Given that, and given DaVince Resolve Studio costs $300 dollars, and especially given what you claim about them basing their SR on FFmpeg (I would definitely be interested in a source for that claim), FFmpeg is currently the best free tool for the purpose out there.

@HashimAziz That’s about R16.  R17 has been out for a while.  I don’t know if superscale is one of the features that got “unlocked” this time around, but BMD always promotes some previously studio-only features to the free version with every update cycle, so there’s no harm in trying it out.  Plus, R18 shouldn’t be too far away.

@JasonConrad R19 is now in beta, and Super Scale remains exclusive to (non-free) Resolve Studio.


text:
Rendering bits from multiple GoPro 7 footage into one file to save space and time without loosing quality
I would like to render bits from multiple GoPro 7 (4k 60fps) footage into one file to save space and time in future (browsing).
So instead of keeping 100 footage files, there would be just one file with compilation of usable clips.
I would like to do this without loosing quality or frame rate.
What are the best settings in Premiere to save the closest possible output to the original?
I understand the resolution and frame rate needs to be set up to match the footage, but what about other settings which could possibly make Premiere manipulate the frames as little as possible?

What you are looking for are lossless codecs. Export with the exact same settings that your footage was recorded in, but use a codec such as Prores4444xq or DNxHD, with no subsampling and 16 bit video-depth.

source: Stack Exchange

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

sort: votes


text:
Leaflets or brochures for MPEG codecs
I'm looking for some official (or semi-official) sources for using MPEG codecs. The official standards specify syntax and semantics for code streams, and do little job teaching the production community anything useful about what they specify.
Does there exist some kind of leaflets or brochures, from the MPEG work group (or a member from the WG), intended for production professionalists, the possibly include explanation for 1) profiles and levels, 2) bitrate and quality correlation, and 3) container format usage.

I take the references from Tektronix seriously in my daily work.
Amazon has a 48-page magazine-sized technical booklet from this company or you could download it from this link
Of course, this company has other references as well
And don't miss out the posters here and here

The primary audience of MPEG video stream standards is developers of encoders, decoders, players, editors..etc so they won't be expected to have material teaching the production community, by which I assume you mean creatives or those working directly with creatives.
profiles and levels
This is specific to each codec, but in general, profile defines the set of encoding methods that an encoder may use e.g. macroblock partitioning, which in turn, defines the capabilities required of the decoder. Their definitions are motivated by various classes of target applications e.g. VoIP, editing, playback on a low-power device but it is upto industry to evolve usage guidelines. See this preface to the Profiles/Levels section within the AVC SPEC (14496-10):

This subclause does not form an integral part of this Recommendation |
  International Standard.  This Recommendation | International Standard
  is designed to be generic in the sense that it serves a wide range of
  applications, bit rates, resolutions, qualities, and services.
  Applications should cover, among other things, digital storage  media,
  television broadcasting and real-time communications.

So, don't expect to find a normative guide from a standards body.
bitrate and quality correlation
There isn't one. An efficient encoder will deliver a better quality for a given bitrate target than an inefficient one. In general, a well-engineered encoder will deliver better quality higher the bitrate, if keeping all syntax elements the same, as well encoder-specific coding algorithms (motion estimation, deblocking loops)..etc.
container format usage
Not the purview of the codec standards body. Containers come and go, and are designed by others. Again, it's upto the industry e.g. H.264/AVC is usually stored without in-band parameter sets in a MP4, but can be stored with them present. It's upto the "application".

part 1 of the answer
Usually, it's the encoder software producer that provides usage guideline documents on codec parameters.
The general idea (workflow) is that:

the standard developers, hardware and software developers, and patent holders gather together to produce a standard, and develop coders (software, hardware, media boxes) that're interoperable with each other.

the media platforms (TV stations, video sharing websites, cinema, etc.) sets requirements and specifications for deliverables, based on their technical capability and financial budget, (sometimes also technical experiments they carry out for signal quality assessment).

the creative people follows the specifications for deliverables and sets the parameters in their encoder accordingly.

the consumers watches your movies.

The OP had an implicit premise that it's the creative people that sets the requirements and the specifications for themselves. This is true majority of the time nowadays, as indie movies are delivered less formally than their commercial and professional counterparts.
This is why coders (FOSS, commercial, and proprietary) provides presets and documents for codec parameters, to save creative people the time that media platforms had already taken to assess and set coding specifications.

part 2 of the answer
The International Telecommunication Union (ITU) has recommendations on profiles, levels, and bitrates of codecs. I found these one year after asking this, downloaded the PDFs, and forgot them until today.
The BT (Broadcasting Service (Television)) has the following recommendation(s):

ITU-R BT.1737 Use of the ITU-T Recommendation H.264 (MPEG-4/AVC) video source-coding method to transport high definition TV programme material

ITU-R BT.1870 Video coding for digital television broadcasting emission

ITR-R BT.2073 Use of the high efficiency video coding (HEVC) standard for UHDTV and HDTV broadcasting

The BS (Broadcasting Service (Sound)) has the following recommendation(s):

ITU-R BS.1196 Audio coding for digital broadcasting

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


text:
After Effects is not seeing CUDA in my GTX 1060 GPU
I've got this weird problem. I have the latest After Effects 2020 and this is how my "GPU Information" window looks like.
As far as I remember, this is not how it should normally be. It must have CUDA details and other options. Why are they missing?
I've spent 3 hours and still got nothing.

I think that's the wrong place. Please go to File -> Project Settings -> and into the first tab: Video and Rendering Effects. There you should find "Mercury GPU Acceleration (CUDA)" as can be seen in the screenshot below.


text:
Stream video using FFmpeg with minimum writes reads to disk
We are streaming a video using a 30 instances of docker containers hosted on Azure each instance running FFmpeg. The problem is that Azure limits the reads/writes that a container can do. Is there a way to modify the command to reduce the reads/writes needed to stream?
ffmpeg -re -i file.mp4 -c copy -f flv rtmps://streamingSite.com/live/x4t

No, that command will read the file only once, and never write anything.

I am not sure what exactly the limitation is; let assume you don't want using disk I/O; how about ramdisk? The link tells you how

Awesome, thanks.


text:
How do I prevent the auto-focus from bouncing on my Galaxy J7 smartphone?
I'm trying to film myself in a dark room with videos. When I start the camera, it records as expected: it checks focus and stops on a nice and crisp view.
However, as I record every second or so, even if nothing changes, it runs the auto-focus feature. That means the video "jumps" (zoom in/out for a little while). It's very visible on the final video.
Is there a way for me to setup the camera so that it doesn't re-auto-focus all the time?
My phone is a Galaxy J7 (SM-J700T).
I've seen many options to change the lighting, colors, etc. but I don't recall seeing anything about auto-focus. I'm hoping I may have missed something so I can use the phone camera without having that bad side effect.

Okay, I found the answer.
After I start recording, I can click for a second or so on the screen where I want the focus to be. The camera is going to make that item appear in focus and then block the focus to that point until I cancel it.
There should be an (AF) button appearing on the side. Clicking that button allows to go back to the auto-focus mode.
Note that there seems to be two modes: one when you do this when you're not recording and one when you are already recording. At this point I have not found the real difference, but the items (buttons) appearing on the screen are different. So I would imagine that there is some kind of a difference between both modes.


text:
Managing compound clips in Davinci Resolve 16
I've made a couple compound clips in my Davinci resolve project. Right now, I need to open that project, manually copy required clips and paste them in a new project. Is there any way to create a catalogue or export these clips, so I could reuse them in new projects?
At the moment I could recreate these clips as simple PNG with transparency, but in the future I'm planning to reuse animated clips.

In Resolve, "Power Bins" are what you use to make elements available across projects.  Unfortunately, as of version 16.3, Resolve won't store Compound Clips, Multicam Clips or Fusion Clips inside a Power Bin.  However, in your case, a workaround is fairly straightforward.
Whether your image is static or animated; an exported still image, file sequence, or video is compatible with power bins.  Export what you need on the Deliver page, Re-import it, add it to the Power Bin, and you should be good to go.
One quick tip for the Export->Re-import step:  After you export anything in Resolve, after Resolve marks the Queue item "Complete," You can right-click on the complete item, and select "Reveal in Media Storage."  Resolve will then open the Media Page, and highlight the file in the browser.  From there, all you need to do is drag it to your Power Bin.
To enable Power Bins, on the Media page, go to the "View" menu, and near the bottom of the list, check "Show Power Bins."  If your media pool and/or media folders sidebar list is not visible, hit command-1 (mac) or control-1 (pc).
You do need to be careful with the way you handle transparency if you expect to use it.  Resolve doesn't "think" for its users the way some apps do.  It doesn't pre-suppose that you "meant" to include an alpha channel because your source sequence contains one, but your chosen export codec doesn't support it.  It won't give you an error, or a warning, or recommend a different codec.  It'll just do what it's told, and then you'll wonder why your backgrounds are black instead of transparent.  So, make sure you're exporting to a format that supports transparency if you need it, like prores4444.  If you're doing that already, and getting black backgrounds anyway, it's because your alpha pipe is broken on the color page; make sure that the last node's alpha output (blue square) is wired to the master alpha output.  If it's not wired to anything, right-click in the background of the node tree, and select "Add alpha output," then wire the blue square to the blue circle that appears.
The same caution applies to premultiplication.  If your antialiased edges appear too bright, or too dark, that's a premultiplication error, and the onus is on the user.  To change how Resolve interprets a clip's alpha math on the import side, right-click on the clip in the media pool, choose "Clip Attributes" and change "Alpha Mode" if necessary.  Note, however, it's possible to accidentally double-multiply, or double-divide on the export side, in which case no menu selection here will produce desired results.  See here and here.
And one final note.  While Resolve doesn't support Fusion CLIPS in Power Bins, it does support Fusion COMPOSITIONS in Power Bins.  So, if you need something more interactive than a flat export down the road, that's the direction you should explore; It's a great way to make titles, and lower-thirds that are re-usable across projects, which maintain a consistent look, yet remain flexible to edit.  Fusion is a complex topic on its own, and I encourage you to experiment with it, and ask specific questions as they arise.
Hope that helps, Good Luck!

Thank you a lot for your reply, I've never seen "Power bins" and I'll try them out tonight! Do you know if there are any plans for supporting Compound Clips and other project files in the future?


text:
Is it possible to remove a border from a Webm video losslessly?
I know that Matroska does have a way to remove the border by editing its metadata, and i also know that Webm is a cheaper version of Matroska. I have tried using MKVtools to edit Webm and it appears to work, but then when i play the file nothing changes.
So does Webm support metadata removal of border from the video? If it does what tool can i use to perform this task?

See here https://www.webmproject.org/docs/container/ under section Track. There you find PixelCropBottom, PixelCropTop, PixelCropLeft and PixelCropRight - all of which are supported. These parameters should do what you want. They also exist for Matroska.
Look for a tool that can manipulate those parameters.

-vf will still reencode the video stream, will it not?

Yes. I'll edit my answer and remove it. I've no other idea what tool to use at the moment.

Thanks. I have checked it, and MKVtools can do that, and i guess i've been doing that.... however, the players simply do not respect that those parameters.

If you use a browser, like Chrome, and open the webm video there, does it work then? Maybe some or many players have not implemented this feature as it is probably not used much.

Yeah, I currently use SeaMonkey, and it works there, but only if i put not only crop values, but also display values.


text:
make a stroke from a path in after effect
I'm moving an object and I would like to make a track that "follow it", I would like to make a path stroke (that I will animate, trimming it) from the path of the object I move

Does this answer your question? How to use After Effects Trim Path with an Illustrator Path

There are many ways to do this - here is one:

Make a null object
Make a mask path on the null layer using the pen
Set a single keyframe on the mask's path
Go to your object (e.g. a star in this example)
Make a single keyframe on its position
Copy your mask path keyframe
Select your position keyframe
Paste, and you should see your object now moves along the path

To make a tail that follows the star:

Add a new shape layer with a single line in it
Make a keyframe on that line's path
Copy the path from your null
Paste it into your new shape layer.
Now you will have a line the same shape as your star's path.
Add a Trim Paths effect to your Line layer
Animate the 'End' control on the Trim Paths effect to get the path you need.

This set of scripts is excellent, and free. http://www.redefinery.com/ae/rd_scripts/
It includes scripts such as "shapes to masks" and "masks to shape".
Highly recommended

Please tell me you are not looking for optical flow

I'm trying to make a trim stroke effect, but this Is not the problem, the problem Is that usually you start from a stroke and you can make something follow this stroke, making a Path from it

But I didnt start from a stroke (a line), I start animating an object moving It, I would like to take his Path and make a stroke (a line)

Then you might check Quaternion Slerp; i use it to interpolate human motion between keyframes represent in bvh

I Will give It a look


text:
Why do DVDs use TS files?
Apologies if this isn't the right community for this question, but I'm wondering why TS files are used for DVDs and not a more widely used format like MP4s or something

Short, overly simplistic answer: because the hardware needed to decode mpeg4 would have been too expensive for consumer set-top players at the time the DVD format was released. Moore's law means that processing power is significantly cheaper than it was in the late 90s.

@stib I don't think this answer fits at all. TS and MP4 are both container formats, not codecs. Processing power should be more or less irrelevant as these formats only define how to structure the data to deal with the video and audio tracks.

MP4 wasn't invented at the time where DVD format was specified. The format M2TS, which is used for Blu-Rays, can be seen as a successor to TS. Therefore it might be more appropriate to ask why do Blu-Rays use M2TS and not MP4?

@Matt That would be a good question, although I have no experience with Blu-Rays so I wouldn't have known that to be the case

@Matt, wrong mp4 is both a container and codec: MPEG-4 part 10 is the video codec, MPEG-4 part 3 is the audio codec, MPEG-14 is the container. But that's beside the point, mp4 in common parlance  ("short, overly simplistic") means h.264/mp4. Although the format hadn't been specified, the theoretical basis for it was well established, it was just impractical to implement in consumer devices at the time.

But mp4 is equals MPEG-14, so since MPEG-14 = container this implies mp4 = container and NOT mp4 = both container and codec. If the general public confuses things or combines mp4 with h264 that's another thing. But yeah, I agree, it was probably just impractical to implement as you say.

DVD-Video does use TS files.

DVD makes use of the Program Stream(PS) container whereas Terrestrial Stream(TS) uses for unpredictable transmission.
PS mostly uses MPEG-2 codec whereas the MP4 uses better video encoding scheme likes 264, 265 or MPEG-4.


text:
Is there a way to export a list of all files used in an Adobe Premiere Pro project?
I have a project which uses a lot of files that are placed on different hard drives. Is there an easy way to get all used files?

Just in case, you want to copy the files afterwards somewhere: You could convert the project to a team project, if not already and use Edit->Team Project...-> Media Management to copy all files to a shared storage.
But for a plain list you best go to File->Export -> Final Cut Pro XML. Make sure you haven't selected any clip in Media browser, because then it'll only export information for that one. With nothing selected, a copy of the whole project file should be converted to the XML file. The benefit: unlike Adobe's own format, this XML is human readable and it contains all file paths. Just search the document for <pathurl> and you find the file path there but with special characters escaped (meaning those are replaced, e.g. the space character is expressed by %20).
One way to get a clean list, is to use a text editor with RegEx (=regular expressions) support. Sometimes usage of regular expressions varies a tiny bit with different tools. The following has been tested with the text editor Sublime for Windows, press Ctrl+H for the replacment dialogue and make sure to click the button with .* as text. In case you use macOS, I am sure there are similar alternatives available or pre-installed.

use ^((?!<pathurl>.*</pathurl>).)*$ and replace it with nothing to get rid of everything but the pathurl parts
replace \s with nothing to remove the tons empty lines.
replace <pathurl>file://localhost/ with nothing
replace </pathurl> with a line break \n.

Finally copy everything into a tool like URL Encode Decode (and press decode URL) to get a list with those %20 and similar escapings removed. You could replace them one by one in text editor, but depending how many different escapings there are, this would be too much work. Oh, and finally replace the / with \ if you use Windows (or \\ in RegEx syntax).
Of course, if you do it more than once, it might help to write a script or a program, that extracts those XML parts. However, this would be well beyond the scope of this question. Alternatively you could look for XML tools, which might make things much more convenient for you, but I'm not aware of a good tool that does this job better than a text editor with RegEx support.


text:
How to cut part of MP4 file using FFmpeg without reencoding?
I have MP4 file. It's duration is 18 minutes 22 seconds. I want to cut part form 7:35 to 14:01 and to save this part as another MP4 file without reencoding. How to do it using FFmpeg?

May you try
ffmpeg -y -i input.mp4 -ss 00:07:35 -to 00:14:01 -c copy output.mp4


text:
After transforming the position of a clip, how can I remove the side lines?

So, I've used transform to change the position of 2 clips (One above the other), but there's this annoying line on the limits of the clip. Is there a way to remove it?

I think it would help if you explained the structure of your project a little more. I had trouble grasping the problem to be honest....

The problem that you won't be able to easily fix is the missing parts of the right hand in the foreground layer. But if you're ok with that there are a couple of ways to do this shot.
First you could key out the white part using a colour key effect. This is going to be problematic, because there are white parts of the image that you want to keep, like the highlights on the dress and her teeth. You'll probably need a combination of keying and rotoscoping (using a garbage matte and animating it to follow the motion of the character, otherwise known as a truckload of work).
The second way would be to feather the edges of the layer. You'll have to sacrifice a bit more of the right hand to do this, but the background plate won't suffer too much (in this frame; YMMV for other frames). In the opacity tab in the effect controls you'll see an elipse, a rectangle and a pen. Click the rectangle to create a rectangular mask.

Drag the tops and the bottoms of the mask well outside the bounds of the clip, then use the widget at the top or the numerical sliders to adjust the feather. In the image below I've turned off the background layer to see what I'm doing.

Do the same for the other plate.

You'll have to fiddle with this until you get a good compromise between cropping too much and making the feather soft enough. It doesn't really work with this random jpeg of a whippet, but it should be ok for your shot if you don't mind the disappearing hand.


text:
In Premiere Pro, is it possible to link the "Create new black video" function to a quick key?
I'm not able to find that specific function when I'm in the keyboard shortcuts menu, leading me to believe it's not possible. I'm hoping someone on here knows more than me about it! I'm on MacOS, if it's relevant. Thanks in advance.
Cheers!

Hotkeys inside premiere are only available if they appear in the shortcut-list. However, you might be able to use an external program such as macro recorder to bind certain actions to a custom button / button-combination.
(i do not own macro-recorder btw and have not tried it for myself. I only heard that it works well with premiere.)

Thank you! Wanted to make sure I wasn't missing anything.

Autohotkey does the same thing and is free BTW.

That's true, good comment.


text:
Resuming a partially-completed encode with FFmpeg
Summary
Given a partially completed encode that:

Was encoded using h264 in the Matroska container
Was cut short by manually stopping FFmpeg by typing 'q' in the console

...what are the ways to resume encoding this file, preferably by appending the extant file?
Details
I have some large encoding projects that I do that can take up to a week of encoding in some cases. In ideal circumstances, the computer doing the encoding can stay on, uninterrupted and left to do the work. In realistic situations though, sometimes that computer needs to stop encoding and be shut off or restarted for a multitude of reasons. Because of this, I'm looking for a way to make encoding using FFmpeg on that computer more "bullet-proof" by anticipating possible interruptions and having a way to use FFmpeg by itself to pick up where it left off later.
What I'm Doing Now
When this happens, I recover what I can of the encoded file, examine it in video editing software, find a good splicing point, then use AviSynth to create a script that will start encoding a new segment where the previous one left off. I then use other software to trim the existing encode so that the splice will be seamless, then use FFmpeg's demuxer to combine the individual h264 segments later into a completed file.
This is all a lot of manual work that can be very slow that I'd like to avoid if there exists a more automated solution.
Ideas
Segmenting: This seems like the most promising solution, but there are gaps I'm not sure how to fill. This answer seems to cover a lot of it. You can tell FFmpeg to output segments, broken up at I-Frames at rough intervals, that can be remuxed later. What I don't know from looking at that answer and at FFmpeg's documentation is how I would start encoding again at a specific segment. It seems like there might be a way to give FFmpeg a file that tells it where each segment should start via frame or timecode, but how do I make it start somewhere in the middle of that list?
This option is not ideal, however, in that I will need to effectively have double the space of the resultant encode (which will frequently be in the 100s of gigabytes in size) available since I will need to mux the segments into a single file. It would be nice if I could somehow cleanly cut off an ongoing encode and have FFmpeg reopen that file and continue where it left off.
Virtual Machines: This has the potential to work since I could just freeze the machine's state before a restart, but all of my encoding space exists on network-attached storage, which I'm not sure will work in the context of a virtual machine being suspended and resumed, since the VM doesn't actually control the drives.

Convert the segmented source files using a batch-file/shell-script which accepts an index as a argument. The index being the segment no. at which encoding should resume. You can get that index by manual inspection of the last encoded output segment, or some folder watch routine.

@Gyan I'm sorry, I don't understand the solution you are describing - could you expand on it? How would this script instruct FFmpeg to continue encoding from where it left off?

I've come up with a "good enough" solution to this problem, as it doesn't appear possible at the time of writing to actually pick up a partial encode that was cut off arbitrarily and accurately concatenate the rest of the video to it.
A Solution Using Segmenting
First, use FFmpeg's segmenting functionality to output segments at some interval for which losing such an interval is an acceptable loss. Also output a .csv file with segment start and end times. An example command that achieves this is:
ffmpeg.exe -i .\source.avi -c:v libx264 -crf 20 -c:a aac -pix_fmt yuv420p -f segment -segment_time 30 -segment_list segments.csv -reset_timestamps 1 seg%03d.mkv

Assume that during the encoding of the fourth segment (seg003.mkv), it becomes necessary to stop the encoder and reset the machine. Sending a q keystroke to FFMpeg during the encoding of a segment stops it arbitrarily at some point and leaves that segment incomplete.
The segment that was interrupted is effectively lost and can be deleted. Opening the segments.csv file reveals
seg000.mkv,0.000000,33.390000
seg001.mkv,33.390000,62.586000
seg002.mkv,62.586000,91.782000
seg003.mkv,91.782000,98.655000

Using this information, we know that seg003.mkv started at 91.782 seconds into the source. In order to pick up where we left off, we use the same command as above to encode segmented output, but also seek (-ss) to the start of our fourth segment, and change the numbering (-segment_start_number):
ffmpeg.exe -ss 91.782000 -i source.avi -c:v libx264 -crf 20 -c:a aac -pix_fmt yuv420p -f segment -segment_time 30 -segment_list segments2.csv -segment_start_number 3 -reset_timestamps 1 seg%03d.mkv

FFmpeg will pick up at the beginning of the fourth segment, and correctly name it seg003.mkv. Notice that the name of the output .csv file has been changed so that the original does not get overwritten. This new .csv file will start at 0.00, so further interruptions will require adding times in this file to the previous file to find a starting point.
Finally, when all segments are ready to be concatenated, we construct an .ffcat file as outlined in the examples on the wiki page:
file seg000.mkv
file seg001.mkv
file seg002.mkv
file seg003.mkv
file seg004.mkv
file seg005.mkv

and run this command:
ffmpeg.exe -f concat -i .\segments.ffcat -c copy output.mkv

This outputs the full, concatenated encode. The option -fflags +genpts is mentioned in the linked answer of the question, and may be necessary to achieve perfect output, but I have not found it to make any difference in my testing.

You could run ffmpeg in a KVM Virtual Machine, which should run nearly as fast native hardware. Then you could pause, snapshot, and resume the VM as necessary.


text:
Why is there so little lighting continuity (consistency) from the close up shot to the wide shot?
In the video from the Joe Rogan Experience #1533, the close up shots of the guests look well lit and perfectly exposed. But the wide shot taken early in the interview around 6:48 looks terrible - the lights are far too bright and the whole shot looks overexposed. What would cause there to be so much difference in the lighting consistency between these two angles?

The lights are positioned to make the single shots look good.  If you point a load of lights at a camera, the image will look overexposed.
Both these shots are, more or less exposed to make the presenters look correct. But lights visible in a camera shot are much brighter than human faces.
It's a compromise in a small room between which shots are the most important (the close-ups) and the wide is a nice to have.  The alternatives would be bigger softer lights, or indirect lighting, but again with limited space (and budget???) options are limited.

Yes changing the lighting is probably the best solution but if that's not possible for them they had other options to make it look better.
The reason it looks bad is also due to how the video is processed and choice of camera and the settings used by the camera.
First of all it you can tell that the video has been digitally darkened because the highlights are grey instead of white. Undoing this makes things look a little better. I think the footage could have been graded better.

Second of all the image is overexposed, whoever did this should have reduced the exposure and then maybe brightened the shadows while editing the footage. Another option is to use a camera with wider dynamic range.
Also on another note I think the wide angle shot looks soft. Looking closer I think the issue was noise reduction or maybe it was because of how much YouTube compresses the videos. If it was a result of noise reduction whoever did this if possible should have opened up the aperture of the lens if possible or brought in more lights or if the light brightness is adjustable increase the light brightness.


text:
Color correct to compensate for low blue
Everytime I create a video,it looks good in a normal screen but considering half of the people have the low blue light effect enabled, I would like to balance somehow the colors of my videos to counter the effect of blue light, since otherwise my videos look orange.

Hi Daniel - a screen shot of the problem would really help here

I am not very certain that I understand your question, but if you want to shift the color-grade of your image away from the orange, you can use the temperature to shift it towards blue, effectively making your image less orange. The temperature setting is available in any popular grading-tool, such as lumetri, resolve or nuke.
Another option might be to actually grade your footage using a monitor that is tuned to the blue-reduced setting. I would like to add though, that you will likely lose some brightness, since most blue-reduction methods simply take away from the value of the blue-channel. So additionally taking away from the orange-channel to compensate will likely darken your image. Also also: People who watch movies on blue-reduced monitors should not be your main focus when grading. Professional studios often grade on 10-bit, calibrated monitors that will look quite different from the average consumer-display. We still grade for the calibrated monitor though, to ensure the best experience on average for most the people who consume the product.

That "also also" bit is key. Color grade, frame for safe area, mix, loudness correct, etc. for your reference environment, check in a likely real world scenario, and adjust for the worst problems. Repeat as necessary. Back in the early days of stereo audio, when mono TVs with small, tinny drivers were still common, audio would be mixed on the studio reference monitors and then checked with the TV in the break room.

I guess if you knew that most of your audience was going to see the video with their screens tinted orange, then the logical thing to do would be to adjust for that. The challenge would be making it look ok for the rest of the audience. Also, the tinny speakers on TVs were fantastic when compared to the tinny speaker on a phone.


text:
Video MP4 file stops and starts
I'm new here, and a pretty new video editor, but I'm having a few problems.
One of my clients sent me some plain mp4 clips of some action video. Both he and I when we watch them remark one thing. The video freezes at a few points, but then starts off where it stopped. I'm running Windows 10 and downloaded the videos from a wetransfer link. I'm supposed to make a video out of them, but in one of the best clips, it freezes for a second and then starts back, which is quite annoying. Just wondering if any of you have had this before, or know of any tools to fix it. I use Final Cut Pro on a computer at my dad's office, so I haven't been able to look at them on an editing program yet; just on my windows laptop on films&TV.
Thanks all so much

Drag the clips into your editing software and go frame by frame. If the freeze doesn't occur, the playback of the video might have lagged behind, causing the freezes. If the freeze still persists when going through it frame by frame, it is likely that something about the clip is broken (perhaps the i, p or b-frames are mangled, assuming the mp4 uses h264 compression.)
If so, try to edit out the section in which it freezes and export the clip as a prores4444, which doesn't overtly compress the clip further, so you can work with the pores-file from that point on.


text:
ffmpeg vf scale shifts colors to washed out
Im trying to scale video down. No matter what I do the colors are always washed up as a result.
original:

After scaling:

Code I run for it
ffmpeg -i input.mkv -vf scale=1028:-1 output.mkv

log: log
Original file codec info

New file codec info

ideally I would want to convert the video to h264 and scale down.
I tried googling for x hours, tried a lot of random attemps, and in the end I tracked it down to scale filter. I have no idea how or why the filter messes up the colors.
I also tried some overkill commands(below) I found on the internet, and it is able to convert to h264 perfectly, but once I try to add scaling to that command it will also produce washed up colors like example above.
Overkill example:
ffmpeg -i "input" -c:v libx265 -preset fast -crf 21 -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,500)" -c:a aac -vf colorspace=bt2020,transfer=smpte2084,scale=1280:-1 "small_output"

Run the command ffmpeg -hide_banner -pix_fmts and check if you have yuv420p10le in the list. If the source video is encoded using a 10-bit colorspace, this may be an issue with your build of FFmpeg being restricted to 8-bit colorspaces. Adding -pix_fmt + before your -vf filters will also reveal if this is the case, or possibly fix the issue. This answer may also shed more light on the issue.

-pix_fmts indeed shows IO... yuv420p10le   3   15. This means the ffmpeg is compiled with 10bit colorspaces in mind, right? Adding -pix_fmt + (or -pix_fmt yuv420p10le or yuv444p10le) produces the same output.
Trough the link you provided I tried to add -profile:v main444-10, and get
Error setting profile main444-10.
Possible profiles: baseline main high high10 high422 high444

But if I understand correctly, shouldnt -pix_fmt + keep the same color/pix format?
Because even with -pix_fmt + the produced file says  "Decoded format: Planar 4:2:0 YUV 10-bit LE", while the original is prim:ITU-R BT.2020, trans:SMPTE ST2084 (PQ), space: ITU-R BT.2020 Range ??

If -pix_fmts returns 10-bit options, then yes, you've got 10-bit FFmpeg. The main444-10 profile is no longer used, the high444 profile includes 10-bit support now. You are correct in that -pix_fmt + maintains the input color format, so that eliminates that variable. The prim/trans/space parameters you see are related to but not the same as color format, but could definitely be the problem. Try using the -colorspace, -color_trc, and -color_primaries flags to set your output to the same values that the input is using. Also try setting the -color_range flag to either pc or tv.

If setting the output color parameters doesn't do anything, consider using the colorspace filter, as described here. You should try adding the filter both before and after the scaling filter. You should be able to convert the colorspace to something like bt709 or the same values as the input and immediately see an improvement if this is indeed the problem. Again, combine this with the -color_range flag (after your -i flag so that it applies to output) in your testing.

Thank you very much!!! Setting -color_trc smpte2084 and -color_primaries bt2020 was enough to do it. If I omit either one, the colors are washed out, albeit differently based on which parameter I leave out. But those two combined made the colors right!
suprisingly, I tried adding more parameters to it and adding -pix_fmt yuv444p10le makes colors much deeper and darker than original, while yuv444p (which is 8 bit) makes output same as input. I would guess using 10 bit pixel format would only help, but here it seems to cause more harm?

Glad to hear it worked! I'm going to convert my comment to an answer per site guidelines. It's hard to say why using the yuv444p10le format could be causing color issues in this case. I can only hazard a guess here, but since -pix_fmt + returns an encoded video with 4:2:0 subsampling, outputting using a color format with 4:4:4 subsampling is technically an upscaling conversion, which might factor into why the colors get messed up when changing between 8-bit and 10-bit formats.

interestingly, using yuv444p produces good results, but using yuv444p10le produces darker colors, exact opposite of the washed up colors I had trouble with originally. Have to say, setting pix_fmt to yuv444p10le I tried before even creating this question, and it didnt help the colors at all, it was still washed up, so I dont think its a cumulative effect.

The video's color transfer characteristics (trc) and color primaries flags are not being set on the output video, which is causing the video player to use incorrect values for playback, resulting in washed out colors. When encoding, use the following FFmpeg flags to resolve this:
-color_trc smpte2084 -color_primaries bt2020

Note that these flags do not actually convert the the source material. These FFmpeg flags merely add flags to the output file that indicate to media players which values to use for these parameters. In this case, the question asker's media player chose incorrect values for these parameters since they were not set on the output video and displayed the video incorrectly.
For actually converting the video's content using specific transfer characteristics or primaries, see this wiki page on FFmpeg's colorspace filter.

I guess the question is then why isn't ffmpeg automatically populating those flags to output media, since input media clearly have them.

@Max Precisely. It's ridiculous that so much work needs to be done just to get FFmpeg to pass through color characteristics from the input.


text:
I used ffmpeg to concatenate to videos and it got stuck and produced a huge file. Where is the mistake?
I have this short videoclips that i recorded either with my webcam or with my phone. The ones that come from my webcam are in Matroska container, and the ones from the phone in mp4. Each piece is between 50 and 150 MB in data size, some 3 or 5 minutes long. I read that the proper way to concatenate in ffmpeg was something of this sort:
ffmpeg -i input1.mp4 -i input2.webm -i input3.mov \
-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0][2:a:0]concat=n=3:v=1:a=1[outv][outa]"
 \-map "[outv]" -map "[outa]" output.mkv

So I took the first two clips, the first one mkv and the second one mp4 and I did:
ffmpeg -i intro.mkv -i part2.mp4 \
-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" \
-map "[outv]" -map "[outa]" output.mp4

and it began to take time... and more time... and more time. After one hour I got worried and I checked the output.mp4 file and it was half a GB in size. Then after another hour it was 1.5 GB.
And the process continued to run, in the terminal indicating huge numbers of framedrops.
I terminated the process and tried to diagnose the output file but couldn't.
What went wrong? What is the proper way to do this?

The concat filter uses the frame rate of the first input as the framerate for the output stream. Some MKV/WebM files don't write valid framerates. That can lead ffmpeg to assign a framerate of 1000 (the inverse of default timebase in Matroska), which can lead to huge frame duplication.
Set a sane output framerate for such scenarios.
ffmpeg -i intro.mkv -i part2.mp4 \ -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" \ -map "[outv]" -map "[outa]" -r 30 output.mp4

Yep,.... that did the trick, thanks!


text:
ffmpeg: Make letters appear one at the time, like a typewriter
How can I show letters one at the time using FFMpeg, I'm talking about something like this:

Thank you.

Use Paint or GIMP to type a letter, save it as img-001.png
do the next letter and img-002.png
ffmpeg -framerate 60 -i img-%03d.png output.mp4
adjust the input frame rate

Typewriter effect on ffmpeg using an .ass file, I generated this gif using the following line:
ffmpeg -f lavfi -i color=size=640x480:rate=30:color=black -vf "subtitles=typewriter.ass" -t 8 ffmpeg_typewriter.gif

I used the Eagisub program to get the parameters used in karaoke !! I created two styles (style1 and style2) both with different fonts, background etc. The shadow colors, background colors were chosen transparent because they appear however transparent, and the time of {\Kn} defines the character display time or time of the word or phrase, just change the n as long as you want !!! Too simple !! follow the file generated on Eagisub that can be easily edited by hand !! That's it thanks !!
    [Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: style1,Ubuntu Mono,100,&H00FFFFFF,&HFF0000FF,&HFF000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,4,10,10,10,1
Style: style2,DejaVu Sans Mono,37,&H00FFFFFF,&HFF0000FF,&HFF000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,4,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:01.10,0:00:12.00,style1,,0,0,0,,{\pos(109,187.5)}{\k25}H{\k25}e{\k25}l{\k25}l{\k10}o{\k15}!{\k15}\NI{\k15}'{\k15}m{\k15} D{\k15}i{\k15}v{\k15}e{\k15}r{\k15}s{\k15}a{\k15}l{\k15}i{\k15}z{\k15}a{\k15}n{\k15}d{\k15}o{\k15}!{\k15}!
Dialogue: 0,0:00:05.50,0:00:09.40,style2,,0,0,0,,{\k15\pos(108,374)}Editing{\k15} a {\k15}.ass {\k15}with {\k15}Aegisub {\k15}to\N {\k15}generate {\k15}the {\k15}typewriter {\k15}effect.

Some info about the ass tags: https://www.nikse.dk/subtitleedit/formats/assa-override-tags
And same code but for creating mp4 :
ffmpeg -f lavfi -i color=c=black:s=640x480:d=8 -vf "subtitles=typewriter.ass" -video_track_timescale 24000 ffmpeg_typewriter.mp4

After improving for my case what Thiago said.
I arrived to this:
First the ffmpeg code
For mp4:
ffmpeg -f lavfi -i color=c=black:s=640x480:d=8 -vf "subtitles=typewriter.ass" -video_track_timescale 24000 output.mp4

ASS file
Then let's create a minimal ASS:
All Tags info are here
[Script Info]
; Comment with ";"
ScriptType: v4.00+

[V4+ Styles]
Format: Name,  Fontname,  Fontsize,  PrimaryColour,  SecondaryColour,  OutlineColour,  BackColour,  Bold,  Italic,  Underline,  StrikeOut,  ScaleX,  ScaleY,  Spacing,  Angle,  BorderStyle,  Outline,  Shadow,  Alignment,  MarginL,  MarginR,  MarginV,  Encoding
Style: style1,  Arial,  30,  &H00FFFFFF, &HFF0000FF, &HFF000000, &H00000000, 0, 0, 0, 0, 100, 100, 0, 0, 1, 0, 0, 7, 20, 20, 20, 1

[Events]
Format: Layer,  Start,  End,  Style,  Name,  MarginL,  MarginR,  MarginV,  Effect,  Text
Dialogue: 0, 0:00:00.5, 0:00:12.00, style1, , 0, 0, 0, , Your text is here

Let's the text only as a typewriter style. I will let you play with the tags for your purpose.
Here is the simpler command I do to create the \k (karaoke) balise for each letter.
I use a random sequence between 10 and 25 centisecondes with an increment of 5 cs for each character.
You can run in in bash (check WSL for Windows)
echo "Let's try to create a type writer text rapidly" | sed 's/./&\n/g' | while read p; do r=$(seq 10 5 25| shuf | head -1); echo {\\k$r}$p; done | tr -d '\n' | sed 's/}{/} {/g'

which will output e.g.: {\k10}L{\k15}e{\k25}t{\k25}'{\k25}s{\k25} {\k15}t{\k10}r{\k10}y{\k25} {\k15}t{\k15}o{\k15} {\k25}c{\k25}r{\k10}e{\k15}a{\k20}t{\k15}e{\k15} {\k10}a{\k25} {\k10}t{\k10}y{\k20}p{\k20}e{\k10} {\k25}w{\k20}r{\k25}i{\k15}t{\k15}e{\k25}r{\k15} {\k15}t{\k15}e{\k15}x{\k10}t{\k15} {\k25}r{\k20}a{\k10}p{\k15}i{\k25}d{\k15}l{\k25}y{\k20}
You just have to put it in your file :)


text:
DaVinci Resolve Python 3.6 not found
I'm trying to run some basic scripts on Linux (Debian), however no python can be found.

Both Python 2 and 3 are present on the system.
$ python -V
Python 2.7.18

$ python3 -V
Python 3.8.5

Based on strace is seems that fuscript binary searches for libpython2.7.so and libpython3.6.so
$ /opt/resolve/libs/Fusion/fuscript -l py3

DaVinci Resolve Script Interpreter
Copyright (C) 2005 - 2020 Blackmagic Design Pty. Ltd.

ERROR: Language 'py3' is not available.

E.g. on Debian based systems this could be installed, if you're lucky and the exact version is available for your distribution.
sudo apt install libpython3.6

The binary looks into several paths one of them is /usr/local/lib/libpython3.6.so. According to documentation this could be configured by PYTHONPATH env variable. However it doesn't seem to have any effect.
Using pyenv any Python version can be installed (we need shared libraries - *.so files):
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.11

then create a symlink:
sudo ln -s $HOME/.pyenv/versions/3.6.11/lib/python3.6 /usr/local/lib/python3.6
sudo ln -s $HOME/.pyenv/versions/3.6.11/lib/libpython3.so /usr/local/lib/libpython3.6.so

Finally console should be working (Resolve will need a restart):
$ /opt/resolve/libs/Fusion/fuscript -l py3 -i

DaVinci Resolve Script Interpreter
Copyright (C) 2005 - 2020 Blackmagic Design Pty. Ltd.

Cannot read termcap database;
using dumb terminal settings.
Py3>

How would this work on a Mac?

It should work the same way, just use brew install pyenv. See pyenv documentation.

Is it possible with PYTHONHOME variable? I have found this post from bmd staff:
https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=141012#p759128

@Tombart how to list the paths in which dr looks for the python3.6?

PYTHONPATH in documentation is said in context of launching the python script located not in expected standard direcrories. So it looks like not ralated to path itself for python3.6.

In macOS: either use the official Python.org installers, or symlink your homebrew installed python3 into /usr/local/bin/python3. See https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=179227


text:
How do I improve sharpness of foliage and distant objects during video recording?
Lately I have tried recording some video using my old Canon. While I achieve decent results during macro shots and while filming human beings, I have noticed that foliage and distant objects in wide shots often lacks sharpness and are quite fuzzy/messy overall. Last couple of days I have filmed outdoors in strong sunlight implying ISO of 100-200, and while I have seemingly tried all possible combinations of shutter/aperture I can't seem to be able to get crisp foliage and distant objects. Here I can note that I have not tried other focal length that 17mm yet, due to the fact that I want the nature shots to be wide. After some testing I can conclude that it does not seem to be a problem of focus. I have not yet been able to conclude is the problem can be related to camera shake - however while placing the camera on a rail or table the results do not seem much better.
My setup is:
Canon 550D
Canon EFS 17-55mm 2.8 IS
Handheld/handheld while placed on natural surfaces
1920x1080 25 fps
AF during shoot: disabled
Movie exposure: manual
Links to sample footage displaying the problem: (Imgur might slaughter the quality a bit, but it should be good enough as example)
Crisp flowers (55mm): https://i.sstatic.net/oB5cz.jpg
Washed-out foliage (17mm): https://i.sstatic.net/cXVJM.jpg
Is it possible to improve the results using my current setup? If not, what parameters should I look for in alternative equipment?
A final note is that I have tried photographing same foliage using same camera and while the result is better than video recording, the results are still somewhat fuzzy in comparison to shots of proximate objects on same focal length.

Welcome! Did you use a tripod for either shot? Have you tried turning off the IS on the lens?

Thank you! I did not use a tripod for either shot, the flowers are completely hand-held, foliage is with camera resting on a rail, but still hand-held. IS was on during both shots, a valid point to try without it.

You are most likely observing Optical Aberration - see https://en.wikipedia.org/wiki/Optical_aberration and also https://en.wikipedia.org/wiki/Defocus_aberration. Haze is also likely a contributing factor, see https://photo.stackexchange.com/questions/93585/are-there-tools-used-to-remove-heat-haze-or-other-atmospheric-conditions-for-lon.
The further back you are from the subject, the more light dispersion / scattering you're going to be getting from the subject. Closing the aperture as much as possible will help (so long as there's enough light remaining for the sensor to get an image), if you test this, you should be able to see visible differences in sharpness between aperture fully open and aperture almost closed.
Haze you can probably do less about, you're basically talking about scattering of light due to imperfections in the air - adding more distance between you and the subject is also adding more imperfection. The stack exchange post above suggests use of different filters to assist, that's not something I've tried. I mostly film theatre productions indoors, and there's a definite image quality difference the closer I can get to the stage. But usually I'm stuck at the back (the show is primarily for an audience, not the video guy), and everyone accepts that shooting an extra 20m to 40m through haze in a theatre is going to result in an image that isn't quite as sharp as what we could get up close.

Thank you for your input, these are definitely interesting points. Due to work I will probably have to wait until the weekend to record some video in good light again. I will get back after testing minimal possible aperture to provide information on if it did the trick. I have already tried a similar test, but might have not pushed far enough, I can try increasing ISO to 400 or 800.

After further testing I was able to improve the quality slightly, mainly though reducing aperture - but was unfortunately unable to get a really crisp image. I feel, however, that smaller aperture does not guarantee improved sharpness. I guess rule of thumb is simply to avoid having aperture wide open or at other first aperture stops.

Reduced aperture will just give you improvement over fully open aperture, it's what will improve your sharpness if moving closer isn't an option. But it's not going to fix the light dispersion as much as moving closer to the subject does, and you'll still be fighting the effects of haze as well. It's helpful info to know why you're getting the image you're getting and how things work (for some shots you might even open the aperture to specifically get that effect), but moving closer if you can is always going to be the correct solution, if possible, if sharp focus is the priority.


text:
How to remove audio translations from the movie?
I want to cut an existing movie and want to remove all the language track from it.
The thing is when I start to edit the movie, Premiere Pro just picks up some language, which is not suitable for me. How do I remove all the soundtracks except the one I need?

I want to cut an existing movie and want to remove all the language track from it.

ffmpeg -i  -c copy -an video_only.mp4

How do I remove all the soundtracks except the one I need?

ffmpeg -i  -c copy -map 0:a:1 specified.mp4
Reference: http://trac.ffmpeg.org/wiki/Map


text:
How to center a clip on Premiere
How can I center my clip on a sequence of Premiere?
Please see the attached screenshot, there's no buttons on "essentials graphics" panel.

To centre the video clip:
Select the clip in your timeline
Click on the Effect Controls tab in the left panel
Open the Motion section by clicking on the triangle, and adjust the position of the clip.
To make it central relative to your sequence, it will need to be half the values of the sequence.
So if your sequence settings are 1920x1080, you would need to choose a position of 960x540
To align the image on top, you can use the same method.


text:
How to clean Lightboard after recording marked with Neon markers
Reaching out to this community as I believe maybe some of the users may using LightBoard for their video recording.
We are using Lightboard for our video production, results seem okey however cleaning is a mess. The provided image is the result after 15 minutes of cleaning efforts of one-time use.
Any help/pointers on the same are appreciated.

Here is a comprehensive answer to your question:
https://revolutionlightboards.com/blogs/lightboard-resources/lightboard-cleaning-guide
Wipe off dry, then use foaming glass cleaner and a squeegee.

Recommended cleaning is to only use glass cleaner, and this should work in a matter of seconds (assuming you have used the correct markers)
You will want a glass cleaner which contains both a solvent and a surfactant. Most big name ones do.


text:
DaVinci Resolve ignores MOV (QuickTime) metadata
When importing MOV files on Linux, DaVinci Resolve seems to use only modification date from filesystem, but completely ignores metadata from movie file:

Using e.g. exiftool we can fetch date information which seems to be ignored:
$ exiftool -time:all -G1 -a -s DSC_0461.MOV
[System]        FileModifyDate                  : 2020:10:17 14:36:06+02:00
[System]        FileAccessDate                  : 2020:10:17 14:36:10+02:00
[System]        FileInodeChangeDate             : 2020:10:17 14:36:06+02:00
[QuickTime]     CreateDate                      : 2018:12:12 22:19:19
[QuickTime]     ModifyDate                      : 2018:12:12 22:19:20
[Track1]        TrackCreateDate                 : 2018:12:12 22:19:20
[Track1]        TrackModifyDate                 : 2018:12:12 22:19:20
[Track1]        MediaCreateDate                 : 2018:12:12 22:19:20
[Track1]        MediaModifyDate                 : 2018:12:12 22:19:20
[Track2]        TrackCreateDate                 : 2018:12:12 22:19:20
[Track2]        TrackModifyDate                 : 2018:12:12 22:19:20
[Track2]        MediaCreateDate                 : 2018:12:12 22:19:20
[Track2]        MediaModifyDate                 : 2018:12:12 22:19:20
[ItemList]      ContentCreateDate               : 2018:12:12 22:19:19
[UserData]      DateTimeOriginal                : 2018:12:12 22:19:19
[XMP-exif]      DateTimeOriginal                : 2018:12:12 22:19:19

Any idea which metadata fields are being recognized by DaVinci Resolve 16?

I wrote a simple LUA script extension that can be executed from Workspace > Scripts toolbar after copying the script to {resolve directory}/Fusion/Scripts/Comp. Here's the source code. Currently the number of EXIF fields is limited, but can be easily extended.
The script tries to match media files from Media Storage with media clips in Project's Media Pool. EXIF data are parsed using exiftool. Currently should work on Linux/Mac OS, but can be easily ported to Windows.


text:
What free video editor is best to stabilize video and fix choppy ones?
I shoot at 30 fps using iPhone 11 Pro and a gimbal (I can't upgrade for now). I still have some stability issues and the video gets a little choppy. So what is the best FOSS video editor to solve this cos there're just toooo many of them - Resolve, Shotcut, Olive, Blender, etc.
I currently use Filmora and I wanna change. So, something not too complicated is appreciated. Thx guys!

Resolve has pretty good stabilisation tools. Blender is more about 3D work and has a steeper learning curve in my opinion. Haven't used the other two.


text:
Video editing/software technique for static shot composed of two or more cropped scenes
I'm trying to create a continuous, static shot video which in theory will contain myself in multiple positions around the set. I want it to be seamless - I figured this wouldn't be hard as I could cordon myself off to a limited space in the separate takes of the video and then somehow crop the video, like you would with an image, and blend the videos into each other with light correction if necessary, or use artificial light.
Problem is that I don't know the name of the technique or how to phrase this for research. I tried looking up 'splicing' and 'cropping' but that refers me to cutting up whole shots and sequencing them. I want one video that will be 3-4 separate videos of the same shot (not moving the camera at all between all 4 takes) cropped/'made transparent' at specific parts to make it seem like I cloned myself, basically. Another way to think about it is perhaps creating a 'green screen' in post production and drawing in a fixed area into the video which will become transparent, and then layering the 2nd shot behind it and repeating the process for the other 2 shots.
Pointers to documentation and advice on free software that can do this sort of thing would be much appreciated :)

Compositing is the broad term for what you want to do. Making part of the shot transparent is called creating a matte.
Not quite sure what you mean about creating a green screen in post production. A green screen is something that you have in the shot that you remove using chroma keying in post, where you make anything that is a particular shade of green (or blue, or any other colour, but most often green for video) transparent.
Free (FOSS) software that does this includes KDEnlive, Natron, Blender and ffmpeg.


text:
Timeline isn't yellow above a section of a Multicam video
Normally when you have a multicam video (or any video for that matter) in your timeline, you'll see a yellow bar across the entire length of the timeline showing that there is something that will be output in the final video.

I just finished editing a project, closed Premiere, then reopened, and I noticed that parts of the video were black screens. These lined up to those that didn't have yellow bars on top:

How do I get the bars back on top?

The yellow bars indicate that there is content that needs to be rendered, but which can be played back in real time. No bar means either that there is no content, or that the content does not need to be rendered. https://theblog.adobe.com/red-yellow-and-green-render-bars/

Looks like this one was a bug in Premiere. First, I noticed that the yellow bar was only missing for one of the clips that was part of the Multicam video. E.g. I noticed there were multiple "holes" in the timeline, but these only happened whenever the multicam sequence was trying to use "Video1".
I went into Multicam edit more by right-clicking the Multicam video in the project editor, and choosing Open in Timeline.
Not sure what fixed it, but I toggled both the Toggle Track Output (eye icon) off then on again, and also Disabled and then Enabled the clip in question. This resolved the issue.

Except that it wasn't actually an issue.

The yellow bar missing was an accurate indicator that there was no video for that segment. Even when I tried exporting the video (not just previewing), it was black during the portions where the yellow bar was missing. -- I think this was a bug/issue because when I looked at the track output, it was enabled, and the eye icon was enabled too. So both options were enabled already, yet the video never played. I had to toggle them both off, then toggle them both on again, and only then was the yellow bar issue resolved, and the resulting video did not have "holes" in it.

Just wanted to say thanks, Senseful! I moved over a project file and the related video/audio files from my weaker laptop to a stronger desktop for final Media-out-rendering, and I had the exact same issue. Multicam project, and one of the cameras was just black holes instead of video in the final rendering (grrr, still 3 days lost to a bad render). I found this question, and what worked for me was disabling and then enabling all the various clips for one particular video track. Then I had the yellow bars again above everything in the multicam track, which were missing before (same as what you describe).
I don't know what "stib" is talking about - it definitely was an issue for me in the exact same way you described. Hope I don't run into this again but at least next time I'll be sure to make sure those yellow bars are there before pressing the export button!

This happened after I applied effects (lumetri color) to one clip of my three cameras in the master timeline, that camera remained in the muticam timeline with yellow over it but wherever cam 2 and 3 were (which had no effects on them) there were holes of no yellow, I fixed this by going the the master timeline clicking on the cam 2 and 3 clips individually and messin with the effects, not really adding any, but moving the temperature and tint bar, for example, as if I was, and then returning it to zero. This restored yellow over all my clips in muticam view, because, it seems, premiere registered me adding effects. Weird.

This worked for me, thank you so much!


text:
Set Matte not masking layers the same
I am trying to use a shape layer with set matte to mask off everything behind the screen, but it does not appear to be working here is a video

Please help

Try pre-comping the shape layer.

the layer you're using as a matte needs to have a fill effect applied.

Not sure about Set Matte, but you could try setting the transfer mode of the shape layer to Silhouette Alpha? That will cut out everything beneath that layer.
(You currently have the transfer modes hidden. Right click on the title bar above your layer names, click to Columns->Modes)


text:
How was this slow motion effect created? what programs can do this?

In the video they seem to be creating new frames inbetween the medium's original frames and then slowing/speeding it up with speed control.
It looks like the equivalent of going every frame and defining a new frame that's a gamma cross between the surrounding 2 frames.
Simply increasing the fps or changing the speed alone can't facilitate this effect. What programs can do the effect as shown, and what's it called specifically? Or do they manually have to take 1 frame, toss it in a vector image editor of some kind and create all those inbetween frames?

Am I missing something? It's animation - all the frames are created, they can do whatever they want with the timing.

I was confused by that, too. But apparently this was fan created from existing content, not original animation.

There are methods to generate frames in between frames, mostly giving you mixed results.
For one, the plugin "twixtor" (~330$) actually does a somewhat decent job at assuming missing frames, so much so, that a 30fps video can be played back at half the speed, making it look like 60fps slow-mo.
On the other hand side, you can sample the frames directly in premiere for example. I wouldn't recommend it however, as the results don't usually live up to the expectations.

I'd just add to this that Twixtor, et al, use what's called "optical flow analysis" to generate the in-between frames, which is available in all the major NLE's today.

I'm curious what other programs are available to do this. In this instance I'd bet twixtor is very program used. I noticed ffmpeg has minterpolate.


text:
"Subtracting" image with clean slate on Premiere Pro/After Effects
I have a camera set up in a room. I take a picture without any foreground as a clean slate. Then, I record a video with a moving foreground while the camera stays in the same position.
Is there any way I could use Adobe Premiere Pro or After Effects to "subtract" the clean slate from the footage so that it would key the background out, leaving only the foreground?

Haven't tried it, but this might work by dragging both shots in after effects, setting the layer with the subject to "difference", which shows the parts that are different. You can then pre-compose both layers, drag in the footage with the subject again, put it on top of the precomp and then add levels to the precomp, dragging the rgb curve up so that the image becomes only fully black and fully white, giving you the luma-mask for the subject. If you now set this precomp as the luma-mask for the shot with the subject, it should subtract only the subject and cut out the background.
Here are some reasons why this shouldn't be an alternative to greenscreens:

You really need to make sure that the camera, as well as the background stays exactly the same for both shots. Any difference will produce bits you need to mask out using a garbage-mask.
Because nearly all cameras compress the captured images, those blocky compression-artifacts will get masked out as well. This might result in messy edges and ugly smudges, especially while moving rapidly.
When for example a hand is in rapid motion, the background will shine through the blurry hand, because the difference will detect it as if its a completely opaque foreground.

Now some reasons for why you should use it under some circumstances:

You won't have to deal with "spill", which is the color of the key-screen (usually green) that gets bounced onto your subject. Cleaning up spill isn't magic, but not having to think about this issue might save you some time.
You don't need to buy and set up a proper greenscreen, which - especially for indie-filmmakers - can be a pain in the rear.

I hope I was able to help :)

Thanks for the response! Damn, that is annoying. So it'll only subtract if the camera is completely still (which I'm afraid won't be possible). There isn't any sort of tracking thing that allows for small camera movements and still a decent key?

You can try to stabilize the footage using the warp stabilizer or a simple 2D tracker that is set to "stabilize". However, the movement in the initial footage will cause some blur and smears during movement, which will most likely show up in the difference comp as well. If you're planning on doing the same thing in the future, make sure to lock the camera down on a tripod (preferably a good, heavy one like the ones from manfrotto), and make sure not to move the camera at all.

Another reason not to do it is noise - all video signals contain noise - if you look closely at a zoomed in image of a video clip, you will see that even areas that appear to be solid colours contain small variations over time, due to many different factors.  So even if two images seem similar, there will be constant small changes, making it harder to subtract the two images.

There's a built-in effect called "Difference Matte" which does what Florian describes.
Another one for the list of reasons not to use it: any foreground areas that are close in colour to the background will be partially (or fully) transparent. E.g. you have someone wearing a white shirt against a white wall—it's not going to work. Skin tones are pretty close to a lot of other colours in common environments, and things like highlights and shadows will also cause problems, because they tend towards white and black, just like the highlights and shadows in the BG plate.
There's a reason why green screen is much more commonly used than difference mattes. A bit more trouble to set up, but a lot better result.


text:
RTMP server using ffmpeg
I'd like to use a Teradek Cube connected to a broadcast camera to push to a server running ffmpeg with an open RTMP port, and have ffmpeg re-stream that feed to a decoder using RTMP or RTSP.
Monaserver does this, but I need to duplicate this functionality using ffmpeg. I would use the Cube as a server, except it could be broadcasting anywhere so opening ports at every location the camera goes to is not an option. Our decoder is a Teradek Slice. Any other suggestions about how to do this would be greatly appreciated.
Thank you!

You can use FFmpeg as an RTMP server as following
ffmpeg -f flv -listen 1 -i rtmp://localhost:1935/live/app -c copy rtsp://YOUR_RTSP_HOST
Notes:

-listen 1 makes FFmpeg act as a RTMP server when used with RTMP protocol
Use rtmp://localhost:1935/live/app as the RTMP server url on the source
You can set any playpath rtmp://localhost:1935/any/thing and any port
The main advantage with this way is simplicity, the disadvantage is server stops if source stopped or had encoding errors
The other option is to use nginx with nginx-rtmp-module

Perfect, thanks a ton. If I'd like to use an application such as VLC to receive the stream from the server, can ffmpeg listen for a connection and output to local port 1935 as well?

Yes, ffmpeg -f flv -listen 1 -i rtmp://localhost:8889/live/app -c copy -f flv -listen 1 rtmp://localhost:1935/live/app, just set different ports for input and output

Thanks again, this is exactly what I need. While testing it I've tried just about every combination of /live/app on the Teradek Cube and various iOS RTMP streaming video apps to test this, and ffmpeg is unresponsive while monaserver works. Is 'app' the key, and does live have to be included in the client's url?

Would elaborate how you set the RTMP urls in Cube, iOS apps and Monaserver? do you open required ports?
You can set any playpath /any/thing

Also FFmpeg Input server starts when it receives stream, and the output starts when it receives a request

On the iOS streaming apps I only entered rtmp://serveraddress (with open ports 1935 and 554) and monaserver connected. In VLC I then just connected to the same address. Some apps required a stream key field, which was live by default. When ffmpeg is listening, no matter what url is entered as an input it's unresponsive.

@Marware, is the double -listen 1 in your second comment correct? The second one is being applied to the output URL, so I think it doesn't make sense to start a listening server... Maybe is it just duplicated by copy&pasting the command?

@Piranna Correct, It should be ffmpeg -f flv -i rtmp://localhost:8889/live/app -c copy -f flv -listen 1 rtmp://localhost:1935/live/app

Can you be able to update your comment with the fixup?

Also, how is that you are applying -listen 1 to the second one instead of the former one?


text:
A program or script to overlay several video clips
I have a few hundred few-second-long video clips (c001.mp4-c999.mp4)
and need to merge them into a clip slideshow.  This is very easy - I drop them into iMovie and click "slideshow", done!
However - I want to fit more clips in less time.  So I was hoping to show 2 clips at once, and stack vertical-video clips side-by-side.
Ideal would be some way to take a script of start times and upper-left positions, and render it to a combined flattened video?  (assuming basics like "no resizing" and "later clips are stacked on top of earlier clips if the earlier clip hasn't finished playing yet")
file:c001.mp4, t:0:05:15, x:500, y:0
file:c002.mp4, t:0:09:25, x:0, y:0
file:c003.mp4, t:0:12:00, x:500, y:0
etc.

Do they all have the same duration?

I could make them have the same duration!  They don't, but ideally, each clip would play to completion, and if another script line tried to play a clip over it, it would cover it.  So it would be my responsibility when building the script to avoid that.

One method is to use concat filters to make a left side and a right side, then stack with hstack filter. Easy to do, but that doesn't address duration differences so each set may not be synced (not sure if that is an issue for you). Another option is to use sendcmd with overlay. More complicated but you can have more control over timings, but you would have to create a command file (almost similar to your example). Do you have a preference?

While having some fun in Python programming language I found a library that allows users to write custom code to overlay (possibly) infinite amount of clips.
MoviePy

Hope this helps!


text:
Vhs capture: 720x576 or less?
On many forum and sites people say that you can capture with resolution of 720x576. But many other replies is too high resolution and is better to capture at 512x384 or similar. Someone know what is the max original resolution of a vhs?

I think you want to capture at 640x480. VHS uses interlaced video, so the recorded content provides half the lines every 1/30th of a second. The effective resolution is horribly low, 352x240.
Have a look at VHS capture DIVX information, which seems to discuss all the issues.
Regardless of the workflow you use, be sure your de-interlacer is high-quality or the output will suffer greatly.

One field (half the scan lines) is transmitted at twice the frame rate, so every 1/60th of a second.

This assumes NTSC; OP may have PAL material.

It depends. My setup is kind of peculiar, but works extremely well.
Regular (decent, but consumer) VHS deck.
SCART2HDMI box. The neat thing about these, is that they usually include a Time Base Corrector (TBC) and thus are much better than the regular USB dongles.
Then, I used a cheap HDMI capture card for about $15 which takes the HDMI. It captures in 1280x720, which on the face of it looks like overkill. However, because it is so cheap, it only capture bad MJPEG format, which is blocky. Downscaled to for instance 720x576 (for PAL VHS) it looks very very good. The blockiness goes away.
Should I capture at 720x576, the MJPEG compression shows as blocks.