FFmpeg gdigrab failed to capture image - ffmpeg

Hi I am trying to capture desktop with ffmpeg gdigrab. I am using SSH connection to remotely use admin cmd on windows 10 pc. When i execute this command normally it works but remotely it doesnt.
ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv
error message
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[gdigrab # 000001f3e781e600] Capturing whole desktop as 1024x768x32 at (0,0)
[gdigrab # 000001f3e781e600] Failed to capture image (error 5)
[gdigrab # 000001f3e781e600] Could not find codec parameters for stream 0 (Video: bmp, none, 754987 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' (15000000) and 'probesize' (70000000) options
Input #0, gdigrab, from 'desktop':
Duration: N/A, bitrate: 754987 kb/s
Stream #0:0: Video: bmp, none, 754987 kb/s, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Output #0, matroska, to 'pipe:':
Output file #0 does not contain any stream
I tried to increase analyzeduration and probesize to max integer but it doesnt help.

Related

FFMPEG Outputs gets blurry when scaled

I'm trying to scale my input video to standard 1280x720 resolution, but my output looks blurred when compared to the input.
FFMPEG CMD
ffmpeg -i input.webm -filter_complex "[0:v] scale=1280.0:720.0 [v0]" -map [v0] output.webm
Input File FFProbe
ffprobe version 4.4.2 Copyright (c) 2007-2021 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
configuration: --prefix='/opt/homebrew/Cellar/ffmpeg#4/4.4.2_3' --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-avresample --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from 'input.webm':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:00:20.01, start: 0.000000, bitrate: 1929 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, bt470bg/bt709/bt709, progressive), 1512x982, SAR 1:1 DAR 756:491, 29.08 fps, 29.08 tbr, 1k tbn, 1k tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libvpx-vp9
DURATION : 00:00:20.011000000
Output File FFProbe
ffprobe version 4.4.2 Copyright (c) 2007-2021 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
configuration: --prefix='/opt/homebrew/Cellar/ffmpeg#4/4.4.2_3' --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-avresample --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from 'output.webm':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:00:20.01, start: 0.000000, bitrate: 1699 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, bt470bg/bt709/bt709, progressive), 1280x720, SAR 1109:1280 DAR 1109:720, 29.08 fps, 29.08 tbr, 1k tbn, 1k tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libvpx-vp9
DURATION : 00:00:20.011000000
Input Video:
Output Video:

FFmpeg no such filter 'tpad'

I have a simple gif. I am not in general familiar with FFmpeg commands so I assume it's just my syntax being wrong, but what I'm using is straight from an answer here so I thought it would work.
I'm trying to add a delay on the last frame of my gif.
ffmpeg -i out.gif -vf tpad=stop_mode=clone:stop_duration=2 out2.gif
But I'm getting this when I try it:
ffmpeg version 3.4.11-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened - -libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enabl e-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-lib caca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreet ype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --en able-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enabl e-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-li bsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora -- enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enabl e-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --e nable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enabl e-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-f rei0r --enable-libopencv --enable-libx264 --enable-shared
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, gif, from 'out.gif':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: gif, bgra, 780x530, 6 fps, 15 tbr, 100 tbn, 100 tbc
Stream mapping:
Stream #0:0 -> #0:0 (gif (native) -> gif (native))
Press [q] to stop, [?] for help
[AVFilterGraph # 0x5609c471d520] No such filter: 'tpad'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

FFMPEG incorrect duration from raw video stream

I have the raw video data from a video stream (no audio) and the duration when I play the raw video in VLC is ~67 seconds. When I convert the file to MP4 using FFMPEG the duration is 82.68 seconds.
Video is available here: https://www.filedropper.com/showdownload.php/67seconds
I am using FFMPEG/FFPROBE version git-2020-07-21-b5f1e05 on Windows.
Details of the raw video here:
ffprobe -i 67seconds.raw
ffprobe version git-2020-07-21-b5f1e05 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 55.100 / 56. 55.100
libavcodec 58. 97.100 / 58. 97.100
libavformat 58. 49.100 / 58. 49.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, h264, from '67seconds.raw':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
The mp4 duration matches my ffprobe calculation against the raw file itself (2067/25 = 82.68 seconds):
ffprobe -show_entries stream=r_frame_rate,nb_read_frames -select_streams v -count_frames -of compact=p=0:nk=1 -v 0 67seconds.raw
25/1|2067
What would explain this difference in durations between the raw playback and the FFMPEG interpretation and how do I encode to the same duration for this and other stream data?

FFmpeg: How can I loop a single frame of video to cover the length of audio track

I have a VOB file holding an MPEG-2 video track with an AC-3 audio track. The video track of that VOB file consists of a single frame, which when played in a DVD player, holds that still frame until the audio track has finished.
How can I (with FFMPEG ideally), loop that frame to make a "normal" video track that lasts for the length of the audio track, rather than just a single frame?
ffmpeg version N-91999-g148a21611d Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 19.101 / 56. 19.101
libavcodec 58. 30.100 / 58. 30.100
libavformat 58. 18.102 / 58. 18.102
libavdevice 58. 4.103 / 58. 4.103
libavfilter 7. 32.100 / 7. 32.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mpeg, from '.\SINGLEFRAME.VOB':
Duration: 00:00:47.94, start: 0.336711, bitrate: 439 kb/s
Stream #0:0: Data: dvd_nav_packet
Stream #0:1: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], 8000 kb/s, 25 tbr, 90k tbn, 50 tbc
Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s

FFmpeg giving me failed to open segment error. Trying to parse .wav file into 30-second files

Here is the command I used and the output when I try and parse the .wav file into 30-second clips:
C:\Users\hmkur>ffmpeg -i C:\Users\hmkur\Desktop\Python\Transcribing_Audio\source\valve.wav -f segment -segment_time 30 -c copy parts/out%09d.wav
ffmpeg version git-2019-11-05-c54268c Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20191010
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 34.101 / 58. 34.101
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[wav # 0000023133098a00] Discarding ID3 tags because more suitable tags were found.
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'C:\Users\hmkur\Desktop\Python\Transcribing_Audio\source\valve.wav':
Metadata:
title : valve
encoder : Lavf58.20.100 (libsndfile-1.0.24)
Duration: 00:06:47.20, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[segment # 00000231334d18c0] Opening 'parts/out000000000.wav' for writing
[segment # 00000231334d18c0] Failed to open segment 'parts/out000000000.wav'
Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times

Resources