text:
Script editor in Premiere Pro
Is it possible to integrate an editor for voiceover texts and other scripts into Premiere Pro CC? Adobe Story will discontinue this year.
I do not mean texts sticking to a clip or a time in the sequence. This can be done using markers or titles. The editor should be independent of clips and exact seconds as this can change while the voiceover text stays the same.
A perfect editor would stick text to a clip but keep it when the clip is replaced later. But a very simple text editor would be enough.
At the moment I open my texts in a separate window while every other function is integrated into Premiere Pro. While speaking voiceover, the mouse and eyes jump between the controls and preview in Premiere and the editor on the other screen.

Unfortunatley no. Adobe Premiere dropped what would have been your best possible “tool” when CC replaced CS6.
CS6 has a tool called Analyze Speech, used primarily for automated transcribing.
This tool could be used to substitute a rolling message box within the MetaData Window, tied to Key Frames. So you could use it manually in that sense to drop in a script and change the timings.
Your Best Bet is to either use basic slates/titles using the titler window. You could try playing with the rolling title feature, making a single rolling slate the length of your program... Or just block it out.
I do a ton of VO heavy productions however, and have never really thought of this as being an issue, even with CS6.
Not sure what your workflow is. But just recording a scratch track of your VO and dropping in temporary slates to indicate the placement of graphics, future media, tittles, etc, should get you there.


text:
how to simultaneously create rtsp and livehttp video streams in vlc from the same live source?
I want to simultaneously create rtsp and livehttp video streams from the same live H.264 source in cvlc. I can individually create either kind of stream just fine, and I can also create two rtsp streams simultaneously using the 'duplicate' tag, so my basic setup is right. Something is wrong when I try to do the two kinds of streams at the same time in a single command.
This runs in linux and the commands are written in bash. My frame rate, $fps, is 10 fps. /home/vout1 is my live H.264 source. Folders and the server URL are defined by variables. Note that I had to add dst= when I went from the single command to the combined command.
Here's the working rtsp command:
cvlc -vvv stream:///home/vout1 --sout '#rtp{sdp=rtsp://:8554/}' --demux=h264 --h264-fps=$fps

Here's the working livehttp command:
cvlc -vvv stream:///home/vout1 --sout "#standard{access=livehttp{seglen=5,delsegs=true,numsegs=2,index=$streaming_video_folder/stream.m3u8,index-url=$server_URL/stream-###.ts},mux=ts{use-key-frames},dst=$streaming_video_folder/stream-###.ts}}" --h264-fps=$fps --demux=h264

Here's a working command that creates two rtsp streams:
cvlc -vvv stream:///home/vout1 --sout '#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=rtp{sdp=rtsp://:9554/}}' :demux=h264 :h264-fps=$fps

Here's the non-working combined, rtsp and livehttp command:
cvlc -vvv stream:///home/vout1 --sout '#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=standard{access=livehttp{seglen=5,delsegs=true,numsegs=2,index=$streaming_video_folder/stream.m3u8,index-url=$server_url/stream-###.ts},mux=ts{use-key-frames},dst=$streaming_video_folder/stream-###.ts}}' :demux=h264 :h264-fps=$fps

I don't get any streams and I get a multitude of these errors:
[0xca4540] access_output_livehttp access out error: cannot open `-treaming_video_folder/stream-001.ts' (No such file or directory)

For some reason, the previously working variable name, $streaming_video_folder, has been transformed to the erroneous, -treaming_video_folder.
Can someone tell me the proper syntax for the combined command ? Thank you in advance.

Your working livehttp command has double quotes, and your non-working duplicate command has single quotes.  Your shell is interpolating the variables in the double-quote example but passing them as a string literal in the latter case.  You can see what the shell is doing by changing cvlc to echo.

source: Stack Exchange

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

sort: votes


text:
.mov file is not playing video in After Effects
I've recorded 7 videos yesterday. All recorded on a Canon 5D Mark III. The files are playing fine from Finder and Quicktime. But when I import them to After Effects, only one of them is not playing any video but just sound. After Effects imports the file as audio file, as it looks to me, still, it says, it is a file of the type "Quicktime".
Does anyone have an idea, what I could look into or what I could try?
Finder's file info says:

Dimensions: 1920x1080
Codecs: H.264, Linear PCM, Timecode Color
Profile: HD (1-1-1)
Duration: 11:49

Adobe Premiere CC 2018 does also play the video as it should. I'm quite a bit confused and have no idea, where to look or what to try.
Any help is much appreciated. Thanks in advance.

Can you give us the codec informations from your video file using mediainfo or FFMPEG ?
As Premiere Pro plays well the video, you can export it to a lossless format such as Apple ProRes and then re-open it in After Effect.

Strange. You could try installing K Lite Codec Pack. Reboot
I’d also clear your Media Cache.

Don't know why it's not working.  But for a quick fix, I'd transcode the video in Premiere to 1920x1080 ProRes 422 and see if that works in After Effects.

I'd reccomend installing the official Microsoft Camera Codec Pack if you haven't already.
https://www.microsoft.com/en-us/download/details.aspx?id=26829
See if that solves it.

Why a 2nd answer? Also, note that OP is on a Mac.

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


text:
How to rotate a (vertical) clip for multicam in Final Cut Pro X
I have two clips taken at the same time: one taken from a camera, one taken from an iPhone. I am going to switch between the clips to change angles, so I need to create a "New Multicam Clip" in Final Cut Pro X which I use for editing.
My problem is, that the clip from an iPhone for some reason is taken vertically, so I need to rotate it by 90 degrees. While it is easy to rotate a single clip back once it is on a storyline, there seems to be no option either to rotate the clip when it is in the library nor after it was combined into a multicam clip. What I get is a combination of a horizontal footage from a camera and a vertical footage from an iPhone.
How can I:
a) either rotate the clip when it is still located in the library, so it will be horizontal when multicam clip is being created?
b) or rotate by 90 degrees only one clip (angle) of a multicam clip?

I think you can do this without having to transcode your footage. Create the multicam clip with both videos as-is, then double-click the multicam clip to get to the multicam editor where you can select each clip individually and make changes to their rotation etc, individually. I've put together a quick screen capture of the steps here:


text:
Histogram measurement in single spot
I have a video that I shot for scientific purposes. I would like to measure the colour information in a single spot and export for example the RGB or CMYK values of that spot through every frame into a text file.
The video itself is a .MOV file which I colour-balanced with a white card. I just couldn't find any information on how to extract the information with any software. My university provides Adobe Photoshop in which I am able to open the video.
Does anyone know a software which enables me to extract that data? Or does someone know how I can do that with Photoshop?

A histogram is a representation of the distribution of channel values for the entire picture. You can't have a histogram of a single pixel. You might get better search results if you search for "point sample". https://en.wikipedia.org/wiki/Histogram

Oh, sorry, that was a terminology mistake of mine. I am looking for the colour information in one spot, as for example the RGB information.

Using ffmpeg, a free command-line tool, you can do
ffmpeg -i in.mp4 -vf "crop=1:1:234:541:exact=1,tile=50x10,format=rgb24,histogram" out.png

A series of filters are run on the input video.
The crop filter takes each frame and extracts a 1x1 sized window i.e. a single pixel at co-ordinates (234,541) measured from top-left of frame. Numbering starts at 0.
The tile filter collects all of these single pixel frames into a single frame of dimensions 50x10. It is important that the product of these dimensions (500) match the total number of frames in the video. If it's greater, the difference will be black pixels added by the tile filter and throw off your histogram; if less, frames will be skipped. Worst case scenario, your frame count is prime, so you can either do Countx1 or MxN where M*N is count + 1.
The next filter converts the tile output to a RGB pixel format, since videos typically are YUV.
The histogram filter generates a graphical RGB histogram which is saved to a PNG. See the filter doc for options to change layout or image size.

The first thing I'd be looking at is Processing. There's a library that lets you read video, there's an example here that shows how to to sequentially grab frames from a video.
Then (instead of displaying the frame like it does in that example) you need to find the channel values for the spot which you could do by copying the frame to a PImage. Then the value of the pixel (x,y) is found in the PImage property pixels[x,y]. Finally use createWriter() to output the data to a file. You could even get fancy and use the mouse to control your sample point, and so on.


text:
Nginx RTMP didn't accept HEVC h265 input format
I'm trying to created live event broadcast on my VPS server , to make the audience able watch my broadcast I use Nginx RTMP that's produce link at this format http://192.168.1.5:8080/hls/live.m3u8 this is my ffmpeg command
ffmpeg  -re -i <input> -s 634x360 -vb 110k  -c:v libx265 -preset ultrafast -c:a aac -ab 38k  -ar 44100 -f mpegts  rtmp://localhost/hls/live
command output
frame= 1465 fps= 25 q=-0.0 size= 1231kB time=00:00:58.56 bitrate= 172.2kbits/s speed=0.999x

Nginx config file
server {
listen      8080;
server_name  localhost;
 location /hls
   {
     types
       {
                application/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
       }
      root /tmp;
      add_header Cache-Control no-cache;
    }
  }

so the encoding runs on mealtime but when I try to access live.m3u8 url I got nginx 404 Not Found error message like Nginx didn't generate .m3u file at all .
==update
Alright I found workaround solution to generate .m3u8 file directly from ffmpeg using this command
  ffmpeg -i <input> -map 0 -c:v libx265 -vb 300k -c:a aac -ab 38k -ar 44100 -preset veryfast -f ssegment -segment_list /var/www/vhl/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/vhl/live%01d.ts

I was able to play it via VLC for which is good for now
to gain more performance e.g you have huge number of audience mount your output folder /var/www/vhl/ as tmpfs

HLS does not accept HEVC.

HLS does support HEVC using an mp4 container. RTMP does not support HEVC.

Alright I found workaround solution to generate .m3u8 file directly from ffmpeg using this command ffmpeg -i <input> -map 0 -c:v libx265 -vb 300k  -c:a aac -ab 38k -ar 44100  -preset veryfast -f ssegment -segment_list /var/www/dmain/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/dmain/live%01d.ts I was able to play it via VLC for which is good for now .

Sorry, I meant to write FLV.

Update, as of March 2023, RTMP has added support for HEVC. Refer to Enhanced RTMP. Therefore, both RTMP and FLV standards now support HEVC.
Support status for related open-source projects:

OBS 29 supports RTMP HEVC. Refer to Enable AV1, HEVC via RTMP to YouTube.
FFmpeg's patch for Enhanced RTMP support has been submitted and is under review.
mpegts.js 1.7.3 supports HTTP-FLV HEVC. Refer to FLV with HEVC support.
SRS media server 6.0 supports RTMP HTTP-FLV HEVC. Refer to H265: Support HEVC in RTMP/SRT/HLS/WebRTC/DASH/GB28181.

To test RTMP HEVC, you can use OBS, patched FFmpeg, and SRS. First, start SRS:
docker run --rm -it -p 1935:1935 -p 8080:8080 ossrs/srs:6 \
  ./objs/srs -c conf/hevc.flv.conf

Download OBS 29+ from here, select the HEVC codec, or use FFmpeg 6.0 to publish RTMP HEVC stream:
ffmpeg -stream_loop -1 -re -i doc/source.flv -acodec copy -vcodec libx265 \
  -f flv rtmp://localhost/live/livestream

Note: Build or patch FFmpeg 4/5/6+ with HEVC over RTMP, please see this post.

Now, you are able to play HTTP-FLV or HLS with HEVC codec:

HTTP-FLV(by H5): http://localhost:8080/live/livestream.flv
HLS(by VLC or fflay): http://localhost:8080/live/livestream.m3u8

Keep in mind that FFmpeg 6.0 does not support HEVC over RTMP until the following commit
637c761b:
commit 637c761be1bf9c3e1f0f347c5c3a390d7c32b282
Author: Steven Liu <liuqi05@kuaishou.com>
Date:   Mon Aug 28 09:59:24 2023 +0800

    avformat/rtmpproto: support enhanced rtmp

    add option named rtmp_enhanced_codec,
    it would support hvc1,av01,vp09 now,
    the fourcc is using Array of strings.

    Signed-off-by: Steven Liu <lq@chinaffmpeg.org>

For details, please refer to SRS HEVC Usage.


text:
Reduce CPU usage when downscaling HD>SD>Low on the same codec (H264)
I'm using ffmpeg over 3 years now mainly I'm doing live broadcasting on my site , currently I'm preparing to do 5 livebroadcast on the same time using my VPS server CPU E3-1240 v5 OpenVZ Since I'm only allowed to use 1 vCore CPU usage jumps high very fast . What I ask , I know H264 algorithm based on calculation of previous frame (ref frame) and I frame So I tried -copyinkf and -break_non_keyframes 1 with no effect on the speed BTW here is my main broadcast command :-
ffmpeg -re -i "http://sorce.m3u " -s 720x406 -r 23.976 -vcodec libx264  -profile:v high444  \
-crf 35 -copyinkf - break_non_keyframes 1 -preset slow -acodec libfdk_aac \
-profile:a aac_he_v2 -b:a 8k -map_metadata -1 -f flv rtmp://localhost/hls/live

Current I use -preset slow to improve image quality little bit CPU usage 60% even with preset fast CPU usage were 47% -preset veryfast CPU-usage 35%

What's wrong with the faster presets?

it's peak the CPU usage sometime goes up 50% which will kill the tow process , and their is huge quality drop, this setting is the lowest I can get for ~265kbpsbroadcast ,,+ I test it without the extra -copyinkf flags with no different at all , BTW I'm using crf method with value of  35

There is no way to use less CPU without reducing quality. If there was, that setting would be turned on by default.

I'm using low pic size 720x406 with low bitrate , on my laptop cpu its run it fast , but the server VPS limited to 1 vCore so my code above will uses more cpu resources .

Alright I found out what's was peak CPU usage -profile:v high444 once I remove it the cpu usage drooped dramatically to less  then 30%


text:
How to use ffprobe to obtain certain information about mp4/h.264 files
I am but a lowly PHP developer that has been tasked with retrieving some basic information about 100's of thousands of video files.  I've had some luck using ffmpeg and extracting the video bitrate, video width, video height, duration, and aspect ratio from them, but with an error ratio of about 5%, this still leaves me with an enormous number of files that I don't know how to deal with. The videos DO play,
but the massive amount of data that ffmpeg returns in has me baffled as to how parse the returned XML to find what I need with all the conditions that I seem to be encountering.  (The files are a collection from the past 15 years or so, some newly encoded, others converted years ago)
At any rate, I found the following use of ffprobe to get duration, and was hoping that someone here who understands the complexities of using ffmpeg & ffprobe would be kind enough to assist me with finding the other values I need in a more straightforward way than the crazy code I'm using myself, created to climb through the full results of ffmpeg.
ffprobe -i "video.mp4" -show_entries format=duration -v quiet -of csv="p=0"

Thanks so very much in advance.
CLARIFICATION:
I should add that with the below cmd, I can "see" what I need, but I don't understand how to extract what I need. E.g. retrieving the VIDEO bitrate, and suppressing/ignoring the AUDIO bitrate, or determining which of 2 different durations to use (Audio/Video durations?)
C:\>ffprobe -v error -show_entries stream=width,height,bit_rate,duration \
-of default=noprint_wrappers=1 input.mp4

duration=1712.000000
bit_rate=64000
width=320
height=240
duration=1711.946113
bit_rate=359827
duration=1712.000000
bit_rate=N/A
duration=1712.000000
bit_rate=N/A

If you only want the information from the first video stream use -select_streams v:0:
ffprobe -v error -select_streams v:0 -show_entries stream=width,height,duration,bit_rate -of default=noprint_wrappers=1 input.mp4

Example output:
width=640
height=480
duration=10.000000
bit_rate=942704

To see a list all entries use -show_streams and/or -show_format instead of -show_entries.
See FFprobe Documentation: Writers for various output formatting styles.
See FFmpeg Wiki: FFprobe for more examples.

Thanks so much for the assist....I had to accept the other answer only because I was alerted of it first, and it did the trick..

@GDP Please consider: notified first in this case, because it's the latest answer.

@poor I take the rep point quite seriously, but this answer wasn't on my screen to accept until I accept the other, then it appeared, thus the immediate apology.  Sorry everyone...really didn't mean to offend.

Source
If you want to get the bit_rate of the first video stream you could use:
ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate \
-of default=noprint_wrappers=1:nokey=1 input.mp4

Where -select_steams v:0 is selecting the first video stream and :nokey=1 gives the value without the key. You could also extract the information by piping it to grep but I'm not sure if that's available on your system.
ffprobe -v error -show_entries stream=width,height,bit_rate,duration \
-of default=noprint_wrappers=1 input.mp4 | grep -oP "(?<=bit_rate\=)[0-9]+"

Hope this helps!

"piping it to grep"...sounds like something I might have done as a teenager, lol...THANKS for the assist!

Thanks @GDP but LordNeckbeard's is the answer you should probably accept as it was published first

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


text:
Lossless concatenation of slightly different MP4 files
I am trying to combine 2 or more .mp4 videos into a single video (concatenation). But I am getting timestamps errors (with ffmpeg concat demuxer protocol). The videos are very similar (same resolution, fps, etc.), so I'm not sure what is causing this. I am open to trying different tools (hopefully something that runs on linux).
Apparently they are slightly different in some way.
How can I concatenate them, without losing quality?
If you need more information please tell me what command I should run to print the required details.
Update: I am trying to concatenate 4 files. I am using the command:
ffmpeg -f concat -i list.txt -c copy full.mp4

where list.txt is a text file with the contents:
file 1.mp4
file 2.mp4
file 3.mp4
file 4.mp4

By request I executed the same command with -report as added as the first option. This produced a large log file (110 MB) that you can see here: http://www.filedropper.com/ffmpeg-20180606-024711.
I also ran ffprobe on each file, and uploaded the results here:

ffprobe 1.mp4: https://justpaste.it/64pih
ffprobe 2.mp4: https://justpaste.it/6r4ig
ffprobe 3.mp4: https://justpaste.it/77iij
ffprobe 4.mp4: https://justpaste.it/3xdoi

Run the same command with -report added and share the report file

@Gyan The report file is ~ 110 MB (is that normal?). I uploaded it here http://www.filedropper.com/ffmpeg-20180606-024711.

That's too large. Share output of ffprobe file and ffprobe file2 as well as your command.

@Gyan Please see edits in the question. I added the requested information.

Your 2nd file is different. You can re-encode it this way,
ffmpeg -i 2.mp4 -map 0:a -map 0:v
       -c:v libx264 -profile:v main -c:a aac -ar 48000
       -video_track_timescale 2500   2-new.mp4

Depending on how the video in the other files was encoded, you may need to try adding -bf 1 or -bf 0.

Thanks. The resulting file is almost half-the size (and smaller than what I expect from similar files of similar duration). Is this lossless?

It uses CRF 23 as default encoding. Add -crf 18 for visually lossless result


text:
ffmpeg hardcoded subtitles from the top, bigger, with thicker stroke, on a dark background
I found this page (I can't comment or answer there so here's a new question):
Render srt subtitles to video?
with this line which works fine:
ffmpeg -i input.mp4 -filter:v subtitles=subtitle.srt -c:a copy -c:v libx264 -crf 22 -preset veryfast output.mp4

I need the following and can't get it done:

subtitles lines start from the TOP of the canvas
subtitles have bigger character size and thicker stroke
subtitles area has a semi-transparent dark background

mencoder might be another viable manner to do it.

Aegisub
Use ASS subtitles. Style them in Aegisub. You can style each letter or word individually, or apply the desired styling to all subtitles. See the documentation for detailed instructions.

Example ASS file:
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None

[Aegisub Project Garbage]
Last Style Storage: Default

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,48,&H00FFFFFF,&H000000FF,&H00000000,&H80000000,0,0,0,0,100,100,0,0,1,6,0,8,10,10,20,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:05.00,Default,,0,0,0,,Top of canvas. Bigger font size. Thicker stroke.

Without Aegisub
You can apply styling via the subtitles filter force_style option in ffmpeg. This should work with any format that the subtitles filter accepts.
ffmpeg -i input -vf "subtitles=subs.srt:force_style='Alignment=6,Fontsize=48,Outline=8'" output

Refer to the example ASS file for accepted force_style options, but it will not allow you to style each letter or word individually as you can in Aegisub.
Note that ScaleX and ScaleY values when used in force_style are a factor, not a percentage, so the accurate values would be 1,1 (not 100,100) in that case.
Transparent background
This can be tricky due to some limitations of libass, but it is possible. See How to set background to subtitle in ffmpeg?

Thanks @LordNeckbeard!!!
I was using Aegisub 3.2.2 on Ubuntu Linux to create these subtitles without exceeding the 15 cps reading speed.
I'll dig into its docs. From this page on styles and the Highlights one, at first glance, it seems to me as I can not render the video with hard coded subtitles using Aegisub alone, can I?
For now I kept using the SubRip .srt format and applied your hint on ffmpeg, great!

It's 720p and I used this line:
ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Alignment=6,Fontsize=22,Outline=2'" -c:a copy -c:v libx264 -crf 22 -preset slower output_Alignment_6_Fontsize_22_Outline_2___slower.mp4
(Separate comment because otherwise it was too long, the platform didn't allow it. I guess I should "accept" you answer but can't see how to do it, yet.)

could you please point me to exhaustive docs on how to use the force_style option? I can only find examples here and there on the web, e.g. no alignment options explained (tried 7 out of curiosity and it's top-right).
Again THANK YOU A LOT! (I tried to upvote your answer, the platform says it gets recorded but not visible to the public because I don't have enough reputation... maybe that's also why I don't find any button or link to "accept" your answer, I hope you won't mind, sorry.)

@JazzTp I'm not sure if you can use Aegisub alone to hardsub, and laziness prevents me from looking it up. I've only used it to create subtitle files. Alignment is described under Line Alignment (refer to \a and \an tags). force_style seems to use the legacy positioning (\a) which makes less sense than the more current "number pad" positioning system (\an). Only documentation on -force_style is under the subtitles filter docs which I linked to in the answer, but the ASS Tags page will help.

Thank you again @LordNeckbeard everything clear (impressive possibilities with the Advanced Substation Alpha format).

force_style only implements the tags set per-style in the INI section of the ASS file.

It worked with the ASS format: ffmpeg -i input.mp4 -vf "subtitles=subs.ass" -c:a copy -c:v libx264 -crf 22 -preset slower output_subsASS_Alignment_8_Font_Arial_55_Outline_5.0___slower.mp4 - Thank you @Gyan, I've actually just seen your comment (which I do not fully understand yet to be honest) when coming here to add this one.

An example with srt format and where the original video needed rescaling, because it was too low res to carry the subtitles text in decent resolution:
ffmpeg -i input.mp4 -vf "scale=1080x720,subtitles=subs.srt:force_style='Alignment=2,Fontsize=22,Outline=2'" -c:a copy -c:v libx264 -crf 22 -preset slower output_1080x720_Alignment_2_Fontsize_22_Outline_2___slower.mp4

Interestingly, fonts come out bigger when using the same font size in the force_style option versus when used in Pinta (Ubuntu graphic editor). Any thoughts on why this is the case?

@RoelVandePaar Never heard of Pinta. Maybe a difference in font sizing (pixels vs picas vs points).


text:
how to get realtime output from ffmpeg
I am currently grabbing a live stream video with the following command:
ffmpeg -i https://urlToTheStream/playlist.m3u8 -f image2 -q:v 30 C:\pathToOutputFolder\%01d.bmp

video is running in 24 fps.
I am then live-processing the bmp files with a self written java program.
My processing program is a bit faster than the output of ffmpeg. i can see that ffmpeg produces packages of bmp files. Around 25 and then pauses.
Is it possible to tell ffmpeg not to buffer anything and instead just producing "in realtime"?
At first I used jpg format which was clearly slower than bmp. I changed quality to 30 which helped too. But I still have a latency about 0.7 seconds compared watching the stream in the browser. I also tried the no buffering option with no efford.
Thanks for any tips!
edit: code format settings in text

If latency matters to you, you shouldn't use HLS in the first place.

ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe -
Read from stdout pipe, The format is documented here https://wiki.multimedia.cx/index.php/YUV4MPEG2

Thanks for the answer.
Before I start messing around with piping (I am using Java under Windows) I tried to route the pipe to ffplay to see if lag is less.  fmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -f rawvideo -pix_fmt yuv420p -s 1440x1080 -  encoding seems not quite to function right, i have a shifting picture, but its quite recognizable, that the lag is still there.

You need to force the same format on ffplay, or skip it altogether.

@Gyan Thanks for the reply. ffplay doesnt support the yuv4mpegpipe format I think. Do you have a hint for me, what you mean by >forcing or >skipping together ?

ffplay supports everything ffmpeg does. ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -i -

ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -i - works, but the lag is still around 1 second compared to the video playing in my browser in parallel.
https://image.ibb.co/jietEd/z.jpg
See, that the speed should be high enough.


text:
Low conversion quality using ffmpeg
I need to convert flv video into mp4 video, so I used this command:
ffmpeg -i input.flv -c -vcodec libx264 -acodec copy output.mp4

But output video has little bit worse video quality, how can I fix it?
MP4 info (output):

video: 472kb/s bitrate, 680*480, 24 FPS
audio: 112kb/s bitrate, 44.1 kHz, mpeg audio, stereo

FLV info (input):

video: 1500kb/s bitrate, 680*480, 24 FPS
audio: 112kb/s bitrate, 44.1 kHz, mpeg audio, stereo

UPDATE:
I tried with -crf 18 and this is result (colors of output are more bright and look at that yellow line on the cap, on the output image that yellow line contains  something like noise).
Input:

Output:

Add -crf 20 ..

@Gyan why 20? 23 is default, right? And 0 is lossless, so why no 0?

0 output isn't compatible with most players. Low CRF offers diminishing returns. 18 is considered visually lossless, but you don't need to try that first.

@Gyan What is wrong with this command
ffmpeg -i input.flv -crf 20 -c -vcodec libx264 -acodec copy -copyts output.mp4? I get an error: Unable to find a suitable output format for 'libx264'

Remove -c. Unless you have specific needs, remove -copyts as well.

@Gyan -c is codec right? And why remove copyts? It just copy timestamp, what is it good for?

You have not set a value for -c and already specified vcodec and acodec so not required. copyts may lead to mux issues depending on output vsync.

@Gyan thank you, by mux issues do you mean that video and audio can be not sync? Look at updated question.

Not sync directly, but timestamp fidelity and drop/dup decisions if source timebase and output timebase have much different resolutions.

As far as the color is concerned, looks like the source is full range and the output is flagged or treated as limited range.

Lossy codecs such as x264 degrade the image quality by design, if you don't want to lose image quality you either have to use a lossless codec or better yet, not re-encode at all.
I assume the source material is either H.264 or MPEG-2, so the best solution in your case would be to simply copy all the streams into the new container:
ffmpeg -i input.flv -c copy output.mp4

Here's the command for using x264's lossless mode if you have to re-encode for whatever reason:
ffmpeg -i input.flv -c:a copy -c:v libx264 -crf 0 output.mp4

Please higher your -minrate, -maxrate, -bufsize and study its codec. Download the Better container for video codec and audio codec separately. encode the codec in these containers but follow these steps:
1. Download the audio and video separately. you can do this by adding -vn and -an on the output command line. -vn means 'no video' while -an means 'no audio'. After that, study the codec of video or audio, and encode it to its better container... Here are the best container for modern codecs.
"Audio/Video codec"

*AAC/H264 is better on (TS)
*OPUS is better on (MKV)
*VP9 is better on (AVI)

2. After downloading the video/audio separately, you need to merge them together of course. Please include your said -minrate, -maxrate, and -bufsize. Don't forget to study your codecs and join them together with these containers:
"Merging"

*Mixing VP9 and OPUS is better on (MKV)
*Mixing H264 and AAC is better on (MOV)
*otherwise most incompatible codec is better on (MKV)


text:
Camera-projector installation and reducing projector feedback
I'm working on a top-down projection game where i detect objects from the real world and project contours on them. My problem is with the output of the projector, I would like to know how to eliminate the feedback/not pick up the projector's output. Will using an infrared camera guarantee that or should i use other things?
I tried placing a solar filter (from a floppy disk) in front of the camera which helped but i had to have a bigger light source in order to see the real objects.
This is my first time working on such a project so i would appreciate your help.

If you place an IR-blocking filter in front of the projector and a IR-pass filter in front of an IR-sensitive camera and illuminate your objects with IR light, then the camera will see nothing from the projector, and you can color your contours with any visible light colors.


text:
Vegas Pro blurring the edges of my sources
I am composing two 'Solid Color' media generator sources in Vegas Pro: a green background and a red rectangle on top of it (using Pan/Crop).

My goal is to have the edges of the red rectangle completely sharp, but no matter what I do, upon rendering I end up with a very annoying sort of anti-aliasing which creates a visibly black border at the edges.

I have tried a handful of quality presets, rendering presets, turning GPU acceleration on or off, the result ends up roughly the same. It even renders this way if I use "save as an image" in the Preview window, despite the Preview showing sharp edges.

Have you tried rendering into a 4:4:4 format? Does it make a difference?


text:
Adding AO render pass in After Effects
I am compositing a modeled sea scene in AE. Here's what I have:

Adding in my AO layer gives nice strong shadows as shown:

However it also covers my blue sea (primarily an AE 4color background)....
How can I keep the AO benefits to the shadows on my critters, but also keep my background?
As rendered, I have alpha, color pass with alpha, AO and depth (which is driving AE lens blur). I can render anything else needed.

Let's try to make it work. :D
1) Place 'Alpha' layer above 'Ambient Occulsion',
2) Change setting in 'TrkMat' of the layer 'Ambient Occulusion' to 'Luma Matte'
if Luma Matte is not working, try with 'Alpha Matte' (I'm not sure about your alpha layer :)),

3) Precompose 'Alpha' + 'Ambient Occulsion' layers ctrl+shift+c,
4) Set precomposed layer to 'Multiply' Mode.
Done!

Absolutely perfect! It was Luma matte that worked, as you suggested... And the solution worked without precompose, and this probably points to something I still do not understand about AE: What additional benefit does precomp offer beyond just stacking things where they are? But THANK YOU !

Precomposing is just collapsing layers into one, in this example I recommend precomposing, for cleaner workflow. becouse propably you are not going to modify alpha channel in AO :D


text:
Masking Radio Waves in After Effects
I created a mask around one part of a radio wave in after effects, to hide that part of the wave. However, when I lowered the opacity of the mask, that left part of the wave doesn't disappear. I've attached a photo below.

I'm using Adobe After Effects 15.1.1. Any help is appreciated.

Yeah, that's a weird thing with the radio waves effect. It seems to be applied after the layer masks, and thus ignores the masks for the layer. This happens for a few effects, particularly ones that generate alpha. It might have something to do with that effect dating back at least to the Bronze Age—you'll have noticed how dog slow it is.
The only way to get the masks to do what you want is to precomp the layer with the effect on it (cut the mask off the layer, then hit cnd / ctrlshiftc and choose move all properties into new composition), and then paste the mask on to the precomp in your original composition.

Yeah, thanks; I was able to lower the opacity afterwards.


text:
How to have an overlay move to specific points at specific frames using ffmpeg
The folliwng should basically have an image appear on frame 438, and then the same image move to a different position on frame 339, then basically disappear for the rest of the video.
ffmpeg -i C:\src\assets\video\base.mp4 -r 25 -i C:\card.png -y \
    -filter_complex [1:v]setpts=PTS-STARTPTS+(1/TB)[1v]; \
    [0:v][1v]overlay=x=0:y=0:enable='between(t,438/25,439/25)'[1v]; \
    [0:v][1v]overlay=x=300:y=300:enable='between(t,439/25,440/25)'[2v]; \
    [1v][2v]concat=n=2:v=1:a=0[out] -map [out] -map 0:a -ss 17 C:\temp\j7kthb0v\composit.mp4

I can't seem to get the actual command correct or output anything that resembles what I need.
I know I'm close, I can get one frame overlayed, but I can't get more than that.

Use
ffmpeg -i C:\src\assets\video\base.mp4 -i C:\card.png -y \
       -filter_complex "[0:v][1:v]overlay=x='if(eq(n,439),300,0)':y='if(eq(n,439),300,0)':enable='eq(n,438)+eq(n,439)'[out]" \
       -map [out] -map 0:a -ss 17 C:\temp\j7kthb0v\composit.mp4

You may need to escape the commas in filters depending on your shell i.e. n,438 -> n\,438

That's awesome, thankyou, much simpler than multiple overlays

I didn't ask this in the original post, but I'm using this solution for animation, I want to basically specify a position for X & Y, based on a frame number.
I can achieve this doing nested if else hell. but is there a nicer way?

Not really. The filter isn't meant for animation like that. You can simplify it somewhat like this: x='0*eq(n,438)+300*eq(n,439)+X*eq(n,567)+...'

I've been playing around with the variable n, in overlay if I were to do: overlay=x='( 605 + -0.8023952095808383 * n)':y='( 406 + -0.4365269461077843 * n)':enable='between(t,438/25,605/25)', does this mean the n would equal 0 and incremented for every frame it's visible for ? (605 - 438)

Those expressions mean the overlay starts at (605,406). With each frame, (0.80,0.43) is subtracted and then rounded. But it's only visible (at the computed positions) between times 17.56 and 24.20

Thanks, I  understood that part, but does: n == 0 at frame 438 and n == 1 at frame 439?

No, n is the frame no. First frame is n = 0.

So in my example n would equal 438 when it is first visible?

That's right...

Are you able to give me advice on the zoompan? I'm basically trying to tack onto the end of the overlay, a zoom effect that zooms out of the image after the start frame (438 and increments to a zoom out of 0.43
This is what Ive tried but it doesnt seem to apply any zoom
zoompan=z='if(gte(in,438),min(pzoom-0.04,0.43),1)':d=1

zoompan can't zoom out to a canvas larger than the input. You'll have to pad the video beforehand.

I don't understand what you mean by that mate

Also, the zoom is on a layer with an overlay image, so isn't the zoom onlya pplied to that?

Actually I can see the background animated now too, dammit

The zoom represents the amount of zoom if input width is 100 then zoom=2 crops out  a window of width 50 pixels. zoom can't go below 1. You have to pad the subject frame with extra pixels (which can be transparent) and then zoom out on that padded frame.

So if the input width is actually 1659, and the main video is 1920, I have to pad the difference between the two?

zoompan operates upon a single input. If that input is the result of an overlay filter, zoompan doesn't know anything about that. All it sees is the composite image. Maybe post a new Q with an illustration of what you are trying to do.

I've done this, https://video.stackexchange.com/questions/24339/apply-scale-to-an-overlay-on-existing-background-video if you wouldn't mind having a look, working on adding a gif to that post now


text:
Benefit of having a GPU for adding watermark using FFMPEG using x.264
My understanding is that GPU acceleration is not beneficial to encoding using x264.
The question is if there is any benefit to having a GPU if you are also adding a watermark.

GPU acceleration is beneficial to encoding; that is its main use. But it has no benefit with x264 which is entirely CPU-based.
There is a H/W overlay filter but the speed improvements are negligible, AFAIK, because of the memory ops transferring data to and from GPU memory. It's primary benefit is for when the entire pipeline is GPU-bound.

I should have clarified, I understand that there is built in encoding acceleration in most GPU's, what I am asking is if you are using x.264 if there is a benefit to using a GPU


text:
Capture original timecode with ffmpeg from decklink
I am trying to capture tape content via a BlackMagic Decklink Quad 2, using ffmpeg.
I believe the timecode is passed on through the Decklink because when capturing manually with MediaExpres the timecode is present in the file. So I suspect my settings for ffmpeg are incorrect.
./ffmpeg -loglevel trace -format_code pal -timecode_format rp188vitc -f decklink -i "DeckLink Quad (1)" -map 0:d  TC9atest_09.mov

This prints the following output (incomplete) from which I understand that it only seems to find audio and video streams. I have tried different timecode formats and a few stream mapping options but with no success so far.
Input #0, decklink, from 'DeckLink Quad (1)':
  Duration: N/A, start: 0.000000, bitrate: 167424 kb/s
    Stream #0:0, 5, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0:1, 6, 1/1000000: Video: rawvideo, 1 reference frame (UYVY / 0x59565955), uyvy422(top first), 720x576, 0/1, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output url TC9atest_09.mov.
Applying option map (set input stream mapping) with argument 0:d.
Stream map '0:d' matches no streams.
To ignore this, add a trailing '?' to the map.

Capturing stops after the message above. If I add "?" as indicated, capturing runs but there is no timecode written in the file. Without an explicit mapping for the d stream, there is also no timecode in the file created.
The only way that worked for me to add a timecode is with the manually specified timecode start -timecode, but this option does not work for my use case as I want the original timecode, not just a timecode.
./ffmpeg -loglevel trace  -format_code pal -timecode_format rp188vitc -f decklink -i "DeckLink Quad (1)"  -timecode 00:10:00:00  TC9atest_10.mov

Any pointers would be greatly appreciated.
Full output from the first command:
./ffmpeg -loglevel trace  -format_code pal -timecode_format rp188vitc -f decklink -i "DeckLink Quad (1)"    -map 0:d  TC9atest_09.mov
ffmpeg version 4.1.git Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Debian 7.3.0-18)
  configuration: --prefix=/usr/local/home/xxx/ffmpeg/build.static --pkg-config-flags=--static --enable-decklink --extra-cflags='-I/usr/local/home/xxx/Desktop/ffmpeg/build.static/include -I/usr/local/home/xxx/Desktop/ffmpeg/BM_SDK_11.1/Linux/include' --extra-ldflags='-L/usr/local/home/xxx/Desktop/ffmpeg/build.static/lib -L~/Desktop/ffmpeg/BM_SDK_11.1/Linux/include' --extra-libs=-lpthread --bindir=/usr/local/home/xxx/Desktop/ffmpeg/bin.static --enable-gpl --enable-version3 --enable-nonfree --enable-libfdk_aac --enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-openssl
  libavutil      56. 27.100 / 56. 27.100
  libavcodec     58. 52.101 / 58. 52.101
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 53.100 /  7. 53.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-format_code' ... matched as AVOption 'format_code' with argument 'pal'.
Reading option '-timecode_format' ... matched as AVOption 'timecode_format' with argument 'rp188vitc'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'decklink'.
Reading option '-i' ... matched as input url with argument 'DeckLink Quad (1)'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:d'.
Reading option 'TC9atest_09.mov' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url DeckLink Quad (1).
Applying option f (force format) with argument decklink.
Successfully parsed a group of options.
Opening an input file: DeckLink Quad (1).
[decklink @ 0x55fc4ab56540] Trying to find mode for frame size 0x0, frame timing 0/0, field order 0, direction 0, mode number 0, format code pal
[decklink @ 0x55fc4ab56540] Found Decklink mode 720 x 576 with rate 25.00(i)
[decklink @ 0x55fc4ab56540] Using 2 input audio channels
[decklink @ 0x55fc4ab56540] Frame received (#1) - No input signal detected - Frames dropped 1
[decklink @ 0x55fc4ab56540] Probe buffer size limit of 5000000 bytes reached
[decklink @ 0x55fc4ab56540] stream 0: start_time: 0.000 duration: -9223372036854.775
[decklink @ 0x55fc4ab56540] stream 1: start_time: 0.000 duration: -9223372036854.775
[decklink @ 0x55fc4ab56540] format: start_time: 0.000 duration: -9223372036854.775 bitrate=167424 kb/s
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, decklink, from 'DeckLink Quad (1)':
  Duration: N/A, start: 0.000000, bitrate: 167424 kb/s
    Stream #0:0, 5, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0:1, 6, 1/1000000: Video: rawvideo, 1 reference frame (UYVY / 0x59565955), uyvy422(top first), 720x576, 0/1, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output url TC9atest_09.mov.
Applying option map (set input stream mapping) with argument 0:d.
Stream map '0:d' matches no streams.
To ignore this, add a trailing '?' to the map.

If I don't map any stream, capturing works but the file does not contain a timecode. Full log linked.

Did you email me earlier?

Hi Gyan, I did not. I believe a colleague of mine did but as far as I know not with this particular question :).

Ok, my reply got bounced back. Share full log of your first command.

Updated with full log.

Show log of run without -map 0:d.

Done, I just left some of the repeated lines out.

Don't do that - paste or link the entire log.

Let us continue this discussion in chat.


text:
One flac file - many tracks - no cue - yet it's 'split' somehow
I have a music album in one FLAC file. There is no CUE file. When I try to play it with VLC or CMUS, it doesn't recognize individual tracks and plays it as one large file.
BUT if I import it into Vox player, it automatically recognizes individual tracks and splits it (gives it proper names and all). How is it possible? What am I missing? How do I make VLC and CMUS recognize the splits without CUE?
EDIT:
When I opened the flac file in a hexeditor, after a couple hundreds of symbols I found a long string starting with "CUETools 2.1." and containing all the cue information. How is it possible? Can I extract it? Why does almost no program recognize this type of internal cue instead of external cue file? It even contains the album cover image which is otherwise nowhere to be found in the file folder!

.flac files are derived from the Ogg container and can have metadata like cuesheets, cover images and seek tables. ffmpeg should recognize them as chapters.

@Gyan Would you happen to know how to extract full cue with the album artwork? I am on unix and playing flac files with embedded cue is impossible.

You can use metaflac to export both the cuesheet and cover image.
metaflac--export-cuesheet-to=out.cue --export-picture-to=out.png input.flac

Good try but it says "ERROR: FLAC file has no CUESHEET block". I can export the image nevertheless, thank you.

Can you share the file?

It's over 350MB. It starts with fLaC, then at 6786th byte cue starts with "CUETools 2.1.6A?ALBUM= [...]" yadayada typical cue, finally cue ends with "REPLAYGAIN_ALBUM_GAIN=-6.90 dBREPLAYGAIN_ALBUM_PEAK=0.997711
TRACKTOTAL=17kà image/png k·PNG" after which (presumably) the album art picture is stored (the PNG signature correctly starts and ends with IEND). And then there is a second PNG picture. I don't know what that is as metaflac gave me only one picture.

I think I could probably export it with CUETools but I'm on unix.

Does metaflac --list input.flac show the cuesheet?

Yes it does. 4 metadata blocks, 0th contains sampling etc, 1st contains seektable, 2nd contains the cue (it starts as "type: 4 (VORBIS_COMMENT)", idk what that means) and the last - 3rd metadata block contains picture ("type: 6 (PICTURE)")

wait, actually there's 2 more metadata blocks: 4th is an another PNG and the 5th is padding

So the cue is embedded as a comment rather than as the specified cuesheet tag. You can export just that tag to a cue file.

How do I do that? Also, I managed to extract both pictures from metadata and convert them to png. They're file size is different but otherwise they're identical - album art.

How do I export everything so that I can have a cue file correctly combined with both FLAC and the exported album art? So that VLC will show album art properly as well automatically recognizes cuts in the flac?

Hmm.. Apparently, VLC recognizes the album art (although it doesn't show it). And since I already exported the CUE from hex, it works properly.

Something like metaflac.exe --list --block-type=VORBIS_COMMENT in.flac | grep CUESHEET -A 500 | sed s/.*=// > out.cue

Yea, that's basically what I did initially. But still, thank you, that metaflac -list was really interesting. There goes your green tick, for being the only person willing to be bothered by me :)


text:
Can I update the scan type by ffmpeg?
I have a video, which was recorded by kurento.  But the video can't replay. after I checked it,  I think the reason is the scan type is incorrect.
The work video,
Tony-MacBook-Pro:ios tony$ ffmpeg -i good.webm
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --disable-jack --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, matroska,webm, from 'good.webm':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2018-06-29T17:15:35.000000Z
  Duration: 00:00:57.52, start: 0.000000, bitrate: 438 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 480x640, SAR 1:1 DAR 3:4, 1k tbr, 1k tbn, 1k tbc (default)
    Metadata:
      title           : Video
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Audio

The bad video,
Tony-MacBook-Pro:ios tony$ ffmpeg -i bad.webm
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --disable-jack --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, matroska,webm, from 'bad.webm':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2018-06-29T13:52:20.000000Z
  Duration: 00:00:35.19, start: 0.000000, bitrate: 367 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p, 480x640, SAR 1:1 DAR 3:4, 1k tbr, 1k tbn, 1k tbc (default)
    Metadata:
      title           : Video
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Audio

I compared both, the only difference is the 1st one has yuv420p(progressive), the 2nd one has yuv420p; so I guess that's the root cause, and want to change the scan type to try.
bad file: https://www.dropbox.com/s/t07pfe69a78h1tg/bad.webm?dl=0
good file: https://www.dropbox.com/s/uivgb1trobhrg5n/good.webm?dl=0

That's just a container flag missing. libvpx doesn't support interlacing. Does ffplay play the file?

Thanks @Gyan , the ffplay can replay the bad.webm. but it can't be replay in kurento. I guess the reason is bad.webm doens't have "(progressive)"; how can I add it, and have a try?

The issue isn't the scan type but the timestamps for the video stream.
Run
ffmpeg -i bad.webm -c copy -an badv.nut

and then
ffmpeg -i badv.nut -i bad.webm -c copy -map 0:v -map 1:a new.,webm

The video timestamps start at some large non-zero number but the audio TS start at zero. That throws stream queueing out-of-whack since the sync relies on the stream with earliest start time within the file. The two step method works around that by isolating the video first into its own file.

Thanks @Gyan. After run your 2 commands. the new.webm can be replayed! can you explain what issue the timestamps of the bad.webm; and the reason.

Thanks @Gyen for your kind help.  But I still don't know why the issue appear. the video was created by kurento RecorderEndpo.

The issue appears because of the timestamp start_time difference  Why kurento created such a file, is best asked to kurento devs.

Can you tell me how to check the start_time for both video and audio?

ffprobe -show_entries stream=index,start_time,codec_type -of compact=p=0 in.mp4

I run "ffprobe -show_entries stream=index,start_time,codec_type -of compact=p=0 ./bad.webm", start_time for video and audio are same, both are "0.000000"

Compare video start_time with pts_time in ffprobe in.mp4 -show_packets -select_streams v -read_intervals 0%+#1  -v 0

ok, but if I have one video that ffprobe reports yuv420p(progressive) and when I encode with ffmpeg (-pix_fmt yuv420p) then ffprobe reports just "yuv420p" . So is there such an option to ffmpeg encoding to make ffprobe report (progressive) or is there not? My problem is I want to concatenate the two videos and they don't seem to work well, so perhaps this is the issue - I tried everything else. But even if this is not the issue, the original questions stands about ffmpeg option to set progressive. Thanks!


text:
Keeping sound from underlay video in creating PIP video with ffmpeg
I'm trying to make a video with an overlay video inside (PiP) but I can't get the sound source right, I need the sound from the underlay video but I keep getting the sound from the overlay video.
I don't have very much experience with or knowledge of ffmpeg, but after some searching around on the internet I found some ffmpeg commands and managed to put the following command together:
ffmpeg.exe -itsoffset 35 -i overlay-race-replay.mp4 -i underlay-race-live.mp4
-filter_complex "[0]scale=700:-1 [overlay];
[1][overlay] overlay=main_w-overlay_w-30:30:enable='between(t,35,552)'"
-profile:v high -level 4.1 -ar 44100 -ab 128k -s 1920x1080 -vcodec h264
-acodec libmp3lame output.mp4

It works great to create a video with an overlay video in it which shows up and starts at 35 seconds and ends and disappears somewhere before the underlay video ends which is just what I want.
Only the problem is the sound! In the output file you only hear the sound from the overlay video, and I want to keep the sound from the underlay video.
Does anyone know how to do this right?
What I need is, overlay-race-replay.mp4 resized to a width of 700 with kept ratio, inside underlay-race-live.mp4, showing up after 35 seconds, placed in the top right corner with about 30 pixels margin and only the sound of underlay-race-live.mp4
I would be very grateful for a solution, I think I've injured my brain in the documentations of ffmpeg I really can't make anything of it, it's like algebra to me.

Ah I found the answer to my question, I ventured into the ffmpeg documentations again and found that all I had to do was add -map 1:a in front of output.mp4 and I also added -c:a copy cause I thought that copies the same codec settings from the original videos or something, not really sure but it seemed better then putting all those specifications in like I did which I actually just left in there from the site that I found the main part of this ffmpeg command on.
My code is now working as I want it and I'll share it below:
ffmpeg.exe -itsoffset 35 -i overlay.mp4 -i underlay.mp4 -filter_complex
"[0]scale=700:-1 [overlay]; [1][overlay]
overlay=main_w-overlay_w-30:30:enable='between(t,35,552)'"
-map 1:a -c:a copy output.mp4
The itsoffset is the time before the overlay video starts playing, between(t,35,552) means the overlay video is visible between the 35th second and the 552nd second on the timeline of the output video.

Hi what if I want to keep sound of the overlay video?


text:
How to download and encode a video from a MPD manifest?
I can watch videos on a website with MPEG-DASH technology.
I can obtain the video's manifest.mpd file from the website. (I am not sure whether the file contains any user credentials or not, so I am not going to post it)
The video contains 3 tracks (1 video track + 2 audio tracks), and I found 3 <AdaptationSet/> elements with attribute mimeType in manifest.mpd.
They both contain a <SegmentTemplate/> element which has an attribute media containing the segment filename template which is being used to download the segment files in the browser from time to time.
The values to be used to construct the segment file URL are inside SegmentTemplate.SegmentTimeline.S elements.
For example :
...
<AdaptationSet mimeType="video/mp4" ...other attributes>
  <SegmentTemplate
    presentationTimeOffset="0"
    timescale="90000"
    media="chunk_video_$RepresentationID$_cs$Time$_mpd.m4s"
    initialization="chunk_video_$RepresentationID$_cinit_mpd.m4s"
  >
    <SegmentTimeline>
      <S t="0" d="900000"/>
      <S d="900000" r="352"/>
      <S d="638370"/>
    </SegmentTimeline>
  </SegmentTemplate>
  <Representation id="SOME-ID" codecs="avc1.640029" sar="1:1" bandwidth="1268094"/>
<AdaptationSet/>
<AdaptationSet mimeType="audio/mp4" ...other attributes>
...

will produce requests to
https://some-website-domain/some-path/chunk_video_SOME-ID_cinit_mpd.m4s
https://some-website-domain/some-path/chunk_video_SOME-ID_cs0_mpd.m4s
https://some-website-domain/some-path/chunk_video_SOME-ID_cs900000_mpd.m4s
https://some-website-domain/some-path/chunk_video_SOME-ID_cs1800000_mpd.m4s
https://some-website-domain/some-path/chunk_video_SOME-ID_cs2700000_mpd.m4s
...

some-website-domain/some-path is not sure at this moment, but I could figure this out.
The real question is:
Is it possible to download and encode all the segment files into one single video file?
---- EDIT ----
After running the following command:
ffmpeg -v 48 -i manifest.mpd -c copy out.mp4

I got this output:
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '48'.
Reading option '-i' ... matched as input url with argument 'manifest.mpd'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'out.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 48.
Successfully parsed a group of options.
Parsing a group of options: input url manifest.mpd.
Successfully parsed a group of options.
Opening an input file: manifest.mpd.
[NULL @ 0x7feff2000800] Opening 'manifest.mpd' for reading
[file @ 0x7feff1c0b100] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x7feff1c0b2c0] Statistics: 28989 bytes read, 0 seeks
manifest.mpd: Invalid data found when processing input

Should be as simple as ffmpeg -i in.mpd -c copy out.mp4. The dash demuxer will fetch the segments and demux in order.

Tried with ffmpeg 3.4.1, but got manifest.mpd: Invalid data found when processing input

I guess some data in the MPD is not in standard format, so ffmpeg could not construct the segment filename, for example, ffmpeg may not know id of <Representation/> is related to media of <SegmentTemplate/>.

Try with the latest version. There have been a number of bugs fixed over the last few months.

Updated to ffmpeg 4.0.1, still the same error

How to find the "invalid data"?

invalid data indicates that ffmpeg can't parse the mpd. Share full log.

This complete output is just the ffmpeg built information and this error message. How can I know which part of the file is invalid?

If there's no informative msg, then you need to switch to higher loglevel -v 48.

Please see the edited question

You can open a ticket at trac.ffmpeg.org. Be prepared to share the mpd file.

I think the videos are encrypted and I found something about the license files of Widevine and PlayReady in the source of the website. I think I could obtain the license file. Can ffmpeg deal with DRM?

I was able to download an MPD stream on Debian 11 Bullseye (ffmpeg 4.3.4) but not on Debian 10 Buster (ffmpeg 4.1.9).

Regarding your FFMPEG issue, you need to build/obtain FFmpeg with --enable-libxml2 configuration enabled to correctly parse a manifest.mpd file.
You can check whether your FFmpeg supports libxml2 by simply running it without any arguments. Here is the output from FFmpeg 4.1 I built with --enable-libxml2 (see --enable-libxml2 in the start of the 4th line of the output):
%./ffmpeg

ffmpeg version n4.1-10-g59e30c05d7 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
 configuration: --enable-gpl --enable-version3 --enable-openssl
--enable-libxml2 --enable-libssh --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-libopus --enable-libpulse --enable-gmp --enable-libmodplug --enable-nonfree
          libavutil      56. 22.100 / 56. 22.100
          libavcodec     58. 35.100 / 58. 35.100
          libavformat    58. 20.100 / 58. 20.100
          libavdevice    58.  5.100 / 58.  5.100
          libavfilter     7. 40.101 /  7. 40.101
          libswscale      5.  3.100 /  5.  3.100
          libswresample   3.  3.100 /  3.  3.100
          libpostproc    55.  3.100 / 55.  3.100
        Hyper fast Audio and Video encoder

Regarding your question above, once you have a working FFmpeg with --enable-libxml2, you can transcode the .mpd to .mp4:
ffmpeg -i manifest.mpd -codec copy out.mp4

Note: I use -codec copy above to avoid transcoding of actual video and audio.

I can see I have --enable-libxml2 but there are still errors when I try on a downloaded mpd file:
If you wish to override this adjust allowed_extensions, you can set it to 'ALL' to allow all```
But `-allowed_extensions ALL` produces errors also.
With youtube-dl it worked on the mpd URL (ffmpeg got 403 Forbidden).

Easy youtube-dl example on macOS (in the command line Terminal; Windows supported too):
$ youtube-dl -F https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
[generic] f08e80da-bf1d-4e3d-8899-f0f6155f6efa: Requesting header
[generic] f08e80da-bf1d-4e3d-8899-f0f6155f6efa: Downloading m3u8 information
[info] Available formats for f08e80da-bf1d-4e3d-8899-f0f6155f6efa:
format code           extension  resolution note
audio-English_stereo  mp4        audio only [en]
628                   mp4        320x180     628k , avc1.42c00d, video only
928                   mp4        480x270     928k , avc1.42c00d, video only
1728                  mp4        640x360    1728k , avc1.42c00d, video only
2528                  mp4        960x540    2528k , avc1.42c00d, video only
4928                  mp4        1280x720   4928k , avc1.42c00d, video only
9728                  mp4        1920x1080  9728k , avc1.42c00d, video only (best)

$ youtube-dl --format 628 https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
...
frame= 5257 fps=193 q=-1.0 Lsize=    6746kB time=00:03:30.16 bitrate= 263.0kbits/s speed=7.73x
video:6679kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.998669%
[ffmpeg] Downloaded 6907810 bytes
[download] 100% of 6.59MiB in 00:29

$ open f08e80da-bf1d-4e3d-8899-f0f6155f6efa-f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mp4

Use the browser's Developer Tools > Network to get the mpd/m3u8 (DASH/HLS manifest) URL when starting a streaming video.

works like a charm

In addition to ffmpeg and youtube-dl/yt-dlp mentioned upthread, you can try

streamlink -o /tmp/output.mp4 <MPD-URL> best (from https://streamlink.github.io/)

vlc <MPD-URL> (from https://www.videolan.org/vlc/)

gst-launch-1.0 playbin uri=<MPD-URL> (from gstreamer)

dash-mpd-cli <MPD-URL> (from https://github.com/emarsden/dash-mpd-cli)

Only dash-mpd-cli will work with DRM-encrypted content (assuming you have the necessary decryption keys).

ffmpeg -i manifest.mpd -codec copy out.mp4 almost works.
the file that is downloaded is corrupt. Only distorted colors are seen in the downloaded video.

For me the BaseURL wasn't a url it was the file names, so when you ran this
ffmpeg -i DASHPlaylist.mpd -c copy out.mp4
It doesn't know where to get the data from.

So what we can do is add the url of the .mpd file to each BaseURL or use the source of of the .mpd file to run ffmpeg. (edit each .mpd file you download to add the urls to each BaseURL or use the .mpd file from the URL)

Or
ffmpeg -i https://example.com/unique_id/DASHPlaylist.mpd -c copy out.mp4
Which should have the same out.mp4 file.


text:
Lighting a subject far away from the camera
My wife is starting to make exercise videos. We set up a great location in the basement but lighting has been an issue.
She needs to be spaced pretty far away from the camera (about 10 feet in front) so her entire body is in frame. Also there is a wall directly behind her - I'm guessing a ceiling light shining down on the wall and floor will reduce shadows from the front lights?
I'm wondering what the best kind of lighting would be for this setup. I'm thinking LED but not sure how many lumens, or how large the LED panels should be etc. I looked into softboxes but from what I've seen, they are better suited for closer camera distances.
She doesn't want to spend too much on lighting at the moment, so something bright and affordable would be ideal.
EDIT: What about some long fluorescent tubes stood up vertically on both sides of the camera?
Any suggestions? Cheers.

This is hard to answer without knowing the sensitivity of your camera, the ISO, the aperture of the lens, the look of the room, etc. But most importantly, the look you want.
I don't think a flat wall directly behind her is the best background. Take a look at this search. Almost every photo has quite some distance to the background.
So. First of all, try to have some distance to the wall. Let's call the spot where she will be standing as "X"
Second. Imagine what is the things you want the viewer to see? You could have some strip LEDs on the sides of X. Are you shooting vertical? Like for TicToc? or horizontal like norma video. Do you want the strips of light to show? Do you have enough space to put them away from the frame?
The same with softboxes. Do you want a "sporty" look? Put them on the sides of X and not so bright, Do you want a happy look? Put them at 45° very bright. You can use or make a ring light for an urban look.
If you have white walls on the sides, you could use a reflector bouncing the light on them, the same as the ceiling. But bounce them far from X, so you do not have a hotspot on them.
I am sorry I can not really answer. Look for tutorials about lighting, and search for a look you like.

But here are some things that you need to take into account.
Some Led lights have low CRI, this is the colors will be dull, look for LED lights that have a CRI above 90.
You can also be creative and add gels to color some lights, a bit warmer for the background.

Do not put the lights on the sides of the camera, except on the case you want an "urban look". It is the least flattering light there is. It is just a flat light.


text:
How is this basic 3D animation template created?
I found this "3D Character Template" which can be used in after effects:
https://videohive.net/item/martin-3d-character-man-presentermanager-product-promotion/6886216?s_rank=52
How can I make these 3D animated characters myself? Because I'd hate to use templates, it makes the work unprofessional so I want to learn to create these myself?

You answered your own question in your tags: use Animation in a 3D package like Blender.
But TBH your question is too broad to be answerable. To tell you how to make those 3D characters yourself we'd have to explain modelling, rigging, skinning lighting and rendering, not to mention the principles of animation. To give even a basic explanation of any one of those topics would be way beyond the scope of a Stack Exchange anser.
It's complex and takes a good while to master. If you want to do 3D animation, get a copy of Blender and start watching tutorials, reading books and practising. It's like any other skill set that has to be learned. There is no short cut... apart from buying templates.

Sounds like it takes more than a year, The way it looked so simple I thought it'd be easy, guess I was wrong :d

When I taught animation it took about a semester to get the students doing basic walk cycles, with one class per week.


text:
Video cam with poor compression ratio (H.264 produces videos at 2.9MB/sec)
I just purchased a cheap dashboard video-camera that is advertised to have a H.264 codec inside. However, after the first video test I have seen that a 43sec movie takes 123MB! How is this possible. I thought that H.264 has a MUCH better compression!
Question:
1. Does my video camera really incorporate a true H.264 codec or is it a fake?
2. If it is a true H264 why is the compression ratio so poor?

UPDATE:
I contacted the producer and they said that "The compression ratio system setting of the H.264 AVC codec is 102:1. This setting cannot be set manually"

000000 File Type (20 bytes)
000000  Header (8 bytes)
000000   Size:                                 20 (0x00000014)
000004   Name:                                 ftyp
000008  MajorBrand:                            qt
00000C  MajorBrandVersion:                     512 (0x00000200)
000010  CompatibleBrand:                       qt
000014 ----------------------------
000014 ---   MPEG-4, accepted   ---
000014 ----------------------------
000014 Data (3774264 bytes)
000014  Header (8 bytes)
000014   Size:                                 3774264 (0x00399738)
000018   Name:                                 mdat
00001C  Data:                                  (3774256 bytes)
39974C File header (2128 bytes)
39974C  Header (8 bytes)
39974C   Size:                                 2128 (0x00000850)
399750   Name:                                 moov
399754  Movie header (108 bytes)
399754   Header (8 bytes)
399754    Size:                                108 (0x0000006C)
399758    Name:                                mvhd
39975C   Version:                              0 (0x00)
39975D   Flags:                                0 (0x000000)
399760   Creation time:                        3118707150 (0xB9E3B1CE)
399764   Modification time:                    3118707150 (0xB9E3B1CE)
399768   Time scale:                           1000 (0x000003E8)
39976C   Duration:                             2221 (0x000008AD)
399770   Preferred rate:                       65536 (0x00010000)
399774   Preferred volume:                     256 (0x0100)
399776   Reserved:                             (10 bytes)
399780   Matrix structure (36 bytes)
399780    a (width scale):                     1.000
399784    b (width rotate):                    0.000
399788    u (width angle):                     0.000
39978C    c (height rotate):                   0.000
399790    d (height scale):                    1.000
399794    v (height angle):                    0.000
399798    x (position left):                   0.000
39979C    y (position top):                    0.000
3997A0    w (divider):                         1.000
3997A4   Preview time:                         0 (0x00000000)
3997A8   Preview duration:                     0 (0x00000000)
3997AC   Poster time:                          0 (0x00000000)
3997B0   Selection time:                       0 (0x00000000)
3997B4   Selection duration:                   0 (0x00000000)
3997B8   Current time:                         0 (0x00000000)
3997BC   Next track ID:                        3 (0x00000003)
3997C0  Track (1547 bytes)
3997C0   Header (8 bytes)
3997C0    Size:                                1547 (0x0000060B)
3997C4    Name:                                trak
3997C8   Track Header (92 bytes)
3997C8    Header (8 bytes)
3997C8     Size:                               92 (0x0000005C)
3997CC     Name:                               tkhd
3997D0    Version:                             0 (0x00)
3997D1    Flags:                               15 (0x00000F)
3997D4    Track Enabled:                       Yes
3997D4    Track in Movie:                      2 (0x0000000000000002)
3997D4    Track in Preview:                    4 (0x0000000000000004)
3997D4    Track in Poster:                     8 (0x0000000000000008)
3997D4    Creation time:                       3118707150 (0xB9E3B1CE)
3997D8    Modification time:                   3118707150 (0xB9E3B1CE)
3997DC    Track ID:                            1 (0x00000001)
3997E0    Reserved:                            0 (0x00000000)
3997E4    Duration:                            2221 (0x000008AD)
3997E8    Reserved:                            0 (0x00000000)
3997EC    Reserved:                            0 (0x00000000)
3997F0    Layer:                               0 (0x0000)
3997F2    Alternate group:                     0 (0x0000)
3997F4    Volume:                              0 (0x0000)
3997F6    Reserved:                            0 (0x0000)
3997F8    Matrix structure (36 bytes)
3997F8     a (width scale):                    1.000
3997FC     b (width rotate):                   0.000
399800     u (width angle):                    0.000
399804     c (height rotate):                  0.000
399808     d (height scale):                   1.000
39980C     v (height angle):                   0.000
399810     x (position left):                  0.000
399814     y (position top):                   0.000
399818     w (divider):                        1.000
39981C    Track width:                         1920.000
399820    Track height:                        1080.000
399824   Media (1447 bytes)
399824    Header (8 bytes)
399824     Size:                               1447 (0x000005A7)
399828     Name:                               mdia
39982C    Media Header (32 bytes)
39982C     Header (8 bytes)
39982C      Size:                              32 (0x00000020)
399830      Name:                              mdhd
399834     Version:                            0 (0x00)
399835     Flags:                              0 (0x000000)
399838     Creation time:                      3118707150 (0xB9E3B1CE)
39983C     Modification time:                  3118707150 (0xB9E3B1CE)
399840     Time scale:                         1000 (0x000003E8)
399844     Duration:                           2221 (0x000008AD)
399848     Language:                           0 (0x0000)
39984A     Quality:                            0 (0x0000)
39984C    Handler Reference (45 bytes)
39984C     Header (8 bytes)
39984C      Size:                              45 (0x0000002D)
399850      Name:                              hdlr
399854     Version:                            0 (0x00)
399855     Flags:                              0 (0x000000)
399858     Component type:                     mhlr
39985C     Component subtype:                  vide
399860     Component manufacturer:
399864     Component flags:                    0 (0x00000000)
399868     Component flags mask:               0 (0x00000000)
39986C     Component name size:                12 (0x0C)
39986D     Component name:                     VideoHandler
399879    Media Information (1362 bytes)
399879     Header (8 bytes)
399879      Size:                              1362 (0x00000552)
39987D      Name:                              minf
399881     Video Media Header (20 bytes)
399881      Header (8 bytes)
399881       Size:                             20 (0x00000014)

    ................
25E131   ------------------------
25E131   ---   AVC, filling   ---
25E131   ------------------------
25E131   slice_data (21876 bytes)
25E131    (ToDo):                              (Data)
2636A8   --------------------------------------------
2636A8   ---   MPEG-4, jumping to offset 3004D4   ---
2636A8   --------------------------------------------
3004D4  2 (64000 bytes)
3004D4   Channel grouping data:                (64000 bytes)
3004D4   Block (64000 bytes)
3004D4    Data:                                (64000 bytes)
30FED4   -------------------------
30FED4   ---   PCM, accepted   ---
30FED4   -------------------------
30FED4   ------------------------
30FED4   ---   PCM, filling   ---
30FED4   ------------------------
30FED4   --------------------------------------------
30FED4   ---   MPEG-4, jumping to offset 399FCB   ---
30FED4   --------------------------------------------
3204D4 ---------------------------
3204D4 ---   MPEG-4, filling   ---
3204D4 ---------------------------
3204D4 ----------------------------
3204D4 ---   MPEG-4, finished   ---
3204D4 ----------------------------

H264 allows for much better compression, but image acquisition should be as good as feasible, so cameras will capture at a high bitrate, say, 10+ Mbps, depends on resolution and framerate. Nothing unusual about that.
The full bouquet of H.264 compression methods i.e. lookahead for rate-control, better motion estimation ..etc is usually applied when producing a file for web playback. You can use ffmpeg with libx264 to achieve that.

Ok. But I had before a cam with mp2 compression. The file size was IDENTICAL. So, there must be something wrong about this camera if its mp4 compressor produces same results as the old camera.

Camera compressors aren't trying to squeeze out small files. They have a set of fixed target profiles. Check the camera menu and manual for lower bitrates.

@gyan-this is a cheap dashboard camera advertised as h264. there are no settings related to video!

Then you'll have to recompress after recording.

My problem is that this camera will kill the SD card after a few months only because of the intense writing. I replaced my old mp2 camera with this one hoping to get less I/O activity.

The producer of this camera finally answered: "The compression ratio system setting of the H.264 AVC codec is 102:1 (This setting cannot be set manually)"


text:
How can I do color grading that changes over time?
I just bought a cheap action camera that I plan to use when freediving and my first test shows that the video quality is quite good. The only thing that isn't good enough are the colors.
I started iMovie and managed to get good colors above water and under water but never both at the same time. I realise that I would need to gradually change color as the depth changes and this doesn't seem to be supported in iMovie.
Which software or app, preferably free but not necessarily, can be used to do color grading that changes over time?

DaVinci Resolve seems to be an industry standard software for color grading that exists as a free version. Here is a tutorial on how to use keyframes to animate color grading that worked for me:


text:
Why do pro cameras still need to pull focus?
Big productions using pro cinema cameras (RED Weapon etc...) still use manual focus and still have someone who's sole job is just to pull focus for a camera.
With today's technology, I would always trust auto-focus over my own eyesight. I know in some instances focal length is literally measured from the sensor which is probably more accurate - but is that extra effort actually noticeable? I also know you could argue cinematic effects such as "racking focus" need manual, but you could still have Auto/Manual setting like DSLRs do.
So why do we still have focus pullers and manual focus in productions with top-end cameras?

Well there's a number of factors that come into play, but first and foremost, the reason a camera operator pulls focus (if shooting alone) or having a 1st AC/2nd AC pull focus is because if you care about what you're shooting, you want focus to be tack sharp.
Focus pulling is required on today's full frame and large sensor cameras because the Hyperfocal is extremely tight/small due to the gate (sensor) size, especially so when using fast lenses, shooting at wide apertures, or long focal lengths. The Hyperfocal Distance is in today's digital cinema world, a very specific and critically narrow point in space, or better put, distance from the the camera's gate. Large sensor cameras also typically need faster lenses, due to the fact that the light entering the lens is refracted over larger plane than on a small sensor capture device. (More info below on that).
Many DSLR cameras have AF features, but they are relatively limited, and require the user to set a focus point, such as center, or another XY or pattern of XY points on the screen in which the camera would attempt to lock to.
Professional systems by RED, ARRI, and others, have 3rd party accesories which can assist with Auto Focus, but again, they are only as good as how you program them.
That said:
With a large sensor, shooting on a fast lens with even a moderately wide aperture at anything other than a "wide/medium wide" focal length will produce an image which has such as shallow depth of field that you have to visually adjust the focus based off the precise distance from gate to your desired focal point.
Do you want the eyes and eye lashes to be tack sharp? Or the tip of the nose? If you focus the camera to be tack sharp on the front/tip of the persons nose, the eye lashes and eyes especially, will appear soft, especially at 4K and above.
You can also focus too deep, which is a very easy mistake to make, making the hairline/front of ears tack sharp, again, leaving the eyes and eye lashes, and even more, the nose, soft and out of focus.
Even shooting a simple sit down interview with someone on a HD camera (not 4K), using a 100mm focal length, at f2.8, this becomes highly noticeable. Tip of the nose, ear lobes, or eye lashes... You want to focus on the eyes... because that's what viewers focus on when watching the footage.
Theres no way a camera can "know" exactly what you want it to focus on. Secondly, automatic systems never work perfectly. This happens often even at short focal lengths using wide lenses; where the cameras AF system will latch onto a brighter spot, such as a light bulb or candle flame far in the background behind the subject- so even on wide shots AF doesn't do a great job.
Lastly, if the AF system gets confused or if something moves in the frame, the AF system will fish for a new focus point, often times over and undershooting the focus point in the process. This fishing effect is highly distracting.
So in closing, if you're shooting anything with actors where their performance matters and you may not get a second chance to capture that exact moment or performance, you have to have someone watching and pulling critical focus on a monitor that is designed to do so (showing pixel to pixel or magnification on a specific zone).
Now with cameras that have a very small sensor, such as the old video cameras from the 90s and early 2000s, the sensor was so small (sometimes as small as 1/5"), that A.) The small gate/sensor size created a very deep depth of field/large hyperfocal, B.) The small sensor received a much higher level of light concentration from the lens (described below); and C.) The small sensor cameras in the past typically shot at lower resolutions and focus could be slightly off, and due to the low resolution it wasn't visually noticeable.
When shooting with a small sensor, the light entering the camera was far more concentrated on the small sensor area (think of a magnifying glass with the sun trying to burn a leaf). The smaller you focus the light into a smaller area, the brighter it becomes. If you pull the magnifying glass up the focus of the sun becomes larger, less bright and less hot.
I only mention this because this is why large sensor cameras require more light. Because the image entering in through the lens is being spread out over a larger canvas, and thus is not as concentrated / bright - requiring either more light, or shooting at a wider aperture. Wider apertures = shallower depth of field.
So the small sensor cameras can shoot in AF mode with greater ease- the reason being "everything" is in focus, due to the small gate, and the fact that the small sensor requires a smaller aperture/f-stop. These factors create a hyperfocal which is so large, that everything is reasonably in focus and there's no discernible difference between the tip of the nose and the front of the eyes.

Brilliant answer, thank you so much for taking the time. I guess in today’s world of YouTube I was thinking of an entire face being in focus rather than specific features which makes so much sense.

@Martin A provided an very in-depth answer, but I feel that it's worth noting one more thing: focus is part of the creative toolbox that filmakers use. Pulling focus from one actor to another in a 2 shot can be used to emphasise a reaction, or it can be used to reveal foreground or backgrounds, or pick out a subject from a crowd. Autofocus is not always able to do this, just as auto-exposure can't use light creatively the way you can if you set exposure manually.

I feel the statement “auto focus is not able to do this” is a bit of a generalisation. For example on my DSLR I can shoot with a shallow depth of field and simply tap another persons face on the touch screen LCD and it will automatically rack focus from one to the other whilst filming. This is the very thing that made me ask the question.

Good point. Edited

One thing I did think of after reading your answer was that although I can rack focus in this way on my DSLR, I have no control over the speed at which it is done etc. It does very much limit the creative aspect of pulling focus which I think is what you’ve touched on here.

I was going to write "autofocus will never be able to do this", but realised that that is probably bollocks; I'm sure AI-enable cameras of the future will be quite capable of doing creative focus pulling.


text:
Output of FFmpeg has a "slow motion" part - what is it and how to avoid?
Source video
I have a screencast recorded from iPad with QuickTime Player on macOS.
When I open the original recording in QuickTime Player for playback, I can see the playback controls as below:

Processing
I processed the video with the following command (full log):
ffmpeg -i test-source.mov test-result.mov

Resulting video in QuickTime Player
Then, when I open the result in QuickTime Player, I see the controls as below:

The part with more sparse "dots" plays in slow motion, I can drag the bars to change the start and end of this part and minimise it to zero-length (the overall length changes from 03:06 to 01:00 then and full video plays at normal speed).

Resulting video in iMovie 10
Similarly, when add the video in iMovie with Import Media, I see "Speed"-control already applied on the source:

I can turn it off before adding to the timeline, but if I don't, the clip shows with the following decorators indicating normal speed (left and right) and slow (the middle section with the turtle):
(for this screenshot I added a black overlay to hide the video)

Both the limits of the speed sections and slowdown rate differ between QuickTime Player (1 min. movie expanded to 3:06) and iMovie (expanded to 1:30).

VLC does not notice it, plays the video at normal speed.

Questions

What is this feature called?
How to avoid this slow motion part in the output of FFmpeg?

Share the log of ffmpeg -i test-source.mov -i test-result.mov. How does the file play in other players like VLC?

I uploaded the log to the pastebin. As I mentioned in my previous comment, VLC plays it at normal speed.

I'm here a couple of years after you asked this, and it's perfectly answered what I was looking for.  Thanks!

Your source is variable frame-rate with a peak rate of 120 and an average rate of close to 60. Editors tend to want constant frame rate streams. If you can interpret your whole transcoded file as 120 fps, then you should get the expected result. Alternatively, you can preserve the original variable frame rate,
ffmpeg -i test-source.mov -vsync vfr test-result.mov

or transcode to a constant 60 fps,
ffmpeg -i test-source.mov -r 60 test-result.mov

This definitely worked, but left me with the same questions as I had before and stated in question - is it a feature (I guess so, because it has a specific interface), what is this feature called and what it is used for. Also why the original does not observe the slow motion part, while the file processed does...

This has more to do with Apple's AV backend rather than the file or ffmpeg. My guess is that in a VFR file, it slows down regions with higher-than-avg rate. Just a guess.

If anyone is still interested in the answer. This kind of video is created when you record it in "slow motion" (at least iPhone does this). In this mode, your camera just slows the video down after first 10% of paly time or so and then speeds it up again before the end. It looks pretty cool when you record playing fetch with your dog I suppose. I was looking for a way to get rid of it and none of these two commands did it =/


text:
Can mathematical data from a recorded video be extracted to a computer file?
Can mathematical data (for example, stop watch/timer values) from a smartphone recorded video be extracted to a computer file for plotting graphs ??
*I have recorded a video of an on-screen measurements which are changing very fast (of the order of milliseconds). I need to get those values in output of any format (say MS word file) and plot them in any software (say MS office).

How is the data stored / presented ?

I have recorded a video of an on-screen measurements which are changing very fast (of the order of milliseconds). I need to get those values in output of any format (say MS word file) and plot them in any software (say MS office)

Smartphone shoots at average frame rate of 30 fps. You require two orders of magnitude more precise data. It simply is not there. But otherwise, you can use tools like those that are used to capture burned-in subtitles, if the numbers appear in the same location on the screen. Instead of doing OCR on video frames how about outputting the data into a file?


text:
Editing software to quickly match audio and video transitions
I would like to create a short movie from a collection of clips, shot with an action cam, where the video transitions are synced with the beats in my audio. I have done some research and the options I have found are:

Quik - not suitable as I don't have a GoPro
2 . Final cut Pro - I don't own an Mac
Premiere Pro - An annual subscription of £200+ is not worth it just to make a few short videos

The key feature is the synchronization of clips to the audio track. I know there are plenty of video editors out there. But I need something fast that will be able to achieve this.
Are these the only options? Are there any other fast editing programs that can generate synced video -audio transitions without spending a fortune? I would be interested in any other solutions

This question has been asked numerous times before. You'll see if you search for free video editor on this site.

Possible duplicate of Free video editing software

@stib I'm not looking for any free video editor. I'm looking for something that can sync the clips to the as soundtrack quickly and without spending a lot of money.

If you want this for any arbitrary sound track you lay, then I don't know. But if you are ok with several pre-defined music tracks, then Adobe Premiere Clip can do that, it works on smartphones and tablets.

From a quick Google search, I can see that Movavi has something like this and (as far as I can tell) is free. However, it only marks the beats for you; you'd still need to actually roll up your sleeves and cut the clips down yourself.
Adobe Premiere Elements also has a beat detector thing (I believe) but, again, I suspect that it'll just help by marking the beats on your timeline, leaving you to do the cutting.
I can't actually find something that does it all for you but, to be honest, you'll probably get better results cutting the thing yourself and it really won't take that long (I reckon about an hour or so for a 2-3 min track, if that - especially if you've already selected your clips).

It is just that the goPro software seems to detect scene changes and therefore auto splits the file and then matches the sections to the beats. I have a copy of Filmora, I noticed that they have an option for scene detection. I will do as you suggest and try and mark the beats and match them with the clip, I'm just worried that the work will be tedious and fiddly, for example a clip can be made shorter but not longer. It would be great to have a matching algorithm that optimises the clip cutting to ensure that the breaks are met.

Ah, I see what you mean! Sorry - I literally thought that you were referring to just cutting down longer clips so that the cuts are on the beats, as opposed to identifying scene changes and, as you said, matching up the appropriate clips. Honestly, it might get a little tedious, but that's video editing :) I still think that you get the best results doing things yourself than relying on an algorithm (though having that do some of the hard work first would be amazing!) - I hope it's not too arduous, though and best of luck with it :)

Redgiant has a plugin that automatically does that for you. It is not free but will save you a lot of valuable time. Here's the link to it:
https://www.redgiant.com/products/shooter-pluraleyes/

As of April 2021, several professional video editor software packages have audio beat detection. Filmora themselves wrote a blog post about the feature, and included the competition: Premiere Elements, Cyberlink PowerDirector, Adobe Premiere Pro etc.
The following editors don't have audio beat detection:

DaVinci Resolve does not, and the community argues you shouldn't do that much anyway, and there are workarounds
Shotcut does not have markers even, but you can use Audacity to create click tracks, and someone wrote a Windows tool to generate a markers track
Kdenlive does not

I'd recommend Sony Vegas! You can align your audio in the timeline and split what you want. Use a clap when filming to align it for editing.

In Android devices I'm using Quik, it can import any video and photos (everything, GoPro and non GoPro footage). But the desktop version can only read GoPro footage.
I'm using Filmora for now, it has the features that closest to Quik.

I have been using MAGIX Fastcut for this. It doesn't have many advanced features, but it does have scene selection, beat detection and automatic scene mixing according to the beat.
To put it in plain words, you select a song, click a button to do beat detection and then select the video clips you want to be fitted to the song. The program then does the cutting automatically, based on the detected beats.

"The key feature is the synchronization of clips to the audio track." You don't mention if it satisfied OP requirement.

I've edited my reply with a better explanation. There's a trial version if you want to try it.


text:
Noticeable video delay when connecting to laptop and DSLR + external mic
I have a Canon EOS RP DSLR camera that is connected to the adapter through the battery, and plugged into a Pengo HDMI capture device, which is plugged into a USB hub (contains 16 USB ports), plugged into a MacBook Pro (new, M1). I also have the Rode NTG1 shotgun mic plugged into a Rode AI-1 USB Audio Interface, also plugged into the hub.

Pengo HDMI Capture Device
Canon DC Coupler DR-E18
Canon AC Adapter AC-E6N
Mini HDMI to HDMI Cable
USB hub

I open Zoom app and everything appears to be working:

I can see input coming from my Rode mic.
I can see my video coming from my Canon DSLR.

However, when I press record, the video is delayed by as much as 0.5-1 seconds from the audio. What am I doing wrong? How do I get rid of all audio delay?
I thought it might be a "Zoom app thing", so I tried recording with the Screenshot app built into Mac (recording my video in zoom playing), and still I get audio delay though a different amount. If I remove the video from the DSLR and use the built-in FaceTime webcam, there is almost no audio delay but still a slight amount.
Should I be plugging the Mic into the camera somehow instead? How do I get everything to sound/play in sync for live streaming or recording?
Using something like OBS to delay the audio to match the video I think is not an option, unless that is the only option haha. I would rather avoid having any delay at all. Why is the video even delaying given this system?

What are you pressing record on?  The camera, or the Zoom call?  If Zoom, are you doing a local record or a cloud record (think that might be Pro version only).  Have you tried using OBS to send everything to Zoom? https://obsproject.com/

You're using two separate systems in parallel, which have no way to communicate timing info to each other.  There's some delay on the video side, and some delay on the audio side, both pre- and post-USB, and the Mac has no idea how to put them back together.  Normally, two-system sound setups are genlocked together to keep their internal clocks synchronized.
To fix your issue, instead of using a USB microphone, plug in an analogue microphone into the camera's microphone input. The specs for the HDMI capture device say it's capable of capturing 48khz audio along with the video signal.  This way, the synchronization happens inside the camera, and picture and sound are locked before any other device performs processing.
You might need to configure the audio input in MacOS System Preferences->Sound->Input to switch from the laptop's internal microphone to the Pengo capture device.

Interesting, okay I have purchased this, here is a follow-up question. Why isn't this system working? Also, will it lose quality not going through the USB audio interface?