Recherche avancée

Médias (91)

Autres articles (57)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (10953)

  • Recording desktop with gdigrab ffmeg to mp4 file with too high video_size don't working

    22 septembre 2021, par tagry

    I try to recording my desktop with ffmpeg using the command :

    



    ffmpeg -f gdigrab -framerate 10 -video_size 1920x1200 -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast output.mp4


    



    The problem is when the video_size option is higher than some size, (for example height higher 1089), the video can't be read with Windows Media. I noticed that with this high size, the video which be recorded doesn't have informations about size. I don't understand why the record don't work with a too big size. If somebody can help me. 
Thank you very much and very sorry for my English.

    



    [edit]

    



        ffmpeg version N-78758-g5156578 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 27.100 / 57. 27.100
  libavformat    57. 26.100 / 57. 26.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 37.100 /  6. 37.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[gdigrab @ 00861860] Capturing whole desktop as 1920x1200x16 at (0,0)
Input #0, gdigrab, from 'desktop':
  Duration: N/A, start: 1467631308.011542, bitrate: 368644 kb/s
    Stream #0:0: Video: bmp, rgb555le, 1920x1200, 368644 kb/s, 10 tbr, 1000k tbn, 10 tbc
[libx264 @ 00863fe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 00863fe0] profile Constrained Baseline, level 5.0
[libx264 @ 00863fe0] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 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=10 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf57.26.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1200, q=-1--1, 10 fps, 10240 tbn, 10 tbc
    Metadata:
      encoder         : Lavc57.27.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=    6 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   11 fps= 11 q=10.0 size=     277kB time=00:00:00.40 bitrate=5664.4kbits/s speed=0.396x    
frame=   16 fps= 11 q=9.0 size=     393kB time=00:00:00.90 bitrate=3578.8kbits/s speed=0.595x    
frame=   21 fps= 10 q=9.0 size=     429kB time=00:00:01.40 bitrate=2507.4kbits/s speed=0.695x    
frame=   26 fps= 10 q=9.0 size=     429kB time=00:00:01.90 bitrate=1849.3kbits/s speed=0.754x    
frame=   31 fps= 10 q=18.0 size=     430kB time=00:00:02.40 bitrate=1466.1kbits/s speed=0.793x    
frame=   36 fps= 10 q=10.0 size=     511kB time=00:00:02.90 bitrate=1442.6kbits/s speed=0.823x    
frame=   41 fps= 10 q=10.0 size=     562kB time=00:00:03.40 bitrate=1353.0kbits/s speed=0.844x    
frame=   46 fps= 10 q=10.0 size=     565kB time=00:00:03.90 bitrate=1185.9kbits/s speed=0.861x    
frame=   51 fps= 10 q=9.0 size=     575kB time=00:00:04.40 bitrate=1070.8kbits/s speed=0.874x    
frame=   56 fps= 10 q=12.0 size=     582kB time=00:00:04.90 bitrate= 972.3kbits/s speed=0.885x    
frame=   61 fps= 10 q=10.0 size=     598kB time=00:00:05.40 bitrate= 907.7kbits/s speed=0.893x    
frame=   66 fps= 10 q=10.0 size=     601kB time=00:00:05.90 bitrate= 834.5kbits/s speed=0.901x    
frame=   71 fps= 10 q=10.0 size=     603kB time=00:00:06.40 bitrate= 772.3kbits/s speed=0.907x    
frame=   76 fps= 10 q=12.0 size=     606kB time=00:00:06.90 bitrate= 719.8kbits/s speed=0.913x    
frame=   81 fps= 10 q=10.0 size=     625kB time=00:00:07.40 bitrate= 691.8kbits/s speed=0.917x    
frame=   86 fps= 10 q=10.0 size=     629kB time=00:00:07.90 bitrate= 652.2kbits/s speed=0.922x    
frame=   91 fps= 10 q=12.0 size=     634kB time=00:00:08.40 bitrate= 618.2kbits/s speed=0.926x    
frame=   97 fps= 10 q=10.0 size=     757kB time=00:00:09.00 bitrate= 689.3kbits/s speed=0.94x    
frame=  100 fps= 10 q=-1.0 Lsize=     772kB time=00:00:10.00 bitrate= 632.8kbits/s speed=0.998x    
video:771kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.153975%
[libx264 @ 00863fe0] frame I:1     Avg QP:20.00  size:242961
[libx264 @ 00863fe0] frame P:99    Avg QP:10.67  size:  5517
[libx264 @ 00863fe0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 00863fe0] mb P  I16..4:  0.8%  0.0%  0.0%  P16..4:  2.9%  0.0%  0.0%  0.0%  0.0%    skip:96.3%
[libx264 @ 00863fe0] coded y,uvDC,uvAC intra: 23.6% 15.1% 13.9% inter: 1.2% 1.3% 0.8%
[libx264 @ 00863fe0] i16 v,h,dc,p: 65% 33%  1%  1%
[libx264 @ 00863fe0] i8c dc,h,v,p: 61% 25% 13%  0%
[libx264 @ 00863fe0] kb/s:631.31


    


  • 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.