text:
ffmpeg Cut a media preserving all streams but also all metadata, timecodes and everything else
Today I wanted to obtain a ts file cut preserving everything, so I tried with this command:
ffmpeg -i "original.ts" -map 0 -c copy -t 00:30:0.0 -threads 1 "cutted.ts"

The resulting file have different minor specs I would like to make matching to the original one.
original.ts
[mpeg2video @ 00000000030df040] Invalid frame dimensions 0x0.
    Last message repeated 2 times
[mp3 @ 00000000030e0420] Header missing
[mp3 @ 00000000030df940] Header missing
    Last message repeated 1 times
[mpegts @ 00000000030dd500] PES packet size mismatch
    Last message repeated 2 times
Input #0, mpegts, from 'original.ts':
  Duration: 01:14:46.92, start: 64563.955900, bitrate: 5367 kb/s
  Program 1
    Stream #0:0[0x201]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], max.
 10000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28b](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x2b7](001): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 64 kb/s
    Stream #0:3[0x2b8](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:4[0x241](001): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250

cutted.ts

[mp3 @ 000000000302fa20] Header missing
     Last message repeated 1 times
  [mp3 @ 00000000030304c0] Header missing
  Input #0, mpegts, from 'cutted.ts':
   Duration: 00:00:10.08, start: 1.400000, bitrate: 4297 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], max.
  10000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
     Stream #0:2[0x102](001): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, s16p, 64 kb/s
     Stream #0:3[0x103](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
     Stream #0:4[0x104](001): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250

Bitrate displayed obviously changes because the subset of media considered have a different length and this is ok.
Start is not kept, being part of a transport stream I would like to keep that exact start time. Here https://ffmpeg.org/pipermail/ffmpeg-user/2013-July/016109.html they talk about reset_timestamps and initial_offset but rather than specifying them i would like them to be copied automatically.
Streams id changes as well as some minor specs inside the parenthesis but i don't know what they are for.
Is also possible obtain an output file without ffmpeg service_name and service_provider metadata ?
PS: Original ts file was created by Terratec Home Cinema.
PPS: My question did not include intentionally the -ss option because that one is supposed to change the start time, however I'm interested also in a solution with -ss that automatically (if possible) offsets the start time with (output start time = input start time + -ss command offset)

This seems to work:
ffmpeg -ss N -i input.ts -c copy -copyts -muxdelay 0 -max_delay 0 output.ts

You can add a
-map_metadata 0

to preserve whatever metadata ffmpeg can. But this doesn't seem to carry over all the metadata.

I tried it but it seems not to work for me :( if i use the -copyts option it give output of 0 kB and an alert. If i add all the other options the start time go to zero and the streams IDs remain untouched as in my previous example.

Can you upload a small portion - 10 seconds?

This answer works, if you specify -ss as 0 (zero) instead of as N. It carries over the start time encoded in the source .ts file to the output .ts file, where it's stored as the output's start time too. Changing -ss to a non zero value does affect the start time in the output. The output file is about 15 percent larger than the source file, even if no processing of the source file has been done! That seems odd. You could adapt this solution to a case of extracting a part of the source .ts file as the output, presumably. I'm running Windows 7.

ffmpeg overwrites service_name and service_provider with default values:
Service01 and FFmpeg.
You could overwrite it with the original metadata but first you have to retrieve it:
i="input.ts"

# get service_name with ffprobe and store it in a variable
svc_name=$(ffprobe -hide_banner -v error -show_entries program_tags=service_name -of default=nw=1:nk=1 "${i}");\

# get service_provider with ffprobe and store it in a variable
svc_provider=$(ffprobe -hide_banner -v error -show_entries program_tags=service_provider -of default=nw=1:nk=1 "${i}");\

# add service_name and service_provider to new TS
ffmpeg -i "${i}" -c copy -copyts -muxdelay 0 -max_delay 0 -map_metadata 0 -metadata service_name="${svc_name}" -metadata service_provider="${svc_provider}" output.ts

Unfortunately ffprobe's program_tags= doesn't work with service_type.

The following is my solution, for an .mp4 video file, using ffmpeg in Windows 7. This command, run in a .bat batch file, will copy a section of the input file (i.e. extract it as the output file), starting 30 seconds into the input file, with the extract having a duration of 60 seconds, and without re-encoding either stream.
This can be modified for a different video type, such as a .ts stream (transport stream), as required. But don't alter the mapping commands in line 2 as that line is the key to maintaining audio synchronisation (the itsoffset option).
The mapping commands preserve the synchronisation of the audio stream with the video stream, by preventing any change in the offset between them.
The metadata in the input file is copied to the output file, also without modification.
The flags commands are needed to write the output file, as mp4 is a container format. The flags commands recreate the mp4 format of the input file (i.e. the container within which the audio and the video streams are housed and synchronised).
The final two lines will display key data from both the input and output files on screen, after the operation, so that you can compare them and be sure that what you intended to achieve has been achieved.
SET file=movie.mp4

SET mapping=-i "%file%" -itsoffset 0 -i "%file%" -map 0:v -map 1:a -copyts

SET flags=-flags global_header -movflags faststart

ffmpeg %mapping% -c:v copy -c:a copy -map_metadata 0 -ss 30 -t 60 %flags% out.mp4

echo. & echo. ffmpeg  -i "%file%" -f nul
echo. & echo. ffmpeg  -i out.mp4  -f nul

I'm not an expert on the .ts format, but it's not a reliable video format. It doesn't provide the global file data that the .mp4 and .mkv video formats provide, so a .ts file is not easily seekable, is slow to start playing, and may not accurately report some file data (such as the overall duration of the video). Hence it is better tactics to convert from .ts to .mp4 or .mkv because those formats don't have the shortcomings of the .ts format.
To convert from .ts to .mp4 video, just delete line 1 in my above batch script and substitute this:  SET file=movie.ts
.


text:
Text titles like in tv shows, After Effects or another software?
I was wondering how is possible prepare some professional grade titles and graphics for broadcasts media (like the ones that you see in actual tv shows).
For example when a person is presented with an animated text like:
James 43
Lawyer of This Corp LTD.
A rich graphic text with alpha transparency that animates and disappear after some seconds.
I'm pretty sure that After Effects is a software to build them. Doing it manually however will be difficult to handle on the long period and lead to errors and discrepancies so I wonder also if it's possible to create sequences with scripts, functions and configurable variables.
Example:
function show_my_custom_animation_text() { ... }

And trigger it at a specific timecode:
00:02:21 - show_my_custom_animation_text("James", "43", "Lawyer");
00:03:16 - show_my_custom_animation_text("Bob", "35", "Barman");
00:04:51 - show_my_custom_animation_text2("Eric", "Bob", "Martin", "Philip");
...

Adobe Flash with it's frames and actionscript functions can allow something similar.
In short:

AE: It is possible to achieve professional grade titles with AE and maybe it's plugins ? Scripting and functions do exists? It's definitively AE raccomended to do this repetitive job?
Software/Tools: What software do professionals use aside AE? Given that this results will be reviewed and sent to actual big tv broadcasting to be actually aired on tv I can also consider learning other programs.
Workflow: Can you suggest a workflow for titling a show?
Resources: If you have some articles or links useful to learn more on the topic it will be a nice bonus!

I serious wonder why people downvoted a question like that, not polemizing, just understand what wasn't off topic or not working :O

After Effects is professional software for creating motion graphics, and can do what you are asking. There are a plethora of plugins, scripts and presets available to make it even easier, but out of the box it is very powerful software.
AE can also be scripted using Adobe's Extendscript scripting API. Within compositions (the name for the sequences created in AE) individual elements can be controlled by expressions. Both Extendscript and expressions are javascript-based.
For titling a show the workflow would depend on the content. For say a regular show the best approach would be to create templates. Adobe Premiere works very well with After effects, so that templates can be re-purposed within Premiere - e.g. the text content of a lower third title can be changed for different people's names.

Thanks for the reply, can you also point out some other softwares? Also can you provide some links of blogs, articles that gives some hints and introduce on the topic?

http://bfy.tw/AxLb

When I talked about introduce about the topic I intended not a general question but specifically on examples of how mix extendedscripts and text items in order to reuse them many times inside the sequencies.. ps: hope you wasn't the downvoter.. i tend to assign the question mark when the answer is fullfilled completely, this also for the sake of learn and be useful to the others..

You'll probably get better answers if you do some research yourself and ask specific questions if you have specific problems.

source: Stack Exchange

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

sort: votes


text:
Encode or Transcode with ffmpeg and libx264 as fast as possible
I'm trying to tune out ffmpeg to squeeze as much fps as possible from my server machines with lot of cores.
Sometimes expecially when there's also a scale (eg: shrinking down from 4k to full hd or from 1080p to 720p) not all cores are used. The behaviour is the same if I use -s:v 1280x720 or -filter:v "scale=-1:720"
I would like to have my machines use something as near as 90-98 % instead of the actual 20 % (on a 32 core machine using the threads 0 options make use of 22 cores but the usage is still 20%, same reasoning goes for 64 or 128 cores servers)
I also have a nvidia gpu on some machines that could be used for the resizing process maybe making the things more faster.
What kind of optimization can I think of to seriously burn out FPS?
tl;dr:

max out the cpu usage
use gpu if it can help and if it is possible (for example for the scale filter pass, it's just bicubic or linear resize cmon..)
the files must be playable inside the well know h264 profiles like main - 4.1

I'm already using ultrafast and fixed bitrate, my aim is pure encoding speed and not the quality as you can see in my command line:
ffmpeg -y -i "input.mov" -c:v libx264 -preset ultrafast -b:v 3000k -profile:v main -level:v 4.1 -s:v 1280x720 -pix_fmt yuv420p -c:a copy -threads 0 "output.mov"

Do what the platforms do - segment, parallel encode, and rejoin

@Mulvya that could be an idea. Could you write or link me a good syntax / command line examples to do that ? I think is not something that you should do manually with -ss and -t right? Also because the trim command in ffmpeg under libx264 are not very precise and after the join the result could be terrible and stuttered. Thanks!

@user3450548, https://stackoverflow.com/questions/35133119/ffmpeg-splitting-large-files This might help you

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

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


text:
Convert video from 24 fps to 25, shortening length (no frame duplication), keeping audio pitch
I have a .mov video with 24fps and 5.1 audio.
Is it possible change the framerate from 24 to 25 fps with no frame resampling (no frame duplication / removal - just new framerate interpretation) and keep the audio pitch the same?
Normally you do this by not resampling the frame data but setting the video flag from 24 to 25 fps however there is the need to adjust the audio so that it is shortened. Is it possible do it all in one ffmpeg command line or maybe in more than one and prepare a batch / bash file for that?
Also, is ffmpeg's audio processing capabilities professional quality or it is low quality compared to pro algorithms like Avid Pro Tools and Adobe Audition?
Note: This question is different from this one Convert video from 24 to 25 fps while keeping video and audio length and also correct audio pitch.
Here I want to know how to do the same thing but shortening the actual length of the video and adjust audio accordingly keeping the pitch in a professional way.

Please create a separate question for your question about ffmpeg's quality. Also, you are confusing a codec (Prores) and a program (Audition and ffmpeg).

Sorry i was sleepy, I wanted to intend Avid Pro Tools

Which video codec?

@Mulvya does it matter? Anyways h264. For the audio codec i would like to keep the original pcm audio wav raw as output format too..

If your input stream has no B-pyramid i.e. B-frames used as references for other B-frames, and your ffmpeg build has librubberband linked then use the following commands:
#1 Extract video to raw stream
ffmpeg -i in.mkv -c copy in.h264

#2 Retime and process audio
ffmpeg -r 25 -i in.h264 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv

If your H264 stream does have reference B-frames then you'll have to use mp4box as an intermediary.
i.e.
#2a Retime video
mp4box -add in.h264#fps=25 -new in25.mp4

#2b Process audio and add video
ffmpeg -i in25.mp4 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv

Isn't possible to cast a single pass command using atempo ? I was trying a command like: ffmpeg -i input.mov -r 25 -c:v libx264 -preset ultrafast -crf 18 -c:a libfdk_aac -filter:v "setpts=0.96*PTS" -filter:a "atempo=1.0417" output.mov I'm not sure about the pitch however.. Anyways sorry for the initial confusion about h264 as input video.. generally my input is a ProRes, DNxHD codec..(would be cool have a command that could work for any kind of input tho)

atempo will alter pitch. There's a new native filter that will soon be added to ffmpeg which will allow tempo changes without pitch change but its quality isn't as good as rubberband.

I see, so.. can I use rubberband in just one passage as I suggested for atempo ?


text:
Check first then enforce and match various broadcaster requests with ffmpeg
This question is a spin-off of a previous one focused mostly on Premiere Pro: How match this broadcast standards with Premiere and ffmpeg

My goal in this one is learn as much as possible to handle the things with ffmpeg or ffmbc
I have to create a MXF file from a input .mov in ProRes or DNxHD with various requests by the network:
Video Requests

Conform to SMPTE 274M, “1920 x 1080 Scanning with no visible video impairment such as blocking errors or pixelization artefacts.
  Luminance and color difference signals must not exceed the bounds of legal gamut. Video technical standards are fully detailed in ITU-R
  BT.709.5.
For the video levels, sync and blanking must be in accordance with EBU recommendations, the component video levels must not exceed
  700mV ±3% for the luminance channel and ±350 mV for the color
  difference channels.  No excursions below black level can be tolerated
  in the luminance, never below 0mV.

Audio Requests

Alignment Level (AL) shall be –18dBFS with respect to maximum audio coding level (PPM4 on a BBC PPM – IEC type IIa). The Permitted Maximum
  Level (PML - as defined in ITU-R BS.645-2) must comply ITU-R BR.1384.1
  and ITU-R BS.1726. Peaks should not exceed a level -10dB below the
  digital full-scale level (0 dBFS) when monitored by a “quasi-peak
  programme meter” as specified in IEC 60268-10.
Loudness control on all audio formats The method to measure the loudness of an audio program is settled by the recommendations,
  ITU-1770, ITU 1771 and ITU-Document 6/175-E.
Program Loudness Level represents the ordinary level of the program resulting from the measurement of the entire contents analyzed whole
  (from start to the end, and all audio channels making up the
  soundtrack).  The Program Loudness must conform to R128-EBU
“Short-term” LKFS values shall not be higher than –21 LKFS for the whole program.  “Long-term” Loudness must be –24 LKFS ± 0,5. In both
  cases the gate must be active at a threshold at -8 relative to the
  target “Long Term” value (- 24 – 8 = -32 LKFS). Short-term and
  long-term LKFS shall be measured for each audio program accompanying
  the picture (ie: Dubbed stereo, original language stereo, M&E stereo
  tracks, etc.).

My interest is mostly on matching the Video Requests.. as for the audio ones if them can be handled also with the ffmpeg filters would be nice too..
My approach would be check with signalstats filter if everything is ok as suggested my @Mulvya in the previous answer. But i would put in output a MXF file that match already the requests.

The audio part is probably easier. Look at the ebur128 filter to measure loudness and the loudnorm filter to correct loudness. Don't worry about the first paragraph on audio. If you get the loudness right, the rest will fall in place. You shouldn't be using a PPM meter anymore. It looks like they didn't remove the out of date specs when they added the loudness specs.

@MichaelLiebman I see, well this is a good starting point. Any hint on how to normalize the video levels with a ffmpeg filter?

There appear to be several that could be useful (colorlevels, colorspace, colormatrix, limiter, and the various LUT filters). I don't know enough about them to say which would work for your situation.


text:
Is possible to pass variables from premiere to after effect compositions?
One of the latest features put inside AE & PR 2017 is the Live Text Edits..
In short you can mark an after effect composition as template and then all the texts inside that composition will be exposed in after effects as editable text.
Instead there's a way to expose some selected after effects composition variables directly to premiere with things like sliders and such ?
Would be cool prepare some comps and handle the things from premiere directly and see what changes..
I can think of some workaround for this but I wonder if this can be done directly!

Without actually trying it I can see a way you could do this. Make some text boxes that are hidden, and in AE use the source text values to drive expressions on other properties. This might work, but it would have the problem that the values of text boxes don't interpolate between frames, so you couldn't use them very well for animating properties.

@stib that was the same workaround that I was talking about in the question ^^


text:
Improve FrameServer performances
I followed ffmpeg guide to install debugmode frameserver.
All works fine except with the fact that the frames served does not goes up to 25 fps. FFmpeg reports a speed of 0.9x..
My initial goal would have been use ffmpeg for encode very fast instead using native NLE export..
I would have expected something like 50x ! How can I improve the performances of the frameserver? The signpost avi is on a NVME professional drive.
There are other frameservers compatible with AviSynth that I can use instead of the debugmode one?
The string I used is:
ffmpeg -y -i D:\frameserver_test\frameserver.avs -map 0 -c:v libx264 -preset ultrafast -b:v 3000k -c:a copy D:\frameserver_test\out.mov

while frameserver.avs contains:
AviSource("D:\frameserver_test\output.avi");

What's your command?

@Gyan what do you mean for my command? The ffmpeg command that I cast for prepare the final file, avysinth or something related to the frameserver ?

The ffmpeg command?

@Gyan I edited the question and added the command line, thanks

What's the speed for ffmpeg -y -i D:\frameserver_test\frameserver.avs -map 0 -c copy -f null -

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


text:
Correct export in Premiere to Vimeo & YouTube in FULL RANGE 0-255
I'm working in Adobe Premiere on some sequences (Full HD, Progressive, 8bit).
In these sequences I added also some matte black backgrounds and after effects comps with black background and other plain colors.
If I export normally from premiere in h264 .mp4 the resulting file have it's colors shifted because Premiere tends to always apply a Limited Range (16-235) to the colors instead of Full Range (0-255).
What normally is a Pure Black RGB 0,0,0 becomes a Dark Gray 16,16,16 and the same happens to the other colors.
For the ones who are wondering why there are these ranges, the Limited Range (16-235) is used in HDTVs and I fear that Premiere enforce this settings always.. But in Youtube and Vimeo you can fully use the 0-255!
So..
What is the correct workflow to have Premiere export h264 video files in full range 0-255 ?
It isn't a problem is given by the REC 709 space right? Could be that premiere only exports h264/h265 files in Limited range ?
I tried export in DNX and convert in h264 with ffmpeg:
ffmpeg -y -i "dnx.mov" -c:v libx264 -preset ultrafast -b:v 12000k -profile:v main -level:v 4.1 -pix_fmt yuv420p -vf format=yuv420p -dst_range 1 -color_range 2 -c:a copy h264.mov

But even doing this, the result is just a file marked somewhat in full range, VLC uses 0-255 even if some gradients are clipped in my opinion and if exported on Vimeo the result is still with the black shifted from 0 to 16 with a nice gray instead of black :(
Do the maximum color depth inside the premiere export panel make something?

yuv420p is limited range. yuvj420p is full range.

@Gyan Interesting.. so if I use that on ffmpeg I should be able to achieve the full range with ffmpeg but for the original in premiere? I assume that premiere is unable to export nativeli in h264 full range.. there's another codec I could use compatible with full range ?

Probably some RGB codec, like QT Animation

@Gyan Oh i see, Premiere codecs doesn't have options like yuvj420p so you have to go for codecs that uses RGB


text:
How can I convert the subtitle file format (.rtf to .vtt)?
Does anybody knows an easy way to create a .vtt (WEBVTT) subtitle file with an .rtf file? I don't want to have to type all the subtitles new to get the .vtt format!
Is there an easy way to convert it? In example with a software? It's a thing I have to do only a single time so it would be nice to be able to use freeware.
Regards.
P.S.: To give an example. This is the content of the .rtf file:
\pard\pardeftab720\ri0\qc
\cf0 Hola, el meu nom \'e9s Marta Peric\'e0s.\
Tinc 22 anys.\
\
\pard\pardeftab720\ri0
\cf0 0002 00:00:06:05 00:00:08:18 38\
\
\pard\pardeftab720\ri0\qc
\cf0 Visc a Sabadell, \
a prop de Barcelona.\

And in the end it should look like this proper .vtt file:
0:00:02.26 --> 0:00:05.74
Hi, my name is Marta Pericàs and I'm 22 years old.

0:00:06.40 --> 0:00:08.74
I live in Sabadell, near Barcelona.

I never seen this kind of format you're showing as .rtf... There's a wonderful tool from Uruguay, like a decade old (or more) and still on the run, that I always use to subtitle but, for one, it doesn't accept RTF and then there's this issue that your input format is really strange... Oh, it does have the WebVTT as output format.

A good text editor like notepad++ or atom or sublime text might be the tool you need. This looks like a job for regular expressions. https://www.xkcd.com/208/


text:
How to trim out black frames with ffmpeg on windows?
I have a short video and I'm trying to cut-out all the blank or near blank frames.
This isn't a case where I care about the breaks in a video that could be dark.  I literally want all near black-frames out.
What I didn't realize with ffmpeg at first was that the 'blackframe' or 'blackdetect' filters, is that they didn't actually filter.  They just seem to show you what you can possibly filter, with other command(s).
What is the best way in 'Windows' to actually filter out the resulting found frames?
So with ffmpeg I'm actually concat-(ting) the forward and reverse of the same file than I'm running some filters on those files.  See my current command:
ffmpeg.exe -y -i "2013-10-14_14-30-55.mov" -filter_complex "[0:v]transpose=3,split[tp][tp2];[tp]reverse[vr];[tp2][vr]concat=n=2:v=1:a=0[vbf];[vbf]blackframe=98:32[v]" -map "[v]" -vcodec wmv2 -q 10 -trellis 2 -r 16 "g:\gd5.wmv"

Then I get this output: (Just the tail end of it anyway...)
[Parsed_blackframe_4 @ 00000000003bf320] frame:650 pblack:99 pts:21821999 t:21.821999 type:B last_keyframe:639
[Parsed_blackframe_4 @ 00000000003bf320] frame:651 pblack:99 pts:21855366 t:21.855366 type:P last_keyframe:639
[Parsed_blackframe_4 @ 00000000003bf320] frame:652 pblack:99 pts:21888733 t:21.888733 type:B last_keyframe:639
[Parsed_blackframe_4 @ 00000000003bf320] frame:653 pblack:99 pts:21922099 t:21.922099 type:B last_keyframe:639
[Parsed_blackframe_4 @ 00000000003bf320] frame:654 pblack:99 pts:21955466 t:21.955466 type:I last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:655 pblack:99 pts:21988833 t:21.988833 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:656 pblack:99 pts:22022199 t:22.022199 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:657 pblack:99 pts:22055566 t:22.055566 type:P last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:658 pblack:99 pts:22088933 t:22.088933 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:659 pblack:99 pts:22122299 t:22.122299 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:660 pblack:99 pts:22155666 t:22.155666 type:P last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:661 pblack:99 pts:22189033 t:22.189033 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:662 pblack:99 pts:22222399 t:22.222399 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:663 pblack:99 pts:22255766 t:22.255766 type:P last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:664 pblack:99 pts:22289133 t:22.289133 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:665 pblack:99 pts:22322499 t:22.322499 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:666 pblack:99 pts:22355866 t:22.355866 type:P last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:667 pblack:99 pts:22389233 t:22.389233 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:668 pblack:99 pts:22422599 t:22.422599 type:B last_keyframe:654
[Parsed_blackframe_4 @ 00000000003bf320] frame:669 pblack:99 pts:22455966 t:22.455966 type:I last_keyframe:669
frame=  362 fps= 14 q=10.0 Lsize=    9004kB time=00:00:22.62   bitrate=3260.2kbits/s dup=1 drop=309
video:8922kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.918756%

So what do I do with this blackframe information in Windows?  Or is there a better method with the 'blackdetect' filter?

Here's a way to do it with the blackdetect and trim filters.
First, a better way to get the blackdetect output is via ffprobe because it is capable of writing structured data such as XML, JSON or one key=value per line.
You do this using metadata injection:
ffprobe -f lavfi -i "movie=/path/to/input.mp4,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet
TAG:lavfi.black_start=0
TAG:lavfi.black_end=5.42208
TAG:lavfi.black_start=73.4067

As you can see it returns the start and end time of each black section. You use the returned info to trim the segments between each end and the next start:
ffmpeg -i /path/to/input.mp4 -filter_complex "[0:v]trim=start=5.42208:end=73.4067,setpts=PTS-STARTPTS[v1];[0:a]atrim=start=5.42208:end=73.4067,asetpts=PTS-STARTPTS[a1]" -map [v1] -map [a1] output.mp4
You can chain multiple trim filters in the same command. See this answer for a detailed example.
To automate this in Windows you can install and use PowerShell or another scripting language of your choice (PHP, Python etc).

Your help is appreciated, and seems to be the right path.  However I tried the ffprobe command you suggested:
ffprobe -f lavfi -i "movie=2013-10-14_14-30-55.mov,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet But no entries come out at all. Could this be, because the frames in question are not black enough, or am I doing it wrong?  I don't understand some of the commands.

@RobertKoernke I used the default blackdetect settings, check its arguments and example on https://ffmpeg.org/ffmpeg-filters.html#blackdetect. Make sure you also have a recent version of ffmpeg and not a default distro installation.

The command means: do blackdetect, show only black_start and black_end tags, use the default output format  -of default with no wrappers nw=1 and suppress all other output -v quiet

btw... You are giving me Windows instructions correct? Ok I temporarily took off the -v quiet and I get this:
[Parsed_movie_0 @ 0056f560] Failed to avformat_open_input 'C'
[lavfi @ 0056e2a0] Error initializing filter 'movie' with args 'C:UsersDOCUME~12013-10-14_14-30-55.mov'
movie=C:\Users\DOCUME~1\2013-10-14_14-30-55.mov,blackdetect=d=0:pix_th=51.80[out0]: No such file or directory`

The -v quiet was suppressing the error messages.

I got it... I put the video in the same directory and ran it, and it is working.  So I'll keep testing..Thankx

I've tried many different items in my tests.  Many times I'll get 'file not found' when clearly the file is there.  As I've shows I've tried old dos file types.  What is causing the issue here:
"movie=C:\Users\INSPIR~1\DOCUME~1\a2d2\A2D2DE~1\MAC_SP~1.com\videos\2013-10-14_14-30-55.mov,blackdetect[out0]"

When you use a path inside a command argument you have to escape the special characters or quote it, or use shorter, simple paths. https://ffmpeg.org/ffmpeg-utils.html#toc-Quoting-and-escaping

No escaping \..\ seems to work.. It continues to show the error:
Error initializing filter 'movie' with args - The alternative is that I'm going to use is to copy to the local ffprobe/ffmpeg directory as a temp file, process it there, and then move the processed version where I need it.  Thanx.

Finally figured out the escaping here.  I finally needed it:
"movie='C:\Users\Inspiron 560\Documents\temp.wmv',blackdetect[out0]" Like so... The help page linked above was vague and did not show the way for ffprobe-movie.

I've put together a Python script that will do all of this.
Generates the ffprobe and ffmpeg commands and runs them And outputs a file without black clips
GitHub repo: https://github.com/FarisHijazi/deblack
GitHub gist (archived): https://gist.github.com/FarisHijazi/eff7a7979440faa84a63657e085ec504
"""
@author: https://github.com/FarisHijazi
Use ffprobe to extract black frames and ffmpeg to trim them and output a new video
"""

# help from:
# https://video.stackexchange.com/questions/16564/how-to-trim-out-black-frames-with-ffmpeg-on-windows#new-answer?newreg=d534934be5774bd1938b535cd76608cd
# https://github.com/kkroening/ffmpeg-python/issues/184#issuecomment-493847192

import argparse
import os
import shlex
import subprocess

parser = argparse.ArgumentParser(__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('input', type=str, help='input video file')
parser.add_argument('--invert', action='store_true', help='remove nonblack instead of removing black')
args = parser.parse_args()

##FIXME: sadly you must chdir so that the ffprobe command will work
os.chdir(os.path.split(args.input)[0])
args.input = os.path.split(args.input)[1]

spl = args.input.split('.')
outpath = '.'.join(spl[:-1]) + '.' + ('invert' if args.invert else '') + 'out.' + spl[-1]

def delete_back2back(l):
  from itertools import groupby
  return [x[0] for x in groupby(l)]

def construct_ffmpeg_trim_cmd(timepairs, inpath, outpath):
  cmd = f'ffmpeg -i "{inpath}" -y -filter_complex '
  cmd += '"'
  for i, (start, end) in enumerate(timepairs):
    cmd += (f"[0:v]trim=start={start}:end={end},setpts=PTS-STARTPTS,format=yuv420p[{i}v]; " +
            f"[0:a]atrim=start={start}:end={end},asetpts=PTS-STARTPTS[{i}a]; ")
  for i, (start, end) in enumerate(timepairs):
    cmd += f"[{i}v][{i}a]"
  cmd += f'concat=n={len(timepairs)}:v=1:a=1[outv][outa]'
  cmd += '"'
  cmd += f' -map [outv] -map [outa] "{outpath}"'
  return cmd

def get_blackdetect(inpath, invert=False):
  ffprobe_cmd = f"ffprobe -f lavfi -i \"movie={inpath},blackdetect[out0]\" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet"
  print('ffprobe_cmd:', ffprobe_cmd)
  lines = subprocess.check_output(shlex.split(ffprobe_cmd)).decode('utf-8').split('\n')
  times = [float(x.split('=')[1].strip()) for x in delete_back2back(lines) if x]
  assert len(times), 'no black detected'

  if not invert:
    times = [0] + times[:-1]
  timepairs = [(times[i], times[i + 1]) for i in range(0, len(times) // 2, 2)]
  return timepairs

timepairs = get_blackdetect(args.input, invert=args.invert)
cmd = construct_ffmpeg_trim_cmd(timepairs, args.input, outpath)

print(cmd)
os.system(cmd)

Combining multiple answers together:

https://video.stackexchange.com/a/16571/37220
https://superuser.com/a/1498811/739491


text:
Youtube Views and Likes
Is there any way to find out which people have viewed or liked your video on YouTube ?
YouTube Only provides data like , how many percentage of views comes Region wise.

No, you cannot, and this is a good thing for privacy reasons.
Using the YouTube Data API v3 you can get general statistics for a list of videos as part of a contentDetails structure:
 "statistics": {
    "viewCount": unsigned long,
    "likeCount": unsigned long,
    "dislikeCount": unsigned long,
    "favoriteCount": unsigned long,
    "commentCount": unsigned long
  },

Where can I run this code?

@LCarvalho It's a REST API. See examples: https://developers.google.com/youtube/v3/docs/videos/list#try-it


text:
Capture a wpf window : The flickering issue
I made a simple animation (as crawl text) using C#-WPF.
The animation is smooth and excellent. (in wpf window)
But when I capture it by FFmpeg as video it has flickering problem.
Please see sample1 (speed of animation is high) and sample2 (speed of animation is low).
Is it field issue or sync problem or ......?
How can I fix it?
UPDATE:
this is my ffmpeg command:
ffmpeg -f gdigrab -i title="Wpfwindow" -framerate 30 -vcodec libx264 out1.mp4 -y

Note:
I need to framerate=30 or framerate=25 , because I want to convert the video to PAL and NTSC formats.
Output of console:
ffmpeg version N-76417-gee20354 Copyright (c) 2000-2015 the FFmpeg developers
 built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  5.100 / 55.  5.100
  libavcodec     57. 13.102 / 57. 13.102
  libavformat    57. 13.100 / 57. 13.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 14.101 /  6. 14.101
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
[gdigrab @ 000001df9916af40] Found window ooo, capturing 704x537x32 at (0,0)
Input #0, gdigrab, from 'title=Wpfwindow':
  Duration: N/A, start: 1464634804.659289, bitrate: 362576 kb/s
    Stream #0:0: Video: bmp, bgra, 704x537, 362576 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 000001df9916db40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 000001df9916db40] profile High 4:4:4 Predictive, level 3.1, 4:4:4 8-bit
[libx264 @ 000001df9916db40] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out1.mp4':
  Metadata:
    encoder         : Lavf57.13.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 704x537, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.13.102 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=   16 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   31 fps= 31 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   46 fps= 31 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   61 fps= 30 q=29.0 size=       5kB time=00:00:00.10 bitrate= 375.1kbits/s
frame=   76 fps= 30 q=29.0 size=      11kB time=00:00:00.60 bitrate= 149.6kbits/s
frame=   92 fps= 30 q=29.0 size=      22kB time=00:00:01.13 bitrate= 159.7kbits/s
frame=  107 fps= 30 q=29.0 size=      28kB time=00:00:01.63 bitrate= 141.9kbits/s
frame=  122 fps= 30 q=29.0 size=      36kB time=00:00:02.13 bitrate= 138.7kbits/s
frame=  137 fps= 30 q=29.0 size=      44kB time=00:00:02.63 bitrate= 137.4kbits/s
frame=  152 fps= 30 q=29.0 size=      48kB time=00:00:03.13 bitrate= 126.4kbits/s
frame=  168 fps= 30 q=29.0 size=      52kB time=00:00:03.67 bitrate= 117.1kbits/s
frame=  183 fps= 30 q=29.0 size=      55kB time=00:00:04.17 bitrate= 107.7kbits/s
frame=  188 fps= 30 q=-1.0 Lsize=      74kB time=00:00:06.20 bitrate=  98.1kbits/s
video:72kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.373045%
[libx264 @ 000001df9916db40] frame I:1     Avg QP:18.54  size:  2426
[libx264 @ 000001df9916db40] frame P:129   Avg QP:15.36  size:   483
[libx264 @ 000001df9916db40] frame B:58    Avg QP:22.37  size:   141
[libx264 @ 000001df9916db40] consecutive B-frames: 52.1% 20.2%  0.0% 27.7%
[libx264 @ 000001df9916db40] mb I  I16..4:  8.8% 88.0%  3.1%
[libx264 @ 000001df9916db40] mb P  I16..4:  0.8%  0.2%  0.2%  P16..4:  1.7%  0.7%  0.3%  0.0%  0.0%    skip:96.1%
[libx264 @ 000001df9916db40] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  2.0%  0.4%  0.0%  direct: 0.0%  skip:97.4%  L0:42.9% L1:46.7% BI:10.5%
[libx264 @ 000001df9916db40] 8x8 transform intra:44.1% inter:38.4%
[libx264 @ 000001df9916db40] coded y,u,v intra: 4.7% 5.2% 3.4% inter: 0.4% 0.4% 0.1%
[libx264 @ 000001df9916db40] i16 v,h,dc,p: 87% 12%  1%  0%
[libx264 @ 000001df9916db40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 42% 50%  0%  0%  0%  0%  0%  0%
[libx264 @ 000001df9916db40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 60%  8% 23%  2%  2%  1%  2%  1%  1%
[libx264 @ 000001df9916db40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001df9916db40] ref P L0: 56.0%  7.0% 17.4% 19.5%
[libx264 @ 000001df9916db40] ref B L0: 84.8% 10.7%  4.5%
[libx264 @ 000001df9916db40] ref B L1: 98.7%  1.3%
[libx264 @ 000001df9916db40] kb/s:93.00
Exiting normally, received signal 2.

framerate should go before -i, as it's telling ffmpeg what the input rate is.
ffmpeg -f gdigrab -framerate 30 -i title="Wpfwindow" -vcodec libx264 out1.mp4 -y

Thanks, but had no effect.
I've also used -r command :  ffmpeg -f gdigrab -framerate 30 -i title="Wpfwindow" -vcodec libx264 -r 30 out1.mp4 -y , But this also does not work.

In your first sample, the amount of horizontal motion is not the same each frame. This could be an issue of low rate. Try 60. Don't add -r option, especially a value different than framerate.

And also try it with full desktop.

my animation has full framerate (FPS=60). aha ,ok . I'll try with full desktop.Thanks.


text:
How to double video frames without any duplicate frames
My video details : DV-PAL 720x576i , 25FPS , duration=20s , frames=500
I need to increase (double) the video frames without any duplicate frame.
I used the following commands to increase (double) frame rate of the video.
ffmpeg -i in.avi -r 50 out.avi
ffmpeg -i in.avi -r 50 -filter:v setpts=2*PTS out.avi

But not works properly.
Please tell me How to double video frames without any duplicate frames?
Note : tool (ffmpeg or mencoder or etc.) and the duration and speed are not matter for me, Because I want to extract frames.

Use
ffmpeg -i in.avi -r 50 -filter:v "setpts=0.5*PTS" out.avi

or
ffmpeg -i in.avi -r 50 -filter:v "setpts=N/50/TB" out.avi

If you want to interpolate new frames, use
ffmpeg -i in.avi -r 50 -filter:v "yadif,framerate=50" out.avi

yadif is a deinterlacing filter, which is needed since the framerate filter does not operate on interlaced media.

Thanks for the reply,But the output of both your commands has 500 frames.(I need to get 1000 frames without any duplicate)

I used this command to extract out.avi  :  ffmpeg  -i out.avi  -f image2 %d.png

See new command.

Yes I want interpolate new frames , but the new frames quality is poor , I need something like this ,But I think that is impossible by ffmpeg (? maybe I'm wrong) ,So I'll accept your answer. Thank you very much.

Try slowmovideo.


text:
How to change every black pixel to a special color?
I want to extract all video frames as images and change every black (pure black) pixel of the images to a special color. (R=3,G=3,B=3)
I used this command to extract video frames :
ffmpeg -I myVideo.avi -f image2 -vf yadif -vcodec png image%d

Please tell me how to change every black pixel of the images to color that I want? (I want R=3,G=3,B=3)
Thanks.

You can use the LUT or GEQ filters for this.
e.g. with LUT
ffmpeg -i myVideo.avi
       -vf
       "yadif,format=rgb24,
        lutrgb=r='if(eq(val,0),3,val)':g='if(eq(val,0),3,val)':b='if(eq(val,0),3,val)'"
image%d.png

That code looks like it doesn't do as asked. For example a pixel with 0, 100, 0 is changed to 3, 100, 3


text:
FFmpeg : How to replace video background color with transparency? (while capturing)
I want to capture a window and overlay it on another video.
This is my command:
ffmpeg -i MainVideo.avi
-f gdigrab -framerate 25 -video_size 300x200 -i title="MyWindow"
-filter_complex "[0]setpts=PTS-STARTPTS[b];[b][1:v]overlay=(main_w-overlay_w):main_h-overlay_h[v]"
-map "[v]" -c:v libx264 -r 25  out.mp4

background of my window is black.
How can I replace this black color with transparency?
is this possible by ffmpeg? (I think it is possible by chromakey/colorkey filters but I'm not sure, and I don't know how to use those filters)
Thanks.
UPDATE:
Suppose this is a frame of video that I want:

GDIgrab supplies RGB feed so colorkey can work here, but if you share a sample frame of the grab, then I can see if a more effective alt method is possible.

@Mulvya, Hi , my question updated.

See here. But insert format=yuv444p filter before the geq and instead of 16, you may have to use a value of 0 or near 0

GDIgrab supplies a RGB feed so the colorkey filter can work here.
Try
ffmpeg -i 1.mp4 -f gdigrab -framerate 25 -video_size 300x200 -i title="MyWindow"
-filter_complex
"[1]split[m][a];
 [a]format=yuv444p,geq='if(gt(lum(X,Y),0),255,0)',hue=s=0[al];
 [m][al]alphamerge[ovr];
 [0][ovr]overlay=(main_w-overlay_w):main_h-overlay_h[v]"
-map "[v]" -c:v libx264 -r 25 out.mp4

You may have to use a value of near 0, if 0 doesn't capture all the transparent area.

Thank you so much! , it works for me with 16 instead of 0. ( ...(X,Y),16),255,0... instead of ...(X,Y),0),255,0...

@Gyan Can you share a command that only changes the background color to another color. My case doesn't have video scale, title, etc...

what mean hue=s=0 work here, thanks

Set saturation to zero in hue filter.


text:
FFMPEG: Cut WMV video not playing on all the media players
This is the command line I use to cut videos with FFMPEG (example to cut from minute 1 to minute 6):
ffmpeg -i OriginalVideo.wmv -c copy -s 1:00 -t 5:00 CutVideo.wmv

It has always worked for me on any format, but this is the first time I try it with WMV videos, and things went not as they must.
The resulting file seems to be OK, and the images of each timestamp are there, but "static", this is: the video does not play (nor sounds). I can jump to any moment of the video, but the images do not move.
I have tested it with BSPlayer and Media Player Classic.
Why is this happening and how could it be solved?
This is the output for the recoding:
ffmpeg -i OriginalVideo.wmv -ss 16:00 -t 27:45 -c copy "CutVideo.wmv"
ffmpeg version N-76041-g0418541 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisy
nth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-ico
nv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --ena
ble-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-
amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroeding
er --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enab
le-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --en
able-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  6.100 / 57.  6.100
  libavformat    57.  4.100 / 57.  4.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 11.100 /  6. 11.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, asf, from 'OriginalVideo.wmv':
  Metadata:
    VBR Peak        : 7000000
    DeviceConformanceTemplate: MP@HL
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 5847
    WMFSDKVersion   : 10.00.00.4005
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 1
    Buffer Average  : 122637
  Duration: 00:46:50.20, start: 0.000000, bitrate: 1675 kb/s
    Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp, 12
8 kb/s
    Stream #0:1: Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 1280x720, 1500 kb
/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc
[asf @ 00000000004f8580] Codec for stream 0 does not use global headers but contain
er format requires global headers
[asf @ 00000000004f8580] Codec for stream 1 does not use global headers but contain
er format requires global headers
Output #0, asf, to 'CutVideo.wmv':
  Metadata:
    VBR Peak        : 7000000
    DeviceConformanceTemplate: MP@HL
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 5847
    WMFSDKVersion   : 10.00.00.4005
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 1
    Buffer Average  : 122637
    WM/EncodingSettings: Lavf57.4.100
    Stream #0:0: Video: wmv3 (WMV3 / 0x33564D57), yuv420p, 1280x720 [SAR 1:1 DAR 16
:9], q=2-31, 1500 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=14102 fps=0.0 q=-1.0 size=   95029kB time=00:07:51.77 bitrate=1650.1kbits/s
frame=35118 fps=35116 q=-1.0 size=  237364kB time=00:19:32.77 bitrate=1658.0kbits/s
frame=49877 fps=35123 q=-1.0 Lsize=  353914kB time=00:27:45.33 bitrate=1740.9kbits/
s
video:317077kB audio:26015kB subtitle:0kB other streams:0kB global headers:0kB muxi
ng overhead: 3.154253%

Further data (thanks you, KC):

The video generated by FFMPEG plays fine on VLC Media Player. So the question is now: how can I generate a video with FFMPEG that plays on any (or most) multimedia players?

FFmpeg sometimes encodes things in a way that certain video players can't decode. I would try playing back the file with VLC, VLC has always worked when other video players haven't for me.
Update: I would try converting the video file to a different container, such as mp4, which has worked for you in the past.

You were right, KC, thanks you. I think the original question must be reworded, then. The question now is more accurate.

I've updated my answer with a recommendation.


text:
Adding and Updating Photos added to Movie
Is there a feature that will allow photos added to a movie to be udated automatically when the image is updated in the asset library, so everything wont need to be recut.
There are about 60 images and they are synced to music.
Using iMovie 10.

I have tried using images from the main movie assets collection and iPhoto, then updating the image in the collection but the old image still remains in the main video editor. I don't see any way to do mass image updates without recutting everything.

A quick google search shows this seems the expected behaviour in iMovie.

Seeking an alternative way, a solution.


text:
How can I change the aspect ratio of the sequence preview pane?
I'm wondering how I can change the aspect ratio and size of the preview pane on the right in the following image:

The source video (seen on the left) is 1280x720 but the preview pane seems to be set to 1:1. I've tried playing with the options in the right pane (changing 50%, 1/2 etc) but nothing seems to change the aspect ratio and size correctly.
For what it's worth, I can create a new sequence and set it's aspect ratio, but I'm wondering how can I change the aspect ration on an existing sequence?

The program panel's sequence preview is mainly determined by the sequence settings. You can change those via Sequence → Sequence Settings. However, some parameters of a sequence can not be altered after creation, including resolution and aspect ratio (an exception is the automated adjustment of the sequence settings that is offered to you when you drop a clip in an empty sequence that doesn't match the sequence's settings).
To fix your issue, create a new sequence with correct settings. Then go back to your old sequence, select everything (CTRL + A), copy it (CTRL + C) and paste it into the new sequence (CTRL + V). To create a sequence with correct settings automatically, right-click on of your source clips and select New Sequence From Clip (I recommend this if you don't know what some or most of the options in the sequence creation menu mean).
The size of the program monitor's preview can be adjusted with the Select Zoom Level dropdown button in the lower left of the panel. The other dropbown button that you mentioned (the one in the lower right) controls the Playback Resolution.


text:
Old webcam recorded video not playing
I have this video (length 1-2 min) recorded on Dell webcam 3-4 years ago. It played smoothly at that time. Now when I play it, for first 40 seconds it plays well but after that video goes blank and audio stops. Video continues to move forward but without video and audio, just blank .
Is there by any chance I can recover this video? If yes, how?
It's an AVI file, 550 MB.
Codec -
Video
ID                             : 0
Format                         : RGB
Codec ID                       : 0x00000000
Codec ID/Info                  : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples
Duration                       : 1mn 34s
Bit rate                       : 47.1 Mbps
Width                          : 640 pixels
Height                         : 480 pixels
Display aspect ratio           : 4:3
Frame rate                     : 30.000 fps
Bit depth                      : 8 bits
Bits/(Pixel*Frame)             : 5.114
Stream size                    : 533 MiB (97%)

Try converting it with a tool from that time: http://www.squared5.com/

To me sounds like a lack of original codecs. Why don't you start by posting a ffprobe of the file? The container is AVI but we doesn't know anything about the codec.
ffprobe file.avi

FFprobe is a tool found in the FFmpeg package: https://www.ffmpeg.org/download.html

I have downloaded above package, but don't know how to use. Will you help?

@HungryDB
Assuming you are using a windows os you should download a package like this: http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20151022-git-a7c5005-win32-static.7z Then you should unzip it, inside there should be a file called ff-prompt.bat, run it. There you could type something right? Type "ffprobe your_file_location" (without quotes), it should give you a long result, take a screenshot. Edit your original question and add a screenshot in it.

i have updated codec information. Kindly suggest a solution.

Does it play correctly with ffplay i.e. ffplay filename.avi?

I used media player classic to get codec information. Not ffprobe. Should i download ffmpeg package?


text:
Cameras battery dies. What happens to video?
Let's say the battery dies or you take it out while recording what would happen to the video?
I believe this camera is from 2006.
I have heard new cameras have a cache that it fixes upon reboot.  Is there a date where this is assumed?  I guess does my camera have this feature?

If the last file the camera recorded is corrupted, you may be able to recover it with Untrunc: https://github.com/anthwlock/untrunc

This highly relies on your camera. We would need to get more information about the exact model.
Generally, most modern cameras can stop and save a recording on power loss, especially on normal battery out (The camera generally shuts down because it is sensing a low battery and not when the battery can't deliver enough battery anymore.
Simplest thing is to try, take an empty storing media and try it out.

Let's say the battery dies or you take it out while recording what would happen to the video?

Why can't you try it? Just start video recording and remove battery.
As I can see, you have camera using DV tape, so you will nothing lose of the recorded data.
If you have DVD camera, sdcard or HDD, things get worse, as you must "finalize" recording. In case power loss with HDD/sdcard, you can lost few last seconds/minutes or whole file. Some cameras writes temporary .dat files, which can not be played. But it can be repaired. Sometimes it's no easy, but it's possible to get back your data. I can't say anything about DVD, as I not expert in this area. So, just do experiment!

So I believe it writes video ever 13 minutes in my case.  So you don't lose all the video but some at least.


text:
What does codec stand for?
Does codec stand for compression or decompression?
I have also heard it stands for encoder/decoder.
Which is it?  Maybe something entirely different.
I'm looking for a source better then Wikipedia.

One of the earliest articles in the IEEE database that uses the term, defines it as "coders and decoders."
However, newer material does not seem to be consistent. One of the Wikipedia page's sources (at the time a page author retrieved it) alludes to both encoder-decoder and compression-decompression. This book defines it as compression/decompression.

Considering video files were originally in raw(I'm believe so) "coders and decoders" makes more sense but I'm only using my superficial knowledge of film and computer science.  You see films originally were not compressed and decompressed which therefore means it couldn't be used to stand for codec.  Maybe.....

The term originated in digital signal processing, not media technology. The first appearance of the term in the SMPTE Journal seems to be in 1972, well after the 1965 Bell Labs article.


text:
Camera settings instead of RAW
I have come across several articles in which the camera settings for shooting video are explained. If the camera does not provide RAW footage it is recommended to set Contrast, Brightness and Saturation as low as possible, and also change the midtones curve adjusting lowlights to high and highlights to low, in order to get an image as flat as possible.
This way it is claimed that the footage can be easily post-produced.
I wonder if that is a valid way, or if it is better to adjust as desired the image on camera.
Any thoughts would be appreciated.

Good question.  Usually, the low-contrast images people use for maximum flexibility in lieu of RAW are known quantities; the mathematical properties of their gamma curves, as well as color space properties and white points are standardized and published by camera manufacturers.  Dialing in numbers arbitrarily might theoretically afford a similar advantage as those gamma curves are designed to give, but it also throws away the roadmap to reconstruct the scene as shot.  Matching one shot to another would require reverse-engineering the camera settings in every case, for example.

It highly depends on your Bit-depth and scene and post-production. If you're trying to maximize for dynamic range and avoid clipping highlights for example, you should reduce contrast as much as possible (and also expose for the highlights). However, by doing that you might lose details in the midtones (separation of colors and luma), which might lead to banding issues after post-processing the footage (adding contrast and saturation), especially if you are recording 8-Bit per channel, which most consumer cameras do.
From my personal experience if you are recording 8-Bit you are probably better off getting your exposure as finished as possible in the camera and only do little post-processing to avoid banding or similar issue. If you're recording 10-Bit, you have way more information to play with and could use LOG profiles (which are another way of reducing contrast and saturation) instead.

+1. The idea that "log" or "flat" recording is useful in 8-bit recording is a myth. In high-bit-depth cameras it's useful, but in an 8-bit camera you're taking detail from skin tones in order to have a small amount of extra wiggle room at the extremes. Exposing properly in-camera saves a lot of time and provides better quality.


text:
DaVinci Resolve 16 the content of all videos become black

I used to be able to see the content of all videos, but since today they all turned into black screen.
Googled and found a few posts
e.g. DaVinci Resolve 16 shows black screen on imported media
After 1 year 4 months there is still not a working answer.
My OS is Ubuntu 20.04, with NVIDIA RTX 2080Ti and Driver 450 installed

What do the properties display?


text:
Video metadata: What is "Video delay" used for?
Recently, I'm forced to fiddle with a nasty little problem with videos that have some special metadata attributes, namely "delay" or "delay_relative_to_video".
There's a software videoconferencing solution wich produces these special files, and when our videoprocessing software examines these files, it gets longer duration values than the actual length of the content, thus storing wrong data into the database which causes more trouble in the postprocessing phase.
For example, we recorded a 46 second long video, which was detected as 104.7 seconds long.
After inspecting the file with FFmpeg and Mediainfo, it turned out that the original file had a so called "delay" value which can be seen as start time in FFmpeg's output:
Input #0, flv, from '/path/to/the/file/converter/master/194/194_video.flv':
  Metadata:
    metadatacreator : Yet Another Metadata Injector for FLV - Version 1.4
    hasKeyframes    : true
    hasVideo        : true
    hasAudio        : true
    hasMetadata     : true
    canSeekToEnd    : false
    datasize        : 12892571
    videosize       : 12198311
    audiosize       : 680584
    lasttimestamp   : 105
    lastkeyframetimestamp: 104
    lastkeyframelocation: 12646873
  Duration: 00:01:44.77, start: 58.033000, bitrate: 984 kb/s
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1280x720, 30 fps, 30 tbr, 1k tbn
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp

...and Delay or Delay_relative_to_video in Mediainfo's:
mediainfo --full --output=XML /path/to/the/file/converter/master/194/194_video.flv

<track type="Video">
(...)
<Delay>0</Delay>
<Delay>00:00:00.000</Delay>
<Delay__origin>Container</Delay__origin>
<Delay__origin>Container</Delay__origin>
</track>

<track type="Audio">
(...)
<Delay>58036</Delay>
<Delay>58s 36ms</Delay>
<Delay>58s 36ms</Delay>
<Delay>58s 36ms</Delay>
<Delay>00:00:58.036</Delay>
<Delay__origin>Container</Delay__origin>
<Delay__origin>Container</Delay__origin>
<Delay_relative_to_video>58036</Delay_relative_to_video>
<Delay_relative_to_video>58s 36ms</Delay_relative_to_video>
<Delay_relative_to_video>58s 36ms</Delay_relative_to_video>
<Delay_relative_to_video>58s 36ms</Delay_relative_to_video>
<Delay_relative_to_video>00:00:58.036</Delay_relative_to_video>
</track>

"Surprisingly", substracting the length and the delay gives me the correct duration...
Also, it is really embarrassing that some encoder libraries count these delays towards the total length, but some of them doesn't! Seemingly there's no way to distinguish which length values are correct and which were incremented accordingly!
So long story short, I'd like to know what are these metadata used for?
What's the reason of their existence and why does some encoders/video editing software injecting these metadata into the file?
Thanks for your answers in advance!
Edit:
According to Mulvya's answer, running a simple stream-copy on the file can reset the timestamps!
However, there was a .mov file on which it didn't worked.
Related console output:
ffmpeg -i 22_video.mov -c copy _22_video.mov
ffmpeg version N-79632-g3ce1988-static Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/home/gergo/buildscript/ffmpeg-static-master-customVSQ/target --extra-cflags='-I/home/gergo/buildscript/ffmpeg-static-master-customVSQ/target/include -static' --extra-cflags=--static --extra-ldflags='-L/home/gergo/buildscript/ffmpeg-static-master-customVSQ/target/lib -lm -static' --extra-libs=-ldl --extra-version=static --disable-debug --disable-shared --enable-static --extra-cflags=--static --disable-ffplay --disable-ffserver --disable-doc --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-runtime-cpudetect --enable-libfaac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-bzlib --enable-zlib --enable-nonfree --enable-version3 --enable-libwavpack --enable-libvpx --enable-librtmp
  libavutil      55. 22.101 / 55. 22.101
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '22_video.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2013-10-29 21:33:33
    com.apple.finalcutstudio.media.uuid: 3B712819-1D1D-4F9B-8593-01656870A04C
    timecode        : 01:00:00:00
  Duration: 00:03:25.00, start: 0.000000, bitrate: 9332 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 9019 kb/s, 25 fps, 25 tbr, 2500 tbn (default)
    Metadata:
      creation_time   : 2013-10-29 21:33:33
      handler_name    : Apple Video Media Handler
      encoder         : H.264
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 307 kb/s (default)
    Metadata:
      creation_time   : 2013-10-29 21:33:33
      handler_name    : Apple Sound Media Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2013-10-29 21:33:33
      handler_name    : Time Code Media Handler
      timecode        : 01:00:00:00
File '_22_video.mov' already exists. Overwrite ? [y/N] y
[mov @ 0x46c6660] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mov, to '_22_video.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    timecode        : 01:00:00:00
    com.apple.finalcutstudio.media.uuid: 3B712819-1D1D-4F9B-8593-01656870A04C
    encoder         : Lavf57.34.103
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080, q=2-31, 9019 kb/s, 0.04 fps, 25 tbr, 10k tbn (default)
    Metadata:
      creation_time   : 2013-10-29 21:33:33
      handler_name    : Apple Video Media Handler
      encoder         : H.264
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, 307 kb/s (default)
    Metadata:
      creation_time   : 2013-10-29 21:33:33
      handler_name    : Apple Sound Media Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 5125 fps=0.0 q=-1.0 Lsize=  233585kB time=00:03:25.00 bitrate=9333.9kbits/s speed= 547x
video:225709kB audio:7706kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.072599%

Streaming formats maintain timestamps for each frame, whether audio or video, which govern when the player ought to present them. Those non-zero big start times usually occur when a snippet is cut out from a longer video and the tool used does not reset the timestamps. Although if this FLV was recorded on its own, then it's strange.
In any case, running the command below should fix the problem.
ffmpeg -i input.flv -c copy output.flv

Thanks for the quick answer!
Yeah, I think the live stream's timecodes were retained when it was dumped, so it makes sense now.
Your ffmpeg timestamp-juggling was sorta solved the issue... it worked with the aforementioned example, however, I've tested it with another file which had the same issue (1 hour delay). That file is a product of some kind of Apple software, on which the command didn't worked as expected...
And I discovered another problem: it looks like some encoder libraries count the delay towards the total length, some of them doesn't, which is EXTRA confusing...

Show the complete console output of the command ran on the Apple file. Insert it into the Q.

Here you go. You basically answered the "why" part, so many thanks for your additional effort!

What's wrong with the Apple output? Looks fine.

Mediainfo still says that the delay is <Delay>1h 0mn</Delay>. FFmpeg hints the same with the timecode        : 01:00:00:00 part... I think the particular problem with the .mov file is so rare, that it shouldn't take any further attention (basically 1 out of 1200+ other files).

That's a timecode, not a timestamp, and shouldn't affect duration detection. You can reset it: ffmpeg -i in.mov -c copy -timecode 00:00:00:00 out.mov

Damn, you're right, the output of mediainfo was pretty misleading in the latter case...
The -timecode option did the trick! Thanks!


text:
FFmpeg select filter does not return frames
I observed a strange behavior while using the select filter. In short, I'm using ffmpeg to detect frozen sections in a video, calculate the exact middle point of these sections, then using filters to extract image snapshots at these timestamps.
The frames are selected with the "select" filter by comparing the timestamps with the desired position: select=eq(t\,TIMESTAMP1)[+eq(...)], which is supplemented with the -vsync 0 option to drop other frames.
As you can see in the last two lines of the console output, the filter returned only 3 frames out of 6:
/opt/ffmpeg/ffmpeg-4.4-amd64-static/ffmpeg -y -hide_banner -i "/tmp/in.mp4" -map 0:v:0 -an -vf 'select=eq(t\,30)+eq(t\,76.84)+eq(t\,104.32)+eq(t\,150.32)+eq(t\,290.6)+eq(t\,524.32)' -q:v 1 -vsync 0 -f image2 /tmp/%06d.jpg

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/in.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V mp42isom
    creation_time   : 2014-10-02T11:59:55.000000Z
  Duration: 00:08:47.92, start: 0.000000, bitrate: 373 kb/s
  Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv), 1024x768 [SAR 1:1 DAR 4:3], 371 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2014-10-02T11:59:55.000000Z
      handler_name    : Mainconcept MP4 Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x5556655cc480] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/%06d.jpg':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V mp42isom
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: mjpeg, yuvj420p(pc, progressive), 1024x768 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn (default)
    Metadata:
      creation_time   : 2014-10-02T11:59:55.000000Z
      handler_name    : Mainconcept MP4 Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    3 fps=0.8 q=1.0 Lsize=N/A time=00:08:44.36 bitrate=N/A speed= 145x
video:209kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

My intention was to extract these images in a single step, but if the filter solution proves to be unreliable, I'll stick to the -ss [timestamp] option.
The question is, what causes FFmpeg to behave this way?
EDIT: There seems to be a correlation with the timestamps. When I drop the fractional parts of the timestamps, the command produces four (4!!!) frames instead of three.

The 'exact middle point' has to correspond to a frame timestamp; can't be between frames.

@Gyan Thanks for the hint. That would imply that frames are handled as infinitely short entities and arbitrary t values are generally unreliable with the select filter.

No, t denotes the presentation timestamp i.e. the time at which the frame is expected to be painted. There is a frame duration field but effectively it is implicit and based upon when the next frame is painted.


text:
Sony Vegas Media Generators not appearing
So, I made a small movie. I added track with text, and then I added another track with text. Then the second track never showed up. I see it in the timeline, but I do not see it in the preview.
There is an unkown light blue arrow pointing to a place on the timeline.
What is this, and how do I resolve this?

Another Screenshot

The track containing the "hidden" text appears to be muted in the screenshot. Unmute it. It's the icon in the track controls of a round circle with the diagonal.
Background
There are two ways for a track to be muted. First is by enabling the mute switch of that track. This can be undone by clicking the mute switch again. Other is by soloing another track. To solo a track is to show only that track and mute all others. In such a case, the mute switches on the mute tracks won't be enabled but the solo switch on the soloed track will be. All of the other tracks' visibility state "pre-soloing" can be restored by clicking on the activated Solo switch. An additional tip here is that a track muted via solo can be unmuted by clicking its solo switch. This is useful if one wishes to temporarily unmute another track.

See my edited post. It was unmuted from the beginning, but it looks like the icons on the media generator is a little greyer, and faded out... I don't know what's doing that though.

It is muted, because the solo button is active in the last track (the exclamation mark). Deactivate that.

Oh well. That solved it. That means I did the same mistake in most of my other videos.


text:
How do I do this Text animation in Sony Vegas (..or AE)?
Sometimes, when I have a look at music videos, I see lyric texts coming up. They are shaped in a rectangle, with different sized words. An example is this, which I made quickly.

What is this effect called?
Let's say I have a music video. And I want to add lyrics to it, just like the example. How would I do this, animated, showing one by one in Sony Vegas Pro 13, or Adobe After Effects (Preferably Sony Vegas, I at used to the controls more)?

How is it exactly related?

Sony Vegas was not designed for such tasks, you have to use AE...

It's called Kinetic Type generally (that link is for Templates). Depending on what you're looking to do you either need to do it manually or can use scripting to auto-fill a list of words. If you auto-fill with a list its generally more randomized, so if sequence is important. Like you want the Lyrics to appear in the order they're spoken you must do it manually.
You can use After Effects or Flash to create something like this.

Tools to help make Kinetic Typography (Video Stack Exchange for After Effects)
Using a Script to do it automatically with random words (Levitated.net for Flash)


text:
Wattage for green screen lightning
What is the minimum wattage for four-point lighting for a green screen?
I am planning to use led lights in a home studio. Is this enough?

Key light: 300W
Fill light: reflector
Back light: 150W
Light pointed towards the greenscreen: 150W

UPDATE
I think I should rephrase my question to: What settings do I need to use to get a crisp image for a greenscreen? Something like this:

I'm using four softboxes as a light source and one reflector. I was thinking in placing my subject less than 1 m away from the key light and 2 m away from the greenscreen. Something like this

I have a f1.8 lens on a Canon T3i. Do you think this would be enough?

There is no such thing as a minimum wattage of lighting for green screen work or any situation. It is more about the amount of light falling on your subject. The light output of the lamps (in lumens), the type of fixture (fresnel, Chinese lantern, cheap flood, etc.), distance from the subject (inverse square law), and the artistic qualities of lighting you are going for all factor in. How big is your subject? What type of video are you producing? What style are you going for?

@MichaelLiebman Thank you for your advice. I did some research and came up with the setup I described in my updated answer. Do you think this is enough to get a decent picture?

You want ZERO lens vignetting. You want a perfectly flat green, no darkness in the corners at all to get the cleanest key. See my response/answer below.

Wattage has nothing to do with lumens, as different instruments provide a wide spectrum of output lumens based on lamp type. For instance, a 1.2K HMI ArriLite would put out more light than a 5000W tungsten lamp. LED, and flourescents are similar, higher output, less watts.
What is critical for greenscreen work is that you use a monitor with a simple waveform scope. When you light your greenscreen, on your waveform monitor you will see basically a horizontal line.
You want to get that line as straight and as thin as possible, at 70-72 IRE. Its fairly challenging the larger the screen (you won't be able to do this with the naked eye).
After your screen is "flat lined". Put in your on camera talent and light them for picture, using dimmers, silks, scrims etc, to cut the light.
If you do it the other way around, you will drive yourself crazy trying to get the screen at flatline 72.
This will give you the best possible key. If you have variance in your IRE (darker corners, even 5 IRE) you will have to use a looser key (meaning more edge artifacting).
I recommend for post KeyLight for AE, Lightwrap for AE.
Also, using a premium screen really makes things easier. Hollywood Rags makes an Ultra Key cloth (order by size) that is ultra bright, the material they use, therefor you need less light to get it to 72 IRE. It really pops.
Last tip most people don't know, based on your Kelvin, use the same Kelvin for ALL lamps. For your hair light; hit your talent from behind, and gel it using 1/8 magenta CTM.   The magenta is complimentary to green, and will give you a clean edge, specifically on the hair.
Hope this helps!

why does everybody call it "the talent"???

TLDR: LOTS and that depends primarily on your camera, lens and size of your green screen.
A good green screen is slightly darker than middle gray. Below is a photo of mine:

To pull a good key you need to have low noise and good separation of the subject from the background (i.e. sharp edges).
So let's say you want to shoot at ISO 100 (low noise) and F5.6 (b/c sharp edges) and 1/100 shutter speed (to avoid motion blur, again sharp edges). In this case the illuminance of the green screen needs to be in thousands of lux. Let's say it's 6000 lux. Now how big is your green screen? Mine is 2m by 2m (for a static medium shot), which means 4 square meters. That means that I need 4m * 6000lx = 24000 lumens to illuminate it.
Now there is no light that will lit your green screen and nothing else, so you need some reserve. So let's say you need a total of 40k lumens (lots will be lost in diffusion or light outside of the green screen). That is about eight 1.5m 60W fluorescent tubes, which means 500W of power.
Now if you shoot with a camera that has low enough noise at 400 ISO and don't plan on moving much (so 1/50th shutter) you need 8x less light. If you get acceptable depth of field with f2.8, you'll need 4x less light again, etc. etc.


text:
Fade text background on one end in Sony Vegas Pro 13
In Sony Vegas Pro 13, I've masked the part where I want the text's black background to appear. It looks like this:

Now, I want to fade one part of the background like in below picture, where right side of the text background is faded.

How do I do it?

What you are looking for is luma keying.
With luma keying, you provide a greyscale image to represent degrees of transparency (properly called an alpha channel) in addition to your background and foreground images. I have not used it in Vegas Pro, but here is a link to a tutorial:


text:
FFMPEG - Image before video
I need to put an image before a video with FFMPEG. The image should not be instead of the video but before. The best is if I can choose a number of frames to show the image, instead of seconds. I'm going to run the command via PHP exec.
I tried some commands but could not get them to properly work via exec or directly via CMD.
So tips on how this could be achieved is appreciated.
How can I make the output an .mxf file? When I only change the extension of output file I get:
    Could not write header for output file #0 <incorrect code parameters ?>: Error number -1 occurred

Command used:
    ffmpeg -r 30 -loop 1 -t 3 -i image.jpg -i video.mxf -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" out.mxf

FFprobe output:
    ffprobe version N-74751-gb54e03c Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 59.100 / 56. 59.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.100 /  5. 40.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mxf @ 000000000310b8a0] broken or empty index
Input #0, mxf, from 'C:/video.mxf':
  Metadata:
    uid             : 8206ba85-3954-2f4a-9d3c-c4e8d5ba793a
    generation_uid  : de90d87a-f4a7-944c-b6c1-368903cb7a3f
    company_name    : Rhozet
    product_name    : Carbon
    product_version : 1.00
    product_uid     : 060e2b34-0401-0101-0e00-000000000000
    modification_date: 2015-10-30 15:45:05
    material_package_umid: 0x060A2B340101010501010D33130000009BC9C7D36B3F43438EAECC12C87EB630
    timecode        : 00:00:00:00
  Duration: 00:00:42.04, start: 0.000000, bitrate: 36660 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:9: Data: none
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
      data_type       : vbi_vanc_smpte_436M
Unsupported codec with id 0 for input stream 9

Please paste the full command you're using for MXF output.

MXF has restrictions on the audio and video streams it can contain, so what's the info about the source MXF. Paste the output of ffprobe.

Looks like ffmpeg may not be able to mux all streams into a new MXF but ffmbc might. I'll check later.

Use this:
ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -encoding_parameters -map "[v]" -map "[a]" output.mp4

Ideally set 'r' of image to frame rate of video. The 'r' will be the framerate of the output as well.
The 't' before the image input and the dummy audio input should be the same and represents the image hold in seconds.
The image should be the same resolution as the video. Else, scale (and pad) one or the other in the filter chain before the concat operation.
Edit: Here's a commandline with some common encoding parameters set
ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" output.mp4

I ran it in cmd and got this error: "Unrecognized option: 'encoding paramters'. Error splitting the argument list: Option not found. I only changed the "video", "image" and "output.mp4" from your line, everything else was the same

Sorry, looks like you're new to ffmpeg. That was a placeholder text to substitute your actual encoding parameters there. I'll update my answer with some common settings.

Wow that's embarrassing, I diden't realise what it actually said... Thanks :)

Thank you alot it works, how can I get frame rate of the video?

If you run ffprobe "video", the console output will show file details and in the video stream, there will be something like 'X fps'. X is your framerate.

@jdoe and Mulvya: ideally you could generate the still-image part of the video and merge it with the already-encoded video, so you don't have to re-encode the entire video.  That's slow and lossy.  If your videos are all in the same format, it shouldn't be too hard.  If you have to detect wmv vs mp4 vs avi, or arbitrary codecs within those containers, it would be messy.

Also, instead of duplicating the image for n frames, you could make a VFR video that just had the one image frame displayed for whatever time period you want, before the rest of the video.

Depending on the codec/format of the video, maybe concat copy wouldn't be possible. About the VFR issue, I'm unsure if ffmpeg outputs VFR MP4.

Just a few nits: the image file demuxer should use -framerate instead of -r, anullsrc is faster than aevalsrc (but that's insignificant), and the -t does not need to match; it only needs to be very short as long as it is shorter than the related video stream because concat will pad the rest automatically.


text:
Encode video for html5 and javascript controlled playback
I want to create something like Apples Mac Pro product page http://www.apple.com/de/mac-pro/ where html5 video playback is being controlled via javascript (by manually setting the currentTime attribute of the video). It works perfectly when I use their video but not at all with my own videos. How can I convert my videos so that they play back nicely?
Using ffmpeg I tried everything I could think of like

removing the audio track
decreasing the videos dimensions
decreasing the framerate
setting the framerate to 30fps (like in apples video)
converting their video to jpgs and create a video from those frames (i thought maybe the color-spectrum made a difference (mainly black))
different options for quality (-crf [18-30] -preset [veryslow-veryfast])
decreasing the length of the video (apple’s video is 47s long)

I also tried some different options of handbrake but nothing helped.
http://movies.apple.com/media/us/mac-pro/2013/16C1b6b5-1d91-4fef-891e-ff2fc1c1bb58/videos/macpro_main_desktop.mp4
ffmpeg -i macpro_main_desktop.mp4

shows:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'macpro_main_desktop.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42mp41
    creation_time   : 2013-10-16 22:55:31
  Duration: 00:00:47.03, start: 0.000000, bitrate: d kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1120x840, 2797 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2013-10-16 22:55:31
      handler_name    : Apple Video Media Handler
    Stream #0:1(eng): Data: none (rtp  / 0x20707472), 139 kb/s
    Metadata:
      creation_time   : 2013-10-16 22:55:31
      handler_name    : hint media handler

here is an example of the videos I encoded via ffmpeg:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-720-main-30fps.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.15.102
  Duration: 00:05:00.49, start: 0.033333, bitrate: 420 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 284 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

I doubt the presence of an audio track or frame size or rate has anything to do with it. Try adding a hint track, like in the Apple video, so "-movflags faststart+rtphint"

Are you sure that the problem is not your HTML or Javasript code? Embedding videos in HTML5 is kinda tricky, especially if you want to control it using custom controls/Javascript

Hi. @Mulvya thanks for the hint with the hint track. It really helped but playback is still really slow. @ MoritzLost I am quite sure that the video is the problem because when I use apples video I can scrub through without any lag. The code is extremely simple atm. I just update the video's currentTime property on scroll.

Can you link to your and Apple's videos?

@Mulvya I added the links.

First change I would suggest is to encode in main or baseline profile, so try "-profile:v baseline" first. Maybe the fewer reference frames makes a difference.

Nice. It reacts much faster now. (At least in Chrome and Safari) ffmpeg -i input.mp4 -profile:v baseline -movflags faststart+rtphint output.mp4
Are there any more tweaks that could improve it even more?

You could add "-x264opts keyint=3:min-keyint=2" to further mimic the Apple file.

The Apple video uses a profile with fewer reference frames and also carries a streaming hint track.
The following ffmpeg command template should create a quick seeking MP4 file:
ffmpeg -i input -c:v libx264 -profile:v baseline -x264opts keyint=3:min-keyint=2 -{other video encoding parameters} -{audio encoding parameters} -movflags +faststart+rtphint output.mp4

Given the profile and GOP sizes set, compression effiency won't be great.

@gang Did this solve your problem? I tried this but am still stuck with a slow scrub :-(

Show the full console output of the command you ran. You can upload it to pastebin or the like.

@bennlich yes this solved my problem.

@Mulvya thar she blows: http://pastebin.com/tiSDPAVZ

Add -r 25. What I can see is that you have a variable frame rate input with an incorrectly flagged FPS value stored in the container and that's leading FFmpeg to use very large timebase values.

No luck :-( New output: http://pastebin.com/e9aJpyF1
The very large timebase values you're referring to is what's reported as tbn? Also, where do you see the incorrectly flagged FPS stored in the container?

The tbr of your input - that's the stored or assumed framerate. fps shown by ffmpeg is total frames / duration. What are you testing the scrub in, and do you have a file that scrubs fast?

Here's the info on a file that scrubs very quickly: http://pastebin.com/z1WdEYAK. I'm scrubbing in an HTML5 video element, like here: http://codepen.io/gfschultheiss/pen/zvQmPz.

@Mulvya Also wondering--how does tbr affect seeking speed?

Unless if's very high, it shouldn't. Bitrate matters more.

Mmm k. Did you notice any clues in the dump from the quickly scrubbing file (http://pastebin.com/z1WdEYAK)? I'm not sure where to look next.


text:
Adobe Premiere CS5 match sequence settings but change codec
So I have a flash video that I tried converting to MPEG4 (H.264) in Adobe Premiere. I simply copied the .flv clip and the created a new sequence by dragging the clip to the new item icon:

I this gave me a new Sequence with Sequence settings that matched the clip:

I then go to Export where I want to maintain the aspect ratio of the clip, no black bars on the top, right, bottom or left. If I check "Match Sequence Settings" I cannot change the format, no surprises there:
:
So I tried to do a custom H.264 and I unlink the Frame Width and Height, and a Pixel Aspect Ratio of square pixels but this gives me black bars on top and bottom (letterboxing) of the final Export, no surprises there:

Since I am amateur hour, I tried a free online flash to mpeg4 converter
http://video.online-convert.com/convert-to-mp4
This actually gave me the full screen mpeg4 with no letterboxing and you can see it in action here in Chrome, Firefox and Safari here (Press play button towards bottom center):
http://beta2.cmykpress.com/
The thing is, I think the free online converter tool gave me some kind of messed up video because Chrome browser is making 3 requests for this video to download while it only makes one request for my Adobe Premiere video converted mpeg4 which you can see here:
http://beta2.cmykpress.com/Home/DifferentMpeg4
So the mpeg4 converted using the online converter seems to be causing bugs in Chrome HTML video player over time so I want to try and figure out how to covert my flash to mpeg4, maintaining the aspect ratio, full screen video with no letterboxing.
Like you see here: http://beta2.cmykpress.com/
My Adobe Premiere export results so far are what you see here: http://beta2.cmykpress.com/Home/DifferentMpeg4

FLV is an Adobe container for streaming video. Historically, FLVs usually contained a variety of codecs (such as FLV1, Sorenson..etc) but nowadays it's usually H.264. Which is to say, the video may already be MP4 compatible. You may not need to recompress the video at all, and could simply transfer it from a FLV container to MP4, bypassing Premiere. ffmpeg is a tool that can do this. Download the 32-bit static build from here and the run the following command:
ffmpeg -i input.flv -c copy -movflags +faststart output.mp4

If the source video is not in fact H264, then try
ffmpeg -i input.flv -c:v libx264 -crf 23 -c:a aac -strict -2 -b:a 128 -movflags +faststart output.mp4


text:
Sony Vegas rendering only audio plus first frame of project
I have Sony Vegas Pro 13.0 and have been using it for a while now without any issues. I have been working on a video project and rendered several drafts so far, all without any issues. I finished my final edit and followed some tips i found online to play with my project properties and played around with different render templates. However, when I finally rendered my video, the result was just the audio of the file with a small picture of the first frame of my video as the only visual. I have tried everything I can think of, including re installing SV. I am in need of a quick answer. Please help.

Found the fix, although bemused at the stupidity of it. Group all the layers as one.

I'm confused - was the grouping the problem or solution? It shouldn't be the solution, because layer grouping is NOT required for a proper render.

@Mulvya It was the solution. As confused as you are. I was at the point that I had nothing to lose and was just trying anything. Luckily, something worked.

If you don't mind sharing a screenshot of the timeline and some details, maybe I can diagnose why the grouping solved it. Could be useful for someone with the same root cause.

@Mulvya Here is the link to the screenshots. Don't hesitate to ask any other questions.
http://imgur.com/a/m6Weh

@Mulvya Same problem again. Grouping doesn't fix. Beyond frustrated.


text:
Smoothly keyframing a wheel to decelerate from point A to B
I am trying to accomplish this:
I have a transparent image, a wheel that can be rotated and moved in DaVinci Resolve (that's what I am using but I guess a solution to this could apply in any editor).

I want this wheel to come from off the screen in motion, and stop at the end of the screen without any jerky movement.... but it should decelerate as it goes along. Smoothly. How should I accomplish this? I've given multiple tries to this and failed. There's always some jerky movement. I think it is a matter of getting things mathematically right lol.
Following are the transform controls we can see in Resolve, for reference (these are not values I've set for this wheel, just to show you the two controls I was trying to modify. Position and rotation angle.

I have done this successfully in DaVinci Resolve but had to ballpark a lot of things and adjust with trial and error. I am just curious if there is a way to get this right in a way that even if I had to change any parameter like rotation angle or distance, it wouldn't mess up my whole timeline. Thanks.

For good or bad, in Davinci it's all about maths. Since you want to move the wheel you will change position x/y and rotation, as you mentioned. But you will have to add time points and make the calculations (i.e. if you want to speed up/slow down, change move/rotation direction etc).
For example you want to have the motion for 5 secs, 1 full rotation lasts 1 secs. So you are gone have something like that:
time=0s x=-200, rotation=0
time=1s, rotation=360
time=2s, rotation=720
time=2.5s, x=0
time=3s, rotation=1080
time=4s, rotation=1440
time=5s, x=200,rotation=1800

I hope to help you out a little.. :)