text:
Remove flickering due to artificial light with ffmpeg
I have video footage shot at shutter speeds of 1/30s under artificial light here in Europe where the AC is 50Hz. Flicker occurs -- obviously I should have used 1/25s or 1/50s but I didn't, and want to save the footage.
I have tried different ffmpeg filters but none did work: deflicker for example is made specifically to remove frame-by-frame luminance changes (e.g., what happens in timelapse videos) but not to fix the banding that I see due to using a shutter speed not in sync with the frequency of the AC feeding the light bulb.
I have found some obscure reference to other ffmpeg filters like hqdn3d but the defaults did not work and I don't really understand how to play with the parameters and how to relate them to my specific case.
I'm looking for a command-line/open source solution (hence, ffmpeg) because my video editor is pretty basic (iMovie) and will not allow me to do tricks like shifting and blending footage.
UPDATE
I have found a 'quick tip' on Philip Bloom's blog that says:

[...] my quick trick fix [...] is simply duplicating layers, shifting top layer over by a frame and adding 50% opacity to it.

So I have spent an hour figuring out the arcane syntax of ffmpeg and tried to replicate the above steps:
$ ffmpeg -i FLICKER.mov -itsoffset 0.1 -i FLICKER.mov \
-filter_complex "[1:v]format=yuva420p,colorchannelmixer=aa=0.5[b]; \
[0:v][b]overlay" -map 0:1 NOFLICKER.mov

With this command I input twice the same input file, the second one is shifted by 0.1 second (-itsoffset 0.1), a 0.5 transparency is applied in the -filter_complex argument ([1:v] means the video stream of the second file) and then overlaid on top of the video stream of the first file ([0:v]). The audio track is simply copied from the first file (-map 0:1).
The good news is that this works as expected, no more flickering. The problem is that I had to offset the second copy too much (0.1 seconds) so I have a very clear and evident shadow effect on my final output, not a faint and what would be acceptable motion blur if only I had it shifted by a single frame like in the Bloom's recipe above.
I think that is due to the fact that my original footage is not high-fps but only 24 fps. A shift of a single frame would have meant -itsoffset 0.0416 (1/24 s = 0.0416 s) and that shift doesn't really do anything. I've also tried to understand why a 0.1 second shift is so effective, but could not come up with any reasonable explanation (I thought that could have been related to the AC frequency is 1/50 Hz but that would've meant that a shift of 0.02 seconds would do something...).
Anyway, the problem remains. I could think of a possible solution where perhaps I could instruct ffmpeg to leave a user-selected portion of the footage free from the overlay and simply copy the original stream (that's because it's a footage of my daughter talking under artificial lights, and the flickering is very disturbing on the borders of the frame where it's all dark, but her face is relatively free from the flicker), or again, like I asked before, find one of the many filters in ffmpeg to work its charm.

Is the camera fixed?

@Mulvya yes the camera was fixed in place while shooting.

The following worked well for me, based on the same ideas
http://www.premiumbeat.com/blog/quick-trick-for-de-flickering-your-video-shots/
https://superuser.com/questions/1025794/merge-two-videos-with-transparency-in-ffmpeg
It's more than a year, so I don't remember exactly how I arrived at this. The VOB was a video shot from a projected screen with serious projector pulldown flicker, alternating lighter and darker frames. The VOB was interlaced at 29.970 fps, where 1 frame would be 0.033 sec. The result was amazingly good, way beyond what I could get with various other deflicker filters.
ffmpeg -fflags +genpts -i FLICKER.VOB -fflags +genpts -i FLICKER.VOB -filter_complex "[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1" -c:v libx264 -crf 26 -an NOFLICKER.mp4

This solution seems to provide better results than OP's, but beware that the -an option is irrelevant here and will actually remove sound (or to quote the manpage : "Disable audio recording").

The idea here is it's blending the brightness of consecutive frames. That will fix flickering at the framerate, but will all produce ghosting for fast-moving objects.


text:
How to recreate this affect
I would like to know what effects are being used and how it would be possible to recreate the effect.
I'd like to recreate how the effect looks like it starts slow then a sort of sped up but slow motion looking by the way it sort of lags the frames.
I would like to recreate this using NCH video editing software since what is the program I am starting out with for now. NCH VideoPad
The clip is from Out of my mind ft. Nicki Minaj by B.O.B.
Very short Clip Link or Longer version.
Alternative examples:
https://www.youtube.com/DhSzLCCT-As?t=1m20s

What software are you using? What have you tried?

In addition to Amob100's comment, could you please describe the effect you are looking to reproduce? This will help other people to find your question later on and helps answerers give you a more tailored answer.

@SaaruLindestøkke I didn't know how to describe it

@Daniel Maybe you can try...? Just describe what you see, e.g.: The effect shows a person in multiple places at the same time or something like that. Just think how you would describe the effect to a friend. And also: add what software you will be using and what you've tried.

@SaaruLindestøkke I edited the post.

source: Stack Exchange

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

sort: votes


text:
Creating a one-off non-pro video to document a project - what software would be sensible?
I should say straight up, I'm not a video professional, although I've used simple tools such as VirtualDub and ffmpeg a lot over the years.  I have probably used incorrect terminology here, if so please let me know.
I have a very simple video in mind, but I'm not sure what software would be appropriate. The video is purely to document the issues on a project - there were so many of them (like 100 - 200!) that if I ever need to give a strong overview on what went on with it, I'd rather put someone in front of a self-evident video for 3 minutes where they can see the photos and the region concerned, instead of asking them to read a dry 30 page list and hundreds of photos.  I've been told that's by far the best thing to do, to convey this aspect.
I'm hoping for a helping hand with shortcutting whatever I can, and with getting going.
As I've described, the video I have in mind is pretty functional, it's not for "niceness" so much as to convey a complex message about a complex 3D region and what was discovered where, and to provide the viewer with a good insight into the 3D layout of the region and what was noteworthy where, quicker and better than diagrams and a written document could do.
Intended style/content
As a video concept, I'm thinking of something that's almost a slideshow with annotations and overlays. The basic "scenes" will simply be a background track made up of stills, giving the viewer a "virtual tour" of the whole region. Overlaid on these "scenes", I want to fade in and out, bubble-like "frames" that contain photos (and the occasional video snippet), and sometimes text or markings, that show the viewer what was discovered and where, with key textual comments if needed, or shapes such as arrows to point to where the items in the overlay frames were found, on the background image. There's likely to be several overlaid objects at any given time, and each will have its own fade in/out timing.
In terms of transitions, all I plan to use is fade in/fade out/crossfade. The objects and backgrounds won't be moving at all, unless their content happens to be a video and not a photo/diagram/shape (there are maybe 4-5 videos I want to include within "frames" in a "scene").
The video will probably use something like 500 - 700 photos and diagrams overall. There's no need for audio although I might add background music.
Workflow
In terms of my own competence and comfort level, I'd like something that supports a workflow in which this project will be as simple as possible. Ideally something like this:

Create a track for each object (an object might be a image/video/shape/text frame, and it could be a background still, or a "bubble" or "shape" within a "frame" that overlays it);For each object:

Mark on its track, when the object exists (between starting to be visible and vanishing) + transitions;
Drag it on the storyboard/video layout frame, to set its start and end positions (I don't plan to have movement so the path is a bit redundant for me)
Drag the track in front/behind other tracks, or groups of tracks, to indicate which other objects it's in front of/behind.

Repeat for all objects and render.

Hardware
I'm using Windows 8.1 which runs most things that work on Windows 10, and the PC is a fairly heavy duty hexacore workstation with 64GB and plenty of large SSDs, so it'll make short work of rendering.
Software
Something that "just works". I don't mind if it's a professional package or much more capable than my needs, as long as it supports a smooth workflow and it's very dependable, and can make this easy and hassle-free for me. The price isn't a worry - I'm happy with Open Source if it does what I need, I'm happy to pay if it does what I need. As examples of programs that are powerful and capable, but also pretty intuitive and "just work", I might think of Microsoft's Excel/Access, where whatever you need, is probably there and reliable; or maybe Photoshop which I like a lot.
I don't have any specific video editor experience so I'm completely open between pretty much anything from Microsoft Movie Maker to Premiere Pro to Vegas - I simply have no idea what to go for. If someone tells me to use Powerpoint and convert it to a video afterwards, I even might listen to them (joking, honest!) - the reality is I'm completely unfamiliar with what's best for doing this.
As it's time sensitive I'd like to prioritise the kinds of things that will help minimise time - it "just works", it's a pretty intuitive program, the kinds of things I will need to do, to make this video, are nicely accessible within the UI, and if I need more capabilities it's probably got them too. Those matter much more.
I don't mind a professional quality editor if it'll be a good choice, and I have a good technical learning curve  - but the more I have to figure out to get the basics working, the more time gets lost, so capable, reliable, but also fairly intuitive and easy/straightforward for a technically-competent newcomer to get going and be productive with simple editing like this. I can play with advanced features another time.
If this can get me a good shortcut in getting going, it will be very helpful and worth it.
Thank you!

This question gets asked quite frequently, and normally the answer is to pick one from this list. But since you very clearly defined what you are looking for in the editing software, I think I can give you a better recommendation.
Premiere Elements
Personally, I use Creative Cloud software, which means Premiere Pro for video editing and After Effects for special effects. However, there are two problems with this:

Steep pricing, only subscription models available. A single app licence is still 20$/month, which is pretty pricy for most prosumer-level customers.
Steep learning curve. Normally I'd say the time investment needed to learn the basics and figure out a fast workflow with Premiere Pro is totally worth it, but since you mentioned you won't be doing any other video projects anytime soon, that's a moot point. Specifically, it's easy to work very inefficiently with Premiere Pro, which becomes very apparent when you have to do repetitive tasks such as add a couple hundred still images to a track and overlay them with text. This will become a huge time sink and you will be annoyed that it doesn't 'simply work'.

There's a good alternative though, namely Premiere Elements. It's basically a stripped down version of Premiere Pro with non-essential functionality removed and a streamlined interface that's optimized around the most common video editing tasks. I wouldn't normally recommend Elements, as it will pretty quickly reach it's limits for live action video and larger editing projects, however I believe it's fitting for your project. You might have to build any graphical elements in Photoshop or another image editing software, but apart from that, you should be got to go. You can get a full Premiere Elements 2018 licence for <100$ (I'm seeing 70$ right now, though the price in your region might differ). As far as I can tell, this won't include major version updates (i.e. a potential 2019 version), but by that time you presumably won't need it any more anyway.
Elements has enough functionality to finish a project of your scope. Of course, only you can tell if you like the software's feel/workflow or if it's missing some niche functionality that you require. Check out the link above, they have some video previews and introductory pages. There's also a free trial available. It's pretty easy to get started (as opposed to Premiere Pro), so you can just install the trial version, import some of your images/video clips and try it out.
Alternatives
A couple of notes regarding some of the programs you mentioned as well as some other options.
Windows Movie Maker. I find this one so dumbed down that it's lacking even the most basic features that you will require even for simple videos. Really can't recommend it.
Vegas. It's an option, though a pricy one as well. What I don't like about Vegas is that it's trying to be both an editing and an SFX software, which makes for a somewhat awkward and not very beginner-friendly interface (as opposed to the Adobe suite, where you have Premiere Pro and After Effects for those jobs respectively). One of the simpler, cheaper version of Vegas might be an option though (they come in tiers, look through their website for a comparison).
Premiere Pro. The best video editing software I know, but not beginner friendly enough for your requirements, see the paragraphs above.
Powerpoint. I see nothing wrong with this plan.
Open Source software / VirtualDub. Most open source software in this space shares the common problem of many open source projects, which is the lack of a streamlined design philosophy, the result being a confusing and at times unintuitive interface. This makes most of those not a good choice for your use case. If you want to put some time into learning one of those, you can get pretty far with Blender for example. But if you want something that just works, it's probably easier to pay a couple of bucks for a software that's not necessarily more powerful than the open source alternatives, but definitely more user-friendly. VirtualDub has been discontinued by the way.
Other commercial options. Pinnacle is pretty affordable and should have all the features you need. Lightworks is another options, though it is more expensive. You have the choice between an outright one-time payment or monthly/yearly payments, which is nice. You will probably have a bit more room to grow in regards to features as compared to Premiere Elements, though I doubt you will need the extra features for the project you outlined.
There are more options still, if you want you can look through the list I linked in the first paragraph to compare those in-depth. Corel Video Studio or Magix are also somewhat viable options, though I personally don't like them.
In conclusion
If you need ALL the features, my recommendation will always be Premiere Pro. But for your project's scope, a simpler software will do just fine. With those programs (such as Premiere Elements), you will always find you're lacking some functionality or setting that you would like to have. However, more often than not there's a workaround for those, and those lacking features are the cost you pay for the beginner-friendly interface and lower price tag. Just make sure the software you choose has all the essential functionality you need by looking through the features lists and tutorials on their websites and installing the trial versions, if available. Make sure to test the export as well, since it's a common trap to only allow low-quality exports in the  trial/free versions of the programs (looking at you, Lightworks).

Wow. If I could have imagined a perfect answer, this would be it. You understood exactly what I'mafter - which a list never gives - and picked out what looks like a very suitable suggestion based on what I need rather than what someone else might do. I already use Photoshop Elements (never got round to moving to Lightroom; I should do so), so I understand what this prog is likely to be like - quite a lot more than the basic functionality, but designed for newcomers, and probably stable, well featured as its based on the pro product. The analysis and info on others is ideal too. Thank you!!!

Its things like workflow efficiency with Premier Pro, your comments on that and other software - that kind of thing and the balance between softwares and approaches, you just can't get from a list. Its either someone else with experience willing to share, or hard work and time of ones own. Your analysis of each is a complete gem. Thank you again!

Quick update/followup. I tried premiere elements, but within a day or so moved to premiere pro. The reason being mainly, fine control over clip adjustment, output file formats, frame sizes, and effects. (For example: I couldn't make 3/4 of the clips work together easily as they each needed frame rates/adjustments as they came from different sources). Unlike Photoshop elements, premiere elements really lacked enough on the detailed controls+depth, for me to end up moving up. Premiere worked nicely! Thank you for the invaluable help with the question.

I'm probably too late to the party at this stage, but I'll offer a suggestion. Unless I've missed some detail, to me the slam-dunk answer is Camtasia. It is in itself a very capable video editor, but it is targeted at non-video-pro types, especially in business, teaching, and the like. There are three aspects about it that I think make it the best choice here. Compared with Adobe, for example, Camtasia:

Has a much shorter, more gentle learning curve than Premiere Pro. You'll get to produce useful stuff much more quickly with it.
Has additional not-strictly-video features, useful to the business person, teacher etc, that Premiere Elements (nor Pro for that matter) even pretends to have. For example, it lets you create stopping points at which the viewer gets to answer review questions. It can also modify a viewer's path through a complex video according to their answers. So it's useful for training, or for video-based documentation.
Is much cheaper than Pro. Roughly the same amount gets you a fully-owned copy of Camtasia versus only one year of Premiere Pro.

On that learning curve, part of that is the way the basic use model has been conceived. It is aimed at the content producer, not the video expert. It is nothing more than that content producer sitting at their computer running a PowerPoint presentation, or working live on some Excel, etc and than recording one or more of: that screen activity; their own video headshot from their computer's webcam; their own dialog from their computer's mic; and any "system" sounds from the computer itself. That recording can be triggered by a couple of mouse clicks, and then when it's done the program drops the whole lot -- channels for each of the sources chosen -- automatically into the editor for subsequent post processing. And you can do that once only, or many times, accumulating a range of takes for subsequent combining. But in addition to that basic workflow, you can also import still images, video from other sources, sound from additional and/or better mics, and so on. Then using the editor itself, you have access to a wide range of the usual types of activities, including cuts, joins, video and audio effects and so on. It is a fully capable NLE in every way.
Now all that said, Camtasia definitely is focused on those for whom high degrees of visual precision and artistry take second place to content delivery. I've argued the learning curve is easier with Camtasia, one reason being the basic use model. But another reason is the sheer power and size of Premiere Pro. My experience, having used Camtasia first, but then working with Premiere Pro (and associated CC) was much the same as my experience of watching the Avengers. At first encounter, Loki (Camtasia), is pretty awesome. But inevitably you have to see him go face to face with The Hulk (Premiere Pro) and you kinda have to re-calibrate what awesome means :-)

Honestly, any of them will do the job you want. For what you're doing you can pick any at random and have your video edited before the answers stop rolling in on SE.
I found Vegas more intuitive at first, but I feel (with no objective justification) that Premiere Pro has a better balance of price and feature set.
Renting PP at the monthly rate month, you can't really go wrong.

I agree that Premier Pro is a great program with a very affordable pricing structure. AFAIK, it's $20 a month for the months that you use it. You can use the wonderful software for a whole month, and then cancel, and you'll be out only 20 bucks.

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

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


text:
ffmpeg log missing "dup" and "drop" key-value pairs
For some reason, my ffmpeg output log does not show dup and drop key-value pairs.
expect:
...
frame=563 fps=138 q=23.0 size=13056kB time=00:00:09.42 bitrate=11346.8kbits/s dup=0 drop=0 speed= 2.3x
...

running the following:
~/bin/ffmpeg -i INPUT.mkv \
    -t 00:00:10.000 \
    -c:v libx264 -crf 15 -preset veryfast \
    OUTPUT.mkv 2>&1|tee ffmpeg.log

results in this output instead:
...
frame=  563 fps=138 q=23.0 size=   13056kB time=00:00:09.42 bitrate=11346.8kbits/s speed= 2.3x
frame=  600 fps=134 q=-1.0 Lsize=   16199kB time=00:00:09.98 bitrate=13294.4kbits/s speed=2.23x
video:16095kB audio:92kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.077694%
[libx264 @ 0x55d5711efac0] frame I:3     Avg QP:15.71  size:227164
...

or running:
~/bin/ffmpeg -f v4l2 \
    -framerate 60 -video_size 1920x1080 \
    -input_format mjpeg -i /dev/video0 \
    -c:v libx264 -crf 15 -preset veryfast \
    -tune film -profile:v high -pix_fmt yuv420p \
    -color_primaries 1 -color_trc 1 -colorspace 1 \
    -dst_range 1 -color_range 2 \
    OUTPUT.mkv 2>&1|tee ffmpeg.log

gives:
...
frame=  880 fps= 60 q=23.0 size=   64512kB time=00:00:14.31 bitrate=36910.3kbits/s speed=0.977x
frame=  911 fps= 60 q=23.0 size=   64512kB time=00:00:14.83 bitrate=35626.4kbits/s speed=0.978x

system info

OS: Linux Debian 10 (buster) x86_64
tested with two versions of ffmpeg:

1) Debian package
$ ffmpeg -version
ffmpeg version 4.1.4-1~deb10u1 built with gcc 8 (Debian 8.3.0-6)

2) compiled for myself
$ ~/bin/ffmpeg -version
ffmpeg version N-97910-g88567a2 built with gcc 8 (Debian 8.3.0-6)

using -loglevel debug and ffv1
~/bin/ffmpeg -i INPUT.mkv \
    -t 00:00:10.000     \
    -acodec  copy       \
    -vcodec  ffv1       \
    -level 1 -coder 1 -context 1 -g 1 \
    -loglevel debug     \
    OUTPUT.mkv 2>&1|tee ffmpeg.log

result: unable to find a single occurrence of the word "drop" in log.txt file
How to output the missing "dup" and "drop" in my log?

If no frames are dupped or dropped, then those fields are not printed.
If you need a definitive statement, add -progress filename to print progress report to a file and search for dup_frames and drop_frames.

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


text:
Is it possible make in Vegas Pro?
I need to create a brief presentation of my mobile app. I use Vegas Pro. But I have weak skills. I want to do something like this: the text and the animated image are interchanged.
I would like to make something like this:

It is possible make with Vegas Pro? Or is it better to use another application?
any advice and suggestions - there is already no time :)

That video was probably made with After Effects, which is pretty popular for this kind of things. There are also a lot of template you can download/buy if you have no experience with that

It's totally possible: the best way to achieve a professional look is, suprisingly enough, to hire a professional.

It is possible but animations are much better suited for a speciality program like After Effects. Vegas on its own will only provide you basic video effects and nothing close to animations like these.


text:
AAC and AC3 audio tracks in M4V file
I've noticed that in movies download from iTunes Store there is duplicated audio track - the first one is AAC and the second one is AC3 but this is visible as one audio track with option "Prefer AC3 passthrough". I've compressed a movie in handbrake with AAC and AC3 audio but when I load this to iTunes, I see 2 audio tracks (same language) instead of 1. I've also noticed that when you put 2 audio tracks in the latest HandBrake, where the first one is AAC and the second one is AC3, iTunes displays this as one audio track. I wonder if there is any possibility to change my M4V file, so iTunes will display 1 audio track instead of 2 without recompressing the video? I'm thinking about using ffmpeg or mp4box to do that but have no idea how to deal with it.
For better results I've created new files. One using HandBrake 0.10 and second using HandBrake 1.0.7. Both files are the same movie, same settings, the only difference is HandBrake version I've used. FFprobe output seems to be the same (except creation date).
Below is the output from ffprobe for the file that is desirable and the file that has 2 audio tracks visible in iTunes:
ffprobe version 3.4 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\tbbb_ok.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2018-02-17T09:09:52.000000Z
    title           : Big Buck Bunny
    artist          : Big Buck Bunny artist
    date            : 2018-01-01
    encoder         : HandBrake 1.0.7 2017040900
    genre           : Comedy
  Duration: 00:09:56.48, start: 0.000000, bitrate: 4857 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 4048 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
    Metadata:
      creation_time   : 2018-02-17T09:09:52.000000Z
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      creation_time   : 2018-02-17T09:09:52.000000Z
      handler_name    : Stereo
    Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 640 kb/s
    Metadata:
      creation_time   : 2018-02-17T09:09:52.000000Z
      handler_name    : Stereo
    Side data:
      audio service type: main

.
ffprobe version 3.4 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\tbbb_nok.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Big Buck Bunny
    artist          : Big Buck Bunny artist
    date            : 2018-01-01
    encoder         : HandBrake 0.10.1 2015030800
    genre           : Comedy
  Duration: 00:09:56.46, start: 0.000000, bitrate: 4806 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 3997 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      handler_name    : Stereo
    Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 640 kb/s
    Metadata:
      handler_name    : Stereo
    Side data:
      audio service type: main

Q is not clear.  Show ffprobe output for a file that appears as expected in iTunes and for a file that doesn't.

No significant difference. How does the iTunes display differ?

When I go to audio/subtitles language settings in iTunes there is for example "English" option twice and "Prefer AC3 Passthrough" option while on second video there is only "Prefer AC3 Passthrough".

I've found solution. To achieve this I used MP4Box and group audio tracks, so I've put AAC tracks in group 1 and AC3 tracks in group 2.
mp4box -add "track1.h264:fps=24.000:delay=0:lang=en:name=Video" -add "track2.aac:delay=0:lang=en:name=English:group=1" -add "track3.ac3:delay=0:lang=en:name=English:group=2" -add "track4.aac:delay=0:lang=fr:name=French:group=1" -add "track5.ac3:delay=0:lang=fr:name=French:group=2" -new "muxed.m4v"

The above command creates new m4v file with 2 AAC tracks and 2 AC3 tracks, so iTunes will display "English" and "French" once and "Prefer AC3 Passthrough" option as well.


text:
Import Adobe Premiere Proxy files encoded separately with FFmpeg
I'm trying to work with a bunch (hundreds) of 4k HEVC video clips, and so far it seems like my laptop is a bit too slow to edit them effectively. I have read guides that talk about ingesting proxy files, which is great but involves running Adobe Media encoder on my macbook.
Ideally I don't want to do any proxy file encoding on my macbook since it slows down my laptop too much. I want to create the proxy files on a separate unix server using ffmpeg, then copy them onto my laptop when they're done. Is this possible?

It appears that you can attach proxies later in Premiere by right clicking on your source files and going to the Proxy > Attach Proxies menu. In there, clicking attach brings up a file dialog to get the proxy files.

You can mark your own answer as the accepted answer if this solves your problem.


text:
VLC 3.0 (Vetinari): Unable to play 360 videos
I installed the last VLC version (3.0.0 (Vetinari) on Windows 7 64 bits) which supports 360 video playback.
In order to do some tests I downloaded the following 360 video from Vimeo:
https://vimeo.com/215984568
But VLC is unable to play the 360 video correctly; the video contains all the 360 degree video information but it's showed at the same time (on Vimeo the video plays OK). The result is the following:

I think that maybe the video could be reencoded with ffmpeg to be more VLC friendly.
The media info of the downloaded 360 video is this:

The 360° video you downloaded is encoded as an equirectangular projection, meaning the video was projected onto a rectangular surface. This makes the video indistinguishable from a normal video.
In order to be recognized as a 360° video, the video must contain specific metadata. You can use a tool provided by Google for uploading videos to YouTube: Upload 360-degree videos. Apply this tool to your video and VLC will correctly recognize it as a 360° video.

Thanks Manuel. VLC recognized the video as a 360° video.

The problem comes from the video which should have the metadata projection=equirectangular. To fix it:

Install Python 3

Download Spatial Media

Unzip Spatial Media

Go into the folder (where there is a subfolder spatialmedia)

Copy the path of the folder

Launch cmd on Windows (by searching cmd on your system)

Go on the folder by typing cd  and the path of the folder

Inject the spherical metadata by typing py spatialmedia -i <yourVideoOnTheDisk> <aVideoName>

Open the created file with VLC. It should be launched as a 360° video. You can remove spatialmedia and uninstall Python.

This methode might work, VLC can't read stereoscopic tom-bottom and i don't think there is any windows player that would allow read a 4096x4096 top bottom video for inspection.


text:
How to edit video like this?
How they manage to dissolve text only and not themselves??
In some videos text even go over there hands but still texts dissolves and they remains intact..
Example is in this video please go through it 1st is at 4 seconds then at 1:30.

They probably just masked off the part of the screen with the text on it, and dissolved it. I didn't see the part you describe with the text dissolving over her hand, I was too distracted by her incorrectly calling a scalar a "constant".

Sit behind a sheet of glass, write, flip video, key dissolve.

That's a pretty definitive answer :)

@tomh - Thanks. There seems to be some doubters (over a dozen thus far) whom wait for a better answer, I'd like to see what they come up with.

this is so funny ^^
Sometimes it's just a super simple solution but nowadays people think it is all edited digital :D


text:
How does ffprobe identifies I frame and IDR, when it sets key_frame=1
How does ffprobe identifies I frame as an IDR and sets key_frame=1.
Is it for the scene change?
My requirement is to filter out IDR frames: the steps I am following are

ffprobe output_file -show_frames -select_streams v:0
Filter above command results with key_frame=1 values(as per ffprobe IDR)
The total count i got is 259. Using ffprobe I am getting wrong sets of key_frame=1 values.
When i analyzed the same file with textronic analyzer I got correct values idr = 118

Textronix analyzer gives me below details for a a file verification.
TotalPictures:Count[ 5864]
I Pictures: Count[  259]
P Pictures: Count[ 1059]
B Pictures: Count[ 4546]

RAP Pictures:Count[259]
IDR Pictures:Count[118]
BLA Pictures:Count[0]
CRA Pictures:Count[141]

Frames:     Count[ 5864]    Percentage[100.00]
Fields:     Count[    0]    Percentage[0.00]

GOP (in Pictures, between I): Count[258] AverageSize[22] MinSize[1] MaxSize[50]
CVS (in Pictures, between IDR):Count[117] AverageSize[50]MinSize[50]MaxSize[50]

Now how to identify correct IDR count using ffprobe?
FFmpeg is setting iskey to 1 for CRA frames as well(tried with -skip_frame nokey). I need to collect only IDR frames

It sounds like you're analyzing a HEVC bitstream. HEVC has multiple types of Random Access Pictures, only one of which clears the buffer. But ffmpeg flags all of them as keyframes.
You have to use the HEVC decoder to parse this info out. The skip_frame option, as implemented in the HEVC decoder, only decodes IDR frames.
Use
ffmpeg -skip_frame nokey -i in.mp4 -vf showinfo -vsync 0 -f null -

The number of frames output is the IDR count.

For the sample file, you can use the filter_units bitstream filter to keep only IDR frames
ffmpeg -copyts -i HEVC-1080i25-STB_02_576i25.ts -an -c copy -bsf:v filter_units="19-20" -f mpegts - | ffmpeg -copyts -i - -vf showinfo -f null NUL

This will show the data of 118 frames, same as the analyzer.

Thanks for your response.                                                                   This issue is there for AVC content  as well.  Actually i need to grab pts values for each IDR frame

I did a source check and AVC decoder appears to work the same way. Added filter in command to display PTS.

Hi it works fine only with interlaced output this issue is still there for progressive

The issue is ffmpeg iskey value is set to 1 for CRA frames as well. (Instantaneous Decoder Refresh (IDR), Clean Random Access (CRA), I need to collect only IDR frames

Let me test this. Can you share a HEVC stream along with Tektronix results for it.

I see only upload image option, Where can i upload stream, ??

To some file-sharing service and post links

HEVC Progressive Stream : http://www.mediafire.com/file/4t2ujzf708ippca/HEVC-1080i25-STB_02_576i25.ts
HEVC Progressive textronic analyzer : http://www.mediafire.com/file/5ayuwtztwtwtig1/HEVC-1080p25-STB_02_576p25.txt

@Mulya updated the stream and textronix analysis results, please have a look and let me know if you need any more information. It will be really great if i could get some help

"The issue is ffmpeg iskey value is set to 1 for CRA frames as well. I need to collect only IDR frames "  Can anyone help me on this issue??

Sorry; forgot about this. Will look into it.

See new command.


text:
Problem setting first frame timecode using ffmpeg - timecode always different from requested for 59.94fps video
Edit: Found to be a small bug in FFmpeg. It should hopefully soon be patched.
I'm having issues with setting the timecode for some .MXF files that I have. If I run the command:
ffmpeg -i test.MXF -vcodec copy -acodec copy -timecode "00:05:00;10" tmp.MXF

and then check using ffprobe:
ffprobe tmp.MXF
dpc3:tmp me475$ ffprobe tmp.MXF
ffprobe version 3.4 Copyright (c) 2007-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[h264 @ 0x7fb652816600] Truncating likely oversized PPS (9469 > 4096)
    Last message repeated 4 times
[mxf @ 0x7fb652815200] decoding for stream 0 failed
Input #0, mxf, from 'tmp.MXF':
  Metadata:
    uid             : adab4424-2f25-4dc7-92ff-29bd000c0000
    generation_uid  : adab4424-2f25-4dc7-92ff-29bd000c0001
    company_name    : FFmpeg
    product_name    : OP1a Muxer
    product_version : 57.83.100
    product_uid     : adab4424-2f25-4dc7-92ff-29bd000c0002
    modification_date: 0000-01-02T00:00:00.000000Z
    material_package_umid: 0x060A2B340101010501010D0013E30DF252947134C9E30DF20052947134C9E300
    timecode        : 00:05:00;30
  Duration: 00:00:08.01, start: 0.000000, bitrate: 577647 kb/s
    Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(progressive), 3840x2160 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 59.94 tbn, 119.88 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D0013E30DF252947134C9E30DF20052947134C9E301
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D0013E30DF252947134C9E30DF20052947134C9E301

Then the timecode is clearly later than the requested timecode (00:05:00;20 -> 00:05:00;30)
I have tested with various different valid input timecodes, and the output timecode is always different from what I request.
e.g.
00:10:00;00 -> 00:10:00;18
09:58:34;00 -> 09:58:51;58

Any suggestions?

It's a bug in the code. It assumes all streams are 30 fps.

Thanks, just found the bug myself too, should now be able to compensate

Fixed now in ffmpeg git master.

The user-supplied timecode value is converted to an integer value that represents the frame number which is associated with that timecode. It is this integer which is stored in the file.
In drop-frame timecode, since some timecode labels are periodically skipped, timecode and (frame count/fps) do not correspond anymore i.e. timecode * fps != frame count. This necessitates an adjustment in order to derive the corresponding frame number. The code assumed a fixed 30 fps, but has now been fixed.


text:
Premiere Pro: Curves for adjusting video effects and its keyframes?
I am pretty new to Premiere, so this is probably going to be a "noob" question. So I want to make keyframed adjustments in my clips position (it just moves from one place to another) and I want to make this effect look more natural by making the movement build up speed. The clip would start moving slow then it speeds up, and finally it slows down to the end.
I saw a few random videos including Premiere, where at the place of the keyframe timeline,  there is a curve timeline window. I mean, a window where you can adjust the speed and the direction of a certain effect value by dragging the curve's point on the 2 axises.
I hope I composed this clearly and that I didn't ask something dumb :D
Thank you for the answer.
Here is a screenshot of my test project:

And these are the curves I am referring to (I'm sorry for the resoltuion, but it's from a video):

You can adjust the keyframe interpolation in the Effect Settings panel. Might have to toggle that option or set the keyframes to an adjustable interpolation mode first. Make sure to click to little right-pointing arrow next to the title of the effect you want to adjust in the Effect Settings panel. (See the screenshots here). If you can't find the option, post a couple of screenshots of your Premiere Pro window so I can tell what's going on.

Thanks for the answer, but to be honest, it wasn't 100% clear to me, and I'm not sure if we're talking about the same thing. I edited my post with pictures.

You can toggle the display of the keyframe timeline by clicking the little arrowhead to the left of each individual effect in the Effect Controls panel. If you can't see the panel, you can open it from the Window menu. If you don't see any effects in that panel, make sure to select the correct clip from your current timeline.
Here's your image with the arrowhead encircled in red (in the top left):

For more information on setting smooth transitions using keyframes, check out my answer here.

Worth noting that to quickly add ease to keyframes you can right-click them and choose the interpolation and ease in the drop-down menu

Thank you for the answer, I'll definitely check it out and I'll come with the result!


text:
Getting gray instead of white when recording screen activity
I am recording from screen

however, the video when recording with a recording program, (screen around cursor mode) gets grayish

why?
Video settings are H264 - NVENC (VBR)
30 fps, 100q

Wow, this was a VLC problem. Its the playback of the video recording that has got darkened!
The left program is "Film & TV" provided by windows.
If I in VLC was unchecking the option "use hardware conversions YUV -> RGB", the playback was not washed out anymore. Describe in https://wiki.videolan.org/VSG:Video:Color_washed_out/.


text:
Prerender nested sequence
I have added an after effects project to my timeline, and that takes a lot of cpu resource to render.
What I want to do is to prerender only the nested subsequence containing that AE composition to aid the renderer in premiere, but that seems to be ignored, it still plays awfully slow.
Why?
I do not want a solution where I save the background to a video file manually because that will obviously affect the quality of the final video rendering.
Details

This is the particle background that I created in AE with the aid of the tutorial on

.
So I created a nested sequence of it and prerendered that one (selecting the clip and in the menu use sequence->render selection.

After half an hour, the three minute long clip has been rendered as you see above and the red bar at the top has turned green.
It also plays nicely.

The parent clip as you see shows that bar in red.

When I try to play the video in premiere, it seems like it does not make use of that prerendition of the nested sequence because it is awfully slow playback.
What did I do wrong?

You might be doing nothing wrong.
I find dynamic linking between Premiere and After Effects still slow and buggy in CC2020.
If I have a complex comp in AE, I would pre-render in AE, not using the pre-render function in the Compositions menu (because that seems to irreprably delete the original comp, unless anyone else knows otherwise?), but by exporting the comp as a ProRes file.
Then you have two choices:

If you trust dynamic linking:
Place your pre-render video above everything else in your comp in AE, and see if it beahves better in Premiere.

If you don't trust dynamic linking:
Bring your pre-rendered ProRes .mov file into Premiere, where it will play quickly, and disable your dynamically linked comp.

I'd be interested to know if others share this viewpoint - maybe I'm doing it all wrong...

Just relinking a load of after effects comps that became mysteriously unlinked in my latest project. It's buggy as hell.


text:
Greenscreen with gradient color mask
I am testing the video editor "videopad" and I use an eyedropper tool to pick a pixel that defines the greenscreen color which will be used overall the image to mask out the background.
However, can I define multiple eyedropper points, resulting in a greenscreen color that varies depending on where in the image you are?
The question extends to any video editing software.
edit
Can I just take a photo of the background before I put myself there and use the photo as greenscreen mask?


text:
Video formats with alpha channel
Which non-obscure video formats with semi opacity are there?
I want to create clips with that format to have as overlay of other videos, so the format better has to be supported by main video editing programs.

What do you mean by semi opacity? Do you mean something like a mask?

Alpha channel, altering topic.

I'm assuming that by formats you mean codecs. The following are codecs that work in either Quicktime (.mov), AVI, and MXF containers, or as image sequences saved as discrete files.
Commonly used in the industry:

Apple Animation (has been around forever, 8 bit support only)
Apple ProRes 4444 (probably the most widely used? I have no data, just guessing)
Avid DNxHD & DNxHR (this could be just as widely used)
GoPro Cineform
PNG Sequence With Alpha (my favourite, allows for faster multi-instance renders), also TIFF sequences (ditto, but bigger files)

More obscure:

Avid Meridien
other image sequences: Cineon DPX, Maya IFF, OpenEXR, Targa


text:
Path created with an expression will not draw other than being selected
I am trying to create a heart shape using an expression like this:

Start AE
New Composition + Ok
Layer, new shape layer
Expand to get the contents node and click add Path
Path -> Edit expression

Then I paste this expression:
var path = thisProperty;
var allPoints = new Array();
for (var a = 0; a < 360; a++) {
  var theta = degreesToRadians(a);
  x0 = Math.cos(theta);
  x = 300 * x0;
  y = 0.75 * 300 * (Math.sin(theta) - Math.sqrt(Math.abs(x0)));
  allPoints.push([x,y]);
}
path.createPath(allPoints, [], [], true);

and I see this on the screen

But this will only be visible in the designer.
If the object is deselected, it will become invisible.
There is no way to control the stroke width, color or fill.
How can I control those properties?
I am trying to add a stroke alongside the path, but they will not "connect".

I get an error when I apply that expression to a path: "property labelled cx in class Global is missing or does not exist"

I am sorry, removing some left over variables. Correcting the code. @tomh

Apologies if I've misunderstood, but you can just click on the Add triangle, and add a fill or a stroke to your shape:

The modifiers in the "Add" menu are hierarchical - so you have to add them below the path's hierarchical level.

Can I add a variable that I can tween at the timeline as well? Acessible through the script.


text:
HD60X Game capture getting wrong aspect ratio from Canon EOS M50
I am outputting a HDMI signal from my camera Canon EOS M50, capturing it with HD60X game capture.
In OBS, it appears cropped and with wrong aspect ratio, Why?

Pressing info to get rid of info icons, still no cake:

The camera is set to filming mode

with resolution 1920x1080

This is also how I setup OBS

Are you actually hitting Record in the camera? idk how Cannon works for this, but my Nikon doesn't drop its normal 4:3 image to 16:9 until the moment I hit the internal Record button.

No, I do not hit record. Do I need to do that? Then I still will have the 30 minute cap.

Maybe they made the output useless on purpose?


text:
Text according to Excel document
A friend and I recently launched a model rocket. We had installed an altitudemeter that exports all it's data for each quarter second into an Excel document. I want to take the data of the time and height of this document (about 1000 time steps) and use it to have a live altimeter in the top of the screen on the video using Vegas Pro 13. I basically want it to count the height live with the video. Does anyone know if this is possible in Sony Vegas?
The best thing for me would be that it follows a graph so that the text doesn't change every quarter second, but every frame. If this can be done, it would be easier, because then I don't have to use every single step of time from Excel, but every 10 steps or so. It will still be accurate and smooth, though less of an annoying job.

You might want to look into using telemetry software, Dashware for example is free.

I think you want this to be done automatically. But f course you could create 1000 text overlays, each one showing a particular altitude, and place the correct overlay at the correct point in the timeline for the correct duration (1/4 second). That would be a terribly tedious job!

Please don't post an answer if you already know that that's not the solution that anyone is looking for.

I don't know you, so I didn't know if you are a person who minds tedious jobs. Some people don't. You'd just asked whether Sony Vegas could do it, and this will work. Again, the only confusion was that I don't know you so I didn't know how much experience you have with editing. Some newcomers honestly don't know that they can add text over their videos on the frames they want!

Haha, okay I understand. Sorry. I have done lots of tedious jobs in the past, though I'm not even sure if I Sony Vegas is going to keep up with little over a thousand little text tracks. I'm running an AMD FX 8350 CPU, which isn't all that stable with video editing.

It sounds like a really cool project though! I hope someone else has an automated solution for you. Maybe FFMPEG can accomplish what you want? I've never used it, but I've seen a lot of questions and answers about it in this community. FFMPEG has command-line features (I think) that can handle some bulk / repetitive tasks.

The best way to do it is with Vegas scripting. I have not used it myself but it should be able to accomplish what you're looking for.
https://www.vegascreativesoftware.com/us/downloads/#c24726

If you have Excel, presumably you have PowerPoint? If so, there may be a way to get what you’re looking for that way. The basic idea would be something like this:

Construct a chart using the Excel data;
Put that into PowerPoint as a single slide;
Animate the slide, suppressing the visual items you do not want to appear;
Capture the actual running of that animation with something like Screenflow;
Pull the resulting clip into Vegas and stretch it to cover the required time of the rocket flight
Lie down in a dark room to recover from the effort

The trick is to choose the most appropriate chart to begin with, with the appropriate chart options, and to then suppress the undesired elements in PP. Done right, you could get anything from as complex as the actual chart series lines, all the way down to nothing but the simple numbers you talk about. I’d do as much as possible of the heavy lifting in Excel, and even prior to creating the chart. Consider things like splitting the data points into series that then all use the same x axis values. That’s the kind of thing that would let you get the consecutive numbers to be located at the same point in your video.
Dunno. If you’re strong on Excel and on PowerPoint animations, give it a ponder?


text:
Can you losslessly ediit H264 at the GOP level?
My scenario is this: I have a few .mp4 files containing H264 video with AAC audio. Each file was encoded from a DVR source. There are a few frames too many at both the beginning and end of the file (less than 1 second worth). I want to edit off these few frames.
The problem is that I can tell that the first keyframe falls a couple seconds into the desired video.
I'd like to chop the first few undesired frames off of the video, but I'd like to not have to re-encode the entire file because this comes with the inherent generation loss of re-encoding already compressed video (and the time taken).
(I'm ignoring audio issues for the moment - for MP3 there are frame-level editors like MP3DirectCut and I think there's something similar for AAC audio. I can use ffmpeg to split the two streams out and work with them independently and then later remux them into a new .mp4 file.)
Here's a simple illustration of what I'd like to do:
Source file
|------GOP---------|------GOP---------|------GOP-----|
IBBPBBPBBPBBPBBPBBPIBBPBBPBBPBBPBBPBBPIBBPBBPBBPBBPBBI...
^   ^
|   first desired frame
- undesired frame(s)

Re-encoded first GOP, other GOPs copied losslessly:
|----New GOP----|------GOP---------|------GOP-----|
IBPBBPBBPBBPBBBPIBBPBBPBBPBBPBBPBBPIBBPBBPBBPBBPBBI
|               |
+---------------+
re-encode just these
frames to a new short
GOP, copy all remaining
GOPs losslessly

I could be completely wrong, but my understanding of video encoding leads me to believe that GOPs are independent sets of frames that can stand alone; you need all of the frames of a GOP to decode the GOP, but one GOP will not be dependent upon another GOP. So, unless that assumption is completely wrong, I imagine something like this should work, theoretically:

Re-encode the first couple of seconds of the video, starting at the desired frame, using the same settings (profile, level, etc.) that encoded the original source. I'd need to be able to do one of the following:

Extract off the first GOP of this newly-encoded file, and truncate that GOP so it ends on the frame right before the keyframe of the next GOP in the original file.
Specify a hard limit on the number of frames per GOP during encoding, so that I could then extract off the first GOP and it would already be the correct size.

Take this new shortened GOP and append all but the first GOP of the original file. The end result would be a new H264 stream where only the first GOP has been re-encoded; all the rest of the GOPs would be copied losslessly.

I'm not necessarily against a paid tool, but pretty much any NLE is going to involve re-encoding the video at some stage. My goal is to bring as much as possible over from the original video losslessly. (Basically, if I could do this, the only area I'd be suffering any generation loss is in the first second of the file, which is likely to be a fade-in or even some black frames and of little importance to the overall presentation.)
Can this be done??

FYI, GOP nomenclature, I frames are generally equivalent to your key frames. P and B frames are equal to your I's. You may want to update your example so that people aren't confused. You should also be aware that depending on your user case, variable GOP lengths can cause problems.

This is possible to do, in theory. The key is to match all relevant source bitstream properties when encoding.
#1 Segment source video
ffmpeg -i source.mp4 -c copy -an -f segment -segment_time 0.01 seg%d.ts

Since the segment muxer by default only splits at keyframes, by providing a very low segment time, each produced segment will be one GOP long.
(I suggest using the whole audio from the source, we don't extract it here)
#2 Re-encode first segment
ffmpeg -i seg1.ts {-encoding args} -copyts -x264opts stitchable{+any-other-args} new1.ts

It's important here to match source settings.
#3 Rejoin segments
ffmpeg -i "concat:new1.ts|seg2.ts|..." -i source.mp4 -c copy -map 0 -map 1:a new.mp4

This is a partial solution but doesn't solve the original question. Doing this as-is will simply re-encode the first GOP, but without truncating it. I tried re-encoding the first GOP with the -ss option, which worked, but then when I use the concat protocol there is a gap between the last frame of the newly encoded GOP and the first frame of the next one, which is exactly the length I cut off the beginning. It appears to be a timestamp issue. I tried using the concat demuxer, but that messes up the framerate of the video (and thus changes its length and messes up audio sync).

Add -reset timestamps 1 to step 1 command and use the concat  demuxer in step 3.

Or with my original set of cmds, use -copyts in step 2.

I fixed it by adding -copyts -start-at-zero to the step where I re-encode the first GOP of the video. I also had to write a Python script to generate the huge list ( seg2.ts|seg3.ts|... ) but it does seem to work. I also was able to truncate off the end by simply re-encoding the final GOP with the -t parameter. I'm giving you the answer credit since you got me in the right direction, and I'll post a more complete list of what I had to do to make it work below.

Avidemux is a simple, open-source video editor which allows for trimming clips without re-encoding. You open your video, choose the trimming marks, and set the "Video Output" to "Copy" before saving.
Here is a tutorial on using it for lossless trimming:
https://steemit.com/videography/@phloatingman/tutorial-how-to-trim-a-video-without-transcoding-using-avidemux
Internally because of the way H.264 works, you can trim trailing P/B frames from a GOP, but if you trim out an I frame, you will need to trim out the entire GOP. Avidemux warns you of this. If you needed an exact trim and it fell mid-GOP you might need to make two clips (with a re-encoding of only the first one) and then join them in Avidemux.

I gave answer credit to @Mulvya since that post got me in the right direction. Here is what I did to trim off the beginning of the video files:

ffmpeg -i source.mp4 -c copy -an -f segment -segment_time 0.01 seg%04d.ts - This split the source stream into hundreds of segments, one per GOP of source video.
ffmpeg -ss 00:00:01.5 -i seg0000.ts -c:v libx264 -copyts -start_at_zero -x264opts stitchable -profile:v high -level 5.0 -crf 18 seg0000a.ts - This encodes the first GOP to a new ts stream, truncating off the beginning 1.5 seconds.

A few files wouldn't truncate correctly, so I first converted them to lossless FFV1 video: ffmpeg -i seg0000.ts -c:v ffv1 -level 1 -coder 1 -context 1 -g 1 seg0000.mkv and then executed the above command against the .mkv file.

To trim off from the end of the video, I encoded the final GOP truncating it: ffmpeg -t 00:00:03.20 -i seg1044.ts  -c:v libx264 -copyts -x264opts stitchable -profile high -level 5.0 seg1044a.ts - This encodes only the first 3.2 seconds of the final GOP, truncating the rest. (GOPs in the source video were about 5 seconds each, so this truncated 1.8 seconds.)
ffmpeg -i source.mp4 -c copy -vn audio.m4a - extract the audio
Trim the audio using an external tool. MP3DirectCut can do frame-accurate trimming of M4A/AAC audio, and delaycut can do frame-accurate trimming of AC3/EAC3/DTS audio.
Used a python script to generate a string containing all the .ts files. There's lots of ways to accomplish this sort of thing. I ended up with a long string on the clipboard: seg0000.ts|seg0001.ts|...|seg1044.ts
Pasted this long string into a text editor and changed seg0000.ts and seg1044.ts to seg000a.ts and seg1044a.ts respectively.
Combine the video segments: ffmpeg -fflags +igndts -i "concat:{string generated in steps 6-7 here}" -c copy -fflags +genpts video.mkv
Finally, re-combine the trimmed audio: ffmpeg -i video.mkv -i audio.m4a -c copy -map 0:0 -map 1:0 final-video.mp4

I imagine this process could probably be optimized further, but this is what ultimately worked after messing with it for over an hour.
(Hint: I found it convenient to extract all the frames of one GOP to .png files for easy browsing to determine which frame to cut at. For example: ffmpeg -i seg0000.ts seg0000-frame%03d.png)

EDIT: This is the Python script I wrote to generate the concat: list:
# ffconcat.py

import sys
from os.path import basename
from os import listdir

if (len(sys.argv) < 2):
        print("Syntax: %s [extension]" % (sys.argv[0], ))
        exit(1)

filelist = list(filter(lambda y: y.endswith("."+sys.argv[1]), sorted([basename(x) for x in listdir('.')])))
filestring = "|".join(filelist)

sys.stdout.write("concat:"+filestring)
sys.stdout.flush()

You could use it in step 7 by first removing the "original" .ts files (e.g. seg000.ts) and then using it like:
ffmpeg -fflags +igndts -i `python3 ffconcat.py ts` -c copy -fflags +genpts video.mkv

This script is very simple (it only scans the current directory) so if you wanted to put the muxed video elsewhere you could, for example:
ffmpeg -fflags +igndts -i "concat:{string generated in steps 6-7 here}" -c copy -fflags +genpts ../video.mkv

Feel free to use/improve this script.

To trim off from the end of the video --> no need to re-encode if trimming off the end. start_at_zero is only required if ss is before the input -i.


text:
White balance auto-adjusted half way through recording
Unbeknownst to me at the time, the camera I was using to record a talking head (so fixed environment and lighting) seems to have drastically altered its colour temperature part-way through recording. I put my hand in front of the lens at one point, and as well as refocusing to the hand (thankfully temporarily) the camera appears to have shunted everything toward blue from that point on. The talking head goes from warm and 'naturally skin-coloured' to beyond pallid.
It was recording to an Atomos Ninja in ProRes 422 HD, which I understand 'bakes' white balance directly into the recorded data as opposed to storing it as metadata like RAW.
Q1: Am I correct here, or is it actually possible to retrieve per-frame colour balance settings from a ProRes .mov file? If so, this would be my preferred option as I can then 'objectively' reverse it. I've tinkered with ffprobe but it doesn't yield anything useful-looking.
Q2: If I am correct that the colour shift exists in the video data itself, what's the best post-recording correction method? Working in my favour is a) the background never changes so before/after can be compared on a per-pixel basis, and b) The shift occurs at a single time, with the colour stable before and after. So only one correction need be applied, and I know when.
I'm using MATLAB (this is computer-vision related), which at first glance offers white point, grey world, and PCA-based correction.
For visualisation here's two frames from before and after the camera auto-corrected, with pixels plotted in RGB space. Right now I'm thinking of computing some rigid transform in RGB space to overlap one with the other, but this question is asking whether there's a more 'standard' solution.

A1: Links like these mention that ProRes 'bakes in' the white balance (as opposed to storing it as separate metadata): blackmagicdesign.com forum ; reduser.net forum ; reduser.net forum ; cinematography.com forum ; bmcuser.com archive
(I am surprised this is not more obviously stated on the web anywhere - it seems to be assumed knowledge)
A2: I did end up computing the least-squares solution that brings the 'bad' pixels over to the 'good' ones in RGB space. This gave me a 3x3 transformation matrix that could be applied to each pixel of the bad frames. After this their colour looked very much like that of the good frames.
In MATLAB this is as simple as reshaping one's image matrices into long 3xN lists of pixels (A = the bad frames, B = the good frames) and computing M = B/A, i.e. solving MA=B for M.

That seems like a very good solution. I was going to suggest tracking an area of colour and using it to drive a colour corrector in After Effects, but using MATLAB and hand-rolled statistical analysis  wins on nerd points alone.

What I lack in video recording knowledge I make up for in linear algebra! Or maybe when all you have is a hammer, everything looks like a nail...


text:
Lossless color compression
I need to reduce the file size of an mp4 video. I don't need color information at all but pixel brightness resolution must be preserved. Videos consist of white background with a few (important) black dots of about 5px diameter. I am confused about what the best method/output would be.

Without knowing the video properties, my generic answer is
ffmpeg -i in.mp4 -vf geq=lum='p(X,Y)':cb=128:cr=128 out.mp4

This will reset the color information, but pass the luma plane intact. Add -crf 0 for truly lossless re-encoding.

This is the faster way,
ffmpeg -i in.mp4 -vf extractplanes=y,format=yuv420p out.mp4

The luma plane is extracted, and then neutral chroma planes are added in the pixel format conversion. This 2nd step is added because otherwise ffmpeg will auto-convert pixel format to yuv444 which isn't widely compatible.

Awesome, that works. Is this the quickest way? If not, what information would need to know for a faster/better solution?

There's one potentially quicker way but I have to check whether it alters the luma.


text:
FFmpeg - One input, two outputs each one w/ different complex_filter - Map error?
I use a Decklink to capture video and ffmpeg to stream it to a localhost rtmp server (low compression, HD) and to a remote CDN (high compression, low resolution). I have used this command with success for many mounths:
ffmpeg -hide_banner -loglevel info -xerror -err_detect buffer -format_code Hi59 -threads 1 -thread_queue_size 32 -f decklink -i 'DeckLink Mini Recorder' -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -vf scale=1280:720 -profile:v high -level 4.1 -b:a 192k -b:v 3500K -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://127.0.0.1:1935/live/alta -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -vf scale=896:504 -profile:v high -level 3.1 -b:a 96k -b:v 900k -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://user:pass@srv3.zoeweb.tv:1935/z474-live/aovivo 2> >(tee /mnt/ramdisk/ffmpeg_error.log >&2)

Some day I need a box for telephone number over HD output in a way that number can be script changed. So I used ZMQ library with sucess:
ffmpeg -hide_banner -loglevel info -xerror -err_detect buffer -format_code Hi59 -threads 1 -thread_queue_size 32 -f decklink -i 'DeckLink Mini Recorder' -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -filter_complex '[0:v] zmq=bind_address=tcp\\\://127.0.0.1\\\:5557,drawtext=text=:fontfile=hp_impact.ttf:x=870:y=850:fontcolor=white:fontsize=105:bordercolor=black:borderw=3:boxcolor=0xC12235:box=1:boxborderw=20,scale=1280:720' -profile:v main -level 4.1 -b:a 192k -b:v 3500K -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://127.0.0.1:1935/live/alta -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -vf scale=896:504 -profile:v high -level 3.1 -b:a 96k -b:v 900k -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://user:pass@srv3.zoeweb.tv:1935/z474-live/aovivo 2> >(tee /mnt/ramdisk/ffmpeg_error.log >&2)

(to change the text I use this command:
echo Parsed_drawtext_1 reinit text='xxxxxxxxxx' | zmqsend -b tcp://127.0.0.1:5557

and the result (working) is:
[decklink @ 0x555668d3bb40] Found Decklink mode 1920 x 1080 with rate 29.97(i)
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, decklink, from 'DeckLink Mini Recorder':
  Duration: N/A, start: 0.000000, bitrate: 995869 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0:1: Video: rawvideo (UYVY / 0x59565955), uyvy422(top first), 1920x1080, 994333 kb/s, 29.97 tbr, 1000k tbn, 1000k tbc
[rtmp @ 0x555668d49d80] Ignoring unsupported var reason
Stream mapping:
  Stream #0:1 (rawvideo) -> zmq (graph 0)
  scale (graph 0) -> Stream #0:0 (libx264)
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
  Stream #0:1 -> #1:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #1:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x555668d6d180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x555668d6d180] profile Main, level 4.1
[libx264 @ 0x555668d6d180] 264 - core 150 - 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=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=3500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 0x555668d4bc40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x555668d4bc40] profile High, level 3.1
[libx264 @ 0x555668d4bc40] 264 - core 150 - 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_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1100 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://127.0.0.1:1935/live/alta':
  Metadata:
    encoder         : Lavf58.3.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p(top coded first (swapped)), 1280x720, q=-1--1, 3500 kb/s, 29.97 fps, 1k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/3500000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc58.9.100 aac
Output #1, flv, to 'rtmp://pass:pass@srv3.zoeweb.tv:1935/z474-live/aovivo':
  Metadata:
    encoder         : Lavf58.3.100
    Stream #1:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p(top coded first (swapped)), 896x504, q=-1--1, 1100 kb/s, 29.97 fps, 1k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1100000 buffer size: 0 vbv_delay: -1
    Stream #1:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      encoder         : Lavc58.9.100 aac
frame=   67 fps= 67 q=21.0 q=35.0 size=      90kB time=00:00:02.17 bitrate= 340.2kbits/s speed=2.16x

Great. It´s working!!  :-)
But I need to create a box for another number over the second output too, with different numbers for eath output and in a way that can be manually/script changed. So I think in use ZMQ library again...
The problem is: When I try to use the same complex_filter (only with the  correct scale and another udp port) on the second (lowres) rtmp output I receive this error message:
ffmpeg -hide_banner -loglevel info -xerror -err_detect buffer -format_code Hi59 -threads 1 -thread_queue_size 32 -f decklink -i 'DeckLink Mini Recorder' -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -filter_complex ' zmq=bind_address=tcp\\\://127.0.0.1\\\:5557,drawtext=text=:fontfile=hp_impact.ttf:x=870:y=850:fontcolor=white:fontsize=105:bordercolor=black:borderw=3:boxcolor=0xC12235:box=1:boxborderw=20,scale=1280:720' -profile:v main -level 4.1 -b:a 192k -b:v 3500K -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://127.0.0.1:1935/live/alta -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -filter_complex ' zmq=bind_address=tcp\\\://127.0.0.1\\\:5558,drawtext=text=:fontfile=hp_impact.ttf:x=870:y=850:fontcolor=white:fontsize=105:bordercolor=black:borderw=3:boxcolor=0xC12235:box=1:boxborderw=20,scale=896:504' -profile:v main -level 3.1 -b:a 96k -b:v 900k -r 30000/1001 -vcodec libx264 -acodec aac -f flv rtmp://user:pass@srv3.zoeweb.tv:1935/z474-live/aovivo 2> >(tee /mnt/ramdisk/ffmpeg_error.log >&2)

[decklink @ 0x56316fb6dcc0] Found Decklink mode 1920 x 1080 with rate
29.97(i) Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, decklink, from 'DeckLink Mini Recorder':   Duration: N/A, start: 0.000000, bitrate: 995869 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0:1: Video: rawvideo (UYVY / 0x59565955), uyvy422(top first), 1920x1080, 994333 kb/s, 29.97 tbr, 1000k tbn, 1000k tbc Cannot
find a matching stream for unlabeled input pad 0 on filter
Parsed_zmq_0

I think that is a mapping case, but as much as I read and try I could not get it right. :-(
Can someone put me in the right way?

Your input has only one video stream. To reuse it for multiple filter chains, you need either express labelled input pads or a split filter. You'll also need -map option for each output.
ffmpeg -hide_banner -loglevel info -xerror -err_detect buffer -format_code Hi59 -threads 1
       -thread_queue_size 32 -f decklink -i 'DeckLink Mini Recorder'
       -filter_complex '[0]zmq=bind_address=tcp\\\://127.0.0.1\\\:5557,split=2[720p][504p];[720p]drawtext@720p=text=:fontfile=hp_impact.ttf:x=870:y=850:fontcolor=white:fontsize=105:bordercolor=black:borderw=3:boxcolor=0xC12235:box=1:boxborderw=20,scale=1280:720[720p];[504p]drawtext@504p=text=:fontfile=hp_impact.ttf:x=870:y=850:fontcolor=white:fontsize=105:bordercolor=black:borderw=3:boxcolor=0xC12235:box=1:boxborderw=20,scale=896:504[504p]'
       -map '[720p]' -map 0:a -vsync cfr -pix_fmt yuv420p -g 60 -preset medium  -profile:v main
       -level 4.1 -b:a 192k -b:v 3500K -r 30000/1001 -vcodec libx264 -acodec aac
       -f flv rtmp://127.0.0.1:1935/live/alta
       -map '[504p]' -map 0:a -vsync cfr -pix_fmt yuv420p -g 60 -preset medium -profile:v main
       -level 3.1 -b:a 96k -b:v 900k -r 30000/1001 -vcodec libx264 -acodec aac
       -f flv rtmp://user:pass@srv3.zoeweb.tv:1935/z474-live/aovivo 2> >(tee /mnt/ramdisk/ffmpeg_error.log >&2)

Thanks Gyan !
I will test your solution. I think that it´s the way, perhaps it´s not the final answer because to create two different texts (on on each output stream) with different strings (each one feed by one different zmq filter in different udp ports) the filter and maps need to be changed, but I learn a lot with your answer.

No, you only need one zmq filter, listening on one port. When you send command, change your target and string e.g. echo drawtext@720p reinit text='xx' | zmqsend -b tcp://127.0.0.1:5557 and echo drawtext@504p reinit text='yy' | zmqsend -b tcp://127.0.0.1:5557


text:
two pass encoding Cannot write log file 'ffmpeg2pass-0.log' for pass-1 encoding
I'm trying to execute a two-pass encoding with compiled ffmpeg library in android.
I'm running my app on a device that is not rooted. So after executing below commands I get :

Cannot write log file 'ffmpeg2pass-0.log' for pass-1 encoding:
  Read-only file system

List<String> testEncodeList = new LinkedList<>();
testEncodeList.add("-i");
testEncodeList.add(inputPath);
testEncodeList.add("-pass");
testEncodeList.add("1");
testEncodeList.add("-f");
testEncodeList.add("null");
testEncodeList.add("-");
// cmd.add("/dev/null");
runSingleFFmpegTask(this, testEncodeList, new ExecuteBinaryResponseHandler() {
    @Override
    public void onSuccess(String message) {
        super.onSuccess(message);
        SRLog.i("FFMPEG_PASS1:" + "onSuccess" + "\n" + message);

        List<String> cmd = new LinkedList<>();
        cmd.add("-i");
        cmd.add(inputPath);
        cmd.add("-pass");
        cmd.add("2");
        cmd.add(generateOutput(MP4_FORMAT));
        runSingleFFmpegTask(AudioComp.this, cmd, new ExecuteBinaryResponseHandler() {
            @Override
            public void onSuccess(String message) {
                super.onSuccess(message);
                SRLog.i("FFMPEG_PASS2:" + "onSuccess" + "\n" + message);
            }

            @Override
            public void onFailure(String message) {
                super.onFailure(message);
                SRLog.i("FFMPEG_PASS2:" + "onFailure" + "\n" + message);
            }
        });

    }

    @Override
    public void onFailure(String message) {
        super.onFailure(message);
        SRLog.i("FFMPEG_PASS1:" + "onFailure" + "\n" + message);
    }
});

Can I force log file 'ffmpeg2pass-0.log' be written in a custom path where a non-rooted device could access?

You have to set the -passlogfile option e.g. -passlogfile my/folder/path/fileprefix. ffmpeg will then write logs to files starting with fileprefix- in my/folder/path/. Set the option and same value in latter passes. The folder path must already exist.

is this option has any extra setting to clean itself after encoding is finished? I mean any logs that is generated by this option to be deleted after process is done. I can't keep track .log files name.

I don't see one. You may open a ticket at trac.ffmpeg.org, if you like.

Based on official doc, the default value of -passlogfile is ffmpeg2pass-0.log which if you do not override when using two pass encoding, ffmpeg will try to write this file in the system path where a non rooted device doesn't like, so encoding process will fail.
The solution is to override -passlogfile:
-passlogfile /mnt/sdcard/myCustomPath  //without extension
full example of a Two-pass encoding
public static void run2PassEncoding(Context context) {

    List<String> pass1Commands = new LinkedList<>();

    String tempLogPath = "/storage/emulated/0/2passLog";
    String inputPath = "/storage/emulated/0/myVideo.mp4";
    String output = "/storage/emulated/0/output.mp4";

    pass1Commands.add("-y");
    pass1Commands.add("-i");
    pass1Commands.add(inputPath);
    pass1Commands.add("-codec:v");
    pass1Commands.add("libx264");
    pass1Commands.add("-passlogfile");
    pass1Commands.add(tempLogPath);
    pass1Commands.add("-preset");
    pass1Commands.add("veryfast");
    pass1Commands.add("-b:v");
    pass1Commands.add("500k");
    pass1Commands.add("-maxrate");
    pass1Commands.add("500k");
    pass1Commands.add("-bufsize");
    pass1Commands.add("1000k");
    pass1Commands.add("-vf");
    pass1Commands.add("scale=420:-2");
    pass1Commands.add("-pass");
    pass1Commands.add("1");
    pass1Commands.add("-an");

    pass1Commands.add("-f");
    pass1Commands.add("null");
    pass1Commands.add("-");

    runSingleFFmpegTask(context, pass1Commands, new ExecuteBinaryResponseHandler() {
        @Override
        public void onSuccess(String message) {
            super.onSuccess(message);
            Log.i("FFMPEG_PASS1: " + "onSuccess" , message);

            List<String> pass2Commands = new LinkedList<>();
            pass2Commands.add("-y");
            pass2Commands.add("-i");
            pass2Commands.add(inputPath);
            pass2Commands.add("-codec:v");
            pass2Commands.add("libx264");
            pass2Commands.add("-passlogfile");
            pass2Commands.add(tempLogPath);
            pass2Commands.add("-preset");
            pass2Commands.add("fast");
            pass2Commands.add("-b:v");
            pass2Commands.add("500k");
            pass2Commands.add("-maxrate");
            pass2Commands.add("500k");
            pass2Commands.add("-bufsize");
            pass2Commands.add("1000k");
            pass2Commands.add("-vf");
            pass2Commands.add("scale=420:-2");
            pass2Commands.add("-pass");
            pass2Commands.add("2");
            pass2Commands.add("-codec:a");
            pass2Commands.add("libfdk_aac");
            pass2Commands.add("-b:a");
            pass2Commands.add("128k");
            pass2Commands.add(output);

            runSingleFFmpegTask(context, pass2Commands, new ExecuteBinaryResponseHandler() {
                @Override
                public void onSuccess(String message) {
                    super.onSuccess(message);
                    Log.i("FFMPEG_PASS2: " + "onSuccess" , message);
                }
            });
        }

        @Override
        public void onFailure(String message) {
            super.onFailure(message);
            Log.i("FFMPEG_PASS1:" + "onFailure" + "\n" , message);
        }
    });

}

note: if you don't know how to use ffmpeg in android, start by using pre compiled ffmpeg.
like this one:
https://github.com/bravobit/FFmpeg-Android
or this one:
http://writingminds.github.io/ffmpeg-android-java


text:
How to achieve the "magic swipe" effect in this video?
How to achieve the "magic swipe" effect in this video (at 0:16)?
https://www.facebook.com/diplycrafty/videos/1867777256617888/
Is it necessary to use After Effects? Can other open source software do so too?

Assuming you're using a layer based compositor (like After Effects) you need two layers. The top layer has the half-painted box with the hand swiping over it. The bottom has the fully painted box, and no hand, but everything else is the same as the first shot.
Now you need to make a matte that corresponds to the trailing edge of the hand, and extending (roughly) to the the top left of the screen and down the left side. As the hand moves across this matte will follow it, so that at the start it is not over the box, and at the end it completly covers it. the easiest way to do this would be to trace the hand, but there are other ways like rotobrush in After Effects. Apply this matte to the top layer so that it hides everything inside it.
Alternatively you could shoot the hand over a green background and use chroma keying to remove the background. Then use a simple matte to reveal the painted box, with the transition hidden by the hand layer. You could even get away with a single still image of the hand, animated to look like it was moving, if the movement is fast and simple enough.
It's certainly doable with After Effects, but You could use Blender or any compositor or NLE that has the capability to create moving mattes

So the key element is the matte thing, right? I am just a newbie in video editing btw

Also, is it doable in Natron ?

Sorry, I don't know enough about Natron to say.


text:
Which bitrate is needed for dvd quality?
As far as I know, cd quality for mp3s is at least 128 kbps.
What should the video bitrate be to obtain dvd quality?
Note I'm using mp4 container with mp3 audio and mpeg4 video.


text:
How to create widely readable video stream with ffmpeg?
As for test I use just a file with data as input and I would like to stream it as video. For this purpose I used ffmpeg:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump
  -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an -f mpegts udp://localhost:20001

(I broke the line for readability). And with MPEG4 as video codec:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump -vcodec mpeg4
  -f mpegts udp://localhost:20001

While ffmpeg was streaming data I executed ffplay to see I can read the stream. I could.
So then I tried the same with VLC player and PotPlayer, giving stream address as "udp://localhost:20001" and "udp://@:20001", with firewall enabled and completely disabled. With those players I have no success at all -- PotPlayer after few seconds gives me an error that it cannot read stream, VLC on the other hand show progress (bouncing yellow line) ad infinitum.
What should I do to make non-ffplay software read the stream as well?
I use Windows 10 if this matters.

I executed:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -re
  -i clean-frames.dump -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an
  -f mpegts udp://localhost:20001 2> log.log

And here is the log file:
ffmpeg version git-2020-05-23-26b4509 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 48.100 / 56. 48.100
  libavcodec     58. 87.101 / 58. 87.101
  libavformat    58. 43.100 / 58. 43.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 83.100 /  7. 83.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[rawvideo @ 000001a01bb9f0c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'clean-frames.dump':
  Duration: 00:02:27.50, start: 0.000000, bitrate: 424673 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 2592x2048, 424673 kb/s, 10 tbr, 10 tbn, 10 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000001a01bbaabc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001a01bbaabc0] profile High, level 5.0, 4:0:0, 8-bit
Output #0, mpegts, to 'udp://localhost:20001':
  Metadata:
    encoder         : Lavf58.43.100
    Stream #0:0: Video: h264 (libx264), gray, 2592x2048, q=-1--1, 10 fps, 90k tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.87.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    6 fps=0.0 q=46.0 size=      15kB time=00:00:00.00 bitrate=10938181.8kbits/s speed=2.17e-05x
...
frame= 1475 fps= 10 q=-1.0 Lsize=     950kB time=00:02:27.40 bitrate=  52.8kbits/s speed=0.999x
video:108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 779.101868%
[libx264 @ 000001a01bbaabc0] frame I:6     Avg QP:43.83  size: 13976
[libx264 @ 000001a01bbaabc0] frame P:1469  Avg QP:45.48  size:    18
[libx264 @ 000001a01bbaabc0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000001a01bbaabc0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 000001a01bbaabc0] coded y intra: 0.0% inter: 0.0%
[libx264 @ 000001a01bbaabc0] i16 v,h,dc,p: 83% 13%  4%  1%
[libx264 @ 000001a01bbaabc0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 000001a01bbaabc0] kb/s:6.00

Literally entire log is here: https://pastebin.com/6g3JD6Gk

Try adding -re input option, and include the complete log from command #1.

@llogan, thank you. I updated the question.


text:
Mi Sphere 360, where is stored the gyro data?
I bought a Xiaomi Mijia MI SPHERE 360 Camera, it has an embedded gyroscope. The iOS app allows exporting stabilized movies combining the video and gyro data.
The camera records .mp4 files of the following format: ISO Media, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005]
I would like to retrieve the gyro information of my movie along the movie. I can imagine there is exif like metadata for each frame where the camera would store specific information but I have not found any way yet to put the hand on it.
How could I retrieve the metadata per frame containing this information?
[Edit]
Here is a github project containing 2 short (10sec) clips I made. I recorded in the dark. One is steady (camera laid on the ground) the second one shaking. Both have a useless? audio track.

Does the iOS app work with a rewrapped file: ffmpeg -i orig.mp4 -c copy new.mp4

@Mulvya I made the copy and put it back on the key, the file is seen by the iOS app as corrupted, there is no preview thumbnail and downloading it results in a 360 video without the gyro calibration and without the lens calibration neither. It is like the app takes a FOV of +200° instead of 190°. I, therefore, suspect the file to contain a padding of proprietary data holding the gyro, thumbnail and lens calibration information. Next step… to find it and decrypt.

@Mulvya you can post an answer as there is none yet and I've 16 hours remaining to award the bounty (or it will just be lost forever).

Added some info as answer.

In the photos the data is for sure stored in a proprietary way. Usually such data is stored in custom exif tags, but there are no exif tags in the images even though they contain the information. The exif tag called User comment actually has exactly 36 bytes of binary data, which corresponds to the answer by Flavien Volken.

The data are stored within the file disregarding of the .mp4 file standard.
the chunk containing those per frame data starts with: #¿Ttlyd or 23C05474 6C7964in hex

Each frame has 36 bytes of data, those seem to be 9 floats of normalized (from -1 to 1) numbers
Those numbers seem to be a 3x3 matrix representing the current coordinate system for this frame.

Did you find out if it is really a 3x3 rotation matrix, and what is the format of the floats?

Well… kind of but it's a mess to get the proper axis. Check my repo for a working viewer POC made in angular. https://github.com/Xample/mi-sphere-gyro-extractor

There is a madv box in the udta atom that is not normally seen in MP4s
type:'madv' parent:'udta' sz: 3145728 115 3145835

It has sufficient size for it to be a candidate.
This is a dump of the first ~350 bytes
madv: s=   3145728 (0x00300000), o=   1950821 (0x001dc465)
  000000   00 00 00 ac 63 75 74 6c  00 00 00 00 00 00 00 00  |....cutl........|
  000010   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000020   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000030   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000040   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000050   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000060   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000070   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000080   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000090   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  0000a0   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 0c  |................|
  0000b0   66 6c 74 72 00 00 00 00  00 00 00 88 63 61 69 66  |fltr........caif|
  0000c0   32 30 31 38 30 33 33 31  00 00 00 00 00 00 00 00  |20180331........|
  0000d0   31 31 00 00 30 00 00 00  00 00 00 00 00 00 00 00  |11..0...........|
  0000e0   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  0000f0   51 4a 58 4a 30 31 46 4a  00 00 00 00 00 00 00 00  |QJXJ01FJ........|
  000100   31 2e 33 2e 31 30 34 2e  31 31 31 2e 35 2e 31 37  |1.3.104.111.5.17|
  000110   33 33 32 00 00 00 00 00  00 00 00 00 00 00 00 00  |332.............|
  000120   31 35 39 30 38 2f 30 30  30 30 38 30 36 32 00 00  |15908/00008062..|
  000130   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  000140   00 00 02 5c 67 70 73 78  00 00 00 00 00 00 00 00  |...\gpsx........|
  000150   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Although not knowing the storage format, I can't confirm it or parse it.


text:
how to downscale 4k with ffmpeg
I have been searching all the web on how to downscale 4k video so that it can play on my non 4k TV.
My 4k video has a resolution of 3840 x 2160 with an audio format of pcm_s16be in a mp4 container. I am trying to convert it to 1920 x 1080 with an audio format of aac.
I use Lubuntu and have been experimenting with the command lines without success.
Thanks
Update -- After further searching I found this code which converts the audio from pcw to aac
ffmpeg -y -i C0010.MP4 -vcodec copy -strict experimental  -c:a aac output-fileC0010.MP4

What command did you try?

I have lost track of the number of commands I have tried but here is an example - ffmpeg -i output-file.MP4-vf scale=iw/2:-1 outputt.mp4

Assuming the lack of space between MP4 and -vf is a typo, command looks ok. What's the issue?

Ah, but I still have not managed to write the command to downscale the video after encoding the audio ...


text:
Is there an online video server that can show paneable extremely large videos?
I want to turn a set of high-resolution satellite images of the Earth (10,000x10,000 pixels) into a time-lapse video. But instead of downsizing the images, I would like that people could zoom into specific areas of the video in real-time, and pan through it.
Is that possible?
Is there any web player with such feature?
I've seen videos of cameras that film in all directions and as the video plays you can choose in which direction to look. How is that technique called? Something similar would be extraordinary.

When it's done with still images it's called gigapixel images. The technique of filming in all directions is called different things, depending on the viewer - if it's a headset it's VR, clicking and dragging on the video is usually called 360 video. I haven't seen anyone combining the two, but I bet there's a startup somewhere doing it right now.

Sounds like you just want a 360° style picture

@TravisO Yes, but on a video, not a still picture.

Ok so how is this not a 360° videos like what YouTube allows?  Is this just a "I want 360 just like YT but higher res?"

@TravisO No, to start is not 360, it is just a zoomable video. Like when you zoom in a map, but this would be an animated map made out of thousands of sat images.

With current technology no, you "can not"; and with more powerful technology it is a waste of resources.
You do not need to stream a gigapixel video, you need to stream a video, receive the new "interest" zone, process the coordinates and display a new version of the video. Even arrange different chunks of different videos.
This is what google maps, bing maps or other applications do. They do not send you all the photos of the planet, just the ones you need.

I agree with no-optimal usage of resources, but then how would he convert a maps-like image representation into a video? Maybe it is not a video but a zoom-able map first. Then he can have another slider (like Apple Time Machine) to go through time. And yes, he can then make the time slider to move through automatically at a fixed rate to give effect of a video.

You may want to look into Prezi.
I think it might be the right tool for the job, as it allows for a nearly infinite canvas and has a user interface that allows for users to navigate around the canvas to view different media, video, photos, etc.
I'm not familiar enough with Prezi to give advice on a specific workflow. But it's the program I'd look at first.
A second option, would be to build it in Flash.


text:
How to Fix Warp Stabilizer Incorrect Rotation
I am using Warp Stabilizer on some footage and it's almost perfect but there's a random erroneous rotation in the middle.
Is there a way I can fix this manually, maybe go into the keyframes or correct some points?
Edit: or just disable rotation all together? (while keeping position and scaling)
Here is an example clip
(btw I lowered the frame-rate to make the stabilization faster)
Thank you!

sorry I don't use this forum and have zero time to answer, but from the clip you posted I'd strongly suggest you don't use warp stabilizer - instead use "stabilize motion" and then make sure to check the "rotation" parameter so that you are given a second tracker - then once you've stabilized the position and rotation of the footage you'll have to do a little extra to manually slide the footage left or right depending on where the camera goes (look into stuff like "setting a null as the target for tracking motion" and you'll get a better understanding of all this stuff).