Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (53)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • 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 (3620)

  • Desktop grabbing with FFmpeg at 60 fps using NVENC codec

    5 juillet 2016, par Akatosh

    I’m having trouble recording my desktop at 60FPS using the latest Windows compiled FFmpeg with NVENC codec. Metadata says the file is 60 fps but when I play it, I can see clearly see it is not 60FPS.

    The command-line I use is the following :

    ffmpeg -y -rtbufsize 2000M -f gdigrab -framerate 60 -offset_x 0 -offset_y 0 -video_size 1920x1080 -i desktop -c:v h264_nvenc -preset:v fast -pix_fmt nv12 out.mp4

    I tried using a real time buffer, using another DirectShow device, changing the profile or forcing a bitrate, but the video always seems to be at 30fps.

    Recording the screen using NVIDIA’s ShadowPlay works well, so I know it’s feasible on my machine.

    Using FFprobe to check the ShadowPlay’s output file I can see :

    Stream #0:0(und) : Video : h264 (High) (avc1 / 0x31637661), yuv420p(tv,
    smpte170m/smpte170m/bt470m), 1920x1080 [SAR 1:1 DAR 16:9], 4573 kb/s,
    59.38 fps, 240 tbr, 60k tbn, 120 tbc (default)

    But If I force my output to have the same bitrate and profile I get :

    Stream #0:0(und) : Video : h264 (High) (avc1 / 0x31637661), yuv420p,
    1920x1080 [SAR 1:1 DAR 16:9], 5519 kb/s, 60 fps, 60 tbr, 15360 tbn,
    120 tbc (default)

    I can see tbr and tbn are different, so I know my output is duplicating frames.

    For testing, all of my recordings had this 60 frame rate test page on the background, and I could clearly see the differences.

    I know ShadowPlay probably does a lot more under the hood than FFmpeg using the same codec. I know OBS can do it quite easily but I want to understand what I am doing wrong. Maybe it’s some FFmpeg limitation ?

    Full console output

    Using -v trace command :

    [gdigrab @ 0000000002572cc0] Capturing whole desktop as 1920x1080x32 at (0,0)
    [gdigrab @ 0000000002572cc0] Cursor pos (1850,750) -> (1842,741)
    [gdigrab @ 0000000002572cc0] Probe buffer size limit of 5000000 bytes reached
    [gdigrab @ 0000000002572cc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
    [gdigrab @ 0000000002572cc0] stream 0: start_time: 1467123648.275 duration: -9223372036854.775
    [gdigrab @ 0000000002572cc0] format: start_time: 1467123648.275 duration: -9223372036854.775 bitrate=3981337 kb/s
    Input #0, gdigrab, from 'desktop':
     Duration: N/A, start: 1467123648.275484, bitrate: 3981337 kb/s
       Stream #0:0, 1, 1/1000000: Video: bmp, 1 reference frame, bgra, 1920x1080 (0x0), 0/1, 3981337 kb/s, 60 fps, 1000k tbr, 1000k tbn, 1000k tbc
    Successfully opened the file.
    Parsing a group of options: output file out.mp4.
    Applying option c:v (codec name) with argument h264_nvenc.
    Applying option pix_fmt (set pixel format) with argument nv12.
    Successfully parsed a group of options.
    Opening an output file: out.mp4.
    [file @ 0000000000e3a7c0] Setting default whitelist 'file,crypto'
    Successfully opened the file.
    detected 8 logical cores
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'video_size' to value '1920x1080'
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'pix_fmt' to value '30'
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'time_base' to value '1/1000000'
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'pixel_aspect' to value '0/1'
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'sws_param' to value 'flags=2'
    [graph 0 input from stream 0:0 @ 000000000257ec00] Setting 'frame_rate' to value '60/1'
    [graph 0 input from stream 0:0 @ 000000000257ec00] w:1920 h:1080 pixfmt:bgra tb:1/1000000 fr:60/1 sar:0/1 sws_param:flags=2
    [format @ 000000000257ffc0] compat: called with args=[nv12]
    [format @ 000000000257ffc0] Setting 'pix_fmts' to value 'nv12'
    [auto-inserted scaler 0 @ 00000000025802c0] Setting 'flags' to value 'bicubic'
    [auto-inserted scaler 0 @ 00000000025802c0] w:iw h:ih flags:'bicubic' interl:0
    [format @ 000000000257ffc0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
    [AVFilterGraph @ 0000000000e373c0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
    [auto-inserted scaler 0 @ 00000000025802c0] w:1920 h:1080 fmt:bgra sar:0/1 -> w:1920 h:1080 fmt:nv12 sar:0/1 flags:0x4
    [h264_nvenc @ 0000000000e3ca20] Nvenc initialized successfully
    [h264_nvenc @ 0000000000e3ca20] 1 CUDA capable devices found
    [h264_nvenc @ 0000000000e3ca20] [ GPU #0 - < GeForce GTX 670 > has Compute SM 3.0 ]
    [h264_nvenc @ 0000000000e3ca20] supports NVENC
    [mp4 @ 0000000000e3b580] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Output #0, mp4, to 'out.mp4':
     Metadata:
       encoder         : Lavf57.40.101
       Stream #0:0, 0, 1/15360: Video: h264 (h264_nvenc) (Main), 1 reference frame ([33][0][0][0] / 0x0021), nv12, 1920x1080, 0/1, q=-1--1, 2000 kb/s, 60 fps, 15360 tbn, 60 tbc
       Metadata:
         encoder         : Lavc57.47.100 h264_nvenc
       Side data:
         cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (bmp (native) -> h264 (h264_nvenc))
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Clipping frame in rate conversion by 0.000008
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [gdigrab @ 0000000002572cc0] Cursor pos (1850,750) -> (1842,741)
    *** 35 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1850,750) -> (1842,741)
    *** 7 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1850,649) -> (1850,649)
    *** 1 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1858,535) -> (1858,535)
    *** 3 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1859,454) -> (1859,454)
    *** 2 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1865,384) -> (1865,384)
    *** 2 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1846,348) -> (1846,348)
    *** 3 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1770,347) -> (1770,347)
    *** 2 dup!
    [gdigrab @ 0000000002572cc0] Cursor pos (1545,388) -> (1545,388)
    *** 4 dup!
    frame=   69 fps=0.0 q=35.0 size=     184kB time=00:00:00.63 bitrate=2384.0kbits/[gdigrab @ 0000000002572cc0] Cursor pos (1523,389) -> (1519,378)
  • transcoding 4K 10bit HDR to 1080p 8bit SDR video with GPU

    19 septembre 2022, par Vandey

    I have a video file that's 4k 10bit HDR that I'd like to transcode to 1080p 8bit SDR. Is it better to use GPU (nVidia GTX 1080Ti) for decoding and re-encoding or should I just let my CPU handle the whole task ? I'd like to have as little loss as possible while keeping the file size manageable. The source file is about 16Gb.

    


    Again source file is .mkv 4k HDR 10bit that I'd like to scale down to 1080p SDR 8bit.

    


    EDIT : I've had no issues transcoding other videos, but for some reason I'm always running into some sort of error. Hopefully someone knows the right set of commands to get it working.

    


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