text:
Merge Video with aspect ratio in FFMPEG
I am confused how to do this thing with no-crop in android with ffmpeg,

Video details
video 1
size - 700*400(width*height)
duration - 5 second
video 2
size - 400*600(width*height)
duration - 5 second

Output video detail
video size - 700*600 (width*height)
Duration : 10second
I need this type of output please help me how to do this type of output with ffmpeg, graphical design is in bottom picture.
Tell me FFMPEG command .

after @gyan's answer i got this Error
 onFailure: ffmpeg version n4.0-39-gda39990 Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 4.9.x (GCC) 20150123 (prerelease)
      configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-ffprobe --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-libvpx --enable-libass --enable-yasm --enable-pthreads --disable-debug --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --enable-nonfree --pkg-config=pkg-config --pkg-config-flags=--static --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags=
      libavutil      56. 14.100 / 56. 14.100
      libavcodec     58. 18.100 / 58. 18.100
      libavformat    58. 12.100 / 58. 12.100
      libavdevice    58.  3.100 / 58.  3.100
      libavfilter     7. 16.100 /  7. 16.100
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  1.100 /  5.  1.100
      libswresample   3.  1.100 /  3.  1.100
      libpostproc    55.  1.100 / 55.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Download/Received/VID-20190404-WA0010.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 1
        compatible_brands: mp41mp42isom
        creation_time   : 2018-11-24T20:20:48.000000Z
      Duration: 00:00:59.51, start: 0.066667, bitrate: 649 kb/s
        Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 640x640, 646 kb/s, 29.98 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          creation_time   : 2018-11-24T20:20:48.000000Z
          handler_name    : Core Media Video
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Download/Received/Video_20171219203619535_by_vimady.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf55.19.104
      Duration: 00:00:44.54, start: 0.000000, bitrate: 17132 kb/s
        Stream #1:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
        Stream #1:1(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 17001 kb/s, 26.18 fps, 24.83 tbr, 90k tbn, 180k tbc (default)
        Metadata:
          rotate          : 90
          handler_name    : VideoHandler
        Side data:
          displaymatrix: rotation of -90.00 degrees
    Input #2, lavfi, from 'color':
      Duration: N/A, start: 0.000000, bitrate: N/A
        Stream #2:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
    Stream mapping:
      Stream #0:0 (h264) -> scale2ref:ref (graph 0)
      Stream #1:1 (h264) -> scale2ref:ref (graph 0)
      Stream #2:0 (rawvideo) -> scale2ref:default (graph 0)
      setsar (graph 0) -> Stream #0:0 (libx264)
      Stream #1:0 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [swscaler @ 0xb11b0000] deprecated pixel format used, make sure you did set range correctly
    [libx264 @ 0xb543b100] using SAR=1/1
    [libx264 @ 0xb543b100] using cpu capabilities: ARMv6 NEON
    [libx264 @ 0xb543b100] profile High, level 4.0
    [libx264 @ 0xb543b100] 264 - core 152 r2851M ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_ran

https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player

You need to use a canvas which can accommodate all inputs. To adapt this canvas during runtime, we can use the scale2ref filter.
ffmpeg -i video1 -i video2 -f lavfi -i color -filter_complex "[2][0]scale2ref[canvas][vid1];[canvas][1]scale2ref='max(iw,main_w)':'max(ih,main_h)'[canvas][vid2];[canvas]split=2[canvas1][canvas2];[canvas1][vid1]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid1];[canvas2][vid2]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid2];[vid1][vid2]concat=n=2:v=1:a=0,setsar=1" out.mp4
Audio is ignored.

To fit within a fixed size, use
ffmpeg -i video1 -i video2 -f lavfi -i color=s=854x480:r=30 -filter_complex "[0]scale=854x480:force_original_aspect_ratio=decrease[vid1];[1]scale=854x480:force_original_aspect_ratio=decrease[vid2];[2][vid1]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid1];[2][vid2]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid2];[vid1][vid2]concat=n=2:v=1:a=0,setsar=1" out.mp4

thanks for the answer, but after i implement your answer i got error which is i added inside question, please check it

Don't see any error in your logs.

it was gone in failure not completed in my android device

First try with smaller sized videos closer to the sizes mentioned in the Q.

in smaller video it works but not higher resolution video.

Insufficient resources - likely memory allocation failure

thanks , if this doesnt work with it then i have one scenario if output height and width are fixed like 854*480 and videos are merge into that in center then how to do that?

New command added

thank you bro but i have error inside that please check updated question

What's the command you executed?

sorry it was my fault , thank you so much for your precious help . and any refrance for learning ffmpeg from scrach ? give me resources please

second video's sound is gone while this command is running


text:
Shorten Video By Removing Quiet Audio Sections with Video
What tools are available to take a video and remove out the silent sections found with its corresponding video track, where the criteria is that the audio goes below a certain threshold?

I can do this by hand by cropping a video. This is done by visually identifying the silent sections in the video via the audio view which are then subsequently highlighted and cut from the video with an automatic join of the video.
But doing that by hand is time consuming..is there a tool or a feature within Movie Studio Platinum or Camtasia or other software which will remove silent video sections?

In a sense this is speeding up the video by removing quiet pauses (with the associated video portion in that cut timeline) as a the person is not talking.  That is my ultimate goal.

Hello. You write "this is speeding up the video by removing quiet pauses". If you cut the quiet audio parts and the corresponding video footage, you are "speeding it up" simply because you are shortening the length of your clip -- you are cutting out portions of video and audio footage. If you are only cutting out audio portions of your clip, while leaving the video intact, you are not going to "speed up the video". So which is it: are you removing audio and video, or just audio?

To be clear, it is to remove the audio and associated video during that time slice. I will update the post.

source: Stack Exchange

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

sort: votes


text:
How drop still frames with timestamp ffmpeg
I have a ffmpeg command that allows me to drop duplicate frames and speed up the video and works well. I use it with hundreds of video recordings from a surveillance ip camera that does not have motion detection feature.
But, the files still have 1 frame per each second still because the video has a timestamp at the top, so I want to know if I could drop those still frames too somehow.
This is my current command:
ffmpeg -n -threads 2 -i input.mp4 -vf "mpdecimate,setpts=N/(25*TB)" -preset superfast -crf 30.0 -vcodec libx264 -movflags +faststart ouput.mp4

This is a sample screenshot showing the timestamp embedded on the video:

There is some way to achieve this ?

Can you show screenshots of these frames - the two with only the changing timestamp and one before and after those ones?

I've added a screenshot, with the command above the video run fast, about one minute each 3 seconds (since the source video is near realtime and the command catchs up 25fps so I could se the seconds running realy fast when the image is still but there is no "jumps" in seconds or minutes... I want to add those "jumps" on those many minutes when the image is still and there is no motion. Thanks.

I tried to use dvr-scan too (written in python) but I saw that it reencode the video and I dont trust much on that, I prefer to leave to ffmpeg the re-encoding task. It would be great if dvr-scan could export the timestamp in a ready to use format or even if I could use an image as a mask to mark which regions to watch and which to ignore. But to much hassle.

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


text:
Reencode MKV (from DVD - Mpeg2) to h264
I have some old DVD that I already converted using MakeMKV, they seems to have the original mpeg stream, so I want to do this:

Reencode the video stream to the more recommended settings for old-DVD using h264.
Reencode the audio streams (some mkv have 1 or 2 audio tracks) to aac or some other 5channel/stereo more compatible codec.
I already set the default language for audio and subtitles using mkvtoolnix but in my old TV it plays the first track of audio and the first track of subtitles no matter if other was set as default or not (yes, some of it have 2 subtitle tracks too, VLC loads the defaults ones with no problem).
Some videos have some interlaced tipical from the old-DVD's so I want to be able to turn on a deinterlace filter too if it is possible.

How can I do this ? Thanks.
    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.3_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from '/Volumes/Data/Peliculas-Infantiles/pitufos.mkv':
  Metadata:
    encoder         : libmakemkv v1.14.3 (1.3.5/1.4.7) win(x64-release)
    creation_time   : 2019-04-05T17:34:38.000000Z
  Duration: 01:30:34.76, start: 0.000000, bitrate: 6261 kb/s
    Chapter #0:0: start 0.083417, end 378.378000
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 378.378000, end 461.661200
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 461.661200, end 644.477167
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 644.477167, end 922.288033
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 922.288033, end 1061.927533
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 1061.927533, end 1162.194367
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 1162.194367, end 1299.965333
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 1299.965333, end 1393.258533
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 1393.258533, end 1630.829200
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 1630.829200, end 1831.329500
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 1831.329500, end 2143.841700
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 2143.841700, end 2327.692033
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 2327.692033, end 2545.743200
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 2545.743200, end 2748.746000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 2748.746000, end 2863.694167
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 2863.694167, end 3016.680333
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 3016.680333, end 3243.573667
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 3243.573667, end 3538.368167
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 3538.368167, end 3665.828833
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 3665.828833, end 3910.106200
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 3910.106200, end 4237.066167
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 4237.066167, end 4854.850000
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 4854.850000, end 5013.708700
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 5013.708700, end 5434.762667
    Metadata:
      title           : Chapter 24
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 32:27 DAR 16:9], SAR 186:157 DAR 279:157, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
    Metadata:
      BPS-eng         : 5484482
      DURATION-eng    : 01:30:34.762666666
      NUMBER_OF_FRAMES-eng: 130304
      NUMBER_OF_BYTES-eng: 3725857328
      SOURCE_ID-eng   : 0100E0
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-04-05 17:34:38
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(por): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 384000
      DURATION-eng    : 01:30:34.720000000
      NUMBER_OF_FRAMES-eng: 169835
      NUMBER_OF_BYTES-eng: 260866560
      SOURCE_ID-eng   : 0180BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-04-05 17:34:38
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:2(spa): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 384000
      DURATION-eng    : 01:30:34.752000000
      NUMBER_OF_FRAMES-eng: 169836
      NUMBER_OF_BYTES-eng: 260868096
      SOURCE_ID-eng   : 0181BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-04-05 17:34:38
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:3(por): Subtitle: dvd_subtitle, 720x480
    Metadata:
      BPS-eng         : 1772
      DURATION-eng    : 01:27:22.759977777
      NUMBER_OF_FRAMES-eng: 660
      NUMBER_OF_BYTES-eng: 1161324
      SOURCE_ID-eng   : 0120BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-04-05 17:34:38
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:4(spa): Subtitle: dvd_subtitle, 720x480
    Metadata:
      BPS-eng         : 1767
      DURATION-eng    : 01:27:22.759977777
      NUMBER_OF_FRAMES-eng: 660
      NUMBER_OF_BYTES-eng: 1158568
      SOURCE_ID-eng   : 0122BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-04-05 17:34:38
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
At least one output file must be specified

Show info from file and your ffmpeg version. The complete output of ffmpeg -i input.mkv will suffice.

I added the ffmpeg -i input.mkv info

Hi, there is some way to do it ? Thanks.

Try ffmpeg -i input.mkv -map 0 -c copy -c:v libx264 -vf yadif -c:a aac -disposition:a:1 default -disposition:s:1 default output.mkv. If it doesn't work try again with -profile:v main output option.


text:
Square edges after rotating video in DaVinci Resolve?
I rotated one of my clips in Resolve to square up some of the lines (compositionally), then zoomed in so that the top and bottom edges were cropped to straight by the dimensions of the timeline viewer.
However, when I try to crop left and right to square up the sides, the rotated/slanted edge is preserved by the crop. How can I crop the edges square?
The intended picture ratio of the film is 1.33, which is why I'm not zooming to the full frame of the timeline. I suppose if there was a way to adjust the dimensions of the timeline to a 1.33 ratio, that would also be a solution.

I suppose if there was a way to adjust the dimensions of the timeline to a 1.33 ratio, that would also be a solution.

TLDR

Open the project settings
Change the timeline resolution to one with a 1.33 aspect ratio, or enter your own custom resolution in the "for ___ x ___ processing" dialogue.

Explanation
Resolve's resolution independence can be a little confusing when you're coming from other apps.  Normally, in other apps, you set your timeline resolution (aka, "sequence resolution") to match your source footage, and then resize or crop to your desired delivery specification when you export.
In Resolve, you do it the other way around: you set your timeline resolution to be the size of what you want to export in the end.  Then, any amount of scaling or re-sizing automatically uses the highest quality source available, and transformations are concatenated intelligently by the software.
So, in your case, all you need to do is set the desired timeline resolution, rotate the source footage, and increase the zoom value until all of the black borders are gone.  There is no reason to touch the crop controls, because all of the pixels falling outside the dimensions you've chosen don't appear in the final render.  They're "cropped" by not getting exported.
I understand the confusion, because cropping in other tools, like Premiere, Photoshop, and AME amounts to changing the size of your working space (artboard, sequence, timeline, or whatnot).  In Resolve, the "crop" controls in the inspector don't  alter the resolution of the source material OR the export.  The only thing Resolve's crop control does is mask the edges of an image, and the only time you might use it is when you're trying to create a quick picture-in-picture effect.
The reason people coming from Premiere find Resolve's resolution independence confusing is that, for close to twenty years, if you started a project with the wrong sequence settings, it was impossible to change them.  To fix it, you had to copy your entire sequence into a new one with the correct settings, and then re-frame everything accordingly.  Editors learned very quickly to get it right the first time, and crop/scale the export as necessary.
It might take a while to get used to the fact that Resolve presents no barriers to changing your timeline resolution in the middle of a project.  But as you do, you'll appreciate the benefits.  To name a few, you can:

Work on a timeline a fraction of the size of your eventual delivery, and enjoy massive performance boosts, then scale up to 8K and beyond when you're ready to export.
Work on a single timeline and deliver, change the aspect ratio, and deliver for a different social media platform, repeat as necessary.

Additional Notes
Blanking
These days, most platforms are savvy about creating pillarboxes, letterboxes, or scaling your media intelligently, so if you give YouTube a 1.33 video, the player will automatically re-size, and add pillarboxes if it's fullscreen inside a 16:9 display.  But you might wonder (and, your question might actually be asking) how to manually add black bars to the top and bottom, or the sides of the image.  This is called "blanking."
To add it via convenient shortcut, go to the Timeline menu-> Output Blanking, and select your desired aspect ratio from the list.  If your desired aspect ratio isn't in this list, you can dial in any custom one on the Color page-> Sizing tab-> Output sizing dropdown.
Resolve applies these black bars as a final step, so you can be sure that you never accidentally have a title, or any media on top of the blanking.
NTSC
Since you're looking for a 1.33 aspect ratio, you might wonder why none of the preset dimensions in the project settings come out to 1.33 when you divide the width by the height.  The reason is because when televisions were shaped 4:3, the standard broadcast didn't use square pixels.  Even when digital video first became available to consumers, it didn't use square pixels either.  So if you select one of the standard compliant options from Resolve's dropdown menu, like "720x486 NTSC," it will give you a 4:3 image, even though 720/486 ≠ 4/3.  This is because Resolve adheres to the original specification, which doesn't use square pixels.  You can always enter a custom number in the "for ___ x ___ processing" boxes if you want a nonstandard 4:3 image with square pixels, but you'll have to work out the math depending on how high or wide you want the final image.

You can crop the timeline, click on it in the media bin and choose Zi eline settings or something in tht way.

worked! thanks!

Change the timeline resolution to Academy under Project Settings, then under Image Scaling select "full frame with crop"


text:
Burn .ass subtitle onto .webm with no loss of quality
I'm trying to burn .ass subtitles onto a .webm, using  ffmpeg -i input.webm -vf ass=subtitles.ass output.webm  but it shrinks from like 150MB to 9MB.   How do I add the subtitles without losing quality ?

Do you want to mux the subtitles or burn them?

Burn -- based on https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo

Use
ffmpeg -i input.webm -vf ass=subtitles.ass -b:v 0 -crf 20 output.webm

The libvpx encoders for WebM, by default, perform Constrained Quality encoding, and use the bitrate as a ceiling. Default bitrate is 200 kbps. To remove bitrate ceiling, set bitrate to 0. -crf controls the quality level.

Cheers!  Worked perfectly.

@Jon, so why you don't accept this answer? Click on check mark near it.


text:
Lossless way to fix aspect ratio in VOB?
I have some old videos that were converted from a camcorder to DVD years ago.  On one of the DVD's, the aspect ratio is incorrect.  Most DVD players and applications seem to ignore this and play the video correctly, but some applications aren't so forgiving, and I'd like to fix the VOB files.
I'm wondering if there's a way that I can use ffmpeg to correct the aspect ratio in the VOB files, without having to re-encode the video (as I assume that would incur some loss of quality)?
Not knowing anything about ffmpeg, and very little about video editing in general, I naively tried ffmpeg -i VTS_01_1.VOB -c copy -aspect 4:3 test.vob, but the resulting test.vob file still shows an incorrect (i.e. not 4:3) display aspect ratio, at least according to mediainfo.
Here's a mediainfo dump for one of the problem files, note the DAR is 0.094, but it really should be 4:3.
General
Complete name                            : D:\Users\Paul\Videos\Bob's Camera\2006-8\VTS_01_1.VOB
Format                                   : MPEG-PS
File size                                : 99.1 MiB
Duration                                 : 1 min 39 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 8 392 kb/s

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=16
Format settings, picture structure       : Frame
Duration                                 : 1 min 38 s
Bit rate mode                            : Constant
Bit rate                                 : 8 000 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 0.094
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.772
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 94.0 MiB (95%)

Audio
ID                                       : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Muxing mode                              : DVD-Video
Duration                                 : 1 min 39 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 3.02 MiB (3%)
Service kind                             : Complete Main

Here is the output from ffmpeg -i VTS_01_1.VOB -c copy -aspect 4:3 test.vob:
D:\Users\Paul\Videos\Bob's Camera\2006-8>ffmpeg -i VTS_01_1.VOB -c copy -aspect 4:3 test.vob
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpeg, from 'VTS_01_1.VOB':
  Duration: 00:01:39.07, start: 0.113011, bitrate: 8391 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Overriding aspect ratio with stream copy may produce invalid files
[svcd @ 000001394d524040] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, svcd, to 'test.vob':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], q=2-31, 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[svcd @ 000001394d524040] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame= 2967 fps=0.0 q=-1.0 Lsize=  101002kB time=00:01:39.04 bitrate=8354.3kbits/s speed= 101x
video:96673kB audio:3096kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.236023%

And the results of ffmpeg -i test.vob afterwords:
D:\Users\Paul\Videos\Bob's Camera\2006-8>ffmpeg -i test.vob
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpeg, from 'test.vob':
  Duration: 00:01:39.07, start: 0.533367, bitrate: 8351 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
At least one output file must be specified

And finally mediainfo dump from the resulting test.vob, still showing 0.094 DAR:
General
Complete name                            : D:\Users\Paul\Videos\Bob's Camera\2006-8\test.vob
Format                                   : MPEG-PS
File size                                : 98.6 MiB
Duration                                 : 1 min 39 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 8 352 kb/s

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=16
Format settings, picture structure       : Frame
Duration                                 : 1 min 38 s
Bit rate mode                            : Constant
Bit rate                                 : 8 000 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 0.094
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.772
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 93.6 MiB (95%)

Audio
ID                                       : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Muxing mode                              : DVD-Video
Duration                                 : 1 min 39 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 3.02 MiB (3%)
Service kind                             : Complete Main

Share full log for ffmpeg -i VTS_01_1.VOB -c copy -aspect 4:3 TEST.VOB and after the op, ffmpeg -i test.vob

thanks, I've updated above with the requested details

Input already has DAR of 4:3, and so does the output. Ignore mediainfo for now and check with one of these unforgiving applications.

Read my long answer which explains, why is the transcoding inevitable in your case - or at least the ffmpeg command near the end, which you may adjust for your input file.


text:
Long video clip stabilization with ffmpeg and vidstab
I'm learning how to use ffmpeg to stabilize some footage I shot at a conference (my setup had a nasty wobble and I didn't realise how bad it was until I started editing).
After trial and error I finally had great results with ffmpeg with the  vidstab option and I'm about to process some longer clips (over an hour each) and just want to check I'm using the optimal settings (for close to visually lossless quality and speed balance)...
Below are the commands I'm using:
ffmpeg -i filename.MP4 -vf vidstabdetect=stepsize=32:shakiness=7:accuracy=10:result=transform_vectors.trf -f null -

and then:
ffmpeg -i filename.MP4 -vf vidstabtransform=input=transform_vectors.trf:zoom=0:smoothing=10,unsharp=5:5:0.8:3:3:0.4 -c:v libx264 -preset slow -crf 18 -c:a copy Output.MP4

Questions:

Does -preset slow vs -preset medium make much of a difference in quality at -crf18?
What is the fastest codec to output / encode to in this situation? At the moment I'm using h.264 (file sizes are good).

Note: ffmpeg with vidstab is much better than the other options I tried like Deshake, Pr/Ae Warp stabilizer, Blender, ...

I would expect that you can reduce settings for shakiness and qrf but want to increase smoothing. However, without sample footage this is difficult to say. Here is what I'm using.

Just a follow up comment that I ended up leaving it on -preset medium and to stabilize a 1 hour clip on my system took less than an hour which was great, approx. 45mins

Ad 1:
Presets have (almost) no impact to the quality — their purpose is for adjusting the trade-off of encoding time for the output size (the longer encoding time, the smaller the output stream).
Different presets enable / disable separate algorithms for compression. For example, in my installation, the -preset ultrafast is equivalent to options
--no-8x8dct --aq-mode 0 --b-adapt 0
--bframes 0 --no-cabac --no-deblock
--no-mbtree --me dia --no-mixed-refs
--partitions none --rc-lookahead 0 --ref 1
--scenecut 0 --subme 0 --trellis 0
--no-weightb --weightp 0

As you can see, almost no optimization, i. e. the output will be very large.

Ad 2:
H.264, aka MPEG-4 Part 10, aka Advanced Video Coding (AVC) is good enough, and its particular implementation — x264 library — is a very good one.
The pervasive rule is again the same:

Recent video compression standards are able to reach a little better compression than their predecessors, but for longer encoding time (and sometimes for lesser compatibility with media players, too).

So if you don't need cutting-edge compression, every contemporary compression standard is good enough.


text:
Is there a high-pass filter for videos in Adobe Premiere Pro?
What I want to do is putting in high-pass filter effect on each image constituting a video by using Adobe Premiere Pro 13.1.2.
Premiere Pro has a high-pass filter for audios but it does not have a high-pass filter for videos as far as I can see.
Photoshop does.
I also have AfterEffects; the way to use it is welcome as well.
Any idea?
Thanks in advance.

The high pass plugin in Photoshop doesn't exist natively in After Effects or Premiere.  The Find Edges tool approximates the kind of effect you're after, but given that it's for a scientific assessment of something, probably won't work for you:

You could try something like the Unsharp Mask in After Effects or Premiere, and then apply it back to the original image using a Difference mode - gives this kind of effect:

If the high pass is what you need, I would export the video as an image sequence, then Automate a Batch in Photoshop to apply it (probably overnight).

What do you consider a high-pass filter for videos if I may ask?
When talking about audio, the high pass filter operates similar to a low-cut, in that it cuts away the lowest frequencies of the audio spectrum and lets the high frequencies pass.
Are you looking for curves? You can adjust the shadows and the highlights of an image (which wouldn't be called high-pass or something similar tho). You can do that using lumetri color. However, comparing to a high-pass, low-cut, low-pass or high-cut, the curves don't actually cut away the brightest or darkest areas, that way you would blow out the highs and crush the blacks, which would result in a fault, not really a stylistic choice but rather actually breaking the image.
If you tell us what you want to achieve with this filter we might be able to tell you the correct name and where to find it.

Photoshops High Pass Filter selects all edges so you can only apply sharpening to those.

The video I want to apply a high pass filter is one which is generated from a kind of scientific instrument and contains scientific data. Each frame of the video has high-frequency patterns, signals I care about, and low-frequency patterns, the noise. To extract the high-frequency patterns from each frame of the movie, I want to apply a high-pass filter in PremierePro. If it's impossible, I would convert the video into a bunch of still frames and take them to Photoshop and apply the high-pass filter in Photoshop. Then, let Premiere Pro load the images as a sequence and export as a video.


text:
Repair MP4 Video with broken header (but with 2 video and 1 audio stream)
I have a MP4 File which has not been finalized at the end so there is no header. The file contains 3 streams: 2 video streams and 1 audio stream.
I tried several tools to repair the header but the best I get is a video where the 2 video streams alternate after about 2 seconds (2 seconds first video, then 2 seconds second video, 2 seconds first video and so on). I also have a working reference file but the header is still not correctly repaired with those tools.
Here are the tools I tested:

Some freeware like Yodot MOV Repair
Yamb (file could not be loaded)
recover_mp4 / recover_mp4_to_h264 (the two video streams will be
extracted as one video stream)

I don't think it was from a GoPro. It was from a Race Keeper System with one front facing camera and a second one filming the people in the car seats. So there are 2 different streams with HD quality. I don't even need both streams, one of them would be enough if that helps.
Maybe it is still possible with one of that tools but I could not figure it out.
I would really appreciate some help.

Have you recorded the video with a GoPro camera?
If yes, then the two video streams may be a low-res preview video followed by the regular video stream. To repair such file, you would have to filter out the low-res stream.
So far as I know, the new version of the recover_mp4 has an algorithm of filtering out low-res streams of the GoPro cameras. The tool is now called Restore.Media. You can try repairing your MP4 with this tool and watch a full-time preview for free just to see if it works. Also, here is their article about repairing GoPro video files.

I don't think it was from a GoPro. It was from a Race Keeper System with one front facing camera and a second one filming the people in the car seats. So there are 2 different streams with HD quality. I tried restore.media but I still get the alternating video. I don't even need both streams, one of them would be enough if that helps.

Are the two streams the same resolution?

@Gyan yes, both have HD resolution 1920x1080 with 30 FPS


text:
How to output high quality 360 VR video with Premiere Pro?
When editing a 360 video in Adobe Premiere Pro, I noticed that if I import the video into the program and export it again without any additional changes, the resulting file size of the output file is 10 times smaller than the original, and the output file is lower resolution and appears blurry compared to the original. The file has been captured with a Garmin VIRB 360, video duration is 4 minutes, the original file size is 3 GB, and the output file size is 300 MB. I run a Windows 10 machine.
Here are the properties of my sequence: 4736 x 2496, 00:03:56:01, 29.97 fps, 48000 Hz - Stereo, VR Projection: Equirectangular, VR Layout: Monoscopic, VR Captured View: 360° Horizontal by 180° Vertical. I exported the file using the following settings: Format: H.264, Preset: Custom, and ticked the box saying "Use maximum render quality"
How do I export 360 video out of Premiere and still preserve the original 4K quality of the footage?
EDIT:
I found a youtube tutorial for how to preserve video quality on a Mac here, but I'm using Windows, and instead tried the export settings listed here. The settings were: "H.264 format with the Match Source preset. Disable the match source check boxes for dimensions, profile, and level. Change the profile to High and the level to 5.2. Choose Stretch To Fill in the Source Scaling setting (**couldn't find this one, so didn't do it**). Disable the aspect ratio link next to the dimensions and change the dimensions to 4096 by 2304 (or 2160 for 60 fps). Select a high bit rate, such as 100 Mbps. Enable Use Maximum Render Quality to achieve the best scaling results."
Unfortunately, the difference in quality is still substantial.
Here is a frame zoomed in at maximum level for the original file:
And here is approximately the same frame zoomed in at maximum level for the exported file:

Format: h.264 -> that's what makes it look bad.
h.264 is a codec in the mp4 container and always compresses, making the file smaller and look worse. For lossless exporting you use prores 4444 xq if you're using mac (or windows with the newest version of premiere) or DNxHR. I highly recommend prores 4444 xq though.

Thank you for the suggestions! I updated to the newest Premiere version, and tried exporting as Quicktime Apple ProRes 4444, but turns out that .mov files are difficult to play on Windows. I also tried DNxHR, but it seems to convert VR video to regular equirectangular video. Please let me know if you can think of more things to try. Highly appreciated!

prores shouldn't be a problem once you installed the quicktime player (which installs the correct codecs with it). I highly recommend using prores as it is (in my opinion) one of the most robust formats out there. Using Windows, you should have no problem playing a .mov file with the quicktime player.

Just installed Quicktime, but for some reason even it cannot open files encoded using ProRes 4444 XQ - it just gives me a white screen. I tried using regular ProRes 4444, which opens fine, but doesn't allow me to scroll around or zoom in - it looks like a flat equirectangular video that I can't interact with.


text:
Manage video metadata across Final Cut Libraries?
We have a massive 15TiB FCPX Library that takes 20 minutes to open and can only be worked on by one person. How can we edit the metadata, such as descriptions of what's in the clips, and have it sync across Libraries?
We've given up and are looking at using a third party tool such the ones below. But we still want to be able to add metadata from a video we see on on the FCPX timeline.

http://www.keyflowpro.com/
https://videux.com/
Text files with metadata

What meta data you want to edit. There are a lot.

Descriptions of whats in the clips... such as what they are doing, regulations they are following, weather, company affiliation etc

If you have such a large library already, putting more stuff into the files seems not a good idea. When you had set that footage is included into the library you might want to change that. With large amount of footage it’s better to not copy it into the library.

If FCPX is reading the meta data only some can be changed as the meta data come from the video file and not from FCPX. So any library you load the video file into should show the same metadata.
If you change the metadata on the files with a 3rd party it should change in any library you use the file.
Playing with metadata from a file can cause problems and even make it unreadable.


text:
How to turn off ffmpeg dithering?
I am trying to convert a video to an animated gif, and I actually want it to have banding, so I'm trying to turn off dithering.
Here's what I've tried:
ffmpeg -ss 1:24 -t 2 -i *.mkv -filter_complex "[0:v] fps=15,scale=sws_dither=none:w=480:h=-1,split [a][b];[a] palettegen=max_colors=4:stats_mode=single [p];[b][p] paletteuse=new=1" avengers3.gif

Here's what the output from the above looks like:

It seems to me that definitely still has dithering, so how to turn it off?
It said in the docs that sws_dither is the flag to set to "none" to disable dithering - perhaps I'm passing that wrong?

https://ffmpeg.org/ffmpeg-scaler.html tells you the sws_dither is the dither algorithm whereas https://ffmpeg.org/ffmpeg-filters.html#paletteuse tells you to turn the dither off.
The answer to your question is to set
paletteuse=dither=none

BTW, http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html gives you the result of the paletteuse settings.

Thank you, that solved it. For future note, I needed to change paletteuse=new=1 to paletteuse=new=1:dither=none

Thanks for this; annoyingly the paletteuse docs don't list none as an option (confirmed they didn't on Nov 17 2020, either, just as a sanity check). ♂ It works though (in 4.3.2 at least).

https://trac.ffmpeg.org/ticket/9950 re: documentation

It's been added to the docs as of today, according to the ticket.


text:
Merge two videos in ffmpeg with audio from one
How can I merge two videos v1 and v2, but the audio coming from v2?
Say v1 is 1 second, and v2 is 2 second. Basically I want to merge v1 and half of v2, but the whole audio be from v2.
Please make it general about the timing.

Probably the most simple solution is to use this command:
ffmpeg -i v1.avi -i v2.avi \
    -lavfi [1:v]trim=0.5:1.5,setpts=PTS-STARTPTS[part1];[0:v][part1]concat[video] \
    -map [video] -map 1:a output.avi

Notes:

This command is sufficient only in an ideal case, when there are not needed another filters for conversions of incompatible video streams (e. g. because of different frame sizes).
It is appropriate to use option -c:1:a copy (somewhere between specifying input files and -map options) to avoid transcoding the audio (of the second input file).
Tested with files v1.avi, v2.avi synthetically created with the command
ffmpeg -f lavfi -i testsrc2=d=1  -f lavfi -i anoisesrc=d=1 -f lavfi -i testsrc=d=2 -f lavfi -i sine=d=2 -map 0:0 -map 1 v1.avi -map 2 -map 3 v2.avi

The detailed explanation:
ffmpeg -i v1.avi -i v2.avi

Input files are introduced with -i options, and are enumerated from 0, so

v1.avi has the number 0,
v2.avi has the number 1.

After the semicolon (:) may be the stream specifier - supposing that you have only one video and one audio streams in your input files, you may simply use v for the video stream, and a for the audio stream. We will use them later — see the picture near the end.
-lavfi

introduces a complex filtergraph. You may use the synonym -filter_complex instead.
[1:v]trim=0.5:1.5,setpts=PTS-STARTPTS[part1];

This is the first linear chain of filters (i.e. the part up to the semicolon) of the filtergraph.
It consists of 2 filters: trim (up to the comma), and setpts (after it).

trim=0.5:1.5 gives only half of the video (particularly, from 0.5 s to 1.5 s).
setpts=PTS-STARTPTS set timestamps of the trimmed part from 0 s (to 1 s).

Note the input pad [1:v] — it is the only video stream (v) from the input file 1 (which is the second input file — v2.avi, because input files are numbered from 0).
Note the output pad, for which I chose the label [part1].

[0:v][part1]concat[video]

This is the second linear chain of filters (after the semicolon) of the filtergraph. It consists of only 1 filter: concat.
concat - the original stream 0:v and the intermediate stream [part1] are concatenated.
I chose the label [video] for this other intermediate result.

-map [video] -map 1:a output.avi

The -map options map selected streams from the input files and / or output pads from the complex filter into the output file output.avi in the specified order:

the output pad [video] from the complex filter maps to the output stream 0,
the audio stream (a) from the input file v2.avi (numbered as 1) maps to the output stream 1.

In more complicated cases with more video or audio streams, e. g. if the second input file contains 2 video and 3 audio streams:

You need specify individual streams with their ordinal numbers - they are again numbered from 0.
For example -map 1:a:2 will select and map the third audio stream (numbered as 2) from your second input file (numbered as 1) into the output file.
As you can see from the picture, you may use -map 1:4 instead.

Looks like it will be working. I will check it later.


text:
Container format requires global headers
Using this FFmpeg:
ffmpeg-20160127-git-9079e99

With this file, if I run this command:
ffmpeg -i Miaow-02-Hidden.m4a -c copy outfile.m4a

I get this message:
[ipod @ 0000000000694500] Codec for stream 0 does not use global headers but
container format requires global headers

How can I resolve this warning?

This issue was fixed with commit 955b818:
commit 955b818cf947473ec94a3fe8aa7f408b119fbbc9
Author: Clément Bœsch <clement@stupeflix.com>
Date:   Thu Sep 1 16:48:45 2016 +0200

    ffmpeg: switch to codecpar

You can suppress the warning on older version like so:

ffmpeg -i Miaow-02-Hidden.m4a -c copy -flags global_header outfile.m4a

Example

You should prefix a + before global_header so that any flags set internally aren't overridden.

Are you saying that this is just a warning and can be ignored?

Does the same requirement apply to formats such as HLS and DASH, ie can one get away without using -flags +global_header?

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


text:
How to turn off LCD on camcorder while external microphone is connected?
I'd like to turn off the LCD on my camcorder during recording, to save battery.
However, I cannot close the LCD screen because I have plugged in an external microphone and the external microphone plug is under the LCD (see picture).
I'm using a Canon Vixia HF R42.

It's not possible to turn off the LCD panel when it is open, but you may do two things with it to save your battery:

reduce the LCD brightness to the its lowest limit, and
set the LCD Backlight to [L Dim]

Both commands are available from the Home Menu -> Other Settings -> Display Setup.


text:
how to create a line by line effect
vid showing what i want to do:

if i have this image: https://i.redd.it/259hhktl49431.png
how would i do what the youtube video is doing with selected lines in that image?
im using hitfilm express 12 and i also have davinci resolve 15. im really new to editing and the closest thing ive done to try to copy the effect is create a mask around a certain line and then create a new mask that shows 2 lines, then 3 lines, etc

image link is broken.

There's different ways of accomplishing this. The easiest method I'd use is to build the entire dialogue in Illustrator or Photoshop, then Import the psd or ai into after-effects and reveal portions of the text using an animated mask.

Your image link is broken, so it's hard to guess why you'd need to use an image.  If you're trying to time text on screen, you could try Resolve's captioning tools, which provide basic controls over appearance.
But if you absolutely need to use an image as your source, you can stack the image layer above your video on the timeline, then mask it however you need to using power windows in the color page.  In order for the masking to take effect though, be sure to wire your last node to an alpha output.  Do this by right-clicking anywhere in the background of the node editor and selecting "add alpha output." Then drag a noodle from the last blue square in the node tree to the new blue circle.  Any power window's you've created (as long as their alphas are piped correctly) will now punch through and act as a mask to punch through your image.  Keyframing is possible, though rudimentary, IMHO.
There are also titling tools built into Resolve, which provide more control over appearance than the captioning tools.  These won't help you mask an image, however.
And last but not least, if you need complete control, there's Fusion.  I would recommend the forum https://www.steakunderwater.com/wesuckless/index.php for help on this topic.  There are a few discussions over there about driving this type of action automatically, with external .txt or .csv files, though you could certainly "hardwire" it more easily.


text:
FFMPEG: Choosing the right win_func for showfreqs
I'm using showfreqs and various other audio viz filters to create cool spectrum visualizations for my self-released music.
Going through the documentation, I see that there's a multitude of win_funcs you can use with showfreqs (and others):
https://ffmpeg.org/ffmpeg-filters.html#showfreqs
I tried reading about these different windowing functions on wikipedia:
https://en.wikipedia.org/wiki/Window_function
While I understand generally that you choose a windowing function based on how you want to handle spectral leakage,  I can't really understand the math that's involved here... it's over my head.
So... my question really boils down to:
What's the right windowing function to use for visualizing music? Is there a best practice here?
hanning (the default) seems to work ok... I tried a few others but I'm having trouble actually observing what the differences are between them...

You be better off not care about window functions, no one pays attention to the rendered audio spectrum. Therefore you need not to be analytically correct so you can let spectral leakages happen and just use the rect window. Which is the identity window, simply put, FFmpeg doesn't do any windowing in this mode and performs plain STFT on the audio waveform slicing each in win_size sized blocks.


text:
How can I make an exact 60FPS GIF?
I'm trying to create a 60FPS GIF. However if I use Photoshop the frame time is not correctly even when choosing 0 delay between each frame.
I was trying to make an emote.
The project is from After Effects.
I've tried various tools, here is my only problem:
https://i.sstatic.net/NmjKK.jpg
The background color I used is #36393F
for some reason though, it has some weird grid around it, so it isn't the clean background which I need it to be. And yeah not sure how to make 60FPS GIFs now. I can not use WebP, it is not supported, that's why I need a background behind it.

I've tried various tools, XMedia Recorder, doesn't have GIF export at all.
GIFGun, the one with the grid issue. I've tried it in another project with any moveable object, the same issue.
ezgif, well that one could work if it had 60FPS.

Here is the .AVI file if anybody wants to try out something: https://workupload.com/file/4Fbdyt5g
The reason why I need it exactly to be 60fps, is because otherwise it doesn't match the length.

Answered at https://superuser.com/q/1449366

Indeed, I can make 50FPS GIF's with ffmpeg

The gif format doesn’t work like this. You won’t be able to get an animation with this high a frame rate.
The good news is that many sites which claim to use GIFs actually use mp4 files. I don’t know your exact workflow, but you could  try making an mp4 at this frame rate and uploading it to one of the “GIF” sites.

There is no such thing as 60fps GIFs.
GIF files store delay time between frames in whole hundredths of second, so it's impossible to make a GIF with exactly 60fps, because value 1 would give you 100fps and 2 would already have half of that - 50fps. Besides that, many programs (including Google Chrome) ignore value 1 and defaults to much slower animation speed when viewing such files, so 100fps GIFs, while technically possible according to file format, are not commonly used and probably a bad idea, so value 2 (50fps) is the most you can get.


text:
Adobe Premiere Hide Clip Keyframes or remove the Adjustment line?
How can you remove this particular line here? Apperantly when you right click on a clip you can see clip keyframes and select something like time rewrapping, however you can not unselect it, but apperantly you can hide it, I just don't know how.
Does anybody know or is this normal and default not sure.

At the timeline there is a wrench icon and here it shows the option to hide the video keyframes.

To do that, click the icon indicated by the arrow in the following image and select “Hide Keyframes” form the menu that pops up.
The icon is under the camera icon on your timeline.

Where? Do you have an image please? You got that from here? https://www.pointsinfocus.com/learning/quickref/ I don't see that icon at all.


text:
ffmpeg add a intro photo before video
I currently have a line that makes my video have a watermark in the bottom right corner.
ffmpeg -i video.mp4 -vf drawtext=text=WATERMARKTEXT:x=w-tw-10:y=h-th-10:fontfile=\\Windows\\Fonts\\Montserrat-Regular.ttf:fontsize=32:fontcolor=white -vcodec libx264 -crf 20 -acodec copy output.mp4;

What I want to do is add an image file .png or .jpg doesn't really matter and display that before the video starts for 5 seconds.
Is this possible all I could find and understand did something with combining the video and the image but if I do like that I will have to encode it with watermark first then combind it with the other one.

Use the concat filter to join the image to the video:
ffmpeg -framerate 25 -loop 1 -t 5 -i image.png -t 5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i video.mp4 -filter_complex "[2:v]drawtext=text='foo'[main];[0][1][main][2:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4

The image should be the same width and height of the video, so you may have to add the scale, scale2ref, crop, and/or pad filters before concatenation.
If the main video has audio then the image needs have audio as well. Generating silent audio with anullsrc as shown in the example can suffice. Make sure to match the channel layout and sample rate of the main input.


text:
How to merge 4 Audio and 1 Video .MXF files in to one h.264 video file on Linux using ffmpeg?
On a recent video shoot, the camera man gave us output as .MXF files. Incidentally, Audio and Video are saved in separate .mxf files.

eg:
0007WA00.MXF - Audio  (probe)
0007WA01.MXF - Audio  (probe)
0007WA02.MXF - Audio  (probe)
0007WA03.MXF - Audio  (probe)
0007WA.MXF - Video  (probe)
I am trying to figure out how to merge these in to a single video file. So far I couldn't find a way out.
[Edit: 20 Jun 2019]
I managed to get audio and video stitched. However, audio is mono. Want a little clarity on whether I can have stereo or surround by utilizing the 4 audio files.
Command that worked:
ffmpeg -i 0007WA.MXF -i 0007WA00.MXF -i 0007WA01.MXF -i 0007WA02.MXF -i 0007WA03.MXF -c:v libx264 -c:a aac -strict experimental ../ffmpeg-stitch-mxf.mp4

Let me add that I am not an expert at this. Perhaps some may find my questions naive.

What command did you try?

ffmpeg -i 0007WA.MXF -i 0007WA00.MXF -i 0007WA01.MXF -i 0007WA02.MXF -i 0007WA03.MXF -c:v copy -c:a aac -strict experimental ../ffmpeg-stitch-mxf.mxf

that didn't work. However, gonna re-try with video codec too. Let's see if that works!

added an edit to the question.

Do you want to open the merged file in a professional video editor?

So the audio is 4 channels and they are supposed to play over the 1 video stream?  Seems that way, since they are all the same length, but just want to be clear. Gyan asks an important question: What do you want to do with the resultant file (e.g. post to YT, open in a editor for further processing, etc.)?

A follow up on the audio channels: Are all of them actually used? I find that most times, only 1 or 2 channels are used. Can you verify that all files have content that you want?

You probably need to look into the -map flag to get what you want. See this related question: ffmpeg - mapping an audio file with 2 channels to a video file?

Q: So the audio is 4 channels and they are supposed to play over the 1 video stream >> A: Yes |  Q: Gyan asks an important question: What do you want to do with the resultant file >> A: Eventually to Web. But, a video editor will process it before uploading. Processing = adding watermark, text, cut-n-merge etc.

Addon-Q: Why look at ffmpeg when there is a video editor? >> A: Video editor wants a format he/she can work with. The Panasonic camera for some reason recorded in MXF and with audio separate from video (courtesy camera man). Me, a Linux user is exploring solution to the given problem.

Suggestion: You probably need to look into the -map flag to get what you want. >> Reply:  That is what I did eventually. I wanted to post that as an answer, but I waited to see if some one gives a better solution. I used only two audio files in the merge. |  I think I should post that as an answer and let community enhance it, if there is scope.

Use ffmpeg -i 0007WA.MXF -i 0007WA00.MXF -i 0007WA01.MXF -i 0007WA02.MXF -i 0007WA03.MXF -map 0 -map 1 -map 2 -map 3 -map 4 -c copy merged.mov to generate a file for the editor.

I used ffmpeg with only '-i' switch to figure out which stream was audio and which was video. Then executed the following to merge two audio channels and its video.
ffmpeg -i 0007WA.MXF -i 0007WA00.MXF -i 0007WA01.MXF -filter_complex "[1:0] [2:0] amerge" -c:v libx264 -c:a aac -strict experimental -qscale 0 -y  ../ffmpeg-att2.mp4

I think there can be more options by utilizing all four audio files to make stereo or surround. However, I stopped here as the output was acceptable. Note - used '-qscale 0'  to limit quality-loss.


text:
How to put a hole in a wall (VFX)
This is a really basic VFX question. I just downloaded Blackmagic DaVinci Resolve (with fusion) and I was interested in trying out VFX. I thought it would be a cool idea to try to put a hole in the wall of my house in a moving handheld shot. I just don't really have any idea how.
I'm not asking for specific buttons to press in the software, I just want to know a general order of events to achieve that goal. (Like what tracking to use, and how to display the whole in the wall in a spatially accurate way, etc...) It's a pretty basic project, I just need somewhere to start off. Thanks!

I wouldn't call it a basic project. Making the geometry of the room behind the hole work with the camera movement is going to either involve creating it in a 3D animation package and rendering realistically, or using motion control to match the movement of the foreground. It would be easier to add a wall with a hole where no wall exists.

Yeah, this is an involved effect. It's basically animation, a specialized video production skill.

Resolve has a pretty solid tracking system built-in. I would recommend you track your footage first and make sure your trackers really stick to the wall. From there, you can go many ways.
The cheap and easy way is to just take a hole.png and attach it to the trackers, so it sticks to the wall. This might look bad though when moving around the wall, since the geometry of the .png will not change.
The more advanced option would be to export the tracked data (I would recommend pftrack for that) and importing the tracked camera into any 3d-software you like (such as cinema 4d, modo, 3dsmax, etc). There, you can create a 3D-Model of said hole by grabbing the texture from the original footage on the edges and then just blend into concrete/brick-textures you can find online for the parts that penetrate the wall. By now beveling inwards and shaping the mesh a bit, you should quickly come to a promising result.
For the next step, it is very important that you study the light from your scene and try to recreate it in 3D as accurately as possible. Lighting, the angle and color of it makes or brakes your 3D-composition.
When you're done with that, you can render out a sequence as long as your original clip from the perspective of your tracked camera. To get ultra-accurate results, you can also match the focal length and distance as well.
If you now take your rendered 3D-hole and lay it on top of your original footage (plus some blending and color grading to make it sit right in the footage) it should stick perfectly to your wall.
Hope I was able to help, if you have further questions please ask. Have a wonderful day :)

But how will the background change?

Only now I realize you intended that one could look through that hole. This would be quite a complicated thing to do, since you would have to build the entire room in 3D and that alone is a hefty task. But if you do, it's the same method for the whole: Place the room at its accurate position and let the tracked camera fly around it. Export this sequence and layer it with a mask on top of your footage. Like I said though, easier said than done.


text:
Major issue importing and exporting mp4 with AE and Media Encoder
This is what my footage is looking like after importing into a composition:

Here's what I've learned so far:
Any mp4 file looks like this when imported. h264 or 265. I'm trying to get screen recorder footage to work, but both Android and Win10 sources are having the same issue. Mostly tried importing 4k, but having the same issues with 1080p. Portrait or Landscape makes no difference.
Now, when previewing the footage file in windows or android, all is looking fine.
In AE, when right-clicking on the video object in preview and setting quality to "draft", it temporarily looks okay, but the issue remains when exporting.
Changing any of the settings in " Interpret Footage > Main " doesn't do the trick.
Importing and exporting in Media Encoder creates the same issue, so I can't go with re-encoding to another file type and then trying again in AE.
Adobe software is all up-to-date via Creative Cloud.
Both video cards' drivers are as up-to-date as they can be: Internal Intel driver is kinda old from last year, but as good as it can be with my Lenovo product. Geforce 940MX driver is up-to-date.
I've tried disabling the Intel card and running exclusively off the GeForce (and visa versa). AE actually crashes when running only on GeForce.
Phew!  : )
I'd love and appreciate some guidance if anyone feels they may know the source of the issue.
Thanks,
Brendan

Hmm very strange, never seen this before. Here are some things I would try to figure out what is causing the issue:

Try re-encoding the file with ffmpeg into both the same container (mp4) as well as other containers such as .mov, .mkv, .wmv, etc. Maybe there's a problem with the codecs for Adobe on your machine.
Which version of AE and Media-Encoder are you using? (is it a legal copy?)
Have you tried uninstalling all codecs such as quicktime, etc. and reinstalling them?
Have you tried uninstalling the Adobe software and reinstalling it?

Since you said that on draft quality the preview looks fine momentarily, I assume that the problem is rooted in the Adobe-Software. Maybe switching off hardware-acceleration might also do the trick. Make sure to keep us updated, I'm genuinely interested what's causing this weird issue.

Transcoding to WMV is what did it! The problem with the other formats/containers, is still a mystery. I didn't explicitly install any codecs. Didn't even have Quicktime or VLC installed... just using what comes with After Effects. At least I can move forward after a couple of days of troubleshooting. Thanks very much for the help.


text:
How to write command in android when I m using FFmpeg Native with C++ file?
Using FFmpeg lastest version ("Ada") with native code and write command in android .cpp file below it's very simple function VideogetDuration() :
#include <jni.h>
#include <string>
#include <iostream>
#include <android/log.h>
#include <unistd.h>

extern "C" {
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
#include <libavutil/display.h>
}

    /***
     *
     * @param input - the absolute path to file
     * @returns the duration of file in seconds
     *
     */
    extern "C"
    JNIEXPORT jint JNICALL
    Java_com_ffmpegjni_videoprocessinglibrary_VideoProcessing_getDuration(JNIEnv *env,
                                                                          jobject instance,
                                                                          jstring input_) {
        av_register_all();
        AVFormatContext *pFormatCtx = NULL;
        if (avformat_open_input(&pFormatCtx, jStr2str(env, input_), NULL, NULL) < 0) {
            throwException(env, "Could not open input file");
            return 0;
        }

        if (avformat_find_stream_info(pFormatCtx, NULL) < 0) {
            throwException(env, "Failed to retrieve input stream information");
            return 0;
        }

        int64_t duration = pFormatCtx->duration;

        avformat_close_input(&pFormatCtx);
        avformat_free_context(pFormatCtx);
        return (jint) (duration / AV_TIME_BASE);
    }

when this value returns 0 value either the wrong value.
also i have read the below docs for more information.
1)http://dranger.com/ffmpeg/data.html
2)https://static.packt-cdn.com/downloads/Developing_Multimedia_Applications_with_NDK.pdf
3)https://github.com/KucherenkoIhor/VideoProcessingLibrary (also see this project)
4)https://github.com/leandromoreira/ffmpeg-libav-tutorial#video---what-you-see
i have also add the same problem with below link :
https://stackoverflow.com/questions/6451814/how-to-use-libavcodec-ffmpeg-to-find-duration-of-video-file/58353968#58353968

Welcome! Unfortunately, this seems more like a programming question than a video production question, even though it involves ffmpeg. You might get better answers on SO.

Ok thank you @ Michael Liebman but, I think this question is related to ffmpeg_video So, i have added in SE. But, have you suggested then i'll try with SO.


text:
Scaling proportionally on After Effects - Shift + click does not work!
For the life of me, I can't tell what I'm doing wrong, but here we are!
I am on Mac, newbie on After Effects. I can scale anything (not proportionally) with the click on a corner but, unlike in Indesign or Illustrator, Shift + click just does not work! It kind of releases the frame, just like if I had clicked outside of it.
I am on Mac, After Effects CC. I verified the following:

Shift is pushed (the "non permanent capital letter" key of the keyboard)
Mode is "Selection tool" (the arrow)
I am indeed clicking on a corner (where little square appears) and not on the side!

Yet it just deselects the whole thing and making me crazy! What am I missing?

When I hold down shift, images and shapes scale proportionally. Just grab a corner handle and drag.
Alternatively:
Select the layer, press S to reveal the Scale parameter. Adjust that value. It will be proportional unless you unlink the x and y scales.

Right, thank you. What you describe is the behavior I expect, because its in Illustrator and the like. For the life of me, does not work in AE. Thanks about the Scale parameter. A little less practical in my case but useful!

Click with no key held down, then hold down shift as you drag.
If you're holding the shift key while selecting it toggles the selection of the object that you click on, adding or subtracting it from the selected items.
So clicking on a selected object with the shift held down will deselect it.


text:
Save video with the exact quality of the source file
I have never had success in saving file with same quality after editing. Either it was much bigger, or quality was worse (square blocks etc).
I thought MediaInfo program would help, i used to check bitrate of the video, frame rate, codec and make a similar (or close to it) preset in vegas. Never worked.
What i have been using as a solution all these years: save video with high quality, then upload to YouTube and then download from there.
What are the key characteristics of the source video file i have to check in order to save my editing with the same quality? Maybe there are some good info sources in the internet.

You need to tell us what codec you are using to save. Sounds like you are using a lossy codec, which, as the name implies, involves some loss of quality

@stib i usually use H.264. Is it not possible to detect the codec, source video was made with?

The codec the source video is made with is irrelevant. Once it's opened in the editor it has been decoded to a raster (aka the raw pixels in your video). It then gets re-encoded when you export. Encoding can be lossy for smaller file sizes, or lossless for large file sizes but original quality.


text:
Is there a way to split up an AVCHD file into smaller files (Sony HXR-NX5R)
From an all day event shoot, I have a 13 hour file recorded on a Sony HXR-NX5R camera. Catalyst Browse transferred the 160GB file OK, Premiere imported the file (but choked for quite a while doing so), but now I can't actually edit with it - adding it to the timeline just comes up "Media Pending", and sits there. Maybe if it sits long enough it will cope, but I wasn't seeing any life after an hour or so. It seems the file is too big for Premiere to handle (Premiere 22.5.0 Build 62, have tried same version on both Mac and PC - I can update to the latest Premiere if it's worth a shot, I've been sitting on this version a while to not disrupt some projects in progress)
I looked into using Catalyst Browse to split the file when copying, but it seems that option isn't available for AVCHD files.
I looked at using ffmpeg to split the big file to smaller ones, it throws "Non-monotonous DTS in output stream 0:2", so I guess I'm just not sure if the files I'm cutting up this way have issues (missing frames, etc). I just don't understand the error, or what I might need to do to validate if the file is still good. Command issued is:
ffmpeg -i "input.m2ts" -map 0 -c copy -ss 00:00:00 -t 2:10:00 output.m2ts
I know some Sony cameras will let you split the recorded file into parts on the camera, but I can't find any such option in the NX5R menus.
Suggestions on any other software or method of processing this that I might try? At this stage it looks like going the ffmpeg route, and crossing my fingers that the split files don't contain issues, I'm just surprised Premiere is having issues (VLC plays/scans the file fine), and disappointed there doesn't seem to be anything on the Sony side to assist in splitting the file up once it has been created.
UPDATE: I decided to let Premiere chew on the file overnight, to see if the "Media Pending" would clear at any point. But I had removed it from the project, so I re-added it back, along with the ffmpeg split version. Premiere didn't choke bringing in the big file at all this time. I dropped it onto the timeline, expecting the "Media Pending", but this time it just came up and worked. So it seems Premiere can handle the file, but there was something internally going wrong, and somewhere between trying to import straight off the SD card files, and playing with split files, and various other things I tried, Premiere must have forgotten whatever it was referencing on the file that wasn't working, and it has now just come in clean. Who knows.

You should use the segment muxer for this.
ffmpeg -i "input.m2ts" -map 0:v -map 0:a -c copy -f segment -segment_time 02:00 -reset_timestamps 1 output_%04d.m2ts
This will create a sequence of files named output_0000.m2ts, output_0001.m2ts ...
I've changed mapping to video and audio to avoid copying data streams that your editor may not make sense of.
P.S. .ts, .m2ts are MPEG-TS files. AVCHD is just a commercial name given to Sony's flavour of H.264 video. Such video streams can be contained within many container formats (MOV, MP4, MXF, TS.. etc).

Thanks for the detailed answer. Note that the source file has one video stream and two audio streams, and I do need all of it in the edit. I didn't know ffmpeg could split a file like that, is there a way to get the segments to have an overlap? I was splitting every 2h, but making the files 2h10m, because each item I'm extracting is only a few minutes - I was avoiding splicing any items and having to rejoin them. Thanks again for all the extra info, most helpful.

I am marking this the correct answer, because failing all else, I think this work around would have resolved this. Premiere did eventually import the big file correctly, and that's what I've used, but this would have been the other workable solution to the issue I was having.


text:
How to fix: ffmpeg: Picture size 32768x16384 is invalid?
I need to use ffmpeg with very large images (32768x16384).
When I try to read such an image I get the error:
Picture size 32768x16384 is invalid

It it does not matter what operation I want to do on the image (like scaling, v360 cutout etc.) it already fails at the read-in stage.
I tried JPG and PNG as input formats.
Full log with demonstration operation (scale 32k to 16k)
E:\XXX\Pipeline>"E:\XXX\Pipeline\bin\ffmpeg.exe" -y -i E:\XXX\Pipeline\calibration_sphere32k.jpg -vf scale=16384:-2 "calibration_sphere32k_scaled.jpg"
ffmpeg version N-94664-g0821bc4eee Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.101 / 58. 55.101
  libavformat    58. 31.104 / 58. 31.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.101 /  7. 58.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[mjpeg @ 000001eefc88ab80] [IMGUTILS @ 000000acfa1fef30] Picture size 32768x16384 is invalid
[image2 @ 000001eefc878740] decoding for stream 0 failed
[image2 @ 000001eefc878740] Could not find codec parameters for stream 0 (Video: mjpeg (Baseline), none(bt470bg/unknown/unknown)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from 'E:\XXX\Pipeline\calibration_sphere32k.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 20939328 kb/s
    Stream #0:0: Video: mjpeg (Baseline), none(bt470bg/unknown/unknown), 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[mjpeg @ 000001eefc88d3c0] [IMGUTILS @ 000000acfa1ff050] Picture size 32768x16384 is invalid
Error while decoding stream #0:0: Invalid data found when processing input
Cannot determine format of input stream 0:0 after EOF
Error marking filters as finished
Conversion failed!

EDIT
Found out, that the maximum horizontal resolution is: 22976.
This is a very odd number.

The general limiting rule is ((Width * 8) + 1024)*(Height + 128) < INT_MAX. The rationale being, that all pixels of an image plane should be accessible using a signed integer index.
On a machine with 32-bit integers, INT MAX is 2147483647.
So, ((32768 * 8) + 1024)*(16384 + 128) = 4345430016 which is > 2147483647.
Now, it's possible there is a bug with the image size check, in that the factor 8 applied to the width is prematurely applied in most cases and can be skipped. You can raise a ticket at trac.ffmpeg.org if you want to explore that possibility. Else, you'll need to use another tool (maybe Imagemagick).


text:
Advice choosing an archival format; prioritize pixel format or PSNR?
I produce 3D animations and I keep an archive of the final rendered animation (lossless 16 bpc RGB tif sequences) in case I need to re-upload it somewhere else in the future. It is much faster to just transcode the archival file again than re-rendering it.
However, I have a lot of them, and I need to keep the file sizes down while maximizing quality.
Of all the codecs I tested, VVC (libvvenc) and HEVC (libx265) seem the most promising. In terms of the encoding parameters, I narrowed it down between these:
VVC:
ffmpeg -i "16bpc_rgb_input_%04d.tif" -y -c:v libvvenc -preset slow -tier high -qpa 0 -period 1 -vvenc-params bitrate=700M out.266
HEVC:
ffmpeg -i "16bpc_rgb_input_%04d.tif" -y -c:v libx265 -preset slower -crf 9 -pix_fmt yuv444p12le out.mp4
Both of these produce files that are a very similar file size and are about the size I'd like to keep them at.
My intuition would tell me the HEVC should be better quality because of the pixel format used; yuv444p12le should preserve much more information than the yuv420p10le used in VVC (this is the only pixel format it supports right now), yet despite this, some of the metrics tell a different story:

(The PSNR metric in this table is a straight average over all frames, and the final average is an average over all input videos. The PSNR was computed using the 16bpc RGB .tif sequence as the reference.)
Basically, the PSNR metric was generally still substantially lower for HEVC than VVC across an average of 6 input videos I tested, despite the fact that the source was 16bpc and HEVC was using a better pixel format (12 bit versus 10, and 444 versus 420).
I can get a slightly better PSNR if I use -crf 1 with HEVC rather than -crf 9; the issue is that this explodes the file size way beyond what is acceptable.
I realize that one metric (PSNR) isn't everything, and I can't visually see a difference when extracting frames from both and comparing side by size. Ultimately, though, I still have to make a decision, and I don't have a sense for what's more important to prioritize; is it the pixel format or should it be the PSNR? Why? I'm just wanting a general understanding.

PSNR in the 50s is high enough that it doesn't matter.

@Gyan, if this is the case, I assume you would prioritize the better pixel format?

Yeah, I would keep full chroma (444)


text:
yuv420p10le ffmpeg pixel format; why does 16 bit input take less space than 8 bit?
I recently experimented with exporting lossless PNG sequences from Adobe After Effects in either 8-bpc or 16-bpc modes. I then encoded these PNG sequences using ffmpeg in two different ways:
VVC:
ffmpeg -framerate 60 -i "out_%05d.png" -y -c:v libvvenc -preset faster -tier high -qpa 0 -period 56 -vvenc-params bitrate=700M output.266

HEVC:
ffmpeg -framerate 60 -i "out_%05d.png" -y -c:v libx265 -preset medium -crf 8 -pix_fmt yuv420p10le output.mp4

I found the file size of the encoded 16-bpc PNG sequence can be decently smaller than the versions which encoded the 8-bpc PNG sequence for both codecs across multiple videos. The values in the table below represent the file size in MB:

Initially I found this counterintuitive given there is more information in the 16-bpc sequences, in which case I would think the encoded file sizes would be larger. Remembering the codec converts the input to 10 bit regardless, my next thought is that they should be a similar file size.
I don't understand why this happens. Would somebody explain?


text:
How is PSNR calculated when the reference file is RGB and the encoded file is YUV?
If I use this command to get PSNR statistics for a file:
ffmpeg -i encoded.mp4 -i reference.nut -lavfi "[0:v]setpts=N[out0];[1:v]setpts=N[out1];[out0][out1]psnr=stats_file=psnr_logfile.txt" -f null -

Where encoded.mp4 was compressed using a yuv444p12le pixel format, but the reference.nut file is a lossless rgb48le format, how does ffmpeg calculate the PSNR? I take it both files have to be converted to a common pixel format, right? Does ffmpeg convert the encoded file to RGB or does it convert the reference file to YUV? Or does it work some other way?


text:
ffmpeg libx264 core 157 vs core 164
For a while I have been using a build of ffmpeg from 2019:
ffmpeg version N-94150-g231d0c819f Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil      56. 30.100 / 56. 30.100
libavcodec     58. 53.101 / 58. 53.101
libavformat    58. 28.101 / 58. 28.101
libavdevice    58.  7.100 / 58.  7.100
libavfilter     7. 55.100 /  7. 55.100
libswscale      5.  4.101 /  5.  4.101
libswresample   3.  4.100 /  3.  4.100
libpostproc    55.  4.100 / 55.  4.100

I recently tried out this version:
ffmpeg version 2021-07-14-git-ca56299fb3-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.3.0 (Rev2, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      57.  0.100 / 57.  0.100
libavcodec     59.  3.101 / 59.  3.101
libavformat    59.  4.100 / 59.  4.100
libavdevice    59.  0.100 / 59.  0.100
libavfilter     8.  0.103 /  8.  0.103
libswscale      6.  0.100 /  6.  0.100
libswresample   4.  0.100 /  4.  0.100
libpostproc    56.  0.100 / 56.  0.100

I decided to compare the output files I get when using each version of ffempg above:
ffmpeg -i inpath -y -c:v libx264 -x264-params "nal-hrd=cbr" -b:v 120M -minrate 120M -maxrate 120M -bufsize 2M -pix_fmt yuv420p out.mov
They look visually similar and are only a few bytes different in file size. However, the binaries are not identical and the compression isn't the same. For example, here is the pixelwise difference between the output .mov files from each version of ffmpeg using the same input file (with the brightness increased for visibility of the artifacts):

Looking at the difference in the header of the file binaries, I see this:

(this is not the only difference between the files, just in the header)
Apparently the older version is using "core 157" while the newer version is using "core 164." I can't find any information about these when I search them online. What is difference between these two codecs? Why aren't the artifacts identical given the input file and the settings are the same?

It's the same encoder - the version has been upgraded. There have been a few bug fixes and assembly optimizations.

If they are just optimizations and bug fixes, why does that affect the artifacts? Shouldn't they be the same? Or do the optimizations affect the the way it is encoded?

Yes, bug fixes which alter the result of certain computations will alter the final result.

Use strings or mediainfo to extract the x264 version/config-options string.  As for pixel differences, the default is --deterministic so different runs of the same version should be the same (not dependent on thread scheduling).  But across different versions, the encoding choices it makes could differ due to a different order of looking at frames or something.  Your binary diff shows no difference in config options for the default "medium" preset you were using ('slow' changed somewhat recently from me=umh to trellis=2 as the thing that's different from 'medium'.)

x264 is open source, if you really want to dig in, see https://forum.doom9.org/showthread.php?t=168378 and the git repository: https://code.videolan.org/videolan/x264/-/commits/master  I didn't find any good summary changelogs when googling (not since about 2013 when it was still reaching maturity), so there's just the commit history of every detailed change.

The "core 164" and "core 157" numbers come from #define X264_BUILD 164 in x264.h - https://code.videolan.org/videolan/x264/-/blob/master/x264.h?ref_type=heads#L48.  You can look at the git history of that file (or that line) to find the version that bumped the library ABI.  Also, the r3065 version numbering is just a count of git commits, like how SVN used to auto-number, so you can I guess use that number to find the latest change your version has.


text:
Export Frames of 10 BPC Video File with ffmpeg
I have several hundred 1080p 59.94fps 10-bit-per-channel (bpc) AVC-Intra Class 100 MXF encoded video files.  I would like to extract the frames of this video file and export them to disk in a 16-bit lossless image format.  I recently encountered this question:
Convert video to 10 bit images
So I tried this:
ffmpeg -i "testinput.mxf" -pix_fmt rgb48 _Frames/out%05d.tiff
But ran into a rather unfortunate issue that I am not sure how to resolve.  Although it technically did work, and exported all of the video frames into a 16 bpc format, the color of these frames appears washed out.  Here's what I mean:
The first frame of the original video file (MXF):

The first frame exported with ffmpeg:

As you can see, the color appears to be faded and doesn't perfectly match the frame in the original video.  I don't know why this is, but it's a serious problem that needs a resolution ASAP.  Perhaps I'm not using ffmpeg correctly, or perhaps this is a bug in ffmpeg.  What do I need to do to extract the frames from this particular codec correctly?  Please, help.
I have included the original MXF file here, for your own testing purposes:
https://drive.google.com/open?id=1HtCmPGkIZMMMEOAVKMlLksov7QyKzqRE
Here is a link to the output of running the command I specified earlier.  I'm on the latest version of ffmpeg for Windows, ffmpeg version N-94150-g231d0c819f Copyright (c) 2000-2019.
https://pastebin.com/8UrxJJpY

@PaulB.Mahol Whether in Windows Photo Viewer, VLC media player, Adobe After Effects, or Adobe Premiere Pro, the frames are noticeably different.  I did not downscale anything.

Try using:
ffmpeg -i "testinput.mxf" -vf scale=in_range=limited:out_range=full -pix_fmt rgba64 path/to/output/out%05d.tiff

instead.
For a reason that is slightly beyond my comprehension of color science (or maybe just something odd with ffmpeg), the output of the initial command was creating .tiff files in the "limited" (15-235) rather than "full" (0-255) RGB color range. I used the scopes in Premiere Pro and DaVinci Resolve to A-B between the first frame of the created .tiff sequence and the original .mxf and the differences became clear.
If you aren't dead set on using ffmpeg, I was also able to achieve a comparable result by importing the .mxf into a Resolve (version 15 in my case) timeline and then using the "Deliver" workspace, selecting the 16 Bit, RGB and .tiff options as the output and using either the 'Auto' or 'Full' range setting. If you go the Resolve route, you can queue up each .mxf file and just let them export until everything is complete.
There are slight variations between the ffmpeg .tiff, the Resolve .tiff and the original .mxf but to my understanding the process of converting YUV (the original .mxf) to RGB (the .tiff sequence) generally isn't mathematically perfect. The files pass the "eyeball" test, however, and should work well unless the people you are working for have really strict delivery requirements.
If you really want to go deep into it, the nice (and smart!) folks over at Doom9 forums can get you into AVISynth (which is really cool and powerful but also quite complicated) for very advanced conversions.
Hope this helps!

@PaulB.Mahol I appreciate your feedback. In theory you are absolutely correct. In practice that wasn't the case. Maybe something is odd with the header information on the original .mxf? I also tried scale=in_range=full and scale with just the out_range=full parameter (omitting in_range) and the above combination was the only one that worked correctly. Additionally, I gave a second option for accomplishing the task. Thanks!

Your ffmpeg code is not a solution; the result is no different than before.  It is imperative that this is done with ffmpeg for speed purposes.  I still do not understand how to decode this video file properly.

Ok. Best of luck to you


text:
Automatically redirects to another layer
Hai friends I am using After Effect 2017
I need help, am download one free ae template for my study purpose, on the layer panel cp1 (main layer) and cp2 (Duplicate layer), I am trying to change the text in cp2, what I change cp2 text it will automatically change in cp1 can tell me how to fix the issue
(note: when I click cp2 layer it automatically redirects to cp1 layer).

Hi - add a link to the template

https://www.videezy.com/after-effects-templates/19299-corporate-presentation-after-effects-template-pack-01

step1: duplicate the text (07 - Service 02) step2: change the layer name step3: on that layer change the text it automatically affects the layer (07 - Service 02)