text:
How can I record Adobe Flash Player stream
I am learning English and I want to record this stream.
It's using Flash Player and in addition include PDF doc.
Thanks for your interest.

It's a little unclear what you're asking. Can you ask the question in another way?

Use a browser plugin such as https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/.
When you go to the page after installing, an icon will alert you to downloadable media and provide you different formats if they are available.

I don't know about legal part of downloading video from youtube... But you can do it without installation of any side softwere:
Write "ss" in the link before "youtube.com" part. So, if it was

https: //www.youtube.com/watch?v=Bpc2jmNpL78

Make it

https: //www.ssyoutube.com/watch?v=Bpc2jmNpL78

Wait a little bit, and you will see download link:

sorry,you misunderstanded me I want download flash player video and in addition include with PDF doc


text:
ffmpeg drawtext text parameter expressions
I am trying to write text on a video in such a way that the text "writes itself" - letter by letter.
To do this I was able to do something like this:
-vf "[in]drawtext=text='a':fontfile='/Windows/Fonts/arial.ttf'\
:enable='between(t\,1\,1.5)':x=300:y=(h)-100-th, \
drawtext=text='ab':fontfile='/Windows/Fonts/arial.ttf':enable='between(t\,1.5\,2)':\
x=300:y=(h)-100-th"

This replaces the text on screen with a new one every half a second adding a new character. ( a changes to ab ). Obviously if the texts are long than this line would be really long.
I was able to do something similar and shorter with :
-vf "[in]drawtext=fontsize=80:shadowcolor=Black:shadowx=2:shadowy=2:fontcolor=White:\
fontfile='/Windows/Fonts/arial.ttf':text='%{expr\:if(gt(t\,1.5)\,12\,1)}':\
x=300:y=(h)-100-th"

Where the text itself is an expression dependent on time. However this only works for numbers: 1 changes to 12 (ignoring the numbers after the decimal point for now).
Now the issue is that if I try to do the same expression for texts (a->ab) this fails. and I get:

Expression 'if(gt(t,1.5),ab,a)' for the expr text expansion function is not valid.

The question is: Is it possible to have the expression return the actual text after expansion and not just numbers?.
Thanks in advance for anyone helping!

Try with 'if(gt(t,1.5),'ab','a')'

tried that (and with all conbinations of , ' " etc...) didn't help

Other than the ultralong multiple drawtexts approach, your choice is to draw the full text to a blank canvas, animate a crop and overlay the result on the video.

Thats an interesting idea.... But can I do it with a transparent background so to overlay just the text?

Yeah, use color=black@0.0:WxH

ah.... thats a little over my head. I assume I need to create a mov file that has an alpha channel somehow?
I trried this with no success:
ffmpeg -f lavfi -i color=c=0x00000000:s=320x240:d=2 -vcodec qtrle -pix_fmt argb -vf "drawtext=fontfile=/Windows/Fonts/arial.ttf:fontsize=30:fontcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/2:text='Stack Overflow'" -y output.mov

Give me till tomorrow. I'll work this out.

Ok, it can be done, but it's inelegant and has limitations, which make it in the end, not worthwhile. The limitation is that this only properly works with fixed-width fonts. And due to a still-unfixed-bug in ffmpeg, it will look somewhat ugly.
But here it is,
ffmpeg -i input.mp4 -lavfi "color=white:1280x120,fps=30[c]; \
[c]format=rgba, \
drawtext=fontfile=cour.ttf:fontcolor=red:fontsize=60:text='    A   AB  ABC ABCD':x=0:y=0, \
crop=144:120:min(144*trunc(2*t)\,432):0, \
colorkey=FFFFFF:0.01:1,setpts=PTS+(delay/TB)[tx]; \
[0:v][tx]overlay=576:600[out]" \
-map [out] -map 0:a -c:a copy output.mp4

The basic flow is

create an opaque canvas - I used full width as my video input and enough height to contain the text, and I used the same framerate as my video
On this canvas, draw the text once. The basic method here is to animate the crop window. So if your text is 5 characters long, then your print string is text='     1    12   123  1234 12345'. The idea is that the crop width is equal to the full string width and the crop source shifts one string width periodically, thus simulating typing, since each new cropped area contains one additional character. So, first 5 blank spaces for the 5 characters, then after the first 1 there are four spaces to pad out till a full string width is reached, then the 2nd stage text follows with 2 characters and 3 spaces, and so on. I've specified the color space of RGBA since it seemed to provide better results in the keying step further on.
Now the canvas with text on it is cropped. Width is the full string width, and I've kept the same height, but as long it doesn't cut the text, doesn't matter. The crop offset X is animated as follows: StringWidth * integer part of (time divided by period). This shifts the crop window right by one string width after every period i.e. 0.5 seconds in this case. Now, this is enclosed in a minimum function because we want the crop to stay still after all characters have been printed. So, the 2nd value is stringWidth * (no. of characters - 1). Y isn't animated since this is one line only.
The next part makes it ugly. Because of the bug, I kept the background opaque. So, now it has to be chroma keyed out. The filter looks for the BG color of white, and selects only that color (0.01) and fully blends it. I was hoping to smooth out the edges. But doesn't work very well.
The setpts allows to set a delay in seconds. The first character will appear at delay + period seconds.
Finally, we simply overlay the result on the video.

ok this is really complicated.. I will check this and see if I can handle it. Could it have been done using several iterations and not trying to do it all in command pass. and (sorry if this is wrong etiquette) but are you available to do some freelance work on this project... it is clear that I am out of my league here.

Well looks like ffmpeg is crashing after consuming too much memory every time I run this. And since I cannot use fixed width fonts I need to explore different routes. Can maybe I render a stand alone video that has the name, and a simple croping from left to right. Than overlay that video onto the other video. Maybe the first video has transperancy/alpha, or maybe just use chromakey (green screen) when overlaying with no need for alpha channel? Anyway, let me know if you are available for freelance or know anyone that is . Thanks for all the help...

leave your email and I'll get in touch.

eran_stackoverflow_nzxy at mailnicks dot org

source: Stack Exchange

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

sort: votes


text:
How to set double fps for tbc option of video
I need to set tbc option for output video. For example, input video has 25 fps with 50 tbc and my encoded video has 25fps with 25 tbc. I used settb and video_track_timescale but these options did not change tbc. So my question is how can i set double fps for tbc?
Input video log

Duration: 00:04:41.33, start: 0.000000, bitrate: 1258 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1064 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)

Output video log

Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720
    [SAR 1:1 DAR 16:9], q=-1--1, max. 1835 kb/s, 25 fps, 12800 tbn, 25 tbc (default)

The ffmpeg command
ffmpeg -y -i input.mp4 -filter_complex "scale=-2:'min(720,ih)',fps=25" -codec:v libx264
    -profile:v high -level 4.0 -preset slow -minrate 1835k -maxrate 1835k -bufsize 2441k
    -c:a aac -strict experimental -q:a 9 -crf 20 -pix_fmt yuv420p
    output.mp4 1> output.log 2>&1

Full output log
ffmpeg version N-76684-g1fe82ab Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  6.100 / 55.  6.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 14.100 / 57. 14.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2015-02-20 11:51:25
  Duration: 00:04:41.33, start: 0.000000, bitrate: 1258 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1064 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2015-02-20 11:51:26
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[libx264 @ 0000001d2ffe0a00] using SAR=1/1
[libx264 @ 0000001d2ffe0a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0000001d2ffe0a00] profile High, level 4.0
[libx264 @ 0000001d2ffe0a00] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1835 vbv_bufsize=2441 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.14.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, max. 1835 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc57.15.100 libx264
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2015-02-20 11:51:26
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 (h264) -> scale (graph 0)
  settb (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame=    3 fps=0.0 q=0.0 size=       0kB time=00:00:05.89 bitrate=   0.1kbits/s dup=0 drop=148

Also in output video, i see option q=-1--1. What is this? How can i configure this option?

Is this to create 25 PsF streams or what is the purpose of the operation?

@HansMeiser No, i just wanted to set double tbc from fps. Now i understood that there is no neccessary to change this option.

Add -r 25 to your command.
The q readout refers to the allowed range for the quantizer. There's no bounds applied in your command, but you can limit by setting one or both of
-qmin N and -qmax N
Unless you have good reason to, don't change it.

How would this set the tbc to 50? I have exactly the same problem, I need to set tbc to 25 while keeping fps to 50

That's the opposite problem: tbc of 25 and fps of 50. -r will set the framerate and libx264 sets its time base (tbc) to twice that.

You can accomplish that by adding -r 25 or even -r 60, as you like to experiment. Here's example:
 ffmpeg -r 25 -i input.mov codec:v copy codec:a copy -f mp4 output.mp4

instead of
ffmpeg -i input.mov codec:v copy -r 25 codec:a copy -f mp4 output.mp4

The key I found to be in control exactly what I wanted is to place -r 25 right before the input agrument.

When streamcopying, this only works for raw video streams.

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

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


text:
Browser-based non-webrtc webcam capture
I have a small hobby project based on live streaming. My streaming server likes RTMP. Currently, the broadcasters use native solutions like OBS, FFmpeg or VLC for publishing webcam and mic input to my streaming server. I want a browser-based solution for this publishing bit.
I'd want to avoid Flash as far as possible (ready-made solutions that can be plugged in directly are okay).
The other option I have been exploring is WebRTC. I don't mind the insufficient browser support but can't seem to figure out how to publish it to an RTMP server.
In short, I need either:

A Flash-based live webcam stream capturing software that I can use with little tweaking.
A way of publishing WebRTC streams to an RTMP server.
Any other way of capturing webcam and mic streams in the browser.

Thanks in advance!

If you can afford to buy a used BlackMagic H.264 ProCoder, it's a fantastic device, allowing you to input either a HDMI or HD-SDI signal and push to either RTMP or HTTP via h.264 -- with full control over bitrate, along with multiple streams (which the user's computer would chose based on their connection speed). So you could simultaneously push a medium and high quality stream in real time.
The device also does all the encoding in the box; putting no strain on your CPU or GPU; which allows you to run it on a fairly simple system even at very high quality streams.
If you need a different input than what the pro-coder has; BM has a full line of adapter units (composite to HD-SDI; etc) to get what ever your source is; to whatever your input needs are.
It's a workhorse.
Lastly; combine the box with livestream; a pro account (about $60 a month) and you are all set.

as an AD.3
you can use HLS or you can use WebRTC with h264 or webm DASH
for DASH it somewhat blurry form me (no straight answer for ffmpeg), but as for the HLS this is supported in a straightforward fashion look here
Some time ago I was looking for a way to publish an h264 stream from the IPCam without the need of extra user actions.
I came across Janus Gateway, this bit of software consumes RTP streams (amongst others types of media) and publishes it as WebRTC media to the browser.
So basically I did the following:

used ffmpeg as an rtsp client and encoder to publish audio and video (separately) as RTP streams
I have setup Janus streaming plugin to accept h264 RTP stream and audio stream (descriptions are coming from the RTSP sdp file)

and it worked just nice.
I had some issues with the h264 from the IPcam so I had to re-encode it using x264 to be visible in the browsers.
Ideally Janus has a support for RTSP, but it seems it's lacking option of interleaved TCP transport of RTP and RTCP, and besides I had to re-encode the stream one way or another.
This are the configs I  have used:
Janus - file janus.plugin.streaming.cfg:
[h264-sample]
type = rtp
id = 1
description = H.264 live stream test
audio = yes
video = yes
audioport = 8005
audiopt = 8
audiortpmap = PCMA/8000
videoport = 8004
videopt = 126
videortpmap = H264/90000
videofmtp = profile-level-id=42e01f\;packetization-mode=1

the ffmpeg stream feeding the pipes should look like that (you can of course re-encode whatever you like in this fashion):
ffmpeg -rtsp_transport tcp -i rtsp://hostname:port/description.sdp \
-an -c:v h264 -profile:v baseline -preset ultrafast -tune zerolatency -f rtp rtp://localhost:8004 \
-vn -acodec copy -f rtp rtp://localhost:8005

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


text:
ffmpeg: preserve timecode when converting mp4 to mov
I have .mp4 files created by a Sony A7s camera. They're using the XAVC S codec. I'm converting them to .mov using the command below. The original files have a timecode but that is not present in the output file. The output files have their timecodes set to zero. Is there any way to preserve the timecode?
ffmpeg -i [filenmae] -vcodec copy -acodec copy [outputDirectory]

Short answer specific to this problem:
Use this option:
-map_metadata 0:s:2

Explanation:
Timecode often comes in a format specific to the file format, so ffmpeg can't be expected to just 'copy' it without getting explicit instructions.
In Sony a7siii 4k 10bit footage mp4 file, there is a separate 'data' stream to which it is added as a metadata. It is usually stream indexed 2 (the third stream), but you can use this command to determine it for yourself:
ffmpeg -i inputfile.mp4

This will display info about all the input streams, including the metadata.
Example output (excerpts):
ffmpeg version...
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inputfile.mp4':
  Metadata:
...
  Stream #0:0(und): Video: h264...
...
  Stream #0:2(und): Data: none (rtmd / 0x646D7472), 2252 kb/s (default)
    Metadata:
      creation_time   : 2021-06-19T16:39:17.000000Z
      handler_name    : Timed Metadata Media Handler
      timecode        : 07:15:07:17

Now, note that timecode is attached as metadata to a separate 'data' stream, which needs to be present in the output for a simple -map_metadata 0 to work. Since it cannot be copied, we need to map that metadata to the global metadata of the file itself.
Note down the stream number containing the timecode, in this example stream 2 of input 0, and map it to global metadata using -map_metadata 0:s:2.
ffmpeg -i inputfile.mp4 -map_metadata 0:s:2 -c copy outputfile.mov

This should map metadata of the stream indexed 2 (s:2) from the first input (0:) to the global (default) metadata of the output file, and copy audio-video streams as they are.
Note that the numbering and the meaning of 's' is different than how it is in other more common options. Check more info in the advanced options part of the ffmpeg documentation.
ffmpeg then reads whatever it understands from that stream's metadata (which includes timecode), converts it to the destination file format's ideal metadata format, and includes it in the output.
The resulting file will have a timecode recognizable in editing software like DaVinci Resolve and Premiere Pro.
I tried other options like -write_tmcd and several forms of  -map 0 with and without -copy_unknown but they didn't work, probably because ffmpeg currently needs to understand what it is copying.
Note that this does not copy the whole data stream, just its metadata. For our current requirement this is okay.
Also, since I was converting to prores422hq, my exact command (that worked) was this:
ffmpeg -i inputfile.mp4 -map_metadata 0:s:2 -c:v prores_ks -profile hq -c:a pcm_s16le outputfile.mov

Welcome! Thanks for an awesome, detailed first answer!

Just use copy for all streams i.e.
ffmpeg -i [filename] -c copy -map 0 [outputDirectory]

Edit: Let's switch byte-order
ffmpeg -i [filename] -c copy -c:a pcm_s16le -map 0 [outputDirectory]

Thanks for the suggestion. I tried it and it copied the timecode, but it didn't copy the audio. I tried it like this " -acodec copy -c copy -map 0" but still no audio.
It also gave this message on both your version and the one I modified:
[NULL @ 0000000005795f00] Unknown hldr_type for rtmd / 0x646D7472, writing dummy

Paste the full console output of the command you ran into the question.

http://pastebin.com/FRey8JZE

As per that readout, the audio was copied successfully. What does ffprobe C0371.mov say?

You're right, it did copy the audio. The problem I have is that the program I'm using, Davinci Resolve, will read the audio created  using the original command, "-vcodec copy -acodec copy",  but won't read the audio created using the modified version. That's a problem, because the sole reason I'm doing the conversion is so that Davinci Resolve will read the audio. This is the ffprobe output for both files http://pastebin.com/Wbkn3nat

Try new command in answer.

The first time I tried the new version, it told me that it couldn't find a compatible output format, so I changed the output file to have .mov extension. It created the output file but it doesn't have audio or timecode. This is the output: http://pastebin.com/vfcYd1uT  This is the test file I'm using: https://goo.gl/xilYd9

This looks to be a DaVinci issue rather than ffmpeg. I used your source file with my commands and the result plays with audio in Sony vegas and Premiere Pro CC but not in Resolve 11 (the version I have). I don't use Resolve for editing, so if you can find a guide to what Resolve needs in a MP4/MOV, I can tweak my command.

In case someone else comes looking for this, timecode in mp4 and mov files is often a "data" track, and ffmpeg usually drops data tracks. To keep all tracks, I usually use these switches to map tracks from the source to tracks in the destination
-map 0:v (video switches)
-map 0:a (audio switches)
-map 0:d (this keeps the data track)

Which also has the advantage of keeping all the source audio tracks, rather than the default of only the first one. So your command might look like
ffmpeg -i [filename] -map 0:v -codec:v copy -map 0:a -codec:a copy -map 0:d [outputDirectory]

EDIT: In modern ffmpeg you can also add a question mark (like -0:a?) which means ffmpeg will keep going if it doesn't find a track like you asked it to copy

Timecode and lot of other informations does not belong to video or audio streams, they are metadata attributes.
FFmpeg has lot of command to manipulate metadata attributes, for the specific question you can give a look to my previous question and relative answer: ffmpeg Cut a media preserving all streams but also all metadata, timecodes and everything else
Please consider that metadata tends to change from format to format, so probably you have to find the right metadata field on the original Sony .mp4, parse it properly and write it changed or renamed into the new .mov file, following the QuickTime .mov specifications for timecode definition.


text:
Merging mp4 video stream with subtitles for use in creating DVD
Suppose I have two files called foo.mp4 and foo.srt. The mp4 file doesn't have subtitles, and I want to add subtitles from the foo.srt file.
The utility mencoder is frequently recommended in this context. I tried using, for example:
mencoder foo.mp4 -sub foo.srt -ovc lavc -oac copy -o foo.mpg

This worked for me before. However, here I get
Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.

I don't know what this means. Running mediainfo on this file gives the following information for the audio stream.
Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 1h 47mn
Bit rate mode                            : Variable
Bit rate                                 : 93.7 Kbps
Maximum bit rate                         : 110 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 71.8 MiB (9%)
Language                                 : English
Encoded date                             : UTC 2014-11-19 03:58:38
Tagged date                              : UTC 2014-11-19 03:58:40

Trying
mencoder foo.mp4 -sub foo.srt -ovc lavc -oac pcm -o foo.mpg

works, but produces a video that is visibly worse with regard to quality.
I suppose ffmpeg could also be an option, but I've not figured out how to use it to do this.
I'm using Debian wheezy. The versions of mencoder and ffmpeg that ship with wheezy are:
2:1.0~rc4.dfsg1+svn34540-1+deb7u1 (mencoder)
6:0.8.16-1 (ffmpeg)
However, I managed to backport a newer version of ffmpeg from unstable,
namely: 7:2.5.1-1.

What output format do you want exactly? I see you used the AVI container in the question, but that doesn't tell me your desired video and audio formats.

@LordNeckbeard Hi. The avi was a typo. The answer is, whatever I can eventually create a DVD with. This usually involves creating a DVD structure, and then an ISO from that. The first step involves creating a file from the original video file using ffmpeg, and I give this a mpg extension for reasons I'm not clear. After that this file is processed by dvdauthor to produce a directory structure, and then converted into an iso with genisoimage. So, I suppose that answer is, whatever formats work.

Use the subtitles filter to create hardsubs ("burnt-in" subtitles):
ffmpeg -i input.mp4 -vf subtitles=subs.srt -target pal-dvd output.mpg

-target pal-dvd will make the output have a frame rate of 25 and a frame size of 720x576. If you want NTSC output instead for a frame rate of 30000/1001 and frame size of 720x480, then use -target ntsc-dvd. For a frame rate of 24000/1001 and 720x480 frame size use -target film-dvd.
The old, so-called "ffmpeg" version 0.8.16 in the repo is a counterfeit from a fork that lacks the subtitles filter. If you need the real thing you can simply download a static build.
I do not believe ffmpeg can convert the text-based SRT to the bitmap-based dvdsub/vobsub, but there are probably other tools that can do so. This will allow you to use standard DVD subtitles which can be turned on or off by the viewer.

Thank you. That is very comprehensive. By "counterfeit"   I assume you mean that unfortunate fork? I think that the "7:2.5.1-1" is the real thing, correct? Would the result of -target film-dvd work on a regular DVD player?

@FaheemMitha I assume it is. If you run ffmpeg, the first line in the console output will tell you who developed it. If it displays FFmpeg Developers it is the real thing.

Also, is mencoder not a suitable tool for such a task? It seems to be widely recommended for doing such things on the net.

@FaheemMitha I believe development of mencoder has basically ceased some time ago, but if it works for you and you prefer it, go ahead and use it.

I'd certainly prefer to use something supported, but isn't mencoder part of mplayer? Why do you think mencoder development has ceased?

@FaheemMitha Looks like there has been ~14 commits to mplayer.c since 2012. Last commit was 2014-05-20. Not a perfect means of measurement, but that will give a good idea of activity. Looks like there have been ~7023 commits to FFmpeg since 2014-05-20. Also not a perfect measurement because that includes all commits to the whole project.

Do you mean mencoder.c, perhaps? I don't see an mplayer.c there. I cloned mplayer from svn. svn info gives "Repository Root: svn://svn.mplayerhq.hu/mplayer". And mencoder.c has 10 commits since the beginning of 2013.

@FaheemMitha Yes, that was a typo. Should have been mencoder.c, but the numbers remain the same.

We must be using different repositories. I have 2014-05-21 as the last commit, and it's definitely 10 commits since the beginning of 2013. But it doesn't really matter - I get your point.

@FaheemMitha Same repository. 10 commits since 2013 + 4 more since 2012 = 14.

Oh, you were talking about commits since the beginning of 2012. That was not clear to me. Then, yes, 14 commits since 1st January 2012. And yes, that isn't a lot of activity. Those maybe the software is mature/stable now. Dunno.


text:
Getting FFMPEG to stream video+audio through RTMP
Can someone help me with this:
The video streams fine but I can't hear any audio. I just hear random click sounds. Please help:
ffmpeg -f video4linux2 -channel 1 -i /dev/video0 -f alsa -i plughw:2,0
   -r 25 -vcodec libx264 -strict experimental -acodec aac -b:a 20k -b:v 200k
   -aspect 4:3 -s 320x260 -ar 16000 -ab 32k -async 1 -g 6 -threads 4
   -f flv rtmp://server:1935/live/test1

Any advice on how I should change this to make it work? I am trying this from a raspberry pi 2. All I need is to successfully stream audio+video at this quality since I'm making it work through slow internet connections.
Thanks.
Edit: Here's the output:
ffmpeg version 2.5.8-0ubuntu0.15.04.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Ubuntu/Linaro 4.9.2-10ubuntu13)
  configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --shlibdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 5415.013497, bitrate: 165888 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x576, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'plughw:2,0':
  Duration: N/A, start: 1442225849.423669, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
[libx264 @ 0x1fc9630] using SAR=13/12
[libx264 @ 0x1fc9630] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1fc9630] profile High 4:2:2, level 1.3, 4:2:2 8-bit
[libx264 @ 0x1fc9630] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=4 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=6 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=6 rc=abr mbtree=1 bitrate=200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://my.server.url:1935/live/test1':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv422p, 320x260 [SAR 13:12 DAR 4:3], q=-1--1, 200 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 16000 Hz, stereo, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc56.13.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[alsa @ 0x1fbefd0] ALSA buffer xrun.
frame=   18 fps= 18 q=35.0 size=       0kB time=00:00:00.08 bitrate=  40.9kbits/frame=   29 fps= 19 q=28.0 size=       9kB time=00:00:00.64 bitrate= 117.0kbits/frame=   39 fps= 19 q=26.0 size=      19kB time=00:00:01.15 bitrate= 133.1kbits/[flv @ 0x1fc8860] Failed to update header with correct duration.
[flv @ 0x1fc8860] Failed to update header with correct filesize.
frame=   41 fps= 17 q=-1.0 Lsize=      40kB time=00:00:02.36 bitrate= 140.2kbits/s
video:38kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.042462%
[libx264 @ 0x1fc9630] frame I:7     Avg QP:26.70  size:  4195
[libx264 @ 0x1fc9630] frame P:13    Avg QP:28.14  size:   290
[libx264 @ 0x1fc9630] frame B:21    Avg QP:27.70  size:   262
[libx264 @ 0x1fc9630] consecutive B-frames: 31.7%  0.0%  0.0% 68.3%
[libx264 @ 0x1fc9630] mb I  I16..4: 53.1% 23.9% 23.0%
[libx264 @ 0x1fc9630] mb P  I16..4:  0.4%  0.5%  0.0%  P16..4: 10.3%  1.2%  0.6%  0.0%  0.0%    skip:87.1%
[libx264 @ 0x1fc9630] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 11.5%  0.3%  0.1%  direct: 1.4%  skip:86.5%  L0:34.4% L1:64.5% BI: 1.1%
[libx264 @ 0x1fc9630] final ratefactor: 19.89
[libx264 @ 0x1fc9630] 8x8 transform intra:24.4% inter:75.0%
[libx264 @ 0x1fc9630] coded y,uvDC,uvAC intra: 41.0% 68.8% 43.0% inter: 2.5% 7.3% 2.3%
[libx264 @ 0x1fc9630] i16 v,h,dc,p: 30% 68%  1%  1%
[libx264 @ 0x1fc9630] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 47% 16%  1%  0%  1%  1%  1%  1%
[libx264 @ 0x1fc9630] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 44%  9%  1%  2%  1%  2%  3%  2%
[libx264 @ 0x1fc9630] i8c dc,h,v,p: 25% 45% 28%  2%
[libx264 @ 0x1fc9630] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1fc9630] ref P L0: 83.6%  1.8% 13.1%  1.5%
[libx264 @ 0x1fc9630] ref B L0: 96.3%  3.7%
[libx264 @ 0x1fc9630] ref B L1: 89.7% 10.3%
[libx264 @ 0x1fc9630] kb/s:124.63

Of course you should also include the complete console output from your command.


text:
Wobble/Wiggle effect in Adobe Premiere Pro CC
Is there a way to add a “wiggle” to a keyframable value in Adobe Premiere Pro (CC)? For example, if I wanted an image to jitter back and forth, I could apply such an effect to the rotation value.
There is such an effect in Adobe After Effects: by adding an expression to a value, and typing wiggle(frequency, amplitude, octaves, amplitude multiplier, time) (with numbers instead of the arguments), the value will randomly shift up and down over time depending on what arguments you entered.
tl;dr: Is there a way to produce an effect in Premiere akin to the wiggle() expression in After Effects?

Not on vanilla Adobe premiere. Perhaps there is a plugin, but I wouldn't count on it since Premiere is more about cuts, than gfx.

Can you use Dynamic Linking to do this in After Effects? I realize it's not the cleanest, but if you are trying to produce this effect, it may be your only option. Good luck!

This might work:
You could build a project in after effects (or get someone else who has AE to build it for you?)
Get them to set a wiggle using Expressions.
Convert the expression to keyframes using the Animation menu --> Keyfraem Assistant --> convert to expression to keyframes.
Save the layer as an Essential Graphics template.
Open the Essential Graphics template in Premiere.
The item will have the positional wiggle, but you won't be able to modify the wiggle, or parent anything else to it (the positional variable in Premiere won't be wiggling).
I'm not sure whether this will work if you do not have AE installed - someone would have to try it and see).

There is a free Wiggler effect that works on PPro. https://www.prosya.com/software/wiggler-effect/
The entire wiggle function  wiggle(frequency, amplitude, octaves, amplitude multiplier, time) is implemented as effect params.

I thought the same thing as @tomh.
Although, I might have another idea:

After Effects has a specific window called Wiggler and it allows you to create a wiggle movement based on keyframes (instead of using a script), this way you could copy the keyframes made in AE to your PP position property.


text:
Non-Linear Video Editor for Free or Cheap That Does These Things
Background
I bought a couple of Handycams 6 months ago, and have since then been making videos and editing them and publishing them:
Sathyaish Chakravarthy
Over the period, I have downloaded and toyed with plenty of video editors that are available free of charge. However, I cannot find a single editor that fulfills all my requirements. As a result, I am not able to make the quality of videos I wish to. Also, it takes up a lot of my time.
I am a sole proprietor of a start-up and time is the only asset I have, so being short of time and money, I cannot afford to spend too much of either of them on non-core activities, video editing being one (it's a marketing activity for me, my core activities being learning/studying for the corporate training programs I offer, preparing for them, conducting them, making sales calls, calling into people, etc.)
Until now, I have tried the following software:
1) Jahshaka
2) Windows Movie Maker
3) Avidemux
4) Free Video Cutter
5) Free Video Dub
6) AVI Edit
7) Blaze Media Pro
8) AVI Trimmer
9) t@b ZS4 Video Editor
10) Video Spin
11) Virtual Dub
12) Wax
My Requirements
I require a non-linear video editing software that is either available for free or at a nominal charge (under $100) and allows me to do the following:
a) Use chroma key to change the background. Wax does it but I lose the audio in the output video file. I see it is a problem that many people have reported.
b) Edit the audio in the video file independent of the visual. For example, I may want to mute the audio for a couple of seconds, or replace the audio during a certain 4-second clip with a different audio file (mp3/wav/raw PCM in the audio editor).
c) Mix, append, insert at any point, another video from a different video file into the source video file.
d) Mix, append, insert at any point, only the visual from another video file into the source video file while having the audio of the source video file play for the duration.
e) Insert audio effects -- echo, reverb, generated sounds like bullet shots, etc. into the video.
f) Chop a frame of the video and split it into two vertical copies, one of which is transposed horizontally to create a lateral mirroring effect, and be able to edit each of the copies independently.
To explain point (f), please consider this.
I have a video of me sitting on a chair facing slightly towards my left. I want to take the frames from this video and flip them horizontally so that I now face towards my right instead. Then, I might want to slice each original frame into two vertical images -- the left one being the original image in the frame, and the right one being the laterally inverted/horizontally flipped image. Also, I want that one of the images, say, the laterally inverted image, be black & white instead of color.
Question
Is there a non-linear video editing tool that is available either for free or for less than $100 to do all of these things?
Update: I forgot to mention that I am a Windows user.

Both kdenlive and cinelerra should do all you need. If you can't make them so, try the consumer version of Sony Vegas, it's also still in your price range.

Thank you, leftaroundabout. I'll try these and report back to give you a green checkie for your help. :-)

I forgot to mention that I am a Windows user. Apparently, the first two names you mentioned are not supported on Windows. I'll give Vegas a try.

Indeed, however both run on Linux which to install costs you nothing but some time – a good investment if you ask me. But you don't have to, of course. Incidentally, I do most AV stuff on Windows, too, but only because the hardware drivers of my audio stuff don't support Linux.

You might want to looked at Windows Alternatives to Cinelerra and see if there is anything there.

@jwernery -- I've tried almost all of them already. :-)

As a Windows user, you can download a live CD of Kdenlive. Burn it to a CD, and then it will boot up into a Linux system for you. Or, you could install Virtual Box on Windows (again, free software) and then install the live CD to that. This would allow you to simultaneously use Kdenlive and your Windows system and share file systems between then.

The solution that I currently use is a group of software. First, I do all my keying and complicated visual effects in Blackmagic Fusion. Then I do all my editing, mixing, color correction and very simple effects in Davinci Resolve. Both Fusion and Resolve are from Blackmagic. Resolve doesn't do audio effects on it's own, but supports plugins. You can find said plugins for doing just about anything you can think of at Splice.

You might want to try HitFilm Express (free). It supports all the features that you want.

This post is 9 years old. A lot of things has changed since then.

@Rafael I still suggested it just for the case that someone now finds this question

Yeap. Davinci Resolve, since the other answer was posted has now a built in audio editor.

Have you looked into Adobe Premiere Elements 10? I got it bundled with Photoshop Elements for approx. €55 ($73). I did get a student discount and they had a special deal going on at the time.


text:
Nvidia Cuda video encoder - output frame size
I am cross posting from the Nvidia forums... I got no answer there :(
I am using the Nvidia cuda video encoder nvcuvenc, and until now I was not able to encode an H.264 video with an output frame size different from the input frame size.
My question: Did anyone use this encoder with an output frame size different from the input frame size successfully?
Thanks in advance for any help.

More details:
The sample is the following "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\cudaEncode" , and the encoding works fine for the default config file "704x480-h264" with the plush video.
But the other config files (720x480-h264 for example) don't work and don't seem to be correct because the input size is different than the actual video in the sample!! (I tested with other videos as well... No luck.)
To be precise: Sometimes the encoder crashes with an access violation, sometimes it encodes but the result is messed up ...

Are you quite sure you didn't do anything else wrong? – I suppose this question is better suited for http://stackoverflow.com/questions/tagged/cuda, but you will have to provide a short-selfcontained-compilable-example.

@leftaroundabout I tested many times before posting this (i am asking for feedback to know if it's supported in the first place). Not sure if i need a SSCCE because it's a sample of the SDK so everyone who installed the Nvidia SDK should have it. Should I cross post again on cuda or delete this question totally ? Thanks


text:
How can I make "videosongs"?
Not purely audio, but definitely related!
Jack Conte and Nataly Dawn have "pioneered" the 'videosong' format.

Rule 1 — What you see is what you hear. (No lip-syncing for instruments or voice)
Rule 2 — If you hear it, at some point you see it. (No hidden sounds)

Example — SEPTEMBER!!! by Earth Wind and Fire,
Can anyone suggest how these are made? Preferably with freeware for Windows...

Uhm. You film yourself recording, and then you edit that into a video. It's unclear what the question is.

What free software is capable of editing the videos? Windows Movie Maker doesn't cut it.

Reopened and cleared comments now that video production is on topic.

Their main software tools are Pro Tools for audio and Final Cut Pro for video editing, on MacBook Pro.  Here's Jack's list of gear:  http://jackconte.tumblr.com/Gear
Jack and Nataly gave a tutorial on making videosongs at CELLspace in San Francisco for the Disposable Film Festival a few months ago.  Unfortunately only the song performances afterward have been posted to Youtube so far.  Perhaps if you contact DFF you can track down someone with video of the tutorial and Q&A session.
Perhaps another tool will be able to meet your requirements.
http://en.wikipedia.org/wiki/Comparison_of_video_editing_software

You need a multi-camera setup and a video card that will receive simultaneous video feeds/channels. Then, multichannel video software which will probably need a very powerful CPU to run all channels with edits and effects.

Why would you need a multi-camera setup?

To capture more than one performer recording at the same time, which I assumed was the case with the Pomplamoose example.

You could also record on several file based cameras, and use the clip syncing feature in FPCX to line them all up.

There's nothing special about how the audio is recorded for these videos.  It appears to be just video clips taken from the recording session arranged into a music video.  It does look cool but that's all it is.
The best people to ask about video tools would be the band themselves!

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


text:
Recording and playing video with variable frame rate
We are using a streaming camera to record and to play back surveillance video.
This camera sends a RTSP stream which will be recorded by our application as a H264 video.
In our application, the H264 videos will be stored in a MP4 container and will be published on a HTTP-server (Apache2). The stored videos can now be watched with any HTML5 web browser. So far, so good!
Our problem is, that the camera sends his frames with a variable frame rate. This is not a problem as long we watch the stream live. But when we watch the recorded H264/MP4 videos the time begins to drift. This means because of the variable frame rate, sometimes the video will be played too fast and the time is not correct!
So, does someone have experience with H264 videos with variable frame rate (VFR)? How can we play these VFR videos without time drift? Is it possible to convert VFR video to video with constant frame rate?
(All tested players like VLC seems to have the same problem...)
Here the output of mediainfo:
Complete name                            : VIDEO_REPLICA_12.h264
Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 249 MiB
Overall bit rate mode                    : Variable

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=15
Bit rate mode                            : Variable
Maximum bit rate                         : 20.0 Mbps
Width                                    : 1 280 pixels
Height                                   : 800 pixels
Display aspect ratio                     : 1.600
Frame rate mode                          : Variable
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

A mediainfo output of one of those file would be helpful.
http://mediaarea.net/en/MediaInfo

Are you sure the files your recorded have indeed a variable framerate? It sounds like you recorded with a constant framerate (even though you get a variable frame rate video feed) which introduced this "artifact" and the players then of course play it back with a constant frame rate even though they shouldn't.
To properly convert variable frame rate footage into constant frame rate footage you can reside to Handbrake. It's an easy to use tool for h264 encoding that lets you choose to convert your video to a constant frame rate.

Yes we can convert the video with a tool to a constant framerate. But if the frame rate is variable the video will be played sometimes too slow and sometimes too fast or not?

The encoder should account for that, variable framerate doesn't mean that you will heavy drops in the frame rate, its usually always around a certain values +-2 fps.

I recently ran into this issue...my transcoded-into-H264 videos started coming
out with VARIABLE frame-rates, whereas in the past, they had come out as fixed
framerate.
I use VLC-cmdline to do my final transcodes (because VLC supports features that
HandBrake and others don't...such as marquee-text and font-color control, etc.
When I recently googled this issue, I noticed that wikipedia, and a few other
comments on variable frame-rate mention that 'container-type' can make a difference on whether fixed or variable frames get generated. (That puzzled me...I never would have guessed that.)
But, sure enough !  In my VLC cmd-line, I changed my 'mux' from MP4 to MKV
and voila.  'Mediainfo' checker shows clearly that I was getting variable
when using MP4-container, and fixed frames with MKV.
[Great...I'd been planning to switch to MKV output files anyway, and this
provided me with a great reason to do so! Be aware -- version 1.x and early VLC supported only MP4-containers, but v2.x now DOES also support MKV.]
Hope this helps others.

Transcode Your Video First
You need to transcode your video first using a "real" encoder like Apple Compressor or Adobe Media Encoder.
Quicktime
MP4
29.97 or 30 frames per second
Make sure you use a standard resolution like 640x360,720x405,1280x720,1920x1080 or 640x360 for standard def 4x3.
You could also try using HandBrake, it may very well do the trick for you and be a lot easier.

640x360 is not the standard SD 4:3 ratio.  640x480, or preferably 720x480 with .9 pixel ratio is the 4:3 ratio.  640x360 is a 16:9 ratio.


text:
Unable to convert Avisynth script in ffmpeg
I tried create a video file from the AviSynth script using this command (in Windows 7):
ffmpeg  -i  file.avs  file.mp4

and I got this message:
[avisynth @ 05000e60] AviSynth version is too old. Please upgrade to either
                      AviSynth 2.6 >= RC1 or AviSynth+ >= r1718.
                      file.avs: Unknown error occurred

Very clear recommendation (as I use AviSynth+ 0.1 (r1576, x86)) but I'm not able to find an newer version, neither for AviSynth, nor for AviSynth+.
Nevertheless, it was probably only an recommendation. The most important part is indeed this:
                      file.avs: Unknown error occurred

So I changed the content of the file.avs - I put only one command into it, enough simple and stupid, so my file.avs now looks like:
version

No change. The same message. So I kindly ask for an advice what to do.
(I tried it with versions 3.2.2 and 2.8.4 of ffmpeg, both of them report  --enable-libxavs in their configuration and D  avisynth  AviSynth script in their file formats obtained by ffmpeg -formats.)

From FFmpeg source code:

On Windows, FFmpeg supports AviSynth interface version 6 or higher.
  This includes AviSynth 2.6 RC1 or higher, and AviSynth+ r1718 or
  higher, and excludes 2.5 and the 2.6 alphas.

From doom9:

The decision to drop support for anything below 2.6 RC1 was due to
  catastrophic header incompatibilities between 2.5 and 2.6 RC1* and the
  maintenance burden (and potential licensing minefield that could mean
  any additional 2.5 support would violate GPL) that would be incurred
  by trying to continue to support 2.5 while using properly updated 2.6
  headers.

Get AviSynth+ r2420 from
https://github.com/pinterf/AviSynthPlus/releases/tag/r2420-MT


text:
How do I set up and use FFmpeg in Windows?
I understand that FFmpeg is a powerful tool for video file conversions. I see online in many places people suggesting it for solutions or getting help in how to use it. The problem is, I don't even know how to set it up or use it at all.
Those posts I'm talking about usually take the form “Use FFmpeg [complicated and unreadable line of code].”
I'm not really a programmer, but I can do a few things, so I think I can figure it out, if I just had a bit of direction.
How do I set up and use FFmpeg in Windows?

Related: What are the benefits of a CLI encoder (e.g. FFmpeg) over GUI Software?

FFmpeg is indeed a powerful video encoder/decoder tool¹. It operates in the command line, as opposed to using a GUI. Command line is that black window you find by typing [windows+r], then cmd in the popup field and hitting enter. This is also called "command prompt". Once setup, you enter FFmpeg commands in one of these windows to use it.
Here are the basic steps to "install" and use it:
Installation

Download the latest FFmpeg build, courtesy of gyan.dev.
Create a folder on your computer to unpack the zip file. This folder will be your "installation" folder. I chose C:\Program Files\ffmpeg\. This is a good idea because you will treat this like a regular program. Unpack the zip file into this folder.
The folder should now contain a number of other folders, including one titled bin where ffmpeg.exe is saved. We're not done yet. Double clicking that file does nothing. Remember, this is a command line program. It runs in cmd.
Before you can use ffmpeg.exe in cmd you have to tell your computer where it can find it. You need to add a new system path. First, right click This PC (Windows 10) or Computer (Windows 7) then click Properties > Advanced System Settings > Advanced tab > Environment Variables.
In the Environment Variables window, click the "Path" row under the "Variable" column, then click Edit

The "Edit environment variable" window looks different for Windows 10 and 7. In Windows 10 click New then paste the path to the folder that you created earlier where ffmpeg.exe is saved. For this example, that is C:\Program Files\ffmpeg\bin\

In Windows 7 all the variables are listed in a single string, separated by a semicolon. Simply go the the end of the string, type a semicolon (;), then paste in the path.

Click Ok on all the windows we just opened up. Just to be sure, reboot your computer before trying any commands.

FFmpeg is now "installed". The Command Prompt will now recognize FFmpeg commands and will attempt to run them. (If you are still having issues with Command Prompt not recognizing FFmpeg try running CMD as an admin. Alternatively, you can use windows powershell instead of cmd. If it still does not work double check to make sure each step was followed to completion.)
Alternative installation methods
I've not tried these myself, but they probably work, and they're easy to do. However, you can accidentally mess up important things if you're not careful.
First, if you open cmd with administrator privileges, you can run setx /m PATH "C:\ffmpeg\bin;%PATH%", and change C:\ffmpeg\bin to your path to FFmpeg. This uses cmd to do all the gui steps listed above. Easy peasy.
Second, user K7AAY reports that you can simply drop the FFmpeg executables in C:\Windows\System32 and run them from there without having to define the path variable because that path is already defined.
Updating FFmpeg
To update FFmpeg, just revisit the download page in step 1 above and download the zip file. Unpack the files and copy them over the old files in the folder you created in step 2.
Using FFmpeg
Using FFmpeg requires that you open a command prompt window, then type FFmpeg specific commands. Here is a typical FFmpeg command:
 ffmpeg -i video.mp4 -vn -ar 44100 -ac 1 -b:a 32k -f mp3 audio.mp3

This command has four parts:

ffmpeg - This command tells cmd that we want to run FFmpeg commands. cmd will first look for ffmpeg.exe in one of the folders from step 6 in the Installation section. If it is found, it will attempt to run the command.
-i video.mp4 - This is an input file. We are going to be doing work on this file.
-vn -ar 44100 -ac 1 -b:a 32k -f mp3 - These are the "arguments". These characters are like mini commands that specify exactly what we want to do. In this case, it is saying create an mp3 file from the input source.

-vn - Leave out the video stream
-ar 44100 - Specifies audio resolution in hertz.
-ac 1 - Audio channels, only 1. This is effectively "make mono".
-b:a 32k - Audio bitrate, set to 32 kbps.
-f mp3 - Force to MP3 conversion. Without this command, FFmpeg attempts to interpret what you want based on the extension you use in the output file name.

audio.mp3- This is the output file.

As you can probably guess, this short command makes an MP3 audio file from an MP4 file.
To run this command, assuming you have an MP4 file to try this on, follow these steps:

Hit the Windows key + r.
Type cmd then enter.
Change the path to where the file is that you want to work on. Type cd [path]. It should look something like cd C:\Users\name\Desktop\.
Now type the FFmpeg command with the name of your input file. The command will run with some feedback. When it's done, cmd will be available for more commands.

This is the basic way to use FFmpeg. The commands can get far more complicated, but that's only because the program has so much power. Using the FFmpeg documentation, you can learn all the commands and create some very powerful scripts. After that, you can save these scripts into a .bat file so that you just have to double click a file instead of type out the whole command each time. For example, this answer contains a script that will create MP3's from all the MP4's in a folder. Then we would be combining the power of FFmpeg with the power of cmd, and that's a nice place to be when you have to do professional quality video/audio encoding on mountains of files.

As a point if technical accuracy, FFmpeg is itself not an encoder or decoder. FFmpeg is a multimedia framework which can process almost all common and many uncommon media formats. It has thousands of to capture, decode, encode, modify, combine, and stream media, and it can make use of dozens of external libraries to do even more. Gyan.dev provides a succinct description.

Thanks a lot for this. I was stuck on the first step, the "path environment var"! You have explained it better than anyone else and I now have a proper response from the cmd query "ffmpeg -version". I think I'm on my way.

The developers use the terms "framework" and "solution" to describe it on their website.

ffmpeg is a framework and most of the encoders and almost all of the decoders are built-in (in libavcodec). It also supports various third-party encoders through wrappers. Those third-party encoders usually have standalone tools. But the built-in modules have to be used through the library API. They aren't standalone.

The answer provided by user24601 is excellent. However, if you copy the extracted ffmpeg.exe, ffplay.exe, and ffprobe.exe into C:\Windows\System32, you can skip steps 4, 5, and 6, which amend the PATH. Those three files are small, and I have run with that method for over a year with no problem.

And ffmpeg, for the most part, can be used without those encoders, etc.

For Windows, in case PATH not works - try to reboot your IDE (VS in my case). Looks like it caching time to time by windows/IDE, so in my case it helps to resolve "file not found" issue. Many thanks to author for this manual!

The other answer gives a very good answer that covers the default way of installing it, I'd like to propose two ohter methods that are good for noobs and pros alike:
Option 1
Chocolatey is a package manager, it's a bit like the Microsoft Store, except that it's actually useful, it's all free, and it runs on the commandline. With chocolatey, installing ffmpeg—and setting up the correct $PATH etc.—is as simple as
choco install ffmpeg

It's way quicker and far safer than searching for the right website, finding the download, unzipping it, reading the installation documentation, googling how to set it up, downloading some dependancy etc. etc.
To install Chocolatey you run a command on the commandline, obvs. The website shows you how, but it is a simple cut-n-paste affair. https://chocolatey.org/
You can then check out over 6000 free packages available with choco list <search term here>. There are even non-CLI programs so it's not just for the hardcore. It makes setting up a new install of windows super easy: I have a list of software that I always install and just get chocolatey to do it for me: choco install firefox ffmpeg conemu edgedeflector ditto rainmeter imagemagick… and so on.
As an added bonus upgrading your software is as easy as choco upgrade all
Option 2
Winget is another package manager, that is built-in to recent versions of Windows. The recipe for installing ffmpeg with winget is similar: open a terminal (can be Powershell, wsl, or even cmd if you like banging rocks together) and type
winget install ffmpeg

This will download and install the build of ffmpeg that is hosted by gyan (at the time of writing). It will also work if you don't have admin privileges, which chocolatey prefers.

Thanks. Unfortunately not all that straight forward. E.g. I'm using Windows 10, Version 10.0.18362 Build 18362 (the most recent as of date) and have admin rights. Pasting the commands for chocolatey installation

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

I get
'Set-ExecutionPolicy' is not recognized as an internal or external command,
operable program or batch file.

Are you running that in a powershell session or a cmd session?

Cmd! So it only works with powershell? Missed that part. Thanks.

I prefer this answer because it doesn't promote the bad habit of downloading an executable from some random guy you've never heard of (no offense to gyan.dev but I have no idea who that is). I already know and trust Chocolatey and trust that their ffmpeg package is the legit thing, and not something that's going to ransomware me

That is a good point and I've added it to the answer. Of course it does shift the trust from the random website owner to the chocolatey package manager, but given that a lot more people have eyes on chocolatey, it's definitely safer.

@JamesAllen I guess that makes sense if you aren't on git or other dev forums/sites like this one, where Gyan has a pretty reputable name.


text:
How to get smooth motion when changing clip speed?
Let's say I have a 30 fps video created by a camera panning at a constant speed while filming some static scenery.
When I watch the video, the motion in the video is perfectly smooth.
When I double the speed, the motion continues to be perfectly smooth.
When I halve the speed, the video looks choppy but again the motion continues to look smooth.
The problem comes when I try to change the speed by irregular numbers.
Let's say I want to change the speed of the video to 120%. I then export the video at 30 FPS. The motion in the video then becomes visually choppy, jerky.
I quickly figured out what is happening:
By increasing the speed, my 30 FPS video becomes 30 * 1.2 = 36 FPS. But I am exporting at the standard 30 FPS so every 6th frame is dropped. This means that every 5 frames the camera moves at double speed. If I look at the motion frame by frame the camera movement is: slow, slow, slow, slow, FAST, slow, slow, slow, slow, FAST, slow, slow, slow, slow, FAST, etc.
So finally my question is what option do I have to get smooth motion or hide this problem when changing the speed of the video by small intervals?
Shooting at a higher shutter speed is not an option in my opinion, as it just blurs the motion until the problem is not visible.
I use Adobe Premiere and Adobe After Effects.
Will the Time Warp plugin in After Effects be able to create smooth motion by using motion vectors? What if there is active movement in the scene? Will it still look good?
I have yet to see people truly understand this problem. How is this effect called? Does anyone have any link or article explaining what I described?

Shooting at a higher shutter speed is not an option in my opinion, as it just blurs the motion until the problem is not visible.

I don't get that part. Isn't hiding the problem until it is no longer visible what you want?
Also, a higher shutter speed results in less blurred frames, not the other way around.

I quickly figured out what is happening: by increasing the speed, my 30 FPS video becomes 30*1.2=36FPS. But I am exporting at the standard 30FPS so every 6th frame is dropped.

This is the default behaviour of the Media Encoder. Adobe calls it Frame Sampling. As you said, since frames will be dropped at regular intervals, it will produce curious results.

So finally my question is what option do I have to get smooth motion or hide this problem when changing the the speed of the video by small intervals?

Use one of the other Time Interpolation modes Premiere Pro has to offer. At the bottom of the Export Settings dialog, there's a dropdown menu containing three options: Frame Sampling, Frame Blending and Optical Flow. You will find the same dropdown menu in the Speed/Duration panel that can be accessed via the context-menu to change the interpolation mode of individual clips.
From the documentation:

The Optical Flow feature in Premiere Pro uses frame analyses and pixel motion estimation to create brand new video frames, resulting in significantly smoother speed changes, time-remapping, and frame-rate conversion. [...]
Frame Sampling repeats or removes frames as needed to reach the desired speed. Frame Blending repeats frames, and it also blends between them as needed to help smooth out the motion.

Here's another helpful article on using the Optical Flow interpolation.
I suggest you try all the interpolation modes and see what works best for your footage.
One more thing, you probably don't want to hear that, but 30 fps video is really bad for doing slow or fast motion effects (except maybe timelapses with 200% speed or more). As you explained yourself, there's not that many frames to go on so some frames will need to be dropped, synthesised or blended in some way which looks subpar at best. The interpolation algorithms do a decent job, but it will never look as good as it would with footage that was shot at a higher frame rate in the first place.

There is a substantial body of literature explaining how frame rate and shutter speed relate to achieve desirable perceptions of motion.  In general, a shutter speed that is 1/2 of the frame rate (1/48th of a second for a 24fps frame rate) gives the best results.  But there are reasons one would choose a (relatively) shorter or longer shutter speed, including the reason that the playback rate will be different than the capture rate.  But first and foremost, one should understand how playback rate and shutter speed interact before worrying about interpolation strategies.  The literature discusses not only this, but also acceptable rates of panning speed for a given field of view and shutter speed rate.  Here is but one example of such a discussion.
There is also a substantial body of literature explaining how frame rate interpolations work or break down under various conditions of frame rate changes (some of which you have already noticed).  Some frame rate interpolations work best with more motion blur.  Some work better with less motion blur.  And if you have not done the math ahead of time, you can find yourself with a frame rate and a shutter speed that will result in universally poor results regardless of the interpolation strategies available to you.  In general, if you want to give optical flow a chance, you need sharp pixels, not blurry ones.  Optical flow can both create "tweens" (synthetic frames in between actual frames captured by the sensor) and it can create motion blur for all frames (both real and synthetic).  This is a computationally expensive process, and it is not uncommon for high-end production houses to actually customize their software to make it work best for the footage they have.  But if you take care ahead of time, knowing what shutter speed will minimize the motion blur within your sequences, and knowing what types of subjects or objects to avoid so as not to break the quality of your optical flow engine, you can use software to realistically create in-between frames.  If you don't prep ahead of time, you are likely to get results that are very artificial, calling attention to the algorithmic limitations of the software rather than the brilliance of your art-direction.


text:
Can I use FFmpeg in a commercial product?
Not sure if I am correct posting my question here and I will of course delete this question if appropriate.
I have a C# desktop app using FFmpeg.
I have a web service using FFmpeg.
I sell both products.
I want to know — can I distribute my desktop app with FFmpeg without paying a fee to FFmpeg people and without releasing my source code?
I also want to know whether I can use FFmpeg on my server for users to convert images to a video file to be emailed them.  This service is also a payable product.
I have read the links to the FFmpeg licensing info and I read many questions here on these boards.
The closet I have got to an answer is that I can use it on my web server because I am not distributing it to client PCs and I can use FFmpeg on my desktop app if I only use certain features of FFmpeg — whatever they are.
However, this is not definitive enough for me and I cannot afford a lawyer and you would think this question/dilemma would have been resolved somewhere by someone considered how popular FFmpeg is.
Thanks.

@LordNeckbeard hi, 'many questions ' mis-spelt.  Yes I have read all that before and is still not black and white. the compilations flags.. I am using Windows build for C# app.  there is only 1 download for that build so I still do not know what to do. Reading the other questions to FFMPEG licensing I cannot see clear answers.. just guesses... hence my question :)

just saw the build request - thanks

I'm voting to close this question as off-topic because it is about licensing for producing software, not video production.

well in-directly it is about video production. FFMPEG seems to be a big mystery in terms of licensing and is a popular question by people. You ought to leave it up as an exception. These boards are all about helping people and this answer helps me and will other people. The trouble with SO boards is that they can become elitism. Pls do not take that as an insult. You have helped me with some of my question and I am v grateful

I'm voting to reopen this question because of the vast prevalence of need for this to be answered. The 22 upvotes indicates this. This is a special case, only because of the great need for this specific question to be answered accurately.

@user24601 need does not make this on topic. Sorry.

@DrMayhem  what so for? Is it not to help people?

No. It is to help people within the scope of the site, not to answer questions outside the site scope.

@DrMayhem seems to me people came to this site for specific things. This answer seems to have helped a lot if people. But hey u know best :)

It's not up to me - it's up to the site scope. Mods don't set scope - we help maintain it.

@DrMayhem does not really affect me. Normally if my question is deemed off scope I would delete it myself to avoid clutter. But it seems wrong to me due to the interest. I got my answer and very happy with it. People can vote to delete it. It really does not bother me. Just bored waiting for my supper so posted my replies to u. Have a nice evening ;)

@drmayhem It's not too much of a stretch that licensing of video software when building video production tools falls under "how to use" that software. Yeah, this isn't about ffmpeg commands, but we've got questions on how to install it, compile it, integrate it, etc. Licensing cannot sensibly be a special case, and therefore off-topic, in light of those other questions here.

Further, the total number of questions like this are few yet so vitally integral to that program's use. Why not allow the 10 or so there are?

Most sites (except law.SE) disallow licencing and law questions. Why would we allow a question that is outside scope? That just makes no sense.

The sense is that it has helped a lot of people.

Yes, you can use FFmpeg in a commercial product

FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later.

It is also available under the General Public License (GPL) version 2 or later.

Some features, external libraries (libx264 and libx265 for example), and various filters, require GPL. If those parts get used the GPL applies to all of FFmpeg.
See LICENSE.md in the source for a list of GPL parts of FFmpeg and which external libraries require GPL.

The (L)GPL, and therefore FFmpeg, does not restrict commercial usage. You only need to properly comply with the license.

FFmpeg is not available under any other licensing terms. There is no commercial license available (but see the x264 & x265 commercial license info below). FFmpeg does not accept or charge any fees.

…but the (L)GPL is copyleft
If you include FFmpeg in your software, under the General Public License (GPL) version 2 or later, you may be required to make available the source code of your software to anyone requesting it.
Make sure your software license is compatible with the (L)GPL. This is an important and often confusing aspect of the (L)GPL. I can only suggest that you carefully read the license, the FAQ, and contact a lawyer or your legal department if you need counsel.
What if I am only using FFmpeg but not distributing it?
You do not have to do anything if you are not distributing anything from FFmpeg.
What about the x264 & x265 commercial licenses?
x264 and x265 are available under the GPL for free or a commercial license that you have to pay for. The commercial licenses are LGPL compatible. FFmpeg does not have an option that disables the GPL requirement for these commercial licenses so you have to do that manually. Therefore, if you purchase a commercial license from x264 licensing or x265 licensing then you are permitted to:

Compile x264/x265 with --disable-gpl.
Modify the configure file in the FFmpeg source code to move libx264/libx265 from EXTERNAL_LIBRARY_GPL_LIST to EXTERNAL_LIBRARY_LIST.
Compile ffmpeg without --enable-gpl and link to your x264/x265 that has been compiled with --disable-gpl.

Don't forget to document and provide these changes with the FFmpeg source code that you are making available.
Do I need a commercial license from x264/x265?
You do if your application is not GPL compatible and is being distributed with linked x264/x265. See [x264-devel] Announcing commercial licensing for x264 for additional details specific to x264.
Also see

FFmpeg License and Legal Considerations
GNU Lesser General Public License, version 2.1
GNU General Public License, version 2
Frequently Asked Questions about the GNU Licenses

wow!  What a great answer!

@AJ Henderson would you like to open this? it seems a popular question and answer :)

Great answer! Could you please clarify what "distributed with linked x264" means? What if I distribute software that relies on ffmpeg being installed and calls it, e.g. via shell or subprocess? What if I install ffmpeg (without modyfing it) silently and subsequently call it from my software?

I create app in c# win desktop. My app containe only this project code https://jsmpeg.com (MIT Licence). My program use ffmpeg but user need to install it. There is no source changes , user need to install binnary (download) from ffmpeg official site. Than my program use ffmpeg to start streaming. Is my app still under LGPL ?

@NikolaLukic You are not distributing anything from FFmpeg, you are making the user get it, so there is nothing you need to do.

ok, One more ;) Can i add simple credit link in about box or better not (if exist some reason  not to do it) ? Maybe i am boring but i like to make it clear to the end.

@NikolaLukic It is up to you, although it is always nice to credit any open source software that your project uses.

I agree, Thks for great info and fast answers Mr. @llogan !

@llogan similar question to nikola-lukic but what if the application includes a script that does a "docker run ... jrottenberg/ffmpeg:4.1-alpine"? The application does not distribute any ffmpeg binary or container image itself but it instructs the user's docker server to download it. That still avoids the "links to x264" issue right?

@jamshid You should ask on [opensource.se]


text:
How do you convert an mxf file to wav using ffmpeg?
I am using a Mac, I've run this:
ffmpeg -i source.mxf -map_channel 0.1.0 -map_channel 0.1.1 \
       -af 'volume=volume=6dB:precision=fixed' target.wav

but I keep getting 'no such file or directory' even though I've used the exact file name and have even tried renaming and trying again.
Is there any other way to do this?

'no such file or directory' means you've probably got the path wrong

The problem is with the source.mxf file – there are 2 possibilities:

there is no such a file in your file system, or
it is there, but in the other directory (folder) than the directory from which you run your ffmpeg command.

If the second one is a case, there are 3 options how to fix it:

move the source.mxf to the same directory, from which you launch the ffmpeg command,

run the ffmpeg command from the same directory, where is the source.mxf file
(i.e. first change your working directory),

instead of the bare source.mxf (after the -i option) use the (full or relative) path to it.


text:
Need help compiling a custom, minimal FFmpeg build
I'm using FFmpeg's showspectrumpic function to generate spectrogram pictures :

I have a working FFmpeg build that does what I need, but it's quite heavy (almost 100mo).
Is it possible to compile a FFmpeg build with the minimal requirements to run just the “showspectrumpic” function ? I have no clue how compiling works.
I've already tried the media-autobuild_suite, but it gives me errors that I don't understand. Maybe I messed up the setup, I honestly don't know.
Either way, any info on “FFmpeg builds for noobs” is more than welcome
Thanks y'all \o


text:
Final Cut Pro X won't accept similar files
I have two files that I want to import into Final Cut Pro X. They are both clips pulled from the same source file using the same commands. I am using a generated script to extract dozens of clips at a time so they are identical other than the output filename. This is the command I am running to create them:
ffmpeg -y -ss 00:02:33 -to 00:02:37 -i c66d0aaedc7848f39066faa244542eac.mkv \
    -c:v prores_ks -profile:v 3 -vendor apl0 -bits_per_mb 8000 -pix_fmt yuv422p10le \
    -map_chapters -1 -c:a aac -ac 2 -b:a 128k -map 0:v:0 -map 0:a:0 \
    -metadata:s:a:0 title="Stereo" cinderella33-extra.mov

They seem almost identical when I check them with mediainfo and ffprobe. Here are the outputs from those.
cinderalla3.mov:
General
Complete name                            : cinderella3.mov
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt   0000.02 (qt  )
File size                                : 232 MiB
Duration                                 : 6 s 48 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 322 Mb/s
Writing application                      : Lavf59.16.100

Video
ID                                       : 1
Format                                   : ProRes
Format version                           : Version 0
Format profile                           : 422 HQ
Codec ID                                 : apch
Duration                                 : 6 s 48 ms
Bit rate mode                            : Variable
Bit rate                                 : 322 Mb/s
Width                                    : 1 456 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 8.545
Stream size                              : 232 MiB (100%)
Writing library                          : Apple
Language                                 : English

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 6 s 0 ms
Source duration                          : 6 s 21 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 93.5 KiB (0%)
Source stream size                       : 94.0 KiB (0%)
Title                                    : Stereo
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

ffprobe version 5.0 Copyright (c) 2007-2022 the FFmpeg developers
  built with Apple clang version 13.0.0 (clang-1300.0.27.3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0-with-options --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-libfdk-aac --enable-nonfree
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cinderella3.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf59.16.100
  Duration: 00:00:06.05, start: 0.000000, bitrate: 322280 kb/s
  Stream #0:0[0x1](eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1456x1080, 322160 kb/s, SAR 1:1 DAR 182:135, 23.98 fps, 23.98 tbr, 24k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : FFMP
      encoder         : Lavc59.18.100 prores_ks
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

cinderella191.mov:
General
Complete name                            : cinderella191.mov
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt   0000.02 (qt  )
File size                                : 137 MiB
Duration                                 : 5 s 5 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 230 Mb/s
Writing application                      : Lavf59.16.100

Video
ID                                       : 1
Format                                   : ProRes
Format version                           : Version 0
Format profile                           : 422 HQ
Codec ID                                 : apch
Duration                                 : 5 s 5 ms
Bit rate mode                            : Variable
Bit rate                                 : 230 Mb/s
Width                                    : 1 456 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 6.106
Stream size                              : 137 MiB (100%)
Writing library                          : Apple
Language                                 : English

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 5 s 0 ms
Source duration                          : 5 s 21 ms
Bit rate mode                            : Constant
Bit rate                                 : 129 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 78.4 KiB (0%)
Source stream size                       : 78.9 KiB (0%)
Title                                    : Stereo
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

ffprobe version 5.0 Copyright (c) 2007-2022 the FFmpeg developers
  built with Apple clang version 13.0.0 (clang-1300.0.27.3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0-with-options --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-libfdk-aac --enable-nonfree
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cinderella191.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf59.16.100
  Duration: 00:00:05.01, start: 0.000000, bitrate: 230352 kb/s
  Stream #0:0[0x1](eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1456x1080, 230215 kb/s, SAR 1:1 DAR 182:135, 23.98 fps, 23.98 tbr, 24k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : FFMP
      encoder         : Lavc59.18.100 prores_ks
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

and here's the result when I diff the two outputs
2c2
< Complete name                            : cinderella3.mov
---
> Complete name                            : cinderella191.mov
6,7c6,7
< File size                                : 232 MiB
< Duration                                 : 6 s 48 ms
---
> File size                                : 137 MiB
> Duration                                 : 5 s 5 ms
9c9
< Overall bit rate                         : 322 Mb/s
---
> Overall bit rate                         : 230 Mb/s
18c18
< Duration                                 : 6 s 48 ms
---
> Duration                                 : 5 s 5 ms
20c20
< Bit rate                                 : 322 Mb/s
---
> Bit rate                                 : 230 Mb/s
29,30c29,30
< Bits/(Pixel*Frame)                       : 8.545
< Stream size                              : 232 MiB (100%)
---
> Bits/(Pixel*Frame)                       : 6.106
> Stream size                              : 137 MiB (100%)
39,40c39,40
< Duration                                 : 6 s 0 ms
< Source duration                          : 6 s 21 ms
---
> Duration                                 : 5 s 0 ms
> Source duration                          : 5 s 21 ms
42c42
< Bit rate                                 : 128 kb/s
---
> Bit rate                                 : 129 kb/s
48,49c48,49
< Stream size                              : 93.5 KiB (0%)
< Source stream size                       : 94.0 KiB (0%)
---
> Stream size                              : 78.4 KiB (0%)
> Source stream size                       : 78.9 KiB (0%)
66c66
< Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cinderella3.mov':
---
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cinderella191.mov':
72,73c72,73
<   Duration: 00:00:06.05, start: 0.000000, bitrate: 322280 kb/s
<   Stream #0:0[0x1](eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1456x1080, 322160 kb/s, SAR 1:1 DAR 182:135, 23.98 fps, 23.98 tbr, 24k tbn (default)
---
>   Duration: 00:00:05.01, start: 0.000000, bitrate: 230352 kb/s
>   Stream #0:0[0x1](eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1456x1080, 230215 kb/s, SAR 1:1 DAR 182:135, 23.98 fps, 23.98 tbr, 24k tbn (default)
78c78
<   Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
---
>   Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)

Why will FCPX import cinderella191.mov but won't take cinderella3.mov?

I moved all the files I'm trying to import to a different directory and FCPX was willing to import all of them. Obviously, I don't know the specifics about why it wouldn't import them but here's my best guess:
Earlier I had tried to import a version of those files that were all blocked using the import option. Those were rejected because it didn't like the audio portion of the videos. The only difference between that first set of files and similar files that FCPX liked was they were missing a field called Title that was set to Stereo so I added -metadata:s:a:0 title="Stereo" to the ffmpeg parameters.
That created the set of files that prompted this question. Going back to the import screen, I noticed that the files FCPX didn't like were all on the first page of the file list, and subsequently all the files it would accept were after the first page. Instinct had me wonder if FCPX had cached the file information for that first page of the file list. So when I moved the files to a different subdirectory, I forced FCPX to reprocess the file check.
That fixed it. Don't know that I'm 100% right about the cause but it fixed the issue so I'm good.


text:
Displaying an image next to a text using ffmpeg
I would like to overlay a text and an image in a video. I know how to overlay text and an image.
The problem is the text is not fixed, e.g “Sad, “Happy,” “Excited,” etc. I need to show an image right next to the text.
Is there a way to save the width of the text (text_w) and use it in overlay for displaying image?
Something like
ffmpeg -i out.mp4 -i image.jpg -filter_complex \
  "[0:v][1:v] overlay=(main_w-overlay_w)/2+text_w:(main_h-overlay_h)/2:enable='between(t,0,20)'" \
  -pix_fmt yuv420p -c:a copy output.mp4

Not possible like that. But you can position the text in a predictable manner in drawtext, by using tw,th.

Hard way with 3 steps. Used scale2ref, drawtext, imagemagick trim, xstack, overlay
#!/bin/bash
f="input.mp4"
l="logo.png"
t="/tmp/text.png"
o="/tmp/output.mp4"

ffmpeg -i "$l" -lavfi "
color=black@0,format=rgba[b];
[b][0]scale2ref=3*ih:ih[b][v];
[v]nullsink;
[b]setsar=1,
drawtext=text='Some text'
:borderw=2
:bordercolor=red
:fontsize=h/4
:fontcolor=white
:x=(w-tw)/2
:y=(h-th)/2
" -frames 1 "$t" -y

magick mogrify -define trim:edges=west,east -trim "$t"

ffmpeg -i "$f" -i "$t" -i "$l" -lavfi "
[1][2]xstack[o];
[0][o]overlay=(W-w)/2:(H-h)/2
" -c:a copy "$o" -y

xdg-open "$o"


text:
Using ffmpeg audio filter loop instead of stream_loop as stream_loop adds a delay
I want to loop an audio file infinitely. The -stream_loop -1 option adds a small pause  / jerk between the loops, as also mentioned in this question with no solution.
The same question mentions that filter loop works fine without delay. But I am unable to get the filter loop to work. The below code along with rest of the command:
 -filter_complex "[1:a]aloop=loop=-1"

gives a warning:
[Parsed_aloop_0 @ 0x55d83e516b80] Number of samples to loop is not set!

What is the correct way to loop an audio endlessly using filter loop? I am trying to merge a video and audio, having them both independently loop infinitely. I have got that part to work using -stream_loop -1 but it has a minor delay between loops as I mentioned. I am looking for a solution using either filter_complex or any other way if possible. Thanks!
Note, I have also noticed that ffplay -loop 0  plays the loop smoothly without adding this pause.

I found a workaround for this here! Using wav file as input instead of mp3 works.
Also in my trials, I found that even aac files suffer from this delay, somehow, wav files do not!


text:
Element 3d placeholder to premiere pro?
Using a virtual studio package that uses Element 3D v2 with 2 Display screens meant for footage to be added. How can I render the scene which is heavy in after effects and leaving the Screen placeholders empty so that I can easily change the footage in Premiere Pro, not having to render the scene each timein AE? Any good tutorials or advice would be really helpful. thnx

I'm not 100% sure that I understand the question, sorry, but could you render out an AVI (both RGB + Alpha channels) of the scene (presuming that the areas for the video don't have anything behind them) from AE and then, in PPro, drop the AVI on a video layer above the videos, adjusting their size/scale to fit into the 'windows'?
In AE; if the video 'windows' aren't already cut out, you should be able to use a mask to get rid of them (you might need to pre-compose the layers if they're not in a comp already).


text:
lossless frame extraction from video
I have an mp4 video file with these characteristics:

-Encoder: Lavf58.29.100
I want to extract each frame as an image, with the following requirements:

one image file is one frame (i.e., account for variable framerates to work in all cases),

the image file has to be lossless TIFF.

I use Linux and would prefer Python to do this, but I can also use FFmpeg.
However, I have seen some other posts here, but they are either not-replied to or just need JPG format. I have read the imwrite documentation (OpenCV) and saw that it is actually possible to export as TIFF (even with different bit-depths),  but I can't see an example of using that. I also do not know how to confirm if the exported TIFF is actually without compression.
The reason I need each frame as a lossless image file is that I need the images for further analysis in research, and I don't want to lose any information at this stage (the sequence of images is the starting 'raw material' of my analysis pipeline).

You don't need tiff. png or jpg at 100% will do just as well. It's not compression you need to avoid, it's lossy compression.

Thank you. Then I will try with cv2.imwrite(name, frame, [cv2.IMWRITE_JPEG_QUALITY, 100])

This ffmpeg command should do the trick for you:
ffmpeg -i in.mp4 -vf "select=eq(n\,0),setpts=N/(FRAME_RATE*TB)" output_%08d.tif

Note: Your input is allready encoded in a lossy encoding, so you will have artifacts from the h264 codec.

After research and help from here and other places, I found 3 ways to do it.
Pillow (Python)

Command: img.save(output_filename,format='TIFF',compression='tiff_deflate',tiffinfo={})
Result: Generates 2246
TIFF files (variable sizes, between 761 and 566 KiB)

OpenCV (Python)

Command: cv2.imwrite(name, frame, [cv2.IMWRITE_TIFF_COMPRESSION, 1])
Result: Generates 2246 TIFF files (6.4 MiB each one)

ffmpeg (tested on Linux)

Command: (see different ways)
Result: Generates 2246 or 2247 TIFF files, depending on the exact command (see different ways). Each file is 2.8 MiB

Edit 1: The differences between file sizes in each option (e.g. 600 KiB vs 6.4 MiB vs 2.8 MiB) seem to be related to the compression used by different algorithms. I used exiftool and found that in deed the compression is different: uncompressed (Python/OpenCV), PackBits (ffmpeg) and Adobe Deflate (Python/Pillow).
Edit 2: after further inspection and comparison, I observed that Python/Pillow (which uses Adobe Deflate method) also significantly changed the colors in the picture! I am unsure if this is due to the compression method or is something else done by Pillow.

Try to get details about the TIFF files via exiftool. TIFFs can have different bit depth, different number of channels, different compression methods. You can even have JPEG inside a TIFF.

Thank you for a great suggestion! I used exiftool and found that in deed the compression is different: uncompressed (Python/OpenCV), PackBits (ffmpeg) and Adobe Deflate (Python/Pillow).