Recherche avancée

Médias (91)

Autres articles (68)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (5170)

  • ffmpeg video to rtsp not working, ffmpeg is not reading the video frame by frame [closed]

    15 janvier, par Leroy Jeslyn

    Here's the ffmpeg command :

    


    gst-launch-1.0 videotestsrc ! decodebin ! videoconvert ! videoscale \
 ! video/x-raw,width=1280,height=720 ! x264enc speed-preset=ultrafast \
 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5000 sync=false \
 ! rtspserver service=0/test


    


    The output was :

    


    ffmpeg version 7.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers                                   
  built with gcc 14.2.0 (Rev1, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth 
--enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libqui
rc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 
--enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable
-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-
cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-lib
shaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enab
le-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --e
nable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Render/fire3.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    creation_time   : 2025-01-08T13:10:15.000000Z
  Duration: 00:01:21.79, start: 0.000000, bitrate: 12799 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 12798 kb/s, 14 fps, 14 tbr, 14k tbn (default)
      Metadata:
        creation_time   : 2025-01-08T13:10:15.000000Z
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : AVC Coding
[out#0/rtsp @ 00000178486d9a00] Codec AVOption b:a (set bitrate (in bits/s)) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some decoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0000017848d200c0] using SAR=1/1
[libx264 @ 0000017848d200c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000017848d200c0] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0000017848d200c0] 264 - core 164 r3192 c24e06c - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 d
eblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_q
p_offset=-2 threads=22 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 
direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=14 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00



    


    This is were the output stopped, instead of reading the video frame by frame, it stops here and runs indefinitely. I tried to use VLC and python script to read the rtsp url, but that didn't work.
I tried the alternative using GStreamer, but i couldn't install rtsp-server on Windows 11.

    


    Thank you for your time, any suggestion or answers are appreciated. The end goal is to convert a video to a rtsp url.

    


  • Something wrong with recording video and merging audio and video by using FFmpeg

    16 mars 2014, par VaFancy

    At the beginning, I have to admit that I am a newbie in FFmpeg and also raspbian. Unfortunately, I need to solve this problem as soon as possible.

    I tried to record videos on my Raspberry PI by using PIcamera and USB webcam separately. When I used command :

    ffmpeg -t 10 -f video4linux2 -r 25 -i /dev/video0 out.h264

    However, something was very wrong because there was nothing saved in that video file. I copy the log.

    [video4linux2,v4l2 @ 0x267ad80] The driver changed the time per frame from 1/25 to 1/30
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 37562.908020, bitrate: 147456 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    File 'out.h264' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x267ca60] using cpu capabilities: ARMv6
    [libx264 @ 0x267ca60] profile High 4:2:2, level 3.0, 4:2:2 8-bit
    Output #0, h264, to 'out.h264':
     Metadata:
       encoder         : Lavf55.34.101
       Stream #0:0: Video: h264 (libx264), yuv422p, 640x480, q=-1--1, 90k tbn, 25 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Press [q] to stop, [?] for help
    DTS 140730117085, next:18648459 st:0 invalid dropping00.00 bitrate=N/A    
    PTS 140730117085, next:18648459 invalid dropping st:0
    DTS 140740452429, next:6538221 st:0 invalid dropping:00.00 bitrate=N/A    
    PTS 140740452429, next:6538221 invalid dropping st:0
    frame=   44 fps=1.1 q=28.0 size=      18kB time=00:00:00.04 bitrate=3712.6kbits/
    frame=   45 fps=0.8 q=28.0 size=      22kB time=00:00:00.08 bitrate=2262.8kbits/
    frame=   46 fps=0.7 q=28.0 size=      27kB time=00:00:00.12 bitrate=1813.4kbits/
    frame=   47 fps=0.6 q=28.0 size=      30kB time=00:00:00.16 bitrate=1559.2kbits/
    frame=   48 fps=0.5 q=28.0 size=      34kB time=00:00:00.20 bitrate=1397.7kbits/
    frame=   49 fps=0.5 q=28.0 size=      39kB time=00:00:00.24 bitrate=1324.3kbits/
    frame=   50 fps=0.4 q=28.0 size=      42kB time=00:00:00.28 bitrate=1241.7kbits/

    As you can see, the size of each frame was only few kb and fps was so low. Thus each frame was taken by using a long time(4s in this case). Then I test my USB webcam by using command :

    ffplay -f video4linux2 /dev/video0

    The video stream which displayed on the screen was so unnatural. It looked like there was such a long delay between each frame. So the video was hardly moved. The log I have copied :

    pi@raspberrypi ~ $ ffplay -f video4linux2 /dev/video0
    avplay version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2003-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [video4linux2 @ 0x1ad83c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, video4linux2, from '/dev/video0':
     Duration: N/A, start: 36107.154598, bitrate: 147456 kb/s
       Stream #0.0: Video: rawvideo, yuyv422, 640x480, 147456 kb/s, 30 tbr, 1000k tbn, 30 tbc
    [avsink @ 0x1ad9960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x1ad9d20] w:640 h:480 fmt:yuyv422 -> w:640 h:480 fmt:yuv420p flags:0x4
    36163.33 A-V:  0.000 s:0.0 aq=    0KB vq= 3000KB sq=    0B f=8/8

    The final problem is that no sound was added in video file when I tried to add some in. I used the command :

    avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264

    I have checked separately that the video and audio were both able to play. However the merged file only had video but no audio. The log is shown below, it seems that the process was succeed.

    pi@raspberrypi ~ $ avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264
    avconv version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [h264 @ 0x1aa6680] max_analyze_duration reached
    [h264 @ 0x1aa6680] Estimating duration from bitrate, this may be inaccurate
    Input #0, h264, from '/home/pi/Desktop/test.mp4':
     Duration: N/A, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr, 1200k tbn, 2400k tbc
    [mp3 @ 0x1aaa120] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from '/home/pi/Desktop/test.mp3':
     Metadata:
       title           : We Are Legend (Original Mix)
       artist          : Dimitri Vegas & Like Mike & Steve Aoki
       album           : SPINNIN RECORDS
       encoded_by      : iTunes 11.1.5
       TBP             : 128
       genre           : Progressive House
       date            : 2013
     Duration: 00:00:11.14, start: 0.000000, bitrate: 191 kb/s
       Stream #1.0: Audio: mp3, 48000 Hz, stereo, s16, 192 kb/s
    File 'output.h264' already exists. Overwrite ? [y/N] y
    Output #0, h264, to 'output.h264':
     Metadata:
       encoder         : Lavf53.21.1
       Stream #0.0: Video: libx264, yuv420p, 640x480, q=2-31, 90k tbn, 1200k tbc
       Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 192 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (copy)
    Press ctrl-c to stop encoding
    frame=  144 fps=  0 q=-1.0 Lsize=    1684kB time=5.06 bitrate=2724.7kbits/s    
    video:1566kB audio:119kB global headers:0kB muxing overhead 0.000000%

    Could somebody helps me, please. And sorry for my bad english.

    BTW : When I finally captured 200 frames, it turns out all of them were green.

  • How to fix laggy ffmpeg screen and audio capture ?

    26 juillet 2022, par Wh0r00t

    I am using ffmpeg to capture the screen along with audio.

    


    The ffmpeg command that i tried is

    


    ffmpeg -y \
    -f x11grab \
    -framerate 60 \
    -s 1366x768 \
    -i :0.0 \
    -f alsa -i default -ac 2 \
    -r 30 \
    -c:v h264 -crf 0 -preset ultrafast -c:a vorbis -strict experimental  \
    "$HOME/Videos/$fname-$(date '+%y%m%d-%H%M-%S').mkv"


    


    The stdout of the ffmpeg https://pastebin.com/Qmi5TMKv

    


    ffmpeg version n5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[x11grab @ 0x561faf77eb00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1658814267.169414, bitrate: 2014248 kb/s
  Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 2014248 kb/s, 60 fps, 1000k tbr, 1000k tbn
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'default':
  Duration: N/A, start: 1658814267.230653, bitrate: 1536 kb/s
  Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> vorbis (native))
Press [q] to stop, [?] for help
[libx264 @ 0x561faf7d4300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x561faf7d4300] profile High 4:4:4 Predictive, level 3.2, 4:4:4, 8-bit
[libx264 @ 0x561faf7d4300] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
[alsa @ 0x561faf78a940] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Output #0, matroska, to '/home/earth/Videos/-220726-1114-27.mkv':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv444p(tv, progressive), 1366x768, q=2-31, 30 fps, 1k tbn
    Metadata:
      encoder         : Lavc59.18.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp
    Metadata:
      encoder         : Lavc59.18.100 vorbis
[vorbis @ 0x561faf7d5500] Queue input is backward in time0 bitrate=N/A speed=   0x
frame=  153 fps= 31 q=-1.0 Lsize=    2295kB time=00:00:05.06 bitrate=3709.5kbits/s dup=0 drop=150 speed=1.01x
video:2282kB audio:7kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.281689%
[libx264 @ 0x561faf7d4300] frame I:1     Avg QP: 0.00  size:381729
[libx264 @ 0x561faf7d4300] frame P:152   Avg QP: 0.00  size: 12857
[libx264 @ 0x561faf7d4300] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x561faf7d4300] mb P  I16..4: 56.3%  0.0%  0.0%  P16..4:  0.1%  0.0%  0.0%  0.0%  0.0%    skip:43.6%
[libx264 @ 0x561faf7d4300] coded y,u,v intra: 1.6% 1.6% 1.6% inter: 0.2% 0.2% 0.2%
[libx264 @ 0x561faf7d4300] i16 v,h,dc,p: 99%  1%  0%  0%
[libx264 @ 0x561faf7d4300] kb/s:3664.27
Exiting normally, received signal 15.


    


    I am using the preset ultrafast because I read that it helps not to compress the video too much.
The output of the recorded test file using ffmpeg is as below.

    


     (+) Video --vid=1 (h264 1366x768 30.000fps)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv444p
AV: 00:00:03 / 00:00:19 (17%) A-V:  0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:14 / 00:00:19 (73%) A-V:  0.000

Exiting... (Quit)


    


    The recording works but there is a audio lag. If I record the same using simplescreenrecorder with the same settings like,

    


    audio backend - alsa

    


    source - default

    


    audio codec - vorbis

    


    video codec - h.264

    


    container - matroska

    


    preset - superfast

    


    The simplescreenrecorder log https://pastebin.com/83hMMRQF

    


    [PageRecord::StartPage] Starting page ...
[PageRecord::StartPage] Started page.
[PageRecord::StartOutput] Starting output ...
[PageRecord::StartOutput] Output file: /home/earth/Videos/simplescreenrecorder-2022-07-26_11.18.13.mkv
[Muxer::Init] Using format matroska (Matroska).
[Muxer::AddStream] Using codec libx264 (libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10).
[VideoEncoder::PrepareStream] Using pixel format nv12.
[libx264 @ 0x563436cbfd40] using SAR=1/1
[libx264 @ 0x563436cbfd40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x563436cbfd40] profile High, level 3.2, 4:2:0, 8-bit
[libx264 @ 0x563436cbfd40] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00
[Muxer::AddStream] Using codec libvorbis (libvorbis).
[BaseEncoder::EncoderThread] Encoder thread started.
[AudioEncoder::PrepareStream] Using sample format f32p.
[BaseEncoder::EncoderThread] Encoder thread started.
[Muxer::MuxerThread] Muxer thread started.
[PageRecord::StartOutput] Started output.
[Synchronizer::SynchronizerThread] Synchronizer thread started.
[PageRecord::StartInput] Starting input ...
[X11Input::Init] Using X11 shared memory.
[X11Input::Init] Detecting screen configuration ...
[X11Input::Init] Screen 0: x1 = 0, y1 = 0, x2 = 1366, y2 = 768
[X11Input::InputThread] Input thread started.
[ALSAInput::InputThread] Using sample format s16.
[PageRecord::StartInput] Started input.
[ALSAInput::InputThread] Input thread started.
[FastResampler::Resample] Resample ratio is 1.0000 (was 0.0000).
[PageRecord::StopOutput] Stopping output ...
[PageRecord::StopOutput] Stopped output.
[PageRecord::StopInput] Stopping input ...
[X11Input::~X11Input] Stopping input thread ...
[X11Input::InputThread] Input thread stopped.
[ALSAInput::~ALSAInput] Stopping input thread ...
[ALSAInput::InputThread] Input thread stopped.
[PageRecord::StopInput] Stopped input.


    


    It works perfectly without any lag whatsoever. The output of the recorded test file using simplescreenrecorder is as below.

    


     (+) Video --vid=1 (h264 1366x768)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv420p
AV: 00:00:01 / 00:00:17 (7%) A-V:  0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:08 / 00:00:17 (47%) A-V:  0.000

Exiting... (Quit)


    


    The only difference that I saw between these two recordings is VO: [gpu] 1366x768 yuv444p
VO: [gpu] 1366x768 yuv420p for ffmpeg and simplescreenrecorder receptively.
I do not know if this matters but is there something that I could tweak to make ffmpeg to capture the screen and audio without any lag.
Like answered here https://unix.stackexchange.com/questions/675436/ffmpeg-recording-slows-down-when-audio-inputs-are-added
I do open pavucontrol but its not much of a help.

    


    The reason that I going with ffmpeg is because I can kill the process using pid at a particular time using cronjobs.
These are my system information, in case if it helps

    


    System:
  Host: taco Kernel: 5.18.12-arch1-1 arch: x86_64 bits: 64 Desktop: dwm
    v: 6.2 Distro: Arch Linux
Machine:
  Type: Desktop Mobo: Acer model: A75F2-M v: P21-A1 serial: N/A BIOS: Acer
    v: P21-A1 date: 02/07/2014
CPU:
  Info: quad core model: AMD A8-5500B APU with Radeon HD Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 1400 min/max: 1400/3200 cores: 1: 1400 2: 1400 3: 1400
    4: 1400
Graphics:
  Device-1: AMD Trinity [Radeon HD 7560D] driver: radeon v: kernel
  Display: server: X.Org v: 21.1.4 driver: X: loaded: modesetting
    gpu: radeon resolution: 1366x768~60Hz
  OpenGL: renderer: AMD ARUBA (DRM 2.50.0 / 5.18.12-arch1-1 LLVM 14.0.6)
    v: 4.3 Mesa 22.1.3
Audio:
  Device-1: AMD FCH Azalia driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.18.12-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.56 running: yes


    


    Any help is much appreciated.