text:
How to deinterlacing with ffmpeg?
I have the following VOB file:
→ ffmpeg -i input.vob output:
ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
  libavutil      55. 11.100 / 55. 11.100
  libavcodec     57. 20.100 / 57. 20.100
  libavformat    57. 20.100 / 57. 20.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 21.101 /  6. 21.101
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpeg, from 'input.vob':
  Duration: 00:31:36.96, start: 0.335967, bitrate: 6517 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s

→ mediainfo input.vob output:
General
Complete name                            : input.vob
Format                                   : MPEG-PS
File size                                : 1.44 GiB
Duration                                 : 31mn 36s
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 518 Kbps

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=3, N=12
Format settings, picture structure       : Frame
Duration                                 : 31mn 36s
Bit rate mode                            : Variable
Bit rate                                 : 6 132 Kbps
Maximum bit rate                         : 9 800 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.591
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 1.35 GiB (94%)
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.470 System B, BT.470 System G
Matrix coefficients                      : BT.601

Audio
ID                                       : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : DVD-Video
Duration                                 : 31mn 36s
Bit rate mode                            : Constant
Bit rate                                 : 256 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 57.9 MiB (4%)

I have converted it to mp4 with the following command:
ffmpeg -i input.vob -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k -threads 0 output.mp4

In the resulting video I see this effect:

How can I solve?

I wrote an app using qTGMC, which gives much better results than yadif https://github.com/hclivess/videer

Add the yadif filter i.e.
ffmpeg -i input.vob -vf yadif -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k output.mp4

See yadif docs for more info.

From empirical comparison I think the bwdif deinterlacing algorithm is superior to yadif, however QTGMC is superior to all of those. If you have to stick with FFmpeg, the nnedi filter is definitely superior but at the cost of massive reduction in processing speed. What is your use case, how critical is rendering time and must you stick with FFmpeg or could you branch out into other tools which use FFmpeg along with other things like Vapoursynth?

-vf yadif_cuda if you have NVidia and CUDA installed.

To expand on Woods' comment, QTGMC, by default, uses nnedi to deint. What makes QTGMC special is the extra filtering it does before and after nnedi. It also has presets to make it easy to use without fiddling with settings for days. nnedi can be 4x slower or more if you turn off the prescreener--which is not suggested because it gains you little. Otherwise, ffmpeg's default nnedi slowed my overall job by only 25% vs bwdif default. Without QTGMC, nnedi is slightly better than bwdif. With QTGMC, it is massively better. Hybrid makes QTGMC easy: https://forum.videohelp.com/threads/401770


text:
What is this effect (Motion Trails) called and how can i create it?
I'm new to adobe premiere pro and I don't know what this effect called and how to create it.
YouTube

It’s a motion trail. You can use After Effects to create one using the Echo effect. Here’s a tutorial that explains how to do it:

I would call it "Onion Skin" Effect.
I suppose there is some plugin for some software like after effects, premiere, DavinciResolve, or something.
A way to manually do it would be layering copies of the same video, let's say 10 copies and de-synchronize them by a couple of frames incrementally.
Define also incremental or decrimental values for the opacity.

source: Stack Exchange

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

sort: votes


text:
AV1 hardware encoding vs software encoding
This is not so much a hardware enquiry as academic curiosity. AV1 encoding is extremely resource demanding and using HW encoding can reduce encoding time considerably.
However, a lot of people seem to believe that AV1 hardware encoding produces notably worse results than software encoding.
While this is often true for live stream situations where the encoding settings are tuned to maintain low bit rates, it is my understanding that using the same encoding settings (or similar settings) a hardware encoder should be able to produce the same visual quality as a SW encoder, but faster.
Is there anything suggesting that AV1 hardware encoding produces worse visual results than software encoding? If so, is there any credible source to suggest so?
Please refrain from using anecdotal examples.

Besides your claim of AV1 encoding being "extremely resource demanding" being out-of-date (that hasn't been the case for years), this is kind of like asking for proof that the sky is really blue. Video coding is a niche enough field that academics generally don't write papers on "is the sky blue" type questions, and amateur video encoder tests (when they do exist) are by-and-large terrible because the people conducting them often have no idea what they're doing. Reliable data is so hard to find that the most common and useful answer to a question like this is "do your own testing for your specific use case".
If you do look at research on hardware encoders though, you may see a bunch of "comparable to software encoding" claims. However, these are for specifically designed implementations, and the reality of practical hardware encoders is that they rarely have the luxury of only focusing on a single video coding format. They need to be able to produce H.264 and HEVC, and possibly others as well. Combine this with a strict silicon area budget of consumer hardware and you get multi-format hardware encoders that need to have as many shared parts as possible. With all these limitations, it's easier understand why most hardware encoders only target the lower end of the efficiency curve, and that hardware encoders with the "same settings" as software encoders don't really exist. For example, no AV1 hardware encoder I currently know of has implemented film grain synthesis, so hardware encoders may completely skip some encoding tools, which will reduce efficiency.
This isn't to say that there are no hardware encoders with higher-than-average efficiency. When most people say "hardware encoder", what they really mean is "hardware encoder I could get my hands on". Dedicated hardware encoder cards aimed for commercial/datacenter users do exist, for example this AMD card which claims x265 slow efficiency for its AV1 encoder (roughly comparable to SVT-AV1's current preset 8, so still not comparable to what software encoders can produce). Companies that deal with video at large enough scale may also design their own hardware encoders for private use, which is something Google has done.
If you really are that skeptical about hardware encoder efficiency and you're interested enough, I suggest you prove this to yourself. Consumer-grade AV1 hardware encoders are easy enough to obtain. There are some very affordable Intel Arc cards, but Nvidia & AMD cards with AV1 encode are currently more expensive. Or you could try literally any hardware encoder for any format, since the principle is exactly the same. There's nothing special about AV1 hardware encoders that make them fundamentally different in this context than, say, H.264 or HEVC hardware encoders. However, some recent encoders for older formats may (or should, even) be better in their comparative efficiency than these first-generation AV1 hardware encoders, since the former are on their Nth hardware iteration and have therefore had more development time.

As a bit of a meta-aside, this question seems to come up every time a new video compression format is introduced and the initial software implementations are slow compared to encoders for current-generation formats. Hardware encoders get hyped up by some as this amazing future technology that will save us from single-digit encoding speeds, but the end result is always the same. Hardware encoders don't reach anywhere near the full potential of video compression formats, and software development, optimization, and more powerful CPUs are what actually bring us the most efficient encoders. So, for the information of OP and anyone reading this in the future: hype and misleading/false claims are not uncommon when it comes to video encoders. In fact, they're pretty much the rule rather than an exception.

Thanks for explaining anything but the question I asked.

Your question was answered quite exhaustively. There's no need to be petty.

Well in that case please enlighten me on which part of your answer addresses the question "Is there anything suggesting that AV1 hardware encoding produces worse visual results than software encoding?". I don't see an answer to that anywhere.

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


text:
Black frame strobing during CC export
I have a sub-3-minute sequence in Premiere CC, containing a single 4k DCI 23.98 AVC stream from a Sony FS7, with a couple static PNGs and 29.97 Quicktime Animation lower thirds.
I need to export to a quicktime wrapper around some sort of mpeg-4 codec; I've tried several configurations of H.264 and MPEG-4 with the same result.
My timeline plays and looks normal, but after export, I see the following result via Imgur videotogif:
https://i.sstatic.net/KGtlB.jpg
Because I know some of you will ask, here is a screenshot of my export settings:

Changing resolution, codec (within variants of Quicktime), with/without previews, max render quality - all has no effect on the strobing issue.
Anyone have any thoughts on what the problem might be here?
I'm having the same issue with a visually similar sequence in the same project for the same client, and had it once before as well (you guessed it, same client, same content specs). I've never experienced this ever before so I'm inclined to think there's some little gremlin in there somewhere - but I'm dashed to figure out what it is.
[edit]
I've also verified that the issue occurs when exporting to P2/MXF as well as ProRes.
Per @Mulvya's question about source properties, here's a screencap of the properties window on one of the clips. All the footage was shot in the same session, same camera, etc, and should be completely identical:

What are the source footage properties?

Edited post with details.

Can you export as an image sequence and check?

I have the same problem, but after several exports, for some reasons, it happens inside premiere now....

Are you using the "Mercury Playback Engine GPU Acceleration (CUDA)" as your renderer inside of media encoder? I've read about and had a few cases where software only rendering can cause similar issues.

So @NataliePi was on the correct track. I ended up poking a few other buttons the next day and, on a hunch, switched off CUDA-accelerated encoding. Boing, black frames gone.
I'm working from a 2014 MBP Retina, which has dual graphics chipsets (Intel Iris Pro and Nvidia GeForce 750M). Since the results so were so consistently happening about halfway through the video, and only on frames being recompressed from original source, I wondered, as Natalie did, if it was a graphics card issue.
Switching to CPU-only solved the problem.

I'll reconfirm the issue when my Akitio eGPU box arrives (along with my shiny new GeForce 1070 in June) and have the firepower to determine if it really was a VRAM, or CUDA-related issue.

My suggestion would be to forget the idea of exporting a Quicktime from Premiere using the H.264 Codec. The reason? Because it typically doesnt work.
The only sure-fire output module for Quicktime is the Animation codec; which will result in very very large files, if you export at 100% quality (essentially uncompressed) and especially so if you use an Alpha Channel.
Is there any reason why you need Quicktime as your actual wrapper?
I would highly suggest using:
Format: H.264  (Not Blu-Ray just H.264).
Setup the output to match your desired settings.
Set a target bitrate to meet your needs (for BluRay quality 1080p = 30mbps on average).
ALWAYS use CBR. Avoid VBR at all costs. Why? 1.) Time, VBR takes a lot more time, especially on a two pass. 2.) VBR will cause artifacting on fast flashes, such as a camera flash going off in frame, or just a white flash you've added in. The VBR engine first scans your video to approximate how to apply the bitrate frame by frame. When a camera flash is encountered (the frame goes near to all white), the preceding and following frame will suffer, because Adobe's algorithm for computing the adjustment will not adjust fast enough. It will drop your VBR very low for the white/black frame, but not ramp back up fast enough before or after that frame (which requires little if hardly any bandwidth).
CBR will ALWAYS give you a rock solid consistent output quality.
**So; as far as the black frame drops, forget Quicktime. Forget Quicktime forever, unless you require lossless output with an alpha channel using the Animation codec- never use Quicktime again. Instead:
Output as format: H.264 with the extention .mp4.  After you have rendered out, if your client wants or demands an MOV file... - just change the extension to .mov and don't tell them. They will never know, the difference. Nor will any application they use to read the file see that it wasn't output using QT.  It's H.264.  The extension does not matter. Rename to .mov and boom it's now QT.
Simple as that. Remember Quicktime is just the wrapper - and a terrible one at that. H.264 is the codec. If it's H.264 they want, its H.264 you'll give them. It makes no difference if you name it movie.mp4 vs movie.mov.
So give that a shot, and I think your black flashes will be gone.
Again, the only valid use for Quicktime is the Animation output codec, which is great. Other than that, Quicktime is a dead format tied to a long dead OS.
The only time I ever use QT is in After Effects, for output of all comps before taking them into PPro for H.264 mastering. That is the only time I --ever-- use it.
Give it a shot.

This doesn't address the OP's problem, since it happens even when exporting to MXF in a different codec.

He stated:  "I need to export to a quicktime wrapper around some sort of mpeg-4 codec; I've tried several configurations of H.264 and MPEG-4 with the same result."       I told him what I would try. Forget the wrapper. Get the H.264 out. then just name it as an MOV.   MXF is even more problematic.

Looking at his settings, also, there is no need to add keyframes every 1 frame. Add a keyframe every 30 frames. More than enough for seeking.

You missed this - "I've also verified that the issue occurs when exporting to P2/MXF". This has nothing to do with the container.

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


text:
Is there an optimum position for placing a bug or DOG?
I'm creating some How To type videos to go online, and I'm looking to add a bug or DOG to the videos. The videos will contain some screen captures of a website with the full logo in the top left but it will not always be visible. I'd like to add the glyph part of the logo to 95% of the video.
Is there any established rules or general consensus on where is best to place a bug or DOG?
My first idea was to go top right (as top left would mean a logo over the top of a logo for parts of he video). This seems to fit with what most traditional TV stations would do. However I've notice a lot of YouTube creators have started to add them to the bottom right.
On most of my Google searches, I've only really found people asking or explaining how to actually place a watermark, and not any advice on where to place them.

The Vulnerability of Visible Watermarks https://research.googleblog.com/2017/08/making-visible-watermarks-more-effective.html ...

If you are talking about a bug or DOG and not a watermark for copyright protection, then the optimum placement is whatever is appropriate for your video's visual style. There is no magical location on the screen to place it. Most US broadcasters started out placing their bug's in the lower right corner, but that has evolved depending on the channel's look and feel.

Ah yes, that's exactly what I'm thinking of. I just didn't know it was actually called a bug or DOG. So essentially, no actual rule of thumb, just what works / looks good for you.

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


text:
Encoding videos for MPEG-DASH
I read this article on encoding for MPEG-DASH, which has helped me a little and then follow up article.
My end goal is to create a batch file that can read in a directory of MP4 files, and then output the configured video bitrates and MPD file needed for MPEG dash consumption by a client.
Previously I was testing with IIS Smooth Streaming, but it seems Microsoft is abandoning that and has been behind the progress of MPEG-DASH.  Their expression encoder 4 encodes videos very nice for Smooth Streaming, but they stopped selling the pro version that supports h.264, of which MPEG-DASH clients can play.  The free version does the VC-1 Advanced which is not supported by MPEG-DASH.
How to encode for MPEG-DASH?  I need it to be targeted to Windows as I have a public server that is plenty fast (Xeon) to encode and will be the delivery method to players as well.

I would get as far away from EE as possible. Using the x264 tool, and mp4box, you can convert and segment out the files which are ready to be streamed to any dash compatible players. Especially since you mentioned using batch scripts, this is a great solution I think.
This is a good guide: https://web.archive.org/web/20141229070857/http://www.dash-player.com/blog/2014/11/mpeg-dash-content-generation-using-mp4box-and-x264/

Got it.  I had multiplexed representations in the MPD that was causing the player to trip up.  I was able to get around it by removing the ContentComponent in the MPD file, it played fine for me in Firefox, Chrome and Edge on W10.  Looks like to get valid MPD I need to demux and then run Mp4Box on those files for each adaptation set.  Thanks for your help, your link helped.  Marking as answer.

What do you mean by "EE"?

After some deep googling, reading white papers, I'm still not finding a conclusive answer to what EE is suppose to mean in reference to video encoding. I've come up with a few possibles: Event Encoding or EE Limited (a BT Group company providing mobile and internet services)

EE = Expression Encoder from Microsoft.


text:
Why do YouTube videos become greyish in Chrome if hardware acceleration is disabled?
Update: One of the tests has shown that the problem persists on certain devices even if the hardware acceleration is enabled. The 4 screenshots below were taken on Windows 10, Chrome 47.0.2526.111 m (64-bit), nVidia GeForce GT240M.

I've just made some tests, see the results below.
White as expected:

Windows 10, Chrome 47.0.2526.111 m (64-bit), nVidia GeForce GT240M, HACC ON.
Windows 10, Firefox, nVidia GeForce GT240M, HACC ON.
Windows 10, Firefox, nVidia GeForce GT240M, HACC OFF.
Windows 10, Edge, nVidia GeForce GT240M, HACC ?.
Windows 10, IE11, nVidia GeForce GT240M, HACC ?.
Windows 10, Chrome 47.0.2526.111 m (64-bit), nVidia GeForce GT630M, HACC ON.
Windows  7, Firefox, SyS Mirage 3 Graphics, HACC ON.
Windows  7, Firefox, SyS Mirage 3 Graphics, HACC OFF.
Android 5.0.1, Chrome, Adreno 320, HACC ?.
Android 5.0.1, YouTube, Adreno 320, HACC ?.

Grey bug:

Windows 10, Chrome 47.0.2526.111 m (64-bit), nVidia GeForce GT240M, HACC OFF.
Windows 10, Chrome 47.0.2526.111 m (64-bit), nVidia GeForce GT630M, HACC OFF.
Windows  7, Chrome 47.0.2526.111 m, SyS Mirage 3 Graphics, HACC ON.
Windows  7, Chrome 47.0.2526.111 m, SyS Mirage 3 Graphics, HACC OFF.

Can you share a comparison of a regular video-frame and is your player Flash or HTML5?

What do you mean by a regular video-frame? The picture I've posted contains 2 screenshots of the same video-frame: with hardware acceleration disabled on the left, and with hardware acceleration enabled on the right. Both screenshots have been taken in Google Chrome while watching the same video. The player is HTML5.

As in some live action, not flat color. Offhand, it looks like a gamma correction error.

I'll take a screenshot soon of this video.

@Mulvya I've added new screenshots, hope this helps.

Seems related to this: https://code.google.com/p/chromium/issues/detail?id=576482


text:
Why has my game video, captured with OBS/Win10 DVR, a black screen in iMovie/WindowsMovieMaker?
I am capturing games on my Windows 10 PC with Open Broadcast Software and x264 codec. My problem is that as soon as I import a video.mp4 file to iMovie or WindowsMovieMaker for editing, it is black, but has sound.
But when I watch it with Quicktime or Windows Video it works without a problem.
A while ago it worked - but I do not know if it was my upgrade from Windows 7 to Windows 10 or a newer version of OBS.
Things i tried:

export it into .mov with Quicktime - didn't work - after rendering an non sense error message á la "did not work"
reset OBS settings
deinstall and install fresh OBS
download h264 codec on windows, but it's just an .exe file - dunno what to do with it

So what am I doing wrong? Do you have any questions or need informations to help me that I didn't provided yet?
Update: Tried to capture a game video with Windows 10s new game capture feature and Windows Movie Maker has same problem with this video as well. Black screen -.-
Looks like OBS is not the problem.
Update 2: Here is the media info from one of my test files. It is recorded with OBS and saved to Fraps folder, it is not recorded with Fraps - but I guess that does not matter anyway.
General
Complete name                            : D:\Fraps\video.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 1.27 MiB
Duration                                 : 9s 499ms
Overall bit rate                         : 1 122 Kbps
Encoded date                             : UTC 2016-01-17 23:47:57
Tagged date                              : UTC 2016-01-17 23:47:57
Writing application                      : Open Broadcaster Software v0.657b

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Muxing mode                              : Container profile=High@3.1
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 9s 499ms
Source duration                          : 9s 466ms
Bit rate                                 : 1 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 30.000 fps
Minimum frame rate                       : 29.412 fps
Maximum frame rate                       : 30.303 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.016
Stream size                              : 1.12 MiB (88%)
Source stream size                       : 1.12 MiB (88%)
Writing library                          : x264 core 146 r2538 121396c
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=4 / 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=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=cbr / mbtree=1 / bitrate=1000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1000 / vbv_bufsize=1000 / nal_hrd=none / filler=1 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2016-01-17 23:47:57
Tagged date                              : UTC 2016-01-17 23:47:57
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : sYCC
Matrix coefficients                      : BT.709
mdhd_Duration                            : 9499

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 9s 487ms
Source duration                          : 9s 429ms
Bit rate mode                            : Constant
Nominal bit rate                         : 128 Kbps
Channel(s)                               :  channel0
Channel(s)_Original                      : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 spf)
Compression mode                         : Lossy
Source stream size                       : 140 KiB (11%)
Language                                 : English
Encoded date                             : UTC 2016-01-17 23:47:57
Tagged date                              : UTC 2016-01-17 23:47:57

And this is recorded with Win10 Game Capture Feature:
General
Complete name                            : C:\Users\User\Videos\Captures\Sid Meier's ~ Pirates! 18.01.2016 01_08_40.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (mp41/isom)
File size                                : 7.06 MiB
Duration                                 : 30s 534ms
Overall bit rate                         : 1 941 Kbps
Movie name                               : Sid Meier's ~ Pirates!
Performer                                : Microsoft Game DVR
Encoded date                             : UTC 2016-01-18 00:08:40
Tagged date                              : UTC 2016-01-18 00:08:40
Xtra                                     : {64440492-4C8B-11D1-8B70-080036B11A03} 27

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=29
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 30s 522ms
Source duration                          : 30s 500ms
Bit rate                                 : 1 810 Kbps
Width                                    : 1 280 pixels
Height                                   : 960 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Variable
Frame rate                               : 30.000 fps
Minimum frame rate                       : 29.970 fps
Maximum frame rate                       : 30.030 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.049
Stream size                              : 6.58 MiB (93%)
Source stream size                       : 6.58 MiB (93%)
Encoded date                             : UTC 2016-01-18 00:08:40
Tagged date                              : UTC 2016-01-18 00:08:40
mdhd_Duration                            : 30522

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 30s 534ms
Source duration                          : 30s 534ms
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Frame rate                               : 43.066 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 481 KiB (7%)
Source stream size                       : 481 KiB (7%)
Encoded date                             : UTC 2016-01-18 00:08:40
Tagged date                              : UTC 2016-01-18 00:08:40
mdhd_Duration                            : 30534

Update 3: This is a screenshot of my Windows Movie Maker. Like you see at the left a black screen and at the right first image of the movie, but that's all. And kinda wired thing is that I have with iMovie same problem. So it can not be a codec problem on my Windows 10 PC, but all capture apps have the same problem, well or all video editors...

Update 4: Here is the media info of my .mkv file.
General
Unique ID                                : 242469772953486188448003563262617227499 (0xB669FAC94B0A3F6673840B2F750A90EB)
Complete name                            : C:\Users\User\Desktop\Neuer Ordner\Video-1.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 1.15 MiB
Duration                                 : 9s 566ms
Overall bit rate                         : 1 005 Kbps
Writing application                      : HandBrake 0.9.9
Writing library                          : libmkv 0.6.5

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 9s 567ms
Width                                    : 1 920 pixels
Height                                   : 1 476 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Writing library                          : x264 core 130 r2273 b3065e6
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : A_AAC
Duration                                 : 9s 566ms
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 spf)
Compression mode                         : Lossy
Language                                 : English
Default                                  : Yes
Forced                                   : No

What does Mediainfo say for the OBS captured file? Use View -> Text mode and paste the readout into your Q.

@Mulvya I added two sample file infos to my question.

@Mulvya I reencoded it with Handbrake into .m4v and now it works on iMovie as well. But I still do not get it why iMovie and Windows Movie Maker have problems with the original .mp4.
I tried Blender and there it works with original .mp4.

The variable frame rate is all that stands out. Save future videos with constant frame rate. As for these ones, transcode using ffmpeg* to CFR MP4s:
ffmpeg -i currentvideo.mp4 -c:a copy -crf 16 -r 30 -fflags +genpts newvideo.mp4

*Get the 32-bit static build.

But why is Win10 game capture feature not working too? I've no settings there and this should work anyway. But I'll try your settings.

Hmm it doesn't work either. Now I will try to reencode it with Handbrake and maybe it works...

It is kinda ridiculous - when I put it into .mkv container instead of .mp4 it works with Windows Movie Maker. Now I'll try it in iMovie.

Can you post the mediainfo of the MKV?

I updated my question.

I read somewhere else that people switched container .mp4 to .mkv and now it works with Windows Movie Player. But I do not why .mp4 does not work anymore with my Windows Movie Player.
And iMovie can not read or open .mkv - so I have still this problem.
With 'switched' I mean recoded it - I used Handbrake for it.


text:
Video format can't be played or converted
My customer gave me a series of videos, recorded from CC Cam. The extension is .dad. I couldn't play them on any player. (Obviously changed the extension for testing) and I wasn't able to convert them into a more common video format.
I've tried Miro, HandBrake, VLC and some other apps on Mac to convert them with no success.
Can anyone help me how can I convert them into a more common format that can be played and used in production.
I can give more info about the video format if anyone asks and tells me how to get that info :)
MediaInfo Text View Output:
General
Complete name : /Users/hadi/Public/20151105-175532.dad
Format : AVC
Format/Info : Advanced Video Codec
File size : 227 MiB

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=50
Width : 704 pixels
Height : 576 pixels
Display aspect ratio : 1.222
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive

What does Mediainfo say for the OBS captured file? Use View -> Text mode and paste the readout into your Q.

@Mulvya Added MediInfo output

Use this ffmpeg* command:
ffmpeg -i "20151105-175532.dad" -c:v copy "20151105-175532.mp4"

*get 32-bit static build.

Great! Worked like a charm. I had to use 64Bit Mac version of ffmpeg binaries. But I worked.


text:
Audio drift after uploading to YouTube?
I recorded myself playing some games and then uploaded the videos to youtube. I noticed that after youtube finished all processing and made multiple resolutions available that the audio and video drift apart over time. As in, it starts out synced but after about an hour there is a noticeable drift. A friend of mine has no issue with the videos on Linux and the A/V is synced when I play the video on my iPad. The A/V is out of sync on every Windows and OSX computer I've tried. On OSX I even tried three different browsers with the same effect.
Things I've tried that didn't seem to make a difference:

Using OBS and OBS-MP
Constant frame rate (60fps)
Variable frame rate
Transcoding with hand brake before uploading to set a constant frame rate
Using the "Web Optimized" checkbox in hand brake
Lots of different recording options like audio sampling rate, etc
Different browsers
Disabling hardware accelerated decode: https://productforums.google.com/forum/#!topic/youtube/ZzW5iQfix3w

Interestingly when I play the video back using this player instead of the direct youtube link, I don't see the audio drift: http://youtubeaudiosync.tumblr.com/
And it's not just all youtube videos that are out of sync for me, this recording (not by me) is 1+ hours and it's perfectly in sync for me even if I skip to the end:

Another data point about the video above is that I can install the h264ify extension in Chrome and watching the avc codec version of that video it is still perfectly synced for me. I was starting to think it was as simple as the avc codec not playing correctly on my computer, but now I think the problem is more subtle than that.
Here is the video that I use for testing. It's acting up for me anywhere after an hour. For a really good test, skip to about 4 hours in to see if you have desync too:

As far as I can tell, the source video is "fine" in that some players have no problem with it, but once youtube processes, it has issues playing back on some computers. I've googled a bunch for issues like this, but I'm having a hard time finding a fix. I believe the issue has to do with which codec youtube serves up to the client. The link above that works for me happens to be the VP9 codec whereas my uploads are playing back on windows using the avc1 codec. You can see this by right clicking on the video and checking the "Stats for Nerds".
How can avoid YouTube A/V sync issues in my recordings? Do I have any control here?
Thanks in advance!

Is the source made by joining multiple files?

No. I recorded all of my test cases as one file each.

is the source variable framerate?

As I mention in the question, I've tried recording in OBS/OBS-MP both ways, meaning with variable frame rate and with constant frame rate. In both cases I see the audio drift.

I'm having the exact same problem and i have tried all that you have done yet i still don't know why it wont fix. Did you end up finding a solution?


text:
ffmpeg: final video too big
I have one image ~1MB (jpg) and a ~30 mins audio file ~7MB (m4a).
What I am trying to get is a final video that lasts like the audio file (30 mins) with the same image displayed. I get that with the following ffmpeg usage:
ffmpeg -loop 1 -i image.jpg -i audio.m4a -c:v copy -c:a copy -shortest -y video.mp4

The final result is correct but the size of the file is way far too big ~41GB as we consider the original size of the 2 files (image+audio ~8MB).
Is there a way to get a smaller size for the final video? I have used -r 1, -vf fps=1 etc but it didn't change.
EDIT
Following your suggestions I have changed the command into this:
ffmpeg -loop 1 -r 1 -i image.jpg -i audio.m4a -c:a copy -vf fps=1 -shortest -y video.mp4

and now the  final video size is dropped from 41GB to only 22MB and it built all in 2 mins.
Anyway it comes out a new issue: The image appears after 3/4 seconds that video is started. How can I fix that to have the image displayed from the beginning?
I think the solution for the delay is using fps=3.

just remove -c:v copy

@incBrain is a good practice also specify the codec that you want to use and some settings instead of relaying on defaults that can always change in future ;)

its actually not important in this case since we have only one input frame. So we actually can go with quite every codec. It is only important to remove this copy option because it tells ffmpeg not to change jpeg and replicate it with some framerate for some duration. But the best way to encode it would be to use IPPPPPPP......P structure. But I have no idea how to tell ffmpeg to do that.

@incBrain is indeed important, the encode you talking about is the compression strategy chosen by the codec. And there are some codecs that doesn't take advantage of intra - predictive frame scheme you talking about. Also if you don't specify the codec ffmpeg nowadays (in future who knows) pick h264 for you but in a lossy fashion, i don't think that one is the solution OP was searching for.

so your assumption is that ffmpeg will use less efficient codec by default in the future?

@incBrain no the assumption it's that is better have control over the process, specifying 1-2 more parameters won't kill anyone but you will have a portable command line valid for thousands of more transcodings, regardless ffmpeg version and the environment in use..

Just remove -c:v copy. So it should look like this:
ffmpeg -loop 1 -i image.jpg -i audio.m4a -c:a copy -shortest -y video.mp4

ffmpeg will select H.264 encoder to encode your image. You could also try -c:v libx264 -tune stillimage option. But probably the result will be similar.

Try
ffmpeg -loop 1 -framerate 1 -i image.jpg -i audio.m4a -c:a copy -fflags +genpts -shortest -y video.mp4

You are right about -r 1 and -vf fps=1 but you said also that you have 30 mins audio, in this case even if you keep fps at 1 it will be still 1800 seconds, 1800 times the repetitions of the same image converted as bitmap data.
Different thing is if you start using a codec that could take advantage of the redundancy of the data present in the stream. For example, even using h264 in lossless fashion retaining the 100% of the quality will make you save a huge amount of disk space.
Take your video 41 GB video as input and try:
ffmpeg -i video.mp4 -c:v libx264 -preset slow -crf 0 output.mp4

ffmpeg will not create an I-frame for each second. Default keyframe distance is 250 frames, and there's no scene change here to trigger earlier placement by x264.

@Mulvya Ok for the default keyframe distance but he used copy as codec with a jpeg input not h264 in his original post, how h264 scene change detection algorithm is pulled in in this case?

Ah, I just tested the OP's command and expected an error or warning but got none. Turns out that although MJPEG isn't an ISO registered codec for MP4, it is an Apple registered one, so ffmpeg generates a MJPEG stream with a major brand of M4A for the .mp4. So, yeah x264 does not come into the OP's command.


text:
Do media containers contain multiple audio channels in separate streams?
The title is self-explanatory. If a media container file (like MPG) contains multiple audio channels, such as left or right channels, does it take these audios in separate streams??

What do you mean when you say "channel" in this context? Do you mean the left and right channels of a stereo signal, or separate languages, or something else?

Depending on the container format, multi-channel audio can either be in a single stream or in separate mono streams.
Most consumer formats allow both, but it's easier for the end-user to have it in one stream (it can be interleaved PCM audio, or encoded bit-streams as ac3 or aac). Notice that it doesn't prevent to have several multi-channel streams in one container (like several 5.1 mixes, each one being one stream, in ac3 codec in a single container)
The MXF OP1A often used in broadcast usually has several mono streams for multi-channel content. A 5.1 mix will then use 6 mono streams in the container.

No, channels are conjoint, so they are part of a single stream. It is possible, using ffmpeg or similar software, to split channels into distinct streams. In which case, each stream will contain one channel.

What is the distinction here between channels and streams? Are you referring to left / right stereo channels, or...?

Yes, channels as compositional elements of an integrated image, somewhat like R G and B channels for a full-spectrum picture.

It's not completely clear to me what the OP is asking, because surely if you have "channels" in different languages, codecs (5.1 vs MP3 etc) they are separated into streams already. It is of course the case that left and right stereo channels, or front/rear/mid/sub etc are streamed as units, but is that what he's asking?

The 'channels' I mentioned was sort of left and right stereo channels. I just edited my question to clarify this point.


text:
Audio issue on concatenation of TS segments
I have downloaded segmented ts files, which i concatenate into mp4 file. The problem is that audio a bit faster than video progress. The problem is appeared when i re-convert concatenated mp4 file. How can i fix this audio issue?
Concatenation ffmpeg command:
ffmpeg -f concat -i hls.txt -c copy -bsf:a aac_adtstoasc hls.mp4 1> hls.log 2>&1

Some concatenation output
ffmpeg version N-76684-g1fe82ab 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-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  6.100 / 55.  6.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 14.100 / 57. 14.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[NULL @ 000000ebd70f13a0] start time for stream 2 is not set in estimate_timings_from_pts
Input #0, concat, from 'hls.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 149 kb/s
    Stream #0:2: Data: timed_id3 (ID3  / 0x20334449)
[mp4 @ 000000ebd7513aa0] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 @ 000000ebd7513aa0] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mp4, to 'hls.mp4':
  Metadata:
    encoder         : Lavf57.14.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 149 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 000000ebd7514460] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 000000ebd7514460] decode_slice_header error
[h264 @ 000000ebd7514460] no frame!
[h264 @ 000000ebd7514460] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 000000ebd7514460] decode_slice_header error
[h264 @ 000000ebd7514460] no frame!
[h264 @ 000000ebd7514460] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 000000ebd7514460] decode_slice_header error
[h264 @ 000000ebd7514460] no frame!
[h264 @ 000000ebd7514460] non-existing PPS 0 referenced
...
[h264 @ 000000ebd789d720] decode_slice_header error
[h264 @ 000000ebd789d720] no frame!
[NULL @ 000000ebd789bbc0] start time for stream 2 is not set in estimate_timings_from_pts
frame= 9321 fps=5550 q=-1.0 Lsize=   97452kB time=00:06:19.95 bitrate=2101.1kbits/s
video:90227kB audio:6888kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.346746%

Here is my re-convert command:
ffmpeg -y -i hls.mp4 -i watermark.png -filter_complex "scale=-2:'min(720,ih)',overlay=(main_w-overlay_w)-40:(main_h-overlay_h)-30" -codec:v libx264 -profile:v high -level 3.1 -preset fast -maxrate 1946k -bufsize 2500k -c:a copy -crf 20 -pix_fmt yuv420p -movflags +faststart output.mp4 1> output.log 2>&1

Some output log:
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 16 2014 22:36:57 with gcc 4.8.2 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/man --docdir=/usr/doc/ffmpeg-2.4.3 --enable-gpl --enable-version3 --enable-avfilter --enable-avresample --enable-libass --enable-libdc1394 --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-postproc --enable-runtime-cpudetect --enable-vaapi --enable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --arch=x86_64 --enable-pic --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -ldl -lssl -lcrypto -lz -lusb' --pkg-config-flags=--static
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hls.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.14.100
  Duration: 00:06:19.96, start: 0.000000, bitrate: 2101 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1946 kb/s, 24.54 fps, 50 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 148 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, png_pipe, from 'watermark.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgba, 250x50, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x2316f40] using SAR=1/1
[libx264 @ 0x2316f40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264 @ 0x2316f40] profile High, level 3.1
[libx264 @ 0x2316f40] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 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=3 lookahead_threads=1 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1946 vbv_bufsize=2500 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.4.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, max. 1946 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc56.1.100 libx264
    Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 148 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 (h264) -> scale
  Stream #1:0 (png) -> overlay:overlay
  overlay -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   38 fps=0.0 q=25.0 size=       4kB time=00:00:01.65 bitrate=  17.4kbits/s dup=3 drop=0
frame=   50 fps= 46 q=25.0 size=      20kB time=00:00:02.14 bitrate=  76.7kbits/s dup=3 drop=0
frame=   58 fps= 35 q=25.0 size=      75kB time=00:00:02.44 bitrate= 249.9kbits/s dup=3 drop=0
...
frame= 9478 fps= 13 q=25.0 size=   94544kB time=00:06:19.26 bitrate=2042.1kbits/s dup=175 drop=0
[mp4 @ 0x2316160] Starting second pass: moving the moov atom to the beginning of the file
frame= 9496 fps= 13 q=-1.0 Lsize=   94901kB time=00:06:19.95 bitrate=2046.1kbits/s dup=175 drop=0
video:87673kB audio:6888kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.359540%
[libx264 @ 0x2316f40] frame I:64    Avg QP:25.22  size: 53069
[libx264 @ 0x2316f40] frame P:5242  Avg QP:27.77  size: 13431
[libx264 @ 0x2316f40] frame B:4190  Avg QP:29.21  size:  3813
[libx264 @ 0x2316f40] consecutive B-frames: 21.7% 52.4% 17.8%  8.0%
[libx264 @ 0x2316f40] mb I  I16..4: 15.5% 61.0% 23.5%
[libx264 @ 0x2316f40] mb P  I16..4:  5.6%  9.5%  1.3%  P16..4: 41.7%  8.8%  4.0%  0.0%  0.0%    skip:29.0%
[libx264 @ 0x2316f40] mb B  I16..4:  1.9%  1.6%  0.1%  B16..8: 29.8%  3.9%  0.3%  direct: 3.5%  skip:59.0%  L0:39.2% L1:55.5% BI: 5.3%
[libx264 @ 0x2316f40] 8x8 transform intra:56.1% inter:70.6%
[libx264 @ 0x2316f40] coded y,uvDC,uvAC intra: 34.0% 52.1% 12.3% inter: 11.3% 12.9% 0.6%
[libx264 @ 0x2316f40] i16 v,h,dc,p: 23% 48% 14% 16%
[libx264 @ 0x2316f40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 30% 25%  3%  3%  4%  5%  4%  5%
[libx264 @ 0x2316f40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 30% 16%  4%  5%  5%  6%  4%  5%
[libx264 @ 0x2316f40] i8c dc,h,v,p: 54% 26% 15%  5%
[libx264 @ 0x2316f40] Weighted P-Frames: Y:1.5% UV:0.9%
[libx264 @ 0x2316f40] ref P L0: 87.9% 12.1%
[libx264 @ 0x2316f40] ref B L0: 87.9% 12.1%
[libx264 @ 0x2316f40] ref B L1: 97.8%  2.2%
[libx264 @ 0x2316f40] kb/s:1890.83

Try with recent versions. Both your ffmpeg versions are old.

Don't use the concat demuxer. Create a single ts file by concatenating the ts segments as a first step. Then run it through ffmpeg.
i.e.
cat 1.ts 2.ts >all.ts
ffmpeg -i all.ts -c copy all.mp4

I guess you mean concat protocol. I read that this method support only MPEG-1, MPEG-2 PS, DV containers. In my case, ts segments are h.264 container

no, I mean exactly what I said (https://trac.ffmpeg.org/wiki/Concatenate#demuxer) h.264 is the codec, transport stream (ts) is the container. I don't know what you read, but you CAN concatenate ts segments.

Yes, i got mixed up mp4 with h264. Your answer is incomplete a bit. I added -bsf:a aac_adtstoasc option and that's ok. Here is another way of the concat protocol


text:
Why does AAC have two Sampling rates?
I am working on a project that reads the meta data of video files with MediaInfo and processes the results. While testing my code with some sample files I noticed that the audio track of a .mkv file has two different samling rates. The file has two different audio tracks (English and Japanese) but they are listed separately and both tracks show two different sampling rates. Here is the according output of MediaInfo for clarification:
Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : A_AAC
Duration                                 : 22mn 46s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz <-- here
Compression mode                         : Lossy
Delay relative to video                  : 31ms
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : A_AAC
Duration                                 : 22mn 46s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz <-- and here
Compression mode                         : Lossy
Delay relative to video                  : 31ms
Language                                 : Japanese
Default                                  : No
Forced                                   : No

Can anyone explain what this means? I always thought one audio track can only have one sampling rate. Is this just a different way of describing one sampling rate? Or is it really possible to use two different sampling rates for one audio track?
At the moment, the the software just expects single values for the meta data, so storing two different values for the sampling rate would make things more complicated. Would it be possible to either convert these two values to one value or just choose one of them?
Thanks for your help!

Maybe the two channels in each stream are at different rates? Do you have ffmpeg?

Yes, I also thought about that. But the only channels are left an right, so why would they have different sample sizes? I do have ffmpeg. Can I use it to get more information about the audio track?

Try ffmpeg -i input.mkv -vn -c:a copy -map_channel 0.1.0 eng-left.aac -map_channel 0.1.1 eng-right.aac -map_channel 0.2.0 jap-left.aac -map_channel 0.2.1 jap-right.aac and then run ffprobe on the 4 files.

Thanks helping. Unfortunately the command does not work for me  because the aac encoder s experimental. Even with -strict -2it's still not working. Is there another way to get the sample rate of one specific channel?

Which version of ffmpeg? AAC encoder became stable in early December.

I was using version 2.8.3. Compiling 2.8.6 now. But according to @Jérôme's answer, the tracks have indeed two sampling rates. I'll still try to get your command to work though!

tracks show two different sampling rates. (...) Can anyone explain what this means? I always thought one audio track can only have one sampling rate. Is this just a different way of describing one sampling rate?

MediaInfo reports what is played by a decoder, depending of its capabilities:
- if your decoder is able to play an HE-AAC stream, the stream will be played at 48 kHz (the frequecy of the "core" + the SBR data).
- if your decoder is not able to play an HE-AAC stream, the stream will be played at 24 kHz (the frequency of the "core" AAC)

I always thought one audio track can only have one sampling rate.

No. You can have a "core" stream with a specific sampling rate, decodable by old players, and an additionnal sub-stream in the stream with additionnal data for having 48 kHz for decoders capable of decoding such additional sub-stream.
Note that it is same for e.g. channels, with HE-AACv2 you'll get a mono "core" + PS for upgrading to stereo. or AC-3 (and DTS) can have a 5.1 "core" lossy stream for old decoders + extra data for newest decoder in order to get 7.1 and/or lossless.

At the moment, the the software just expects single values for the meta data, so storing two different values for the sampling rate would make things more complicated.

If you are interested only in the "maximum" capability, don't care of the second value.
If you use the command line or DLL, you can say to MediaInfo to not show info about legacy players with --LegacyStreamDisplay=0 option.
Note : this is not "24-bit" as I read in another comment, bit depth in AAC is "dynamic" so no bit depth is shown for AAC (it would be shown for e.g. PCM). This output with several values is wanted by design (showing how an old decoder would decode the stream), and you can disable such behavior with the option provided.

I suspect that your MediaInfo parser is mis-reporting.  Sampling rates are usually described both in terms of frequency and bit depth.  It is quite common to have 48kHz at 24 bits.  I suspect that whoever wrote the printf statements producing the above output meant to say "bits" not "KHz" after the "/".

I don't see Mediainfo ever reporting sample size for MPEG audio streams. When it does so (for WAVs), it reports them as a separate field bit depth.

I just ran mediainfo on another .mkv file and got Sampling rate and Bit depth in to separate fields. So I guess if the bit depth known it will be listed in a separate field, or not?

Yes, separate field


text:
Flicker in the Capture, LED light source
Incident:
I'm trying to capture small particles at about 20-30 cm distance to the camera at ~60-70 fps. Was using SMD32 LED with rechargeable battery as light source. By using that light source, there was no flicker in the video (almost no light intensity variance between frames), but the scene was a bit dark.
SMD32 LED with rechargeable battery
To increase intensity, I tried cheap light bulbs of all kind, such as Philips Classic Tone 60W, and Energy efficient Philips Economy Stick 23W. As expected, intensity levels were quite reasonable, but the flickering was quite obvious and problematic in the captured video. Then I tried 2 LED light bulbs:  Wiselite Warmwhite LED A60 8W, and GoldMaster 9W LED. Interestingly, LED light bulbs DID flicker too.
Energy efficient Philips Economy Stick 23W, Philips Classic Tone 60W, Wiselite Warmwhite LED A60 8W
Please note that voltage levels in the region is quite fluctuating, sometimes electrical home appliances stop operating and lights dimming although the electricity is on.
Question:
What made SMD32 LED non-flickering compared to LED bulbs? Is it the battery, or multiple light sources, or the type of the LEDs? What should I do for a non-flickering but enough intensity capture environment?

Edit :
After the responses, I have further investigated the SMD32 LED, by only capturing the light projected from SMD32 LED on to the screen. Fps was variable between 59-61, exposure time was 1.5 ms, CV_8UC1 color scheme (grayscale) was used. I have saved 0th, 40th, 80th, 120th... frames and combined them to build animated gif images. Each gif image consist of 35 jpg images. As side note, each animated gif image below is at 4 fps.
1st animated gif one on the left is captured when SMD32 LED is not plugged into mains power (while it is only using battery power). It is almost steady.
2nd one on the right is captured when SMD32 LED is plugged into mains power. Overall intensity compared to first one increased but the flicker is quite obvious.
Consequently, there is something with the mains power. And I still don't know how to obtain the desired lightning conditions in a cheap way.
[
[

Here is a blog posting from one of the leading LED fixture manufacturers, SORAA.  (Their chief scientist won the Nobel Prize for the invention of the blue LED.)  One of the design problems is that a rippler-suppressor reduces LED output efficiency by 2%-3%.  If you are a consumer looking for absolute Lumens from a given form factor, or highest Lumens per Watt, you'll end up buying a product that compromises on flicker in favor of output.  Moreover, while the industry used to agree on a definition of a flicker index, they are walking away from that and going to very application (and person)-specific definitions.  In the referenced article, mention was made that in the state of California, the only recognized flicker test is performed by the person sensitive to the phenomenon.  Finally, if you are using these lights for anything other than scientific motion studies, i.e., if color is actually important to you, Color Rendering Index (CRI) may also be important.
Obviously, cameras have very different sensitivity than humans.  And specialty instruments (made for high-speed video) exist, with more expensive power supplies and lower lumen/watt output.  I have been impressed with the SORAA lights I've purchased (CRI 95, and no visible flicker at framerates I've used).  If they don't test out for you, the best alternative is to get a specialty light that does specifically advertise flicker-free (usually by using a true DC power supply).

Currently I'm trying to find a cheap solution for initial tests, but later I may require one. Besides, I didn't know there are indexes like CRI. Thank you for all the nice info.

I can't speak to the specific models / part numbers, but it's often the case that an LED 'array' is not continuously lit, but rather scanned or modulated.
That is, each element (or row, or other group) is briefly supplied full current, then switched off while another element is addressed, and so on. This reduces the total amount of current required, and if done above a 'flicker rate' determined by human persistence of vision, is undetectable in normal use. This rate is anything above about 30 Hz for a full cycle of elements, and is usually higher.
However, this scan rate is not synchronous with camera scan rates or shutters times, so you may get 'beats' or strobing in captured video. A similar effect can occur when shooting video displays and computer monitors.
A trick that can sometimes show this is to blink rapidly while looking at the light off-axis (at the edge of your vision), or quickly moving the light up/down or right/left in the same area. Persistence of vision is lower at the periphery.

After your post, I did some tests with SMD32 LED Array, for further investigation (Added an edit section to my post). In the 60 fps range SMD32 LED array gave me the non-fluctuating light source if its battery is used, but lacking intensity.  Seems like it is possible to get desired result with LED arrays for my needs, but need some tweaks


text:
What is the correct MPEG-2 FourCC?
In my attempts to encode a video to MPEG-2 in an MOV (which seems to be a valid combination, at least according to Wikipedia), using ffmpeg (-vcodec mpeg2video) and other tools, I have become extremely confused about the FourCCs as well as seemingly related limitations on container formats. I have found:

m2v1: This is the default FourCC used by ffmpeg when encoding MPEG-2, but it is unplayable in all media players I have tried (VLC, Windows Media Player, mplayer, and QuickTime Player). It also does not seem to exist in any FourCC databases I have found. Forum posts are rare and are related to old Mac software and compatibility problems regarding this code.
mp2v: I can force this code with ffmpeg. It is then playable in all common media players. However, MPEG-2 videos encoded with other encoders (such as Handbrake or Prism), to AVIs, do not use this code, they use mpgv, which makes me suspicious.
mpgv: I can force this code with ffmpeg as well, but only when outputting to an AVI (and Handbrake uses it too but only outputs Matroska and MP4). Ffmpeg fails when I attempt to output MOV. Forum posts also indicate trouble with the mpgv + QuickTime container combination.

I'm very confused. Why are there different FourCC's for this, what is the correct one to use, how is it related to the container and, at the end of the day, if I want an MPEG-2 in an MOV what do I do?
I guess by "correct" in the title I mean compatible with the most common players; least likely to cause problems for normal people with stock software.
As a sub-question, VLC describes mpgv and mp2v as "MPEG-1/2 Video". So, if I see a video with FourCC mpgv, is it MPEG-1, or is it MPEG-2? I suspect my lack of understanding of how all the MPEG versions are related to each other is coming into play here.

Strictly speaking, fourcc is the codec ID used by Microsoft. It has been adapted for use with many other formats, thus making it seem like a standardized ID format, but it's not.
ffmpeg, in particular, seems to only consider XDCAM standard MPEG2 for inclusion in MOV.
From the source code:
else if (track->enc->codec_id == AV_CODEC_ID_MPEG2VIDEO)
    tag = mov_get_mpeg2_xdcam_codec_tag(s, track);

where if the xdcam tag function doesn't find a matching XDCAM stream, it runs
if (!tag)
    tag = MKTAG('m', '2', 'v', '1'); //fallback tag

which ffmpeg, interestingly, thinks is tha tag that should be used for recording MPEG-2 in a MOV by a camera.
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', '2', 'v', '1') }, /* Apple MPEG-2 Camcorder */

and mp2v is signalled as required for (an old version of) Final Cut Pro.
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', '2', 'v') }, /* FCP5 */

mpgv is not on that (ISO media) list that the MOV muxer can be forced to work with, but it is on the RIFF list (for AVIs) where it's only declared for MPEG-2, not MPEG-1
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', 'v') }

All the tag variants exist because each vendor or program decides to mark their streams a certain way and there's no single body policing their use. Stick with mp2v since that works for you.
Update: I just realized that any stream can be tagged with any tag if -strict -1 or -2 is applied. I was able to tag an AVC stream in a MOV with mpgv :)

Thanks. Now, if I were to file an ffmpeg bug report claiming that mp2v should be the default output for mpeg2video+MOV instead of m2v1, would that be reasonable or does it seem like m2v1 is still the more "correct" tag? I'm not particularly familiar with the Apple side of things. There's a discussion about this on the ffmpeg-user mailing list right now; I'll post a link as soon as it's archived.

Also, btw, is there general non-Microsoft terminology for FourCC's and their non-Microsoft spin-offs? "Tag"? "Object type"? "Codec ID"?

Codec id sounds the most vendor and format agnostic term to me. Considering that other people in that list can't play m2v1 files either, mp2v does sound a better fallback. Of course, also allowing custom tags via -vtag seems the most flexible way forward.

http://ffmpeg-users.933282.n4.nabble.com/MPEG-2-video-m2v1-vs-mp2v-tp4674329p4674338.html if it's interesting.

The detailed answer by Gyan helped me to solve a practical problem which may be worth mentioning.
Davinci Resolve cannot import .mpg files, but can import the same files when they are re-wrapped in .mov with the correct tag.
The bash+ffmpeg command below can be used to:

re-wrap all ".mpg" (or ".MPG") files in the current directory to Quicktime .mov
set the Codec ID to "mp2v" which works with both VLC and with Resolve

for file in *.mpg *.MPG; do
    ffmpeg -i "$file" -c copy -vtag mp2v "${file%%.[Mm][Pp][Gg]}".mov
done

Try "MPG2". My stream was properly detected as MPEG-2 by MPC, MPC-HC and WMP.
Source of info here: https://git.ffmpeg.org/gitweb/nut.git/blob_plain/HEAD:/docs/nut4cc.txt


text:
Unable to hardcode subtitles in FFmpeg on Mac to mov
I would like to hardcode subtitles using FFmpeg, I'm trying to do this using the following command:
ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt gradedFinalwithSubs.mov

which returns the following error:
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  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
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'grdedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11270 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.1.3 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Unable to open portSbs.srt
[AVFilterGraph @ 0x7fbeaa50ba80] Error initializing filter 'subtitles' with args 'portSbs.srt'
Error opening filters!

I followed those instructions when installing FFmpeg:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Feedback following comments
1st suggestion
Judging by the error message, it appears that something may be wrong with the SRT file, isn't it?
me-bash-3.2:/Volumes/Duracell$ ffmpeg -i gradedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  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
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gradedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11267 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
portSbs.srt: Invalid data found when processing input

Subtitle file
The subtitle file looks like that (extract):
1
00:02:25,000 —> 00:02:29,000
Falei com um homem que me disse que eu estava a usar
demasiada roupa

2
00:02:29,000 –> 00:02:31,000
Que com isso devo querer proteger-me de alguma coisa

File info
me-bash-3.2:/Volumes/Duracell$ file -I portSbs.srt
portSbs.srt: text/plain; charset=utf-8

2nd, checking filter
me-bash-3.2:/Volumes/Duracell$ ffmpeg -help filter=subtitles
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  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
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Filter subtitles
  Render text subtitles onto input video using the libass library.
    Inputs:
       #0: default (video)
    Outputs:
       #0: default (video)
subtitles AVOptions:
  filename          <string>     ..FV.... set the filename of file to read
  f                 <string>     ..FV.... set the filename of file to read
  original_size     <image_size> ..FV.... set the size of the original video (used to scale fonts)
  fontsdir          <string>     ..FV.... set the directory containing the fonts to read
  charenc           <string>     ..FV.... set input character encoding
  stream_index      <int>        ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  si                <int>        ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  force_style       <string>     ..FV.... force subtitle style

It says, "Unable to open portSbs.srt". Recheck the filename, and refer to it with the full path. If that doesn't work, try with another (known good) SRT.

@Mulvya Thanks very much for showing interest, I tried passing the full path /Volumes/Duracell/portSbs.srt but I arrived at the same error message. The file appears to be not damaged, I can open and edit it in a text editor.

Run ffmpeg -i grdedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov and paste the console output into your question.

@Mulvya Thanks very much for the helpful comments, I pasted additional output.

Let's confirm that subtitle filter is compiled in: ffmpeg -help filter=subtitles <-- does that say unknown filter?

@Mulvya Thanks for the continued interest in my problem, I just tested the command and it appears that the filter is compiled.

Can I suggest TextWrangler for editing these kinds of files on the Mac to avoid that kind of nastiness.

@stib The file was edited externally, I mostly use Atom or TW for text editing.

It appears that the subtitles file did not have --> but a –> with the – corresponding to the en dash that was placed in the file, which was edited by hand externally. It seems like the en dash sign was assigned to typing -- in Mac TextEdit (the functionality can be disabled in preferences).


text:
Convert 4:3 to 16:9 like QuickTime Panoramic Size
QuickTime has an awesome feature called "Panoramic Size". It basically scales the input video to the screen aspect ratio without cropping by leaving the center as-is and gradually increasing the scale factor towards the sides.
It’s a quite unique feature as far as I can tell, as I’ve only ever seen it in QuickTime.
It can be activated like this (Apple Guide here):

What I’m looking for is any way to permanently use the same or a similar algorithm to re-encode some 4:3 videos into 16:9, so that they show correctly on all my devices, not just the ones using QuickTime.
4:3 input example:

just for ease of comparison

Naïve 16:9 crop:

as you can see, there’s quite a lot of content missing top and bottom

Naïve 16:9 scale:

as you can see, the circle barely looks like a circle anymore and a lot of content will look odd, especially faces

QuickTime 16:9 panoramic mode results:

pretty good, if you ask me — that’s why I want to re-encode like this.
the sides are stretched much more than the center, which usually yields good results as the center is the most important part of the screen
this is actually why I chose a scene with a clearly visible circle — which stays nearly unchanged thanks to QuickTime magic

So, what can I do to accomplish this? Only way I can think of is making a screen recording, which would take hours and is very error-prone

Do you have After Effects?

@stib Not currently, but if you know how to do it then in the spirit of Stackoverflow it would still be a good answer, as it could help someone else trying to accomplish this. Also, depending on how good the results are, I may just buy or get a free trial for After Effects for this purpose. Right now, any solution is appreciated — currently considering to write my own program for this ;)


text:
To MP4V, or to DX50, or not to be
Should i compress my final outputs down to FOURCC of DX50 or MP4V?  Tis the question.  I'm having a hard time deciding on this, since im not really sure what to expect in future technology development.
I do want mac compatibility lending support to MP4V, i do run windows almost exclusively lending support to DX50, and there is a nice feature in DVD players playing divx files which think also supports DX50(among others, incluging DIVX)
However i can give a flying crap about dvd player support for the most part because i did away with using those 'Circular Silver' things altogether for audio and video media, on all fronts.
What i really want is only future compatibility, and playibility by any operating system in 10-25 years, and i only want to use either DX50(ill consider DIVX, but prefer the newer), or MP4V.
CONS of MP4V, dvd player compatibility, and what else???
CONS of DX50, no native MAC support(i might not be here in 20 years to explain to my children and grandchildren how to install alternative legacy players to play all my "old crap")
Trying to avoid becoming Legacy..
MP4V?  or DX50??

If it's just a matter of which FOURCC to assign, and not the codec, then choose MP4V since it has broader compatibility, and the tag can always be changed later, using a tool like ffmpeg i.e.
ffmpeg -i input.avi -c copy -map 0 -vtag DX50 tagged.avi


text:
How to remove honking noise in room for voice over recording
I am making some video tutorials on some programming topics. An outside honking noise is interfering with the recordings. The windows and doors are packed, but even then the problem persists.

Maybe a directional mic would work?

This is an issue for me too. You need a multi-pronged technique:

Choose the quietest room. If street noise is an issue, which room is furthest from the street? Many people have offices and desks, but record in a child's room while that child is at school.
Arrange yourself facing into a corner (for echo reasons) and surround yourself with soft stuff as much as possible. A bedroom is quieter than the basement. Buy thick muffly curtains as an investment in what you're doing. Putting them over windows keeps out noise and soaks up noise that gets into the room. You can also buy canvas covered foam panels that look like art but soak up noise.
Choose the time to record. Less traffic at night? Airplanes stop landing at midnight? Neighbours mow the lawn every Sunday? Take all that into account
As Wouter says, if there's a noise, do that sentence over. That's how I handle ringing phones, footsteps overhead, and toilet flushes by people who forgot I was recording. Just take a breath, wait for quiet, and do the sentence again from the beginning. Then edit away the first try and the noise.
Use a product that does some sort of noise reduction. For background irritations like rain or wind this can really help
Know when to switch tasks for the day. After the tenth time you try to cheerfully say the same two lines but that dog next door barks or a car horn sounds, let it go. Work on writing the material for the next few things so that when you get a quiet time, you can record a bunch at once.
If none of that works and moving isn't an option, you can make a recording booth or even arrange to go to a studio for a day and do it all at once. But that's getting out of life hack territory.

After you remove as much external noise as possible from the room, consider your microphone selection. You want one that rejects off-axis sounds, such as a cardioid. Keep the back of the microphone pointed towards the strongest noise source. This Shure article gives a nice refresher on microphone types. http://blog.shure.com/multi-pattern-microphones-what-where-and-how/
Check your gain settings and stay close to the microphone to keep the signal to noise ratio good.
Apply a gate to your audio so that it's muted when you're not talking.
If your audio is too sensitive, and you're noticing every defect, mix some room or white noise in at a low level to soften up your audio.

I tweaked with gain settings. There is less echo now and less noise. But as you can imagine, India is full of traffic noises. Getting a clean noiseless environment is only between 12 am to 6 am. Will have to sacrifice my sleep then. Was looking forward if there is some other tweak i can work on. I think FOAM is a good option.


text:
Should I separate files in After Effects for different part of a Premiere Pro project?
I am new to these two software and I want to do a little video for the promotion of the next show of a musical troupe. They want to recruit new people.
I have done an effect for the intro in after effects, I want to add another one effect for the end to tell about what kind of people they want to recruit.
Should I do both in one same after effects project or shoud I do several production in one project ?
I guess I should do several projects but I'm really not sure as far as I am new and found noting about it on the Internet ...

If you use the replace clip with After Effects composition feature in Premiere it will automatically add the new comp to whatever After Effects project is currently open. I usually use this when I'm adding things like titles and FX to vieo that I'm editing, so everything ends up in the same project.
If you keep the project organised I find this isn't a problem, in fact it's easier if you want to re-use assets, or use templates. E.g. things like lower thirds I will make using one pre-comp as the background with the text for each one on its own layer, so I can just swap it out for each one.

So for a project your recommend one project with several compositions if it is organised, isn't it ?

Well, I wouldn't say one is better, but if you have AE and Premiere open then this is what will happen.

You can do both. I myself have used both methods. However, my recommendation would be to do each shot in its own project. Here are my thoughts on both methods.
Doing it all in one project makes things faster, because you don't have to create a new project for every shot you have. However, the problem with this is that the project gets really convoluted. It means you have to be super organized to keep the project tidy. But even when you do that, if you need to come back to the project, it usually takes you a bit of time to get your head around what is what and where can I find this specific item, especially if you are using a lot of precomps in the project.
Doing each shot in its own project keeps things really simple, because you know that everything here belongs to this shot and that's it. You can quickly figure out what is happening, especially if the project is organized and tidy.
Of course, I am assuming that you are doing simple effects on each shot. If you are doing major vfx or compositing work on your shots, then you should definitely create a new project for each shot, because that project will get convoluted due to the scale of the job you are doing. So you shouldn't be making it even bigger with adding other shots to it.


text:
Why does Canon 600D/T3i video quality drop dramatically once it's recorded — in comparison to what I see in Live-View w/ Digital Zoom?
I have a low-light situation with a lot of small details and diagonal lines. When I look at the scene with digital zoom in Live View mode I see some grain but I see all the details and can clearly read the small print. Once I record the same scene in 1080p (I also tried to increase the bitrate with ML firmware) everything gets blurry, aberrations pop up (green/blue flickering edges), lines get broken, and it looks like upscaled 480p.
Why does this quality drop happens and is there a way to minimize it if not get rid of it?

I'm not sure what quality drop in the video you're referring to, but the video quality will never be as good as the image you see in the Live View of your camera due to the way it works.
Here's how Canon describes the Live View mode:

When the camera is in [Live View] mode the reflex mirror is in the  up
  position, blocking the normal pentaprism viewfinder.  Instead, the
  image is projected through the lens and  directly onto the sensor,
  which in turn displays the image  on the rear LCD panel.

Source
So the Live View basically shows you the image that reaches the lense, taking focus and depth-of-field into account. It isn't actually a preview of your video recording quality.
Here's what you can capture with your camera:

RAW pictures. While normal low- to mid-end cameras usually only capture compressed images such as .jpg-files, the RAW format contains all information captured by the lens. This is why you can fully adjust settings such as exposure, white balance, temperature and tint in post-editing. No compression is happening between the information captured by the camera (lens) and the saved file.
Compressed pictures such as .jpg-files. The information captured by the camera is compressed into a pixel-based image using your current white balance and exposure setting to calculate the pixels color values. Canon cameras can generate compressed pixel-images with a high pixel count (for example, the maximum resolution of the Canon 600D camera is 5184x3456, about 18 megapixels). So there is some compression.
Video. Video capture quality is limited by the cameras image processing speed and, to a lesser extent, by the writing speed of your SD card. The camera can't possibly capture about 25 images per second (assuming 25fps) in a resolution as high as that of single images. The maximum video resolution of most Canon DSLR-cameras is Full HD, i.e. 1920x1080. So you have a much lower pixel-resolution, therefore there is much compression.

The Live View shows you the information captured by the lens on the (obviously pixel-based) LED monitor, so its quality is somewhere between the RAW-and JPG-qualiy. This is why you notice a quality difference between your Live View and the captured video.
There are professional video cameras that can capture RAW-video (e.g. Alexa cameras which capture ARRI-video), but they cost several thousand euro.
How to get rid of it
If you are seeing grain and artifacts because you're filming in a low-light situation, use better lighting. If you want a dark scene, do it in post-production.

Or simply, you are looking on a small monitor - everything will be sharper and more clear; only when you see it on a large monitor (such as your computer screen) will the issues become apparent.


text:
Convert fisheye videos to equirectangular videos
My goal is to quickly create equirectangular videos from full-frame fisheye videos with a given hfov. Panoramatools, especially mpremap allow that but it takes long for each single picture. Given that gpu and 8-core cpu can be used, which program can do that quickly?

You can do that very easily in After Effects. Import your footage/images, create a new composition that matches your footage/images specifications and then apply Optics Compensation (Effect> Distort > Optics Compensation.
Tweak Field of View values until you have the desired result. In some cases you will need to check the Reverse Lens Distortion box.
Cheers!


text:
Creating an 8K/4K video in ffmpeg from single image frame leads to video longer than audio
I want to make a video using a cover image and an audio file with the audio file as the length. What's the most optimal modern way to do this with new codecs and high resolutions?
Reason why I want 4K/8K: The deployment display is an 8K panel and a lower resolution yields sub-par experience.
Here's the command I tried:
ffmpeg -r 0.01 -loop 1 -i image.jpg -i audio.mp3 -c:v hevc_toolbox -c:a aac  -b:a 196k -pix_fmt yuv420p -shortest out.mp4
But the output was inconsistent and usually 1.5-2x the length of the audio file even with -shortest
Relevant Past Research:

ffmpeg has a long-standing still-open bug about this issue where it can't approximate timing of the output correctly: trac.ffmpeg.org/ticket/5456

https://superuser.com/questions/1041816/combine-one-image-one-audio-file-to-make-one-video-using-ffmpeg but it doesn't cover it

And a lot of Reddit posts with h264/1080p instructions that were not fully applicable here.

ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)

What was the original full command you tried? And which ffmpeg version?

added the command

And version? ...

oops, added version

Directly converting mp3 was yielding incorrect times. So pre-converting to aac and then doing a loss-less copy to mp4 fixed it. I currently use the following:
for i in *.mp3;
do (
  ffmpeg -i "$i" -b:a 256k "${i%.*}.aac";
  ffmpeg -r 0.01 -i image.jpg
         -i "${i%.*}.aac" -c:a copy -shortest -max_interleave_delta 500M
         -c:v libx265 -x265-params lossless=1 -pix_fmt yuvj420p -vf "loop=-1:1"
         -movflags faststart "${i%.*}.mp4");
done

-r 0.01: Sets a very low framerate (0.01 frames per second), making it essentially a static image video. This feels so hacky, I'd love to get your input if there's a better/proper way to do this!

-i image.jpg: Specifies the input image file that has resolution of 7680x4320.

-i "${i%.*}.aac": Takes the previously generated AAC audio file.

-c:a copy: Copies the audio stream without re-encoding (saving time).

-shortest: Makes the output video end when the shortest input (image or audio) ends.

-max_interleave_delta 500M: Improves compatibility for streaming by limiting audio/video gaps.

-c:v libx265: Uses the x265 (HEVC) video encoder for efficient compression. I wanted to use hevc_toolbox since I'm on an arm64 MacOS machine but it doesn't seem to support similar parameters. If you know a hack to use that for still images, please share!

-x265-params lossless=1: Sets x265 encoding to lossless mode for high-quality output.

-pix_fmt yuvj420p: Sets a common color format for compatibility. Even though , using [this format fixes/avoids][1] the deprecated pixel format used, make sure you did set range correctly` warning that you get.

-vf "loop=-1:1": Loops the image indefinitely (-1 means unlimited, size is 1 frame).

-movflags faststart: Optimizes the video file for web streaming.

"${i%.*}.mp4": Replaces the ".mp3" extension with ".mp4", creating an MP4 video file as output.

The resultant file works in Youtube, but doesn't work well in Infuse, VLC, Quicktime or Finder's QuickLook. Dunno how to fix that.
Next goal is to do a royalty-free version of this with av1/vp9 and Opus. And to add subtitle files