text:
How do I avoid objects having flickering edges when I encode a screen recording to mp4 using x264 and ffmpeg?
The Goal
I'm creating short tutorials by recording my screen (720p30fps). The content is just a recording of using some desktop software - so mouse moving and opening dialogs, typing, drawing shapes, etc. No high speed action like in a game, no live footage, no talking head or anything like that. After basic editing of the original screen recording, I want to encode the videos to webm and mp4 formats at exactly the same resolution and framerate that I recorded and I want the playback quality to be as close to the original recording quality as possible. So there should be no visible compression artifacts after final encoding.
Regarding the original recording: Resolution is 1280x720 pixels. Framerate is 30 frames per second. Recording software is Simple Screen Recorder. Encoding is H.264 at Constant Rate Factor of 10 (so close enough to lossless) in a Matroska container. Playback of the original shows no artifacts at all.
Then I add some very basic effects like cross fades and text overlays to the original MKV using blender. Then render out to an image sequence (PNG format). I use high quality image export from Blender, and again the output images show no sign of compression artifacts.
The problem
The problem occurs after I encode the image sequence to an mp4 video using the x264 encoder with ffmpeg. Sometimes, some parts of some of the hard edges / shape outlines flicker. These are not moving objects. They are motionless in the background compared to where the mouse is moving. It seems random. For example, I could have two yellow rectangles side-by-side, each with a black outline and just the top part of one of the rectangle outlines flickers for a few frames, then stops. It's a bit distracting and ugly for what should be a really clean/easy encode based on a screen recording.
I generally see this for the horizontal dark lines / hard edges. Occasionally I've seen similar for vertical edges.
I haven't noticed this problem yet with the output webm files produced by ffmpeg, only with the x264 encoded mp4 files. The ffmpeg command I use is like this:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -pix_fmt yuv420p -movflags +faststart -crf 22 -r 30 -g 300 -y myvideo.mp4
For webm, I use the same basic command and the same crf value, but obviously a different encoder (libvpx-vp9). The webm file is about 9+MB for 2 minutes of footage. The mp4 is about 3.5MB. Generally, the quality between the two is impossible to distinguish, only at those times where the mp4 has some hard line segments flicker.
I've roughly illustrated the problem below using ASCII art, where I'm trying to show one rectangle across four frames. At first it's fine then for some frames part of rectangle's outline draws with some extra thickness in some parts, making it appear to flicker or jiggle a bit. Then it goes back to being perfect again.
-----------------
|               |
-----------------

------=====------
|               |
-----------------

______=====______
|               |
-----------------

-----------------
|               |
-----------------

Examples
Compare the following images. Notice in the second image the bottom 2 rectangles have an extra grey line appear above or below part of their black border. I captured these images while VLC was replaying my x264 encoded mp4 at 100% (no scale). This is not a really dramatic example, but it's hopefully enough to show whats going on. Because the extra lines appear and disappear, it creates a kind of flicker effect.
Notes:

The recording was captured using Simple Screen Recorder on a 1280x720 screen with LibreOffice Draw maximised. You can't see artifacts in the original recording, nor in the PNG image sequence I exported from Blender.
The command I used to generate the mp4 video was: ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -coder ac -pix_fmt yuv420p -movflags +faststart -crf 22 -bf 16 -b_strategy 2 -refs 16 -direct-pred spatial -me_method umh -me_range 16 -r 30 -g 300 -y myvideo.mp4

(It's easier to notice the artifacts if you cycle between the two images at original size)
Questions
What is this kind of compression artifact called?
What flag can I pass ffmpeg to try suppress it?
What I have tried so far
Lots of experimentation with the CRF and speed values. For CRF I have dropped down to 18 and that does seem to reduce the flicker a bit, but not eliminate it. But that rate factor seems way too low to get a decent encoding of content as simple as a low action screen recording in 720p.
I have also tried manually setting b frames and reference frames to values between 1 and 16, varied the gop size between 30 and 300 and tried different values for the -me_method option. And I tried a couple of the deinterlace settings via the yadif option, but I'm fairly sure that's not relevant to this problem and it only seems to make the output video quality worse. I've ended up with ffmpeg commands looking more like this:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -coder ac -pix_fmt yuv420p -movflags +faststart -crf 22 -bf 16 -b_strategy 2 -refs 16 -direct-pred spatial -me_method umh -me_range 16 -r 30 -g 300 -y myvideo.mp4

But so far only varying the CRF value has had any noticeable effect. I don't want to drop that much lower, because it's going to blow the video size out too much.
Update: Test Results
I used the above example with LibreOffice Draw and a 1280x720p screen to record a clip of about 47 seconds to an H.264 encoded MKV file. I imported this to Blender and exported straight back out as a PNG image sequence- no effects or edits at all. Then I ran the image sequence through ffmpeg with the x264 encoder to produce the mp4 video file.
I started varying my original ffmpeg command one parameter at a time to see the difference. I focused on the CRF value mainly, because that was the only way I could definitely see a reduction in the compression artifacts. Even with the CRF set to 10, I could still see the weird flickering/banding on the edges in a couple of places. Finally I dropped the value to 5 and didn't notice any artifacts at all. The ideal value is possibly somewhere between 5 and 10 for this content.
That left me with video that's way too big for what it is. After messing around with B-frame and reference frame values to eke out marginal decreases in file size, I finally went back to varying the gop value and that had a relatively big impact. Setting the gop to 300 instead of 30, basically halved the file size. So my final ffmpeg command was this:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 5 -bf 16 -refs 16 -r 30 -g 300 -me_method umh -me_range 16 -y myvideo.mp4
(Update: I originally posted the above command as -crf 10... now corrected to -crf 5)
The main parameters I dropped were:

-pix_fmt yuv420p (it could degrade the quality)
-coder ac (I couldn't see any positive impact with or without this)
-b_strategy 2 (this actually increased the file size slightly in some cases)
-direct-pred spatial (absolutely no impact on the output file quality/size that I could observe)

If I was delivering the output file to YouTube, I'd consider putting back -pix_fmt yuv420p and -coder ac and -flags cgop, just because they recommend those.
These parameters yielded marginal improvement/decrease in file size (as in fractions of 1MB):

-bf 16
-refs 16
-me_method umh -me_range 16

You can see the variation in file size in the screen below where I have named each output file according the ffmpeg parameters I varied. Anything that doesn't have crf05 in the name manifests the artifacts problem.

As a comparison, I ran a similar command to produce a webm file, but with a much worse/higher CRF value. At a CRF value of 22 the resultant mp4 file was 1.4MB with no noticeable compression artifacts at all. The ffmpeg command I used was:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libvpx-vp9 -b:v 0 -tile-columns 2 -crf 22 -r 30 -g 300 -y myvideo.webm
Update: More Test Results
Following suggestions by stib and Mulvya, I tried the -tune and -trellis options and varied the crf value between 5 and 10. I did likewise for my own experiments with -me_method and -bf options. The output mp4, based on my input mkv video, all had visible, flickering compression artifacts at the same place until I turned the crf down to 6 when using -trellis, and down to 5 with the -bf -refs options or when using -tune. Here are screen shots showing the final bit of artifacting I’m trying to eliminate while using higher crf values. The first screen is the input mkv video, the second is a sample encoded mp4 video created using the -trellis 0 option. You can see the artifacts on the top border of one of the rectangles. (There is a thick gray band in the black background also – that’s not a compression artifact though, I think it’s a dialog in the process of vanishing after clicked cancel in my demo/sample recording.)

Here are the commands and resultant file sizes
-tune animation:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 5 -tune animation -r 30 -g 300 -y myvideo.mp4
Size: 2,757,370
Visible artifacts: No
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 6 -tune animation -r 30 -g 300 -y myvideo.mp4
Size: 2,593,711
Visible artifacts: Yes
-trellis 0:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 6 -pix_fmt yuv420p -x264opts trellis=0 -r 30 -g 300 -y myvideo.mp4
Size: 2,214,534 bytes
Visible artifacts: No
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 7 -pix_fmt yuv420p -x264opts trellis=0 -r 30 -g 300 -y myvideo.mp4
Size: 2,074,544 bytes
Visible artifacts: Yes (though a minuscule amount – literally a few pixels over a fraction of a second)
-fast_skip 0:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 7 -pix_fmt yuv420p -x264opts fast_pskip=0 -r 30 -g 300 -y myvideo.mp4
Size: 2,012,596 bytes
Visible artifacts: No
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 8 -pix_fmt yuv420p -x264opts fast_pskip=0 -r 30 -g 300 -y myvideo.mp4
Size: 1,883,919 bytes
Visible artifacts: Yes (very small/brief amount)
-psy 0 -fast_pskip 0:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 7 -pix_fmt yuv420p -x264opts psy=0:fast_pskip=0 -r 30 -g 300 -y myvideo.mp4
Size: 1,886,919 bytes
Visible artifacts: No
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 8 -pix_fmt yuv420p -x264opts psy=0:fast_pskip=0 -r 30 -g 300 -y myvideo.mp4
Size: 1,764,771 bytes
Visible artifacts: Yes
-bf -refs:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 5 -bf 16 -refs 16 -r 30 -g 300 -me_method umh -me_range 16 -y myvideo.mp4
Size: 2,257,420 bytes
Visible artifacts: No
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 6 -bf 16 -refs 16 -r 30 -g 300 -me_method umh -me_range 16 -y myvideo.mp4
Size: 2,106,439 bytes
Visible artifacts: Yes (though a minuscule amount)
-deblock:
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -preset veryslow -crf 14 -pix_fmt yuv420p -x264opts fast_pskip=0:psy=0:deblock=-3,-3 -r 30 -g 300 -y myvideo.mp4
Size: 982,549 bytes
Visible artifacts: No
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -preset veryslow -crf 14 -pix_fmt yuv420p -x264opts fast_pskip=0:psy=0:deblock=-3,-3 -bf 16 -refs 16 -me_method umh -me_range 64 -r 30 -g 300 -y myvideo.mp4
Size: 961,460 bytes
Visible artifacts: No
Conclusion
Either the vp9 encoder is much better at handling this kind of video content, or there is some x264 parameter that I'm not aware of that would improve things. Does anyone have any ideas for an option I can give ffmpeg to get a better result with x264/mp4? (And I'm not trying to start some codec war - I need to publish in both formats!)

Comments are not for extended discussion; this conversation has been moved to chat.

The parameter that seems to have the greatest impact on removing this artifact (for the type of content in the original post), while allowing higher CRF values is deblock. Using -deblock -3,-3 allowed for a CRF value of 14 with the artifacts completely eliminated. Using CRF values of 15 and 16 reintroduce the artifact, albeit in tiny amounts and not really noticeably unless you are specifically looking for it. Also deblock values of -3 -1 and -3 -0 worked reasonably well, but didn't elminiate the artifact completely at CRF 14.
The final command was:
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -preset veryslow -crf 14 -pix_fmt yuv420p -x264opts fast_pskip=0:psy=0:deblock=-3,-3 -r 30 -g 300 -y myvideo.mp4
To squeeze out some more kb of compression you could readd the bf refs me_method umh and me_range parameters. But I found I needed the me_range set at 64. Lesser values would reintroduce the compression artifact.
Note: I had some success with varying aq-mode and aq-strength, but that wasn't as good as deblock for removing the artifacts.

Added the results of using this approach to the original post, for comparison with the other methods.

Thanks for working through this.  I think its prob the way the encoder cant decide to do with black, and through randomness per the encoder necessity, it ends up being random in that area.  I think it may be helpful to clean up the OP now, so others dont have to wade through it, it may help get some response.   Ive been there. It takes alot of restraint when asking a good question.  not easy with something so complicating. Could maybe even combine answers, if related?  just a thought.

Vary the CRF value down until you don't see compression artifacts. Go ridiculously low if needed, like CRF = 5.
Vary the GOP value up to compensate for the larger output file size. For example, for video at 30 frames per second, try gop=300
Your ffmpeg command could look like this:
ffmpeg -speed 1 -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -crf 5 -bf 16 -refs 16 -r 30 -g 300 -me_method umh -me_range 16 -y myvideo.mp4
Edit: (Using the correct speed option for x264, adding pix_fmt and other x264 options)
ffmpeg -framerate 30 -f image2 -i frames/%04d.png -c:v libx264 -movflags +faststart -preset veryslow -crf 5 -pix_fmt yuv420p -x264opts fast_pskip=0:psy=0 -bf 16 -refs 16 -me_method umh -me_range 16 -r 30 -g 300 -y myvideo.mp4

I'm basically giving up on resolving this problem in any sensible way. This is an ill-informed and probably poor answer to my own question. Hopefully someone more knowledgeable else can answer with more sensible ffmpeg/x264 parameters for this kind of content, rather than just varying the CRF value to something extreme.

I've been using an approach similar to my posted for some months now and it works well. I typically don't need the CRF value as low as 5... but 7 is usually a reasonable starting point. Also with later versions of ffmpeg I had to change to from -speed 1 to -preset veryslow. (It seems that -speed is actually for libvpx, not libx264). Also I use these options now: -pix_fmt yuv420p -x264opts fast_pskip=0:psy=0 Answer updated accordingly.


text:
libx265 NUMA pool configuration misleading
I have the following scenario: Using libx265 and a dual-socket system (thus 2 NUMA nodes) I want to encode videos using ffmpeg and libx265. libx265 can be configured to use thread-pools which are isolated to one NUMA node, using its --pools-parameter (docs).
There a few examples in the docs which I do not fully comprehend. The examples there are for a 4-node system. Quoting from the doc:

'+'  is a special value indicating all cores detected on the node
'*'  is a special value indicating all cores detected on the node and all remaining nodes
'-'  is a special value indicating no cores on the node, same as '0'
A thread pool dedicated to a given NUMA node is enabled only when the number of threads to be created on that NUMA node is explicitly mentioned in that corresponding position with the –pools option. Else, all threads are spawned from a single pool. The total number of threads will be determined by the number of threads assigned to the enabled NUMA nodes for that pool. The worker threads are be given affinity to all the enabled NUMA nodes for that pool and may migrate between them, unless explicitly specified as described above.

I am not sure how the thread-count and the pool-count can be explicitly specified and would be happy if someone could explain these examples, taken from the docs:

"+,-,+"   - allocate one pool, using only cores on nodes 0 and 2

Q: Why is this not allocating 2 pools on nodes 0 & 2?

"8,8,8,8" - allocate four pools with up to 8 threads in each pool

Q: Why is this now allocating 4 pools, while the next example

"8,+,+,+" - allocate two pools, the first with 8 threads on node 0, and the second with all cores on node 1,2,3

Q: .. is only allocating 2 pools?

In my case, I will have access to 2 nodes x 12 "cores" and was thinking of 1-3 ffmpeg encoding-processes per node (which would yield pool sizes of 12, 6 or 4 "cores").

As the excerpt below says,

A thread pool dedicated to a given NUMA node is enabled only when the
  number of threads to be created on that NUMA node is explicitly
  mentioned in that corresponding position

"+,-,+"  --> no numerals stated, hence a single pool.
"8,+,+,+" --> numeral for node 0, hence that's one pool. The other nodes have no numerals, hence any threads spawned there are managed within a consolidated (2nd) pool.
No experience with NUMA, just parsing the quoted doc.

source: Stack Exchange

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

sort: votes


text:
Devices for slow-motion video recording
I'm interested in shooting slow-motion videos of sports (eg. ping-pong, badminton; for analysis and such). After trying an iPhone camera I wish to get something higher quality/more crisp (ideally 1080p@240fps).
However, finding something decent at an affordable price-tag seems to be rather difficult. hispeedcams.com is a quite good source for this purpose. Here are some notable finds.
research
rather professional solutions (too expensive)

RED RAVEN "[...] 4.5K Full Format (FF) at up to 120 fps, or in 2K FF at 240 fps, [...]" (at $8,950.00 (USD), €9,030.00 (EUR), £7,970.00 (GBP))
Panasonic AG-DVX200 "120-fps Variable Frame Rate" ($3,795.00)
SONY NEX FS700 "120fps at 4K" ($3,499.00)

dedicated high speed cameras (more than needed)

edgertronic SC1 "- 701 fps @ 720p: Color 8GB DDR3 Install IR Filter - 400-675nm response" ($5,495.00)
chronos 1.4 "1,057fps [at] 1280x1024" (2,999.00$

action-cams (too limited): ("240fps at 720p and 120fps at [...] 1080p")

Sony FDR-X3000 ($348.00)
GoPro Hero 5 Black ($399.00)
Yi 4k+ ($339.98)

DSLM/MILC (which would also be nice as default photo cameras but don't have a optical TTL view finder)

Panasonic GH5 apparently 1080p@180fps (€ 1.999,00)
Sony A6500 1080p@120fps ($1,399.99)

It would be nice to have something more versatile than action-cams, but less expensive than those professional devices. As I don't want to shoot slow-motion only, cameras specially designed for that aren't really what I am looking for either.
This leads to the (still quite expensive) GH5 (or similar DSLM) and also to a few
questions:

What should I look for in gear for a beginner?
Is there something (DSLRs/DSLMs) in between (regarding price) GH5 and action-cams (similar to a6500) supporting slowmo ?

Some specifications mention that high-speed capture is only available for a few seconds

Is there always a maximum on how long can I capture slowmo if it is not noted?
If a camera is advertised with (eg.) 8sec 1000fps, at which rate could it record permanently then ?

note:
I have asked for DSLRs on photography already with comments mentioning the GH5 only - I can remove this partial question if it is not fitting
I have split off the SDI part-question here.

Your question in SDI should pribably go in a separate question. But basically it allows uncompressed capture on a recorder, or the use of minimally lossy codecs like prores, sometimes at higher colour depth, depending on the recorder.

@stib, I have had a look on that article. 1000fps sure looks impressive, but how does this translate into lower fps recording times ? (Could not find anything on that) I am not planning to analyze  bee-flight but ordinary quick human actions. I have split off the SDI part here.

While I know you are probably looking for something cheaper.  I'd add the Ursa Mini 4k to the list of professional cameras with high speed features.  It does 120fps 1080p as well and is only $3k, making it cheaper than any of the others in that section, but still quite pricy.

You may want to look into Sony's camcorder line (even legacy; like the NX5U).
The NX5U and I think even the FX1000 (which is an HDV Tape Format and can be had used on a place like ebay for under $1000) could do bursts of full 1080p 240+ for a "limited time".
If I remember correctly the FX1000 by sony could do 240 frames at for 10 seconds. It would buffer the video into internal memory; then queue the tape; then record to tape when the 10 seconds was up.
It was limited in terms of it's usefulness; but it sounds like based of what you want to use the slow motion capture for; it may be worth looking into to.
Burst cameras (even the iPhone now does this); will give you a higher frame rate, with limited record time for a much lower price than say going the RED route or Phantom Route.
Or you could rent a RED, RED Epic's will do 480FPS at 1K; and they can be rented cheap; as they are everywhere... and sit on the shelf most day's of the week by people who own them.

There isn't really any magic bullet in high speed photography.  High speed photography is difficult because of the amount of data involved and the sensitivity necessary for the sensor.  Both of these factors combine to drive up the cost of all portions of the camera to do it well.  You can either sacrifice quality (which the iPhone does) or you can sacrifice affordability.
The higher the frame rate gets, the less time is available to expose each frame and thus the more sensitive it needs to be.  This makes the cost of the sensor higher.  Additionally, that data needs to be transferred off the sensor more quickly, which means more expensive sensor, it needs to be processed more quickly, which means more expensive electronics and it needs to be stored more quickly, which involves more expensive media.
Some cameras try to save on the cost and maximize quality by putting the money in to a faster sensor, but then putting a limited amount of high speed cache in the camera.  This means that the camera can not record continuously at high speed, but rather will record at high speed until the cache is filled and then will have to wait while the processor and storage have a chance to process the data after the fact before it can do another high speed recording.
If you are able to use burst capture like this, it may be the best chance at getting something which is capable of both high speed capture at high quality and also not breaking the bank, but that only works if you are ok with the limitation of not being able to record continuously.

Thank you for this informative answer. I have split off the part about external recording; am I mistaken or does this not notably reduce the stress on the most limiting internals ? (which I understood to be cache, sensor and processor in regards to not overheating and limited throughput; apart from copying and compressing maybe).

@hillbilly - not sure what you mean about external recording.  External recording only impacts part of compression and storage speed, but you are just transferring the cost to an external device then.  The camera still has to process the data from the sensor in to an image stream and put it in to some format that can be sent over the wire to the external recorder.  It can be done pre-compression, but then you need ultra high data rate cables and communications gear, which is also expensive.

Well I thought sending out RAW via SDI would maybe allow to push the limits of the device. Obviously this is nowhere cheap and would be interesting to know mostly for upgrades.

This would potentially offset the storage requirement and would technically offset a portion of the processing requirement if you were doing it in raw, but most things that are able to push that kind of data rate in raw are also able to record it, so I'm not sure how much you would gain there.  There might be some device that could gain something, but it'd be the exception rather than the rule I think.

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


text:
SDI - serial digital interface
I have heard of a video-grip for the Panasonic GH5 Panasonic GH4 that supports SDI-output. Off the top of my head a few questions pop up

What is the advantage of using a SDI-output ?
Does this generally allow for higher performance than what the camera alone would achieve ?

I must admit, I have only completely read the Wikipedia entry for SDI in my mother tongue; which is not as detailed as the english entry.

additional notes:
This was split off from another question about slow-motion recording. Ideally the camera would be used for photography and video recording of all sorts.

What brand is the camera? What are you using it for?

@MichaelLiebman, I was loosely speaking of the Panasonic GH5 and am planning to use it for photography and video recording (with an eye on slow-motion). (added information in the question)

General SDI vs. HDMI Information
SDI is easier to connect to other professional equipment than HDMI. It is an all purpose signal, as opposed to HDMI that was originally intended only to connect to consumer display devices. There may be a slight advantage in quality where HDMI can be limited to 4:2:0 subsampling at certain resolutions, where SDI will usually be 4:2:2 or 4:4:4.
There isn't necessarily a performance advantage to SDI over HDMI. Sometimes HDMI outputs don't produce a clean HD signal and you need to put extra equipment in line to clean up the signal.
The disadvantage of SDI is cost. Most all SDI equipment is more expensive than HDMI equivalents. But you usually get higher quality equipment for that price.
In general, you need to weigh the exact specs of the equipment you are looking at for the application you want to use it for. If, in your case, the HDMI output has a 120fps maximum, but the SDI output has a 60fps maximum, you would want to choose the HDMI output.
One other often overlooked advantage of SDI, is that it uses locking BNC connectors (or sometimes other smaller form factor positive locking connectors) as opposed to non-locking connectors of HDMI. If you are going to be in an active environment, it offers a lot of piece of mind to know that your connector won't slip loose.
Why do you need an external output?
External outputs like HDMI or SDI are used for connecting a camera to peripheral devices. Some people use it to connect to an external monitor. External monitors can be bigger, allowing you to see more detail, or allow someone other than the camera operator to see the picture simultaneously.
Some people use it to connect to an external video recorder. External recorders can have larger storage capacity, have higher sustained I/O throughput, or capture a more advantageous format (less compressed, a different codec, etc.) than the internal SD card. For your application, it is the higher sustained throughput that might make a difference. The internal SD card, no matter which card class you get, probably will have a hard time recording high frame rate video flawlessly for extended periods of time. It might drop frames or just stop recording after buffers fill.
Decisions
You need to decide for what you are trying to do and what price/performance trade-offs you want to make. If you are doing work professionally, then I would strongly recommend going the SDI route. If you are just having fun with some short slow motion shots, then you probably only need the internal recorder. If you want to take a step up from there, still in the hobbyist realm, you could consider adding HDMI-based accessories in the future.
Lumix GH5 and the Panasonic YAGH Grip
According to this article, the YAGH Grip is not compatible with the GH5 and there is no planned SDI output.

Thank you for this information! I was mixing up the video grip (which is for GH4). However, I still don't see where the advantage of SDI- or HDMI-output (and recording that) vs. internal is. I have found this footage similar to what I'd like to achieve. Though, he also mentions, that he always uses HDMI-recorder. Would that slowmo be capped at some point without that recorder?

Also, I could not open that linked article. (Only after googling the and using a non-https link)

Sorry about the link. I fixed it. The advantage of an external recorder (either SDI or HDMI connected) vs. recording on the internal SD card has to do with storage capacity and the ability to sustain a frame rate. That's really a separate question from the SDI vs. HDMI decision. I'd suggest asking a separate question for that.

Uhm, I'm afraid we have a misunderstanding here. I actually had no idea about these kinds of outputs at all in the first place. Thats what I meant in the higher performance part. If you wish to, I can separate that into another question keeping this about the difference( to not using)/ advantages. But also, that was the reason why I have hesitated to jump on accepting your great summary. Or add some info from this comment and we'll leave it at that.

The point about BNC connectors is important, given that most HDMI connectors are made out of butter. I don't know why any manufacturers think they're an appropriate connector to have on a camera.

hillbilly, I added some more information on why you would need an external output at all. I hope that gets to the core of your question. @stib, non-locking connectors have no place on portable equipment, especially anything aimed at professionals. I wish more manufacturers would use DIN 1.0/2.3 connectors. They solve many of the problems with BNCs, though they do have a bandwidth limitation.

I'm not quite sure I'd agree with "easier to use" as an advantage of SDI.  It's honestly quite a bit harder to use as you need to know more about what it is actually being used for.  It is more versatile, but more complex to use.

SDI is a professional, locking video connection system over coax cable.  SDI itself has more expensive licensing costs associated with it than HDMI, so hardware that supports it will generally be more expensive.  If you don't have hardware that supports SDI, it won't do you any good, so that's the first point.
One of the biggest advantages of SDI is that it can support very high quality video such as the 4k 10 bit 4:2:2 supported by the SDI outputs for the GH4 adapter.
SDI also supports a stable signal over much longer runs than standard HDMI.  There are ways to boost an HDMI signal that can help it run further, but in general HDMI is limited to around 20-30 ft where as SDI can potentially go hundreds of feet.
The locking connector should also not be undersold.  In any production environment, connections coming loose can result in missed shots or dead air.  Having connectors that lock in to place is a huge must.
The biggest downside to SDI is that it is far less consumer friendly.  HDMI has a relatively small number of backwards compatible versions that are simplified in to some basic version numbering.  SDI on the other hand has not only a variety of different cable qualities, but also a variety of different signal formats that can be sent over the connector.  You need to be aware of the signals supported throughout your environment and properly configure things to exchange video correctly.  It is much more versatile, but also requires a better understanding of what the video formats you are working with actually are.
Overall, for your purposes, if you intend to do live video work I would recommend getting SDI capabilities to make sure you don't lose connections.  If you plan to do post-produced video and want to make use of an external 10 bit prores 4:2:2 recorder, having the SDI output will also be very helpful.  It's a bit limited for recorded video as it unfortunately doesn't support the much more versatile 4:4:4:4 format which is much easier to color grade, but 10 bit color still offers some advantages over any in-built 8 bit recording.  (I forget if the GH4 can support 8 bit recording without third party firmware.)
For the GH4 specifically, if you aren't doing live, I'd take a look at what the third party firmwares now offer.  I think they might support as good or better recording in camera at which point the adapter might be largely unneeded, though the XLR inputs for external audio could be helpful if you want to avoid using an external audio recorder and doing your audio-sync in post.

In short; HD-SDI and SDI are the industry standard for professional applications; and HDMI is for consumers.
HDMI is highly limited in terms of length; you will need a very high quality cable to go more than 25 feet.
HDMI is fine for most applications; but it is limited to 4:2:2; you can't do long runs; if you are trying to integrate it with professional equipment you will likely need adapter boxes (such as those by BlackMagic);
SDI and HD-SDI offer full 4:4:4; you can genlock easier; you can breakout out easier; you can run it a few hundred feet before it needs to be reclocked; you can run it dual link mode for 4K, and so on.


text:
FFmpeg tool graph2dot doesn't recognize some filters
I have graph2dot FFmpeg utility for converting filtergraph descriptions to the textual representations in the dot language for their subsequent visualisation.
(Thanks to Mulvya who uploaded it in this answer).
It works fine for me but it doesn't recognize some filters, e. g. mpdecimate and delogo:

No such filter: 'mpdecimate'
  No such filter: 'delogo'

Is there some way (e. g. a newer version of this program or its DLL libraries) to fix it?

My upload was compiled using license LGPL. I need to compile it as GPL to include those filters. I'll do it in a couple of days.

@Mulvya - If you will have time, please build and upload it. I'll appreciate it.

In a couple of days or so.

Updated in original answer.

@Mulvya - Thank you very much, I tried it an it works! I'm sorry that I have no chance to appreciate your work at least by voting up your answer. If you will put it here as an answer, I will be glad.

The older upload did not cover those filters as they require GPL license and the older binary was built with a LGPL configure.
I've uploaded a 64-bit GPL3 Windows binary of graph2dot (with 4 dependencies) to http://www.datafilehost.com/d/6fcd14be
Source is at https://github.com/FFmpeg/FFmpeg/blob/master/tools/graph2dot.c
License is at https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.GPLv3


text:
Nikon D3300 Headphone output?
How can I from my Nikon d3300 get a headphone output? Im using rode micro I would like it not to be a huge box or super long cable.
This is my first preference. Start in the upper left. (mic)

This is my second preference. Start in the upper left. (mic)

REG/rode_videomicro_compact_on_camera.html

Nikon d3300:https://www.bhphotovideo.com/c/product/1266500-DEMO/nikon_1532_d3300_dslr_camera_with.html
Rode Micro:https://www.bhphotovideo.com/c/product/1183909-REG/rode_videomicro_compact_on_camera.html

Microphone outputs are typically very low level and have only enough output to drive a sensitive preamp, not headphones.  To drive headphones you need an amplified output.  According to a variety of sources, the D3300 does not have a headphone jack, which means you have to provide a separate amplifier, which means you have to provide one, and the power to drive it, and the cable to connect to it.  I suspect the best solution would be a battery-powered preamp that receives your mic output and then delivers two amplified outputs: line level for your D3300 input jack and phones-level for your headphones.


text:
ffmpeg "Error while opening encoder for output stream #0:1"
Ok, this is probably a very stupid mistake on my part, but I am losing my head here. I have been using a simple command for transcoding MOV file for months now:
ffmpeg -i SOURCE.mov -c:v libx264 -profile:v baseline -pix_fmt yuv420 TRANSCODED.mp4

I never had a problem with that... until today. I am getting the aforementioned encoder error with this MOV (PCM24 LE, MPEG-2). Here is the log:
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers   built with gcc 5.2.0 (GCC)   configuration: --enable-gpl
--enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib   libavutil      54. 31.100 / 54. 31.100   libavcodec     56. 60.100 /
56. 60.100   libavformat    56. 40.101 / 56. 40.101   libavdevice    56.  4.100 / 56.  4.100   libavfilter     5. 40.101 /  5. 40.101   libswscale      3.  1.101 /  3.  1.101   libswresample   1.  2.101 /
1.  2.101   libpostproc    53.  3.100 / 53.  3.100 Guessed Channel Layout for  Input Stream #0.0 : 7.1 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BL2.mov':   Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2017-03-14 21:48:34
    encoder         : FFmbc 0.7
    timecode        : 00:13:29;19   Duration: 00:12:53.57, start: 0.000000, bitrate: 59235 kb/s
    Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s (default)
    Metadata:
      creation_time   : 2017-03-14 21:48:34
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2017-03-14 21:48:34
      handler_name    : Apple Alias Data Handler
      timecode        : 00:13:29;19
    Stream #0:2(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50002 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-03-14 22:56:29
      handler_name    : Apple Alias Data Handler
      timecode        : 00:13:29;19 [libx264 @ 0354dc20] using SAR=1/1 [libx264 @ 0354dc20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64 [libx264 @ 0354dc20] profile Constrained Baseline, level 4.0 [libx264 @ 0354dc20] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 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=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 [libvo_aacenc @ 03bb0200] Unable to set encoding parameters
Output #0, mp4, to 'bl2.mp4':   Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    timecode        : 00:13:29;19
    encoder         : FFmbc 0.7
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2017-03-14 22:56:29
      handler_name    : Apple Alias Data Handler
      timecode        : 00:13:29;19
      encoder         : Lavc56.60.100 libx264
    Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
    Metadata:
      creation_time   : 2017-03-14 21:48:34
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.60.100 libvo_aacenc
Stream mapping:   Stream #0:2 -> #0:0 (mpeg2video (native) -> h264 (libx264))   Stream
#0:0 -> #0:1 (pcm_s24le (native) -> aac (libvo_aacenc)) Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

This seems to tell me that it is an audio issue (even though I transcoded an identically encoded file just last friday...):

[libvo_aacenc @ 03bb0200] Unable to set encoding parameters

So I try to copy the audio codec (not sure if this works for MP4...) with "-c:a copy" and I get this:

Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 7.1 (24 bit), 9216 kb/s (default)
Metadata:
  creation_time   : 2017-03-14 21:48:34
  handler_name    : Apple Alias Data Handler Stream mapping:   Stream #0:2 -> #0:0 (mpeg2video (native) -> h264 (libx264))   Stream

0:0 -> #0:1 (copy) Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

What is going on here?

Your AAC encoder only supports 2 channels. Add -ac 2.
But actually, you should upgrade your FFmpeg. It's very old, the VO AAC encoder is no longer available as the native encoder is better and supports 7.1 CH audio, so no downmixing required.

Thanks a ton! I still don't get why I never had to set any audio parameters before, but what works works, I guess. About the version, this is a XP machine (yes, I have complained about this to my employer a million times...) so I try to avoid updates lest they break something. Will look around for a more recent stable release, though. Thanks again!

Check this thread for XP builds: https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=13&t=3572&sid=7724c0e3b458fd1dce0a4ce17711c1ea


text:
Trying to sync audio in mpeg2 video whose video freezes first 8 seconds in playback
So I have a handful of old mpeg2 (.mpg) files with the following profiles as provided by ffmpeg (the timecodes on each are different):
Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1385 kb/s, 29.88 fps, 29.97 tbr, 2997 tbn, 1k tbc (default)
Metadata:
  creation_time   : 2006-XX-XX XX:XX:XX
  handler_name    : Apple Alias Data Handler
  encoder         : MPEG-4 Video
  timecode        : 00:00:08;07
Stream #0:1(eng): Data: none (tmcd / 0x64636D74)
Metadata:
  creation_time   : 2006-XX-XX XX:XX:XX
  handler_name    : Apple Alias Data Handler
  timecode        : 00:00:08;07
Stream #0:2(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
Metadata:
  creation_time   : 2006-XX-XX XX:XX:XX
  handler_name    : Apple Alias Data Handler

it appears that for each of them in playback (using mplayer and vlc) the first frame will be frozen for about 8 seconds while the audio starts from 00:00:00. So the audio remains about 8 seconds ahead of the video stream throughout.
When I try to convert them with FFmpeg, copying the video and audio codecs, I get a ton of "buffer underflow" and "packet too large" errors (which probably has to do with the codec etc. as per: https://superuser.com/questions/835871/how-to-make-an-mpeg2-video-file-with-the-highest-quality-possible-using-ffmpeg). If I convert it to another video and audio codec, it's fine - no buffer underflow/packet too large errors. But the audio remains out of sync with the video.
I have also tried passing the ffmpeg conversion -itsoffset -8.0 to the input file and the audio is still out of sync, even though the video then does appear to advance from 00:00:00 in playback for the converted file.
Not sure if there is anything else I can do about this but I am wondering if it's possible to get this audio and video synced. I have also tried mencoder with -mc 0, -noskip and -vf harddup options and that actually syncs the video for the first portion, but then the audio and video fall out of sync after about 30 minutes or so in.
Update - some input and output details:

ffmpeg -threads 1 -itsoffset -8.0 -i in.mpg -f mp4 -g 60 -c:v libx264 -pix_fmt yuvj420p -c:a libfdk_aac -y out.mp4

ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8.5 (Gentoo 4.8.5 p1.3, pie-0.6.2)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --    cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags=' ' --disable-    static --enable-avfilter --enable-avresample --disable-stripping --enable-version3 --disable-indev=v4l2 --disable    -outdev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --disable-outdev=sdl --enable-nonfree     --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-gpl --enable-    hardcoded-tables --enable-iconv --disable-lzma --enable-network --disable-openssl --enable-postproc --disable-    libsmbclient --disable-ffplay --disable-vaapi --disable-vdpau --enable-xlib --disable-libxcb --disable-libxcb-    shm --disable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-    libcaca --disable-openal --disable-opengl --disable-libv4l2 --disable-libpulse --disable-libopencore-amrwb --    disable-libopencore-amrnb --enable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libcelt --    disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --    disable-libssh --disable-libschroedinger --disable-libspeex --disable-libvorbis --enable-libvpx --disable-    libzvbi --disable-libbs2b --disable-libflite --disable-frei0r --disable-libfribidi --disable-fontconfig --disable    -ladspa --disable-libass --disable-libfreetype --disable-libsoxr --enable-pthreads --enable-libvo-aacenc --    disable-libvo-amrwbenc --enable-libmp3lame --disable-libaacplus --disable-libfaac --disable-libtheora --disable-    libtwolame --disable-libwavpack --disable-libwebp --enable-libx264 --disable-libx265 --disable-libxvid --enable-    x11grab --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=core-avx-i
libavutil      54. 27.100 / 54. 27.100
libavcodec     56. 41.100 / 56. 41.100
libavformat    56. 36.100 / 56. 36.100
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 16.101 /  5. 16.101
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  2.100 /  1.  2.100
libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.2 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mpg':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2006-XX-XX XX:XX:XX
  Duration: 01:00:19.88, start: 0.000000, bitrate: 2940 kb/s
    Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3],     1385 kb/s, 29.88 fps, 29.97 tbr, 2997 tbn, 1k tbc (default)
    Metadata:
      creation_time   : 2006-XX-XX XX:XX:XX
      handler_name    : Apple Alias Data Handler
      encoder         : MPEG-4 Video
      timecode        : 00:00:08;07
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2006-XX-XX XX:XX:XX
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:08;07
    Stream #0:2(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2006-XX-XX XX:XX:XX
      handler_name    : Apple Alias Data Handler
[swscaler @ 0x1297040] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x12c7be0] using SAR=1/1
[libx264 @ 0x12c7be0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x12c7be0] profile High, level 3.0
[libx264 @ 0x12c7be0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf56.36.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 640x480 [SAR 1:1 DAR 4:3],     q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2006-XX-XX XX:XX:XX
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:08;07
      encoder         : Lavc56.41.100 libx264
    Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 139 kb/s (default)
    Metadata:
      creation_time   : 2006-XX-XX XX:XX:XX
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.41.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (pcm_s16be (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
Past duration 239.760002 too large
frame=   98 fps=0.0 q=26.0 size=     345kB time=00:00:02.26 bitrate=1250.8kbits/
frame=  186 fps=185 q=29.0 size=     933kB time=00:00:05.18 bitrate=1474.3kbits/
...
frame=108248 fps=218 q=-1.0 Lsize=  708299kB time=01:00:11.81 bitrate=1606.5kbits/s dup=78 drop=0
video:643485kB audio:61559kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.461699%
[libx264 @ 0x12c7be0] frame I:1846  Avg QP:19.79  size: 25621
[libx264 @ 0x12c7be0] frame P:93233 Avg QP:24.01  size:  6332
[libx264 @ 0x12c7be0] frame B:13169 Avg QP:25.95  size:  1618
[libx264 @ 0x12c7be0] consecutive B-frames: 80.5%  8.5%  3.6%  7.3%
[libx264 @ 0x12c7be0] mb I  I16..4: 17.5% 76.4%  6.1%
[libx264 @ 0x12c7be0] mb P  I16..4:  1.9%  9.2%  0.4%  P16..4: 35.5%  9.0%  6.3%  0.0%  0.0%    skip:37.6%
[libx264 @ 0x12c7be0] mb B  I16..4:  0.4%  1.7%  0.0%  B16..8: 28.2%  3.0%  0.7%  direct: 4.2%  skip:61.8%  L0:59.1%     L1:33.8% BI: 7.1%
[libx264 @ 0x12c7be0] 8x8 transform intra:79.2% inter:86.3%
[libx264 @ 0x12c7be0] coded y,uvDC,uvAC intra: 65.8% 77.0% 11.3% inter: 24.3% 16.3% 1.4%
[libx264 @ 0x12c7be0] i16 v,h,dc,p: 42% 32% 24%  3%
[libx264 @ 0x12c7be0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 24% 40%  3%  2%  2%  2%  2%  4%
[libx264 @ 0x12c7be0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 27% 12%  3%  5%  5%  5%  4%  5%
[libx264 @ 0x12c7be0] i8c dc,h,v,p: 40% 28% 29%  3%
[libx264 @ 0x12c7be0] Weighted P-Frames: Y:0.6% UV:0.2%
[libx264 @ 0x12c7be0] ref P L0: 73.9% 12.5%  9.0%  4.5%  0.0%
[libx264 @ 0x12c7be0] ref B L0: 82.4% 16.2%  1.4%
[libx264 @ 0x12c7be0] ref B L1: 91.0%  9.0%
[libx264 @ 0x12c7be0] kb/s:1459.47

ffprobe out.mp4

[mov,mp4,m4a,3gp,3g2,mj2 @ 0xaf7c40] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661),     none, 640x480, 1459 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.36.100
  Duration: 01:00:11.88, start: -8.042667, bitrate: 1606 kb/s
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 640x480, 1459 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn,     23976 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 139 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

mencoder in.mpg -oac pcm -ovc raw -o out2.avi

tons of 1 duplicate frame(s)! warnings. video not synced

mencoder in.mpg -ovc copy -mc 0 -noskip -vf harddup -oac pcm -o out2.mpg

works partially, seems to be the closest fix, no warnings in the output, but loses sync (in this example) at 00:28:48, where the video stream seems to jump some frames at that time

Can you provide a sample file? Are you using a recent build of ffmpeg? An example command and the complete console output would be informative (you can trim lines that repeat over-and-over).

Back in the MPG days, MPEGStreamclip was quite a useful tool, last release was in 2012 but still works nowadays

@LordNeckbeard unfortunately I won't be able to provide a sample of these files. I'm using ffmpeg version 2.7.2  and MEncoder SVN-r37440. Not sure how helpful it will be, but I've put some example commands and output in an update above.

You didn't specify if you want the first 8 seconds of Audio (it appears you do not) but you can split the input into separate Video and Audio files using ffmpeg (deMux).
Then with a second call to ffmpeg use "-ss" before the Audio's "-i" to chop off the first 8.07 seconds and use "-copy" to Mux them back  together (this is lossless).
Using "-itsoffset" before the "-i" of the Stream with "-copy" is another solution. Using "-aresample" can change the length of the Audio but you'll ruin Lipsync if it's a Video with people talking (as opposed to, for example, a Video with people walking down the street with traffic noise).
An OLD question that went without an answer for a long time (and sat in the unanswered Queue). Maybe good for a Necromancer Badge.
Reference: https://ffmpeg.org/ffmpeg.html

Gonna say answered bc at least you provided something that seems reasonable. I no longer have access to the source video but would have given a shot if I did.


text:
How to make Vegas Pro open AVI files
In using Vegas Pro 13 on a new Windows 10 computer, I find that I cannot open AVI files. It's not a codec issue; the file will not open at all because Vegas doesn't recognize it as a type of file it can open. I've used Vegas Pro for years and do not remember having this issue, but it has been five years since I got a new computer. I've had trouble with the codecs in AVI files, but they always opened.
How can I fix this issue?

It seems that sometimes Vegas Pro's plugin that opens AVI files is corrupt or installed incorrectly (if this is the case, a reinstall may fix it).
There is a simple fix that involves replacing the DLL file that controls AVI files.
The file is called aviplug.dll. The file path will be similar to: C:\Program Files\Sony\Vegas Pro 13.0\FileIO Plug-Ins\aviplug\

The fixed dll can be found at Mediafire.
Here's a YouTube walkthrough.

dll missing now. Bummer.


text:
Speeding Up, Joining and Increasing Frame Rate FFMPEG
"Is it possible to speed up a video using handbrake?"
In the above link, Mulvya show us how to speed up a video, but I want to know, if possible, how can I speed the video joining two or more videos and increasing the frame rate, for example:
I have 2 video files, which I need to join. Both are at 30fps and I want to speed up to 5 times and increase the frame rate to 60fps.
How can I do it?

Assuming audio's not a concern,
ffmpeg -i in1.mov -i in2.mov -filter_complex
       "[0]setpts=(PTS-STARTPTS)/5[a];[1]setpts=(PTS-STARTPTS)/5[b];[a][b]concat[v]"
       -map "[v]" -r 60 -crf 18 output.mov


text:
How to batch covert a folder of mp4 files to avi?
I'm trying to batch convert a folder of MP4 files to AVI using this script:

for f in *.mp4; do ffmpeg -i "$f" -q:v 6 "encoded/${f%.*}.avi”; done

(This is based an earlier question that was helpfully answered for me by @Mulvya here: What's the best way to convert mp4 to avi?)
I'm receiving the error message:

Unable to find a suitable output format for 'encoded/test file.avi”; done
for f in *.mp4; do ffmpeg -i test'
encoded/test file.avi”; done
for f in *.mp4; do ffmpeg -i test: Invalid argument

Can anyone suggest where i may have made a mistake?

Change the ” to a ".
Avoid using TextEdit or other "smart" editors to edit your scripts and shell commands. They will mangle it with fancy quotes and other oddball characters and ruin your commands.


text:
Batch conversion into a new folder with ffmpeg
I'm trying to batch encode 45 video files, and copy the encoded files into an existing subfolder called "encode"
I've used the suggested code from this question (https://stackoverflow.com/questions/5784661/how-do-you-convert-an-entire-directory-with-ffmpeg) But, I don't know how to capture the original file names (with spaces and punctuation) and use that as the new file name in the new directory.
Here's the code I'm using so far:

for i in *.mp4;
  do name=`echo "${i%.*}"`;
  echo $name;
  ffmpeg -i “$i” -vf "scale='if(gt(a*sar,16/9),640,-1)':'if(gt(a*sar,16/9),-1,360)',pad=640:360:(ow-iw)/2:(oh-ih)/2,setsar=1" -vcodec libx264 -b:v 1600k -bufsize:v 1600k -r 30000/1001 “encoded/$name.mp4”
done

It's giving me an "invalid argument" error message when I run it - probably because I haven't specified the names correctly(?)
The ffmpeg code that I'm using does work (I can encode individual file) but I haven't figured out how to batch encode the entire directory.
If anyone can let me know what I'm doing wrong, I would love to know!
Thank you!

For users looking for a Windows solution see How to change output filename in ffmpeg batch?

The accepted answer in the question you're referring to uses additional unnecessary processes, legacy code, and doesn't prevent globbing or word splitting.
See the second answer which is shorter, simpler, and more efficient:
for f in *.mp4; do ffmpeg -i "$f" <additional options> "encoded/${f%.*}.mp4"; done

Secondly, don't use fancy quotes which will cause errors, so instead of “$varible” use "$variable".

Returns f was unexpected at this time. I feel like I'm missing something.

I had to use for %f in (*.mp4); do ffmepg -i %f <additional options> %f.mp3. I got the batch to run correctly, but the extension is now duplicated. My files look like file.mp4.mp3. I'll figure it out soon, I'm sure.

Acutally, I couldn't figure it out. Perhaps you can help: http://video.stackexchange.com/questions/20474/how-to-change-output-filename-in-ffmpeg-batch

@fredsbend Are you using Windows? My example is Bash shell (for Linux users).

@LordNeckbeard Yes, I'm on Windows 10.

I think you can achieve what you need with my ffmpeg Windows front-end, where you can easily select output destination folder.
https://sourceforge.net/projects/ffmpeg-batch
It adds to ffmpeg a window fashion interface, progress bars and time remaining info, features I always missed when using ffmpeg.

Please make sure to clearly indicate if an answer refers to a software or product that you are affiliated with.  I have altered the answer to include the needed information.

Yes indeed, thanks for the clarification, just trying to make people's life easier.

I'm trying to batch encode 45 video files, and copy the encoded files into an existing subfolder called "encode"

Try this: https://github.com/alessandro893/ffmpeg-batch-remux

Could you provide a little more detail on how to use the tool you linked to? Most people come here looking for more in depth answer than just a link.

To convert a file within the same format without the extension saved into file name in batch mode just add ~n to the final input, like so:
for %f in (*.mkv) do ffmpeg -i %f <additional options> %~nf.mp4

If one needs to reformat the codec and wishes to keep the same title and save in the same extension it must be saved into another folder. Start the ffmpeg command from the location of the original files. Navigate to that different folder and copy the entire location from the address bar and paste it exactly as is at the beginning of the output name. For this there must be " " around the whole output address. Replace everything within () with your address, and then remove the ().
for %a in (*.mp4) do ffmpeg -i "%a" <additional options> "(F:\VIDEO\New)\%~na.mp4"

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


text:
The -itsoffset parameter of FFmpeg is having no effect
When rendering my animation video with ffmpeg, I want my video to start with 28-odd seconds of silencebefore the soundtrack begins.
(Well, I really want it to be 0.28 seconds but making it longer makes debugging easier.)
That's easy enough. According to the manual and SuperUser and others, it is all about adding the -itsoffset parameter before the audio input you wish to delay.
Here's my command line:
ffmpeg -y -itsoffset 28.84 -i soundtrack.wav -framerate 30 -i %d.png -r 30 -vcodec mpeg4 generated.mp4

It generates the video, but the soundtrack starts immediately.
I am stll new to FFmpeg, so I assume I am missing something obvious.

You can use the adelay filter for MP4.
ffmpeg -y -i soundtrack.wav -framerate 30 -i %d.png -af "adelay=28840|28840" -r 30 -vcodec mpeg4 generated.mp4

Will try that out.

Thanks. This worked. I still don't understand the reason why my way didn't work, and I have to assume it is a bug, but that could still be wrong.

It is likely a bug. Try with -copyts immediately after the itsoffset.

Apparently itsoffset only works for video inputs, not audio

Not so.  Unless the demuxer sends packets with no timestamps, itsoffset should work with all inputs

There is an open ticket against FFmpeg from 4 years ago, that suggests that this is a bug with the mp4 container

2) outfile has expected playback behavior with .ts and .mkv containers.
  3) It does not work with .avi (no timestamps, so not a surprise)
  4) It does not work with .mp4 container (a bug?)

Sure enough, when I use an mkv file, it works.
(Well, in VLC, but no sound at all in the Windows 10 "Films & TV" viewer.)


text:
How can a GIF made from a vid be larger than the vid itself?

iPhone 6S Plus
Tumblr app GIF creation feature used for taking vid and making GIF
9 seconds of video taken =949kB
3 second portion used for GIF =1.3MB

How?

my assumption is that app wouldn't use low res vids for high res GIFs
I ask because I figured GIFs would be smaller thus transmit faster and use less data when messaging.

There are several factors at play here. For example, your gif creation app may have a quality slider/setting that influences the size of the output. However, the most likely cause is the difference in compression.
The videos your iPhone records are probably compressed using a highly efficient codec such as H264 (I didn't find any information on what codec/file type the iPhone camera uses, but I'll take an educated guess and say it's mp4). This codec is very efficient at reducing the file size of a video while maintaining relatively high quality.
The gif-format, on the other hand, was built for an entirely different purpose. It was actually intended for small, animated graphics with limited color palettes, not complex videos. The original gif-format is lossless, meaning it stores every frame of the animation completely. Works great for those small animated graphics, but is terrible for actual video. Actually, because of this, many apparent gifs that you see on the internet aren't actually gifs.
In conclusion: Gif is a terrible format to store or transmit video, use a video format instead. Follow the link above if you are interested in the  technical side of this.


text:
Downscale to "native" look
I want to downscale UHD-1 videos to 1080p. According to this and on other websites the Lanczos method should give best result for downscaling.
However my goal is to downscale a video in a manner like it was captured natively in 1080p. Since there is more information available for UHD I fear that the downscaled video could result in better quality than it could have when captured natively by using a camera with 1080p resolution.

The "native" look of a high-quality 1080p image is one that preserves as much information as possible within the Nyquist limit.  Downscaling UHD-1 videos to 1080p can only approach this ideal, just as any native 1080p imaging chip can only approach this ideal.

so in short you mean that the quality of a downscaled video will always be worse than "native" 1080p content?

No.  The quality of a downscaled video will always be an approximation of an ideal, just as a native video will also be an approximation of an ideal.  One approximation may be better or worse.  Both will be massively, unmistakably altered (as far as the math is concerned) by compressing the video to 4:2:2 or 4:2:0, the typical chroma encoding schemes used when playing video on consumer devices.  And both will be even more massively, unmistakably altered by video compression schemes such as H.264 or H.265.

It also depends on the quality of your UHD camera. Even though they may be higher pixel resolution the amount of compression that they often apply is usually greater than a HD camera, meaning the image has more artefacts and doesn't necessarily resolve that much more detail.

Your understanding of sampling seems to be a bit off.  When downsampling from a UHD stream you don't have more information than a native 1080p sensor capturing it, you have less.  When the 1080p sensor is capturing video, it has near infinite points and photons it can capture as it is looking at a real life source.  Each photosite captures exactly what photons hit it (within the margin of error of the photosite anyway).
With downscaling, you have a much, much smaller amount of input.  All you have is the samples available and you don't know exactly where within the pixel they came from.  If the sample is an exact multiple, then it is still possible to make an exact 1:1 mapping by combining a group of pixels in to the only pixels they impact, however if you do not have an evenly divisible number of pixels, then you can't determine the exact impact of your new set of pixels from your old and you have to apply some type of imperfect translation between them.
This imperfect translation will produce less positionally accurate information, but also can have other advantages.  One advantage of downsampling is the reduction of noise.  Since noise is random, averaging multiple samples together will generally reduce noise when all other factors are equal.  It's ideal for this to be done at an evenly divisible interval to avoid needing to translate data between pixels, but the advantage is still seen with any downscale.
Getting back to your question however, unless you are shooting an even multiple of 1080p or choose to crop your sensor input to an even multiple of 1080p, you will have some type of translation of pixels.  If you want the most "natural" look, I would encourage using a resolution and aspect that allows you to directly map pixels.

Thanks for this great answer which makes perfectly sense with the comments from Michael.


text:
What is the easiest, no-frills way to produce a simple video on Windows 10?
This question is basically the same as one I posted 2.5 years ago here, except that now I am using a different laptop that runs Windows 10 instead of Windows 8.
My laptop has a camera. Since it can obviously take video of me (a la Skyping), it should be easy to create a video of myself practicing a presentation.
My laptop runs Windows 10.
This is going to be a long video -- 1.5 hours. What is the easiest way to accomplish that using apps that come with Windows or something free that I can download?

I would look into using OBS (Open Broadcaster Software). It's free, and allows you to capture from a webcam and/or your actual monitors or windows. Many people use it for streaming to sites like Twitch, but it also has built-in options for recording to a file.

I wanted to do nearly the same thing on my Windows 7 laptop. I needed to make a 2 minute video of a device I built.  I messed around for a day with Camtasia, only to find out this very feature-rich video editor couldn't do this "simple" recording task. I ended up using Debut Video Capture Software. Free download. Got it working in 5 minutes to do exactly what I needed. I don't know if it works for Windows 10.


text:
How can I play a file created in OBS?
I downloaded OBS based on an answer here.
I tested it by selecting "Start Recording" saying a few words, and then "Stop Recording"
I then selected File > Show Recordings, and it opened the This PC > Videos folder in Explorer; the file just created was there, named "2016-08-15 06-11-54.flv"
However, 2-clicking it does not run it in OBS; it wants me to choose an app from the list to use, which, in my case, is "IrfanView" and "Look for an App in the Store"
I tried Irfanview, but the .flv file won't run because Irfanview is apparently lacking a needed Flash .DLL; Flash kind of gives me the fantods, so I let that slide.
Won't OBS play the videos it creates? If so, why doesn't it show up in the list of apps to execute the .flv file? How can I (if possible) get it to run the file?

Install Potplayer or VLC.

OBS records in mkv format which can be played on almost anything.

OBS is a video streaming and recording software, not a video player. You will need either find a video player that will play an .flv file, or switch your settings in OBS to record to a different format, like .mp4, which most video players will be able to playback.


text:
Best way to set up my AE project?
In a nutshell, I just got a new job where I have to create at least 30 MP4 files a day cutting different parts of music videos (even from the same one).
They will provide me the videos to download and I have to make different MP4s in After Effects not longer than 8 secs.

I was thinking of doing it this way:
Project in AE (10 sec composition) with 3 project folder

Footage: full-length videos
Cut Footage: cut videos pre-composed

Here is a problem: cutting in AE is so annoying and (because the main comp is 10 seconds) I have to extend the new composition from 10 sec to the length of the video, find the relevant part, put two markers and reduce again the composition within the markers. Finally, I have to move the pre-comp in the main composition where I can start with the effects and stuff. I do all of this because I want more control of the layers, for this reason I prefer to keep a fixed length layer rather than a reduced layer, like in the screen below:

Render: the folder where I put the pre-comps formed by cut footage pre-comp + effects

What is the better way of making a rendering queue in AE?

So the worst part is cutting, but what about the size of the project? I mean, should I create an After Effects Project every day that includes 30 MP4 files with of course all of the effects, layers, videos, etc. or is it going to be to excessive? Do I have other options?

Is there a reason you're using After Effects for this? Seems a bit overkill and there are MUCH easier ways of doing this. Premiere Pro seems like it would be a more natural choice for cutting down video into little segments like that.

Agree with John, but if you're allergic to using Premiere or really need AE for some reason, there's a tool here that will automatically adjust the length of the comp to the first or last frames of the layers in it, even if they extend past the end: http://blob.pureandapplied.com.au/first-n-last/ full disclosure: I wrote it.

That's amazing @stib! Anyway I'm totally fine with Premier Pro, but I don't know, I should create a dynamic link everytime? Or maybe there is a future that I don't know like: cut the video and just drag and drop in After Effects?

Why are you moving it to After Effects at all? If you're on Windows, you can export a GIF straight from Premiere Pro. If not, you can export the video (segment) from Premiere and use one of a myriad of tools to convert the video to a GIF (like giphy.com)

Right, I wasn't clear about the format, I'm sorry!
We use the term "GIF" because is what looks like, but on the CMS I send a normal MP4.
Anyway I need AE because I make proper small lyric videos with lights, effects and everything, Premiere is not able to do anything like that.So I must cut and work on AE, finally make the render.

Okay, I think you're definitely missing some key info in your question then. I'm guessing your "footage" is then the raw footage (no effects), and you must add effects/lights/etc. Why is your "main comp" 10 seconds? Can you not just create a new composition each time?

Yeah man, huge mistake in my explanation, sorry!
It's getting easier than what it seemed before, isn't it? Ahah!
Well, your comment just made me realise that if I drag and drop the footage on the Composition Icon (even if the audio preview of AE is sh*t) it will fit perfectly, than I can use that script for cutting and finally, work on the video without using ANOTHER pre-comp containing the footage.
Update: the script is no more available.
But I found a cheap one: http://aescripts.com/trim-to-comp-contents/

I found that this was a very useful tutorial on ways of setting up multiple renders - you might find it helps (not with the trimming your comp part, just the rest): https://vimeo.com/12875270

That's great @tomh!
Anyway I found a solution about cutting.
I can upload the video on Premiere Pro, cut and select "Replace With After Effects Composition" and that's it, that future is amazing for this type of work! Thank you all by the way!

I found a solution about cutting. I can upload the video on Premiere Pro, cut and select "Replace With After Effects Composition" and that's it, that feature is amazing for this type of work! Thank you all by the way!


text:
Hearthstone-style graphics with After Effects
I'd like to make some graphics like Hearthstone with After Effects. But I'm having trouble finding the right technique to simulate that look. After some research, I found the way that the Blizzard developers make their graphics, but they use coding. How can I achieve similar results with After Effects?
Here's an example. And there is another.
I already figured out how to mask-map(?) using colors thanks to Stib in this post.
But now I'm trying to figure out how to make this "warpy" thing, based on the color map:

I do have the way they make the particles effects and all that stuff in mind, but their technique is way more practical. In deep research some techniques came to me, like Plasma, but they're all coding techniques.
PS: I do know about the displacement mapping.

Here's a few effects to take a look at, which may get you closer to the result you are looking for. These effects are based on your helpful thumbnails:
Effect > Stylize > Glow / Trapcode Shine (uSampler1)
Effect > Noise & Grain > Fractal Noise + Turbulent Displace (uSampler2)
Effect > Generate > 4-Color Gradient (uSampler3)
Effect > Noise & Grain > Fractal Noise w/ Default Settings (uSampler4)
Effect > Color Correction > Colorama (uSampler5)
These styles require heavy experimentation, so play around with Track Mattes, Blending Modes, and importing textures and other source imagery to help achieve these results. Good luck!


text:
Extracting video fields Respectively
Extracting individual video fields is my previews question.
Based on the Mulvya's answer I can extract the top fields (only) or the bottom fields (only) individual.
Now, I need to extract the video fields In the following order:
TopField1 , BottomField1 ,TopField2 , BottomField2 ,....
Is it possible?
my source format: DV PAL 720x576i

Sure, you have to combine the field extraction with interleaving.
ffmpeg -i video.avi \
       -filter_complex "[0]field=top[t];[0]field=bottom[b];[t][b]interleave" -r 50 fld%d.png

where the r value is double the original frame rate (or the same as the field rate).

would you please tell me how can I get this order : TopField1 , Frame1 ,BottomField1 ,TopField2 , Frame2 , BottomField2 , . . .

Use interleave as follows: [t][0][b]interleave=3

sorry , I've tested  [t][0][b]interleave=3  , but it did not work. it get error.

You'll have to resize either the field outputs or the full frames, since the latter is double height. You're better off extracting the fields and frames individually and then renaming the files using a script.


text:
flattening a sequence in Adobe Premiere (collapsing included sequences)
I'm using Adobe Premiere -- I'm trying to convert a project to use a single sequence, with all the media clips in that sequence.
At the moment I'm in Adobe Premiere 5.5, but I have Adobe CC available.
Any leads are welcome!
Question
Q: What is the fastest and easiest way to replace these subsequences in my main sequence, with their component clips, such that the main sequence still renders to exactly the same video?
If you have any leads or even partial ideas, please feel free to leave a comment.  Also, please mention which version of Premiere you are using.
Current State of the Project
This is a simplified view, the actual number of clips and subsequences is much larger!

Main Sequence A

Clip 1
Clip 2
Sequence B
Clip 3
Sequence C

Sequence B

Clip 4
Clip 5

Sequence C

Clip 6
Clip 7

Desired State of the Project

Main Sequence A

Clip 1
Clip 2
Clip 4
Clip 5
Clip 3
Clip 6
Clip 7

Difficulties In Flattening

Sequence A doesn't use all of Sequence B, and it doesn't start at the beginning
Suppose I just copy the clips from Sequence B
...pasting them in Sequence A where Sequence B is now
the clips will not start at the same time they do when in Sequence A

Flattening Techniques
Attempt 1: Nesting

Select the clips in Sequence A, including Sequences B and C
choose "Nest"
now only one sequence is in Sequence A!
...however that sequence still has nested sequences.

Attempt 2: Trim project

I selected only Sequence A and chose Project Manager...
Premiere made an entirely new, simplified ("trimmed") project
the media used in that Sequence A, and therefore B and C as well, were included in the sequence, and no others
the media used were copied to the new location (so they are in two places on this drive now)
...but when I opened the new project, Sequence A STILL has nested sequences.

Attempt 3: brute force
Why bother?  Why not fix all these manually?  Well...
Here's the process I have at the moment to replace a single sub-sequence.  Bear in mind this is a large project and I'll have to do this dozens of times.

in Sequence A, select Sequence B and duplicate to another layer
...we'll call this "Sequence B2"
extend Sequence B2 in length to the very beginning of its earliest point
cut B2 to where Sequence B begins
the new first half of B2 is the length of B that elapses before showing the part used in Sequence A.

This half we'll call B2a
the part that plays in Sequence A we'll call B2b

now, in Sequence B, use timecode/frame arithmetic to go to the exact point in the clip
make the cut in the same place in Sequence B as it began in Sequence A... we'll call this B3, which is theoretically starts at the same point as B2b
copy the cut clip B3 in Sequence B...
...and paste in Sequence A on top of B2b and use a separate layer
set B3 to a partial opacity to verify Sequence A is EXACTLY THE SAME as it appeared before B3 was pasted in!

if it's off, you'll see B3 and B2b as two distinct and overlapping images

Did you see this?

Aha!  Looks like this "insert and overwrite sequences as nests or individual clips" button is in Adobe CC.   I'll check it out.

(1.) Open the master sequence containing the nested sequences.
(2.) MAKE SURE that the "Insert or overwrite sequences as nests or individual clips" selector (the leftmost icon under the timecode display in the sequence panel) is NOT highlighted. This will force a nested sequence in the Source Monitor to be edited into the sequence as the individual clips contained in the nested sequence.

(3.) Park the playhead in the middle of one of the nested items in the main sequence
(4.) Choose "Marker / MARK CLIP" (I have this programmed to "X" on the keyboard.") You need to make sure your track selection toggles are correctly set to target the track containing the nested item.
(5.) Choose "Sequence / MATCH FRAME" (I have this programmed to "F" on the keyboard.) This opens the nested sequence into the Source Monitor.
(6.) Choose "Clip / OVERWRITE" (I have this programmed to "B" on the keyboard, like an Avid.) This should have replaced the nested sequence CLIP ITEM with the clips contained in the nested sequence. This overwrites (from IN to OUT as selected in step 4) with the contents of the nested sequence.
(7.) move the playhead to the next clip and press X, F, B
(8.) repeat step 7 until you're done.
[This is tested on Premiere CC 2015.2]

John, your Kung Fu is the best.


text:
Modify video file for viewing in generic media player
I have a file called ~/somePath/foo.264, containing video from a surveillance camera's DVR. I am unable to view this video on several media players including the default media player on an Apple tablet and the Ubuntu Videos application. I am able to view it using MPlayer on Linux. How can I transform the video in this file to something that is more universally useable? I tried the following command at Linux terminal:

avconv -i ~/somePath/foo.264 -vcodec libx264 -f mp4 ~/somePath/foo.mp4

but the output mp4 file was basically empty, with a total size of 285 bytes. The source file, foo.264, is 80 MB.
Maybe I need to re-encode the video; maybe I need to place the video into a container of another format; or maybe the solution is something else. I am a novice at audio-video editing, but I am slightly more experience at Linux operating system.
PS. When I do the command

mediainfo ~/somePath/foo.264

from linux terminal I receive the following output:

General
Complete name: ~/somePath/foo.264
Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 79.1 MiB
Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L2
Format settings, CABAC                   : No
Format settings, ReFrames                : 2 frames
Format settings, GOP                     : M=1, N=30
Width                                    : 352 pixels
Height                                   : 240 pixels
Display aspect ratio                     : 3:2
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

PPS. I have already posed a related question, https://unix.stackexchange.com/questions/283548/convert-264-to-mp4-using-avconv , on the Unix & Linux Stackexchange.

You need to convert the codec used to encode the video to something that the players you are trying to use support. MPlayer supports a wider range of codecs than many players.
To allow you to view the video in other players you need to transcode the video using an application like ffmpeg. The command below will provide the conversion you need:
ffmpeg -i foo.264 -c:a aac -c:v libx264 -preset medium foo.mp4

i - input file
c:a - set audio codec to transcode to. Here I chose AAC
c:v - set video codec to transcode to. libx264 is used to transcode to H.264, one of the most common and widely used video codecs. Most players should be able to play files encoded with H.264.
preset - used to quickly define the H.264 encoding parameters. Choose from ultrafast,superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. There is obviously a trade-off between quality and transcode speed here.

After running this command I could play the video you uploaded in QuickTime on OS X.

If you use -copy or don't specify a codec, then ffmpeg will use the same codec as the source. So the command
ffmpeg -f h264 -i foo.264 -c copy foo.mp4

Will change the container around the video to mp4, but not the video encoding itself. You can read more about the difference between containers and codecs here.

The information realted to input files seems perfectly fine. Can you share the file or file link here. I will experiment with it and update you about the results.

The file is available from the following URL: [ https://drive.google.com/file/d/0B0ej35Mor2U-d1NNMFNoZUhuNU0/view?usp=sharing ]

You should just be able to place it in a MP4
ffmpeg -i foo.264 -c copy foo.mp4

Maybe if they don't detect the format, then
ffmpeg -f h264 -i foo.264 -c copy foo.mp4

I ran the second command. Then when I tried to play the output file in Ubuntu Videos app I got the following error message: "An error occurred  GStreamer encountered a general stream error."
Here is the output of [mediainfo ~/somePath/foo.mp4]:
General;
Complete name : ~/somePath/foo.mp4;
Format : MPEG-4;
Format profile : Base Media;
Codec ID : isom;
File size : 79.2 MiB;
Duration : 18mn 1s;
Overall bit rate : 614 Kbps;
Encoded date : UTC 1904-01-01 00:00:00;
Tagged date : UTC 1904-01-01 00:00:00;
Writing application : Lavf57.29.101;
... continues ...

... continued ...
Video;
ID : 1;
Format : AVC;
Format/Info : Advanced Video Codec;
Codec ID : avc1;
Codec ID/Info : Advanced Video Coding;
Duration : 18mn 1s;
Bit rate : 614 Kbps;
Width : 352 pixels;
Height : 240 pixels;
Display aspect ratio : 3:2;
Frame rate mode : Constant;
Frame rate : 25.000 fps;
Bits/(Pixel*Frame) : 0.291;
Stream size : 79.1 MiB (100%);
Encoded date : UTC 1904-01-01 00:00:00;
Tagged date : UTC 1904-01-01 00:00:00

The source is not a standard-compliant file. If you run ffmpeg -i foo.264 foo.mp4 with a recent version of ffmpeg, it will throw some errors but produce a mostly intact generic MP4.


text:
Automated rendering of After Effects or similar
Initially posted on graphicdesign.stackexchange.com:
I'm looking for a way to integrate animations into our existing product. The animations would essentially be 30 second commercials containing some variable data (names, dates, numbers). The system needs to automatically render the animation when the user pushes a button. These are non-technical users, so it needs to be all very black-box.
It looks to me like we could use After Effects for this, but I am not a designer so I'm looking for confirmation and suggestions from the experts. This is how I see it working:

We have a designer create an AE project for each desired animation.
The AE project is set up to pull the variable data from a file at render time.
When our user pushes the button, the system generates the data file and puts it into a folder known to the AE project.
The system then kicks off the render using aerender.exe.
When rendering is complete, the system shows the animation.

Does this sound like a reasonable way to proceed? Any alternative suggestions?
One area I'm concerned about is the data merge part. Can an AE project be set up to automatically do that at the time of rendering (i.e. initiated by aerender.exe)?

After Effects can be automated using the Adobe extendscript scripting language,  and can be run from the command line, meaning that it can be integrated into other processes.
Extendscript is JavaScript and it works across Adobe's product line (to varying degrees, you can use it to script Photoshop for instance). If you have a JavaScript developer available then this would be a relatively straightforward task.
There are also third party frameworks such as Dataclay that make the process easier for non-technical users to avoid scripting, but they are relatively pricey, though they might work out cheaper than hiring a developer and rolling your own.

Thanks @stib. As it happens, I am the developer in this situation, so a scripting language is exactly what I want. Sound perfect.

Pro tip: to make it easier navigating After Effects' arcane object model, go download the Redefinery tools, in particular rd_GimmePropPath which shows you the path to any particular element in the app. http://redefinery.com/ae/view.php?item=rd_GimmePropPath

I did end up using extendscript for this and it worked perfectly. The script both injects the variable data into the AE project, and kicks off the render. Also, by configuring AE as render-only we don't need an AE license for the rendering server. It runs completely unattended.

I wrote an automation script for after effects that allows data and assets to populate a template

I have worked with companies over the years extending this so that it runs on a server, takes assets and data through a web browser, and renders the modified template.

I work with DataClay have built out several automated AE Comps allowing for thousands of personalized videos to be rendered based on data.
I would highly recommend dataclay.com


text:
Scene change detection
What off the shelf (COTS or OpenSource) have scene change detection? I would really like one that is not a fixed algorithm, but can either use motion vectors, audio, or static analysis depending on our needs.
Is there something beyond what is already talked about in:
Split one video file into small files made up of its scenes
Or with the matlab tool:
http://www.mathworks.com/help/vision/examples/scene-change-detection.html

I have been working with Magnum 3 (http://aescripts.com/magnum/) {a plugin in for After Effects} for a few days. It definitely meets my needs (at $39.99). Things I like:

You can set the threshold for scene detection
You can get a graph of the detection layer, where spikes show values on timeline for where detection is higher (set the threshold to include all the spikes you want)
Either splits the layer, or creates markers
You can export thumbnails for scene changes, and a text file for the "EDL" (actually, you have a template you can use to write out Text or CSV files in any format you want).

Both Speedgrade and Davinci Resolve have scene change detection.
Davinci Resolve is also free. I am not sure however on how exactly it detects scenes changes.

I sorta like the flexibilty of the Magnum3 plug-in for After Effects, But I am not sure how to get the split scene back into Premiere (SpeedGrade puts out an EDL but Premiere does not understand EDLs that operate on one clip. http://aescripts.com/magnum/

I think that SpeedGrade and Premiere can talk via Dynamic Link while both are running. No need to mess with EDL files.

It can talk via dynamic link. But two issues. 1. MP4 files when linked to speed grade do not allow scene detect. So one still has to export as avi or QuickTime (full frame data) Issue 2: even if you dl-link an avi from premiere. The clips on the timeline do not show premiere.


text:
Advanced Low Cost Editing Software
I am looking for a cheap (not necessarily free) editing software.
At the moment I have to work with Serif MoviePlus X6 but I find this too basic.
I have a lot of knowledge of video editing but am usually restricted by the limitations of the software I can afford. I need something as advanced as After Effects - and similar to Blender's layout which is NOT designed for ease of use but rather to offer as much flexibility as possible - for general video editing; but for a lower cost than Adobe products.
Any suggestions?

ANSWER
Of the amazing answers I received I found the best suggestions were:

BlackMagic Davinci Resolve 12
Lightworks

You say you're looking for editing software, but give After Effects as an example, which is mainly an SFX program. What exactly do you need? Also, what do you mean by 'non-specific'?

As you said by non-specific I meant software that is not JUST audio; but I was under the impression that After Effects was "motion graphics and visual effects" as I just doubled checked on the Adobe website?

That is correct, After Effects can be used for all kinds of special effects (i.e. SFX) and animations. That's more than regular editing software (such as Adobe Premiere) can do. If you're only looking for something with video editing capabilities, here a list of free editing software. Fully-featured animation/sfx software is rather expensive. So the question is what do you need, only editing or animation/sfx as well?

Only editing because I use blender for any animation. Thank you for the list.

In that case you have a couple of good options, I'll post an answer in a sec

Since you said you use Blender for animation, why not just use that? Feature-wise, it's video editor can stand on it's own. It's a nightmare in usability (in my opinion, I believe that's also the general consensus), but if you're used to the program anyway ...
Free software
There are a couple of free programs available (a list, another list), most of which suffer from the same problem as Blender, that is not having a coherent design which leads to inconsistensies in it's functionality. It might take longer for you to get a grip of the software, and certain functionality might be missing. So if you're willing to invest some money, you can probably do better (even though it mostly comes down to preference).
The low-cost software trap
Be careful with cheap software (for example, Magix software), as it's most likely consumer oriented and not fit for (semi-)professional editing. The problem with those programs is that they are not built for editors who are willing to put some time into learning the software and fine-tuning effects and settings, but rather for people who just want to throw their vacation video together, add a title, some background music and be done with it. That means advanced functionality such as keyframe animation will probably not be available and in terms of visual effects you will most likely be tied down to a couple of presets.
It comes down to what you want to do, what functionality you need and personal preference.
Some affordable candidates

Sony Vegas (at least Pro)
Final Cut X
Lightworks
Corel VideoStudio Ultimate
Premiere Elements

Please note that this list is influenced by personal preference (I use that word a lot for a reason). Again, it comes down to what you need. Also, all of those low- to medium-cost options are to some degree limited, i.e. might lack certain functionality. None of them will compare to professional software such as Premiere Pro and After Effects. Final Cut X and Sony Vegas Pro Suite probably come closest to it, whereas Corel VideoStudio and Lightworks would be somewhere in between professional and consumer software. Premiere Elements is pretty easy to learn, but lacks most functionality that you will need for professional/advanced editing.

I would give lightworks a try. The good thing is that it's "freemium" so you can learn it (and use it) free of charge - limited to 720p h264 output. Then, only license export options when you need them.

Hitfilm has a free express version and a paid version.
It's a video editor and a compositor.

You can do a lot with the free version and buy the modules as you go. The basic module is just USD 10.

Lightworks (as mentioned previous) but also newcomer to the game is BlackMagic Davinci Resolve 12 which can be both Free and Paid (if you want all the PRO Pro Features)

Just wanted to mention Davinci's hardware requirements. Of course you can't neglect hardware when editing video, but Davinci is quite voracious on that account - not comparable, for example, to Lightworks or Sony Vegas.
I really wanted to try it, but gave up because the hw upgrade needed was huge.


text:
Loss of quality while adding subtitle via FFmpeg
After solving on problem I cam coming to a next one. After adding subtitles, discussed here, with the command:
ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt gradedFinalwithSubs.mov

the quality of the generated file significantly decreased. The original file was of size 1,5GB whereas the resulting file was of size ~300MB. The subtitles are added correctly but the compression is unnecessary. In a word I would like for the FFmpeg to add subtitless and do only that leaving the sound and picture quality untouched.

As you are hardcoding subtitles, the video (with the subtitles added) will be re-encoded.
You can use the CRF rate control method to modulate the quality of the output.
So, start with
ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt -crf 18 -c:a copy gradedFinalwithSubs.mov

If the quality's not acceptable, lower that value till it is - in exchange for a larger file. Of course, don't decide based on file size but on visual quality. x264 is very good at compressing video while maintaining subjectively perceived quality.

Thanks very much, I had a look here and put crf 0.

Unnecessary, but that's your choice. Use edited command for audio passthrough.

So what crf would be optimal for lack of quality loss? Side question, the created file does not open in QuickTime but it runs in VLC so I'm guessing that the file is no longer mov but avi for example?

For being mathematically lossless? None. For being visually lossless, 18 is generally transparent, but YMMV. Try -crf 1 - I think ffmpeg has chosen a pixel format for CRF 0 that QT doesn't work with.