ffmpeg avfoundation freezing video when recording webcam - ffmpeg

When running ffmpeg -f avfoundation -framerate 30.0 -i 0:0 1.mkv my video freezes after the initial webcam capture. Why is that? How can I get around it?
The resulting video has a few working frames and then freezes entirely.

Related

How can I change the fps of video without restarting the video stream, which is being played by ffmpeg command?

I am playing the video (.mp4) in VLC by this below command in terminal:
ffmpeg -i input_file.mp4 -crf 18 -c:a copy -r 60 http://localhost:1234/feed1.ffm
Currently it is 60 fps.
Now I want to change the fps during the playback of video file, so is it possible to change the fps during runtime without restarting/breaking the video using FFmpeg? And if it is possible then please guide me.

FFMPEG Preview from Capture device

I am using MacOS with FFMPEG --enabled-decklink installed to capture from BlackMagic Ultrastudio Expressto SDI to Thunderbolt and streams it to youtube, it works perfectly fine, here is my code.
ffmpeg -f decklink -format_code 'Hi50' -i 'UltraStudio Express'
-deinterlace -b:v 1M -vcodec h264 -pix_fmt yuv420p -color_range 1 -acodec aac -f flv rtmp://a.rtmp.youtube.com/live2/*******
but I am kinda blind cuz I cannot see what I am capturing till its live on Youtube, is there away to preview the video locally on my Mac before I start streaming via ffmpeg?

Play video overlay over video not working in ffmpeg

I am trying to play video over another video using ffmpeg. When i am trying to play video from starting then overlay video plays. But if i try to overlay video from n seconds it doesn't work
ffmpeg -i input.mp4 -i overlay.mp4
-filter_complex [1:v]scale=920:920[out],[out][0]overlay=0:0:enable='between(t\,4\,8)'[out]
-map [out] output.mp4
If i change between(t\,4\,8) to between(t\,0\,4) then overlay video works normally. It is not working for between(t\,4\,8). Please help how to solve it

FFPLAY shows video, but FFMPEG just shows black

I'm trying to record video/audio from a VIDBOX device using ffmpeg. Using Windows 10 and ffmpeg version N-86129-g1e8daf3, I can see and hear the video/audio fine when I execute
ffplay -f dshow -i video="VIDBOX NW07":audio="Microphone (VIDBOX NW07)"
but, I only record a black screen (and the correct audio) when I execute
ffmpeg -f dshow -i video="VIDBOX NW07":audio="Microphone (VIDBOX NW07)" -c:v libx264 out.mp4
What could be causing this to work in ffplay but not ffmpeg?
You are probably testing the output in a generic player. Add -pix_fmt yuv420p to force ffmpeg's output to a standard pixel format that all players can show.

FFmpeg recording audio from several sources

everyone.
I'm trying to use FFmpeg to record video and 3 audio sources and use it to generate 3 different video files - each file should contain the same video stream but the different audio stream. The problem is that I got audio sync issues. The first audio stream is synced perfectly, but the second one has 1 sec lag, and the third one has like 2 sec lag.
I've made a few tests so far and it seems that root cause of the issue is initialization time of video/audio devices. So, one device is already recording something but the second is still being opened and so on. I've tried to change input devices order and after that audio streams still have the same issue BUT if before 2nd and 3rd audio streams were some time ahead of video, after reordering they became to lag after the audio (audio for the same event appears with some delay). So this test confirms my version about device initialization times.
But the question still, why the first audio stream is synchronized properly, while other 2 are not. and also, how could I overcome this issues? Any workarounds and ideas are highly appreciated.
Here is FFmpeg command I'm using and it's output.
ffmpeg.exe -f dshow -video_size 1920x1080 -i video="Logitech HD Webcam
C615" -f dshow -i audio="Microphone (HD Webcam C615)" -f dshow -i
audio="Microphone Array (Realtek High Definition Audio)"
-filter_complex "[1:a]volume=1[a1];[2:a]volume=1[a2]" -vf scale=h=1080:force_original_aspect_ratio=decrease -vcodec libx264
-pix_fmt yuv420p -crf 23 -preset ultrafast -acodec aac -vbr 5 -threads 0 -map v:0 -map [a1] -map [a2] -f tee
"[select=\'v,a:0\']C:/Users/vshevchu/Desktop/123/111/111_jjj1.avi|
[select=\'v,a:1\']C:/Users/vshevchu/Desktop/123/111/111_jjj2.avi"
OUTPUT
PS. Actually, the issue is exactly the same when I'm not using "tee" muxer but writing all the audio streams to one container. So, "tee" isn't a suspect.

Resources