Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (7)

  • 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" ;

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (3768)

  • ffmpeg command not interpreted correcly from cron

    16 avril 2022, par Andre Lörchner

    on my raspberry pi I'm trying to run a script every 30 minutes that restarts a video stream. Reason is the stream is consistently running into hickups after roughly 35 minutes and stops a few minutes after.
I tried fixing the root problem without any success so far, so an easier and valid workaround is to just restart the stream.

    


    I created a script restart_stream.sh that kills the previous stream and immediately starts it again.

    


    #!/bin/bash&#xA;&#xA;killall -r libcamera-vid ffmpeg&#xA;libcamera-vid -t 0 --framerate 30 --width 1280 --height 720 -b 2000000 -o - --nopreview | ffmpeg -f h264 -thread_queue_size 4096 -i - -f pulse -ar 44100 -ac 2 -acodec pcm_s16le -thread_queue_size 4096 -i default -vcodec copy -acodec aac -ab 128k -fflags genpts -fflags igndts -f fifo -fifo_format flv -map 0:v -map 1:a? -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 2 rtmp://a.rtmp.youtube.com/live2/<key>&#xA;</key>

    &#xA;

    cron job

    &#xA;

    */30 7-19 * * * /bin/restart_stream.sh >/tmp/stream.log 2>&amp;1&#xA;

    &#xA;

    Running this script manually from the ssh console works perfectly fine but once I run it from cron it fails with the following error

    &#xA;

    [1:41:01.657471459] [2138]  INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unic>&#xA;[1:41:01.658232799] [2136]  INFO Camera camera.cpp:1028 configuring streams: (0) 1280x720-YUV420&#xA;[1:41:01.659060988] [2138]  INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor >&#xA;[1:41:01.698525343] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000&#xA;[1:41:01.698798789] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000&#xA;[1:41:01.698840990] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000&#xA;[1:41:01.698877617] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0&#xA;[1:41:01.698910745] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000&#xA;[1:41:01.698947187] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000&#xA;[1:41:01.698983203] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0&#xA;[1:41:01.699014646] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]&#xA;[1:41:01.699050903] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0&#xA;[1:41:01.699082938] [2145]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 1&#xA;ffmpeg version 4.3.3-0&#x2B;rpt2&#x2B;deb11u1 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10 (Raspbian 10.2.1-6&#x2B;rpi1)&#xA;  configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/arm-linux-gn>&#xA;  WARNING: library configuration mismatch&#xA;  avutil      configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  avcodec     configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  avformat    configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  avdevice    configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  avfilter    configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  avresample  configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  swscale     configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  swresample  configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  postproc    configuration: --prefix=/usr --extra-version=0&#x2B;rpt2&#x2B;deb11u1 --toolchain=hardened --incdir=/usr/include/>&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, h264, from &#x27;pipe:&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 30 fps, 30 tbr, 1200k tbn, 60 tbc&#xA;default: No such process&#xA;

    &#xA;

    It seems to interpret the command differently and not treat default within the ffmpeg call as a parameter.

    &#xA;

  • FFmpeg return 'invalid argument' only for some runs, even though it is the same code

    20 septembre 2021, par Gustavo Marinho

    I have code in Python where I need to use FFmpeg to merge an audio and a video downloaded using pytube together :

    &#xA;

    for video in p.videos:&#xA;    video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].download(parent_dir&#x2B;&#x27;/mp4/processing/video&#x27;)&#xA;    print(video.streams.filter(only_audio=True)[1].download(parent_dir&#x2B;&#x27;/mp4/processing/audio&#x27;))&#xA;&#xA;    subprocess.run([&#xA;&#xA;        r&#x27;c:\FFmpeg\bin\ffmpeg&#x27;, &#x27;-i&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4/processing/video&#x27;,video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].default_filename)&#xA;        ,&#x27;-i&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4/processing/audio&#x27;,video.streams.filter(only_audio=True)[1].default_filename),&#xA;        &#x27;-c:v&#x27;,&#x27;copy&#x27;,&#x27;-c:a&#x27;,&#x27;copy&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4&#x27;,video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].title&#x2B;&#x27;.mp4&#x27;)&#xA;&#xA;    ])&#xA;

    &#xA;

    I thought the code was working perfectly, but in some cases, the FFmpeg returns "invalid argument", like this example :

    &#xA;

    ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;D:/videos/mp4/processing/video\Dropkick Murphys - Rose Tattoo (Video).mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6avc1mp41&#xA;    creation_time   : 2020-04-04T10:16:52.000000Z&#xA;  Duration: 00:05:26.08, start: 0.000000, bitrate: 557 kb/s&#xA;  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 854x480 [SAR 1:1 DAR 427:240], 7 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-04-04T10:16:52.000000Z&#xA;      handler_name    : ISO Media file produced by Google Inc.&#xA;      vendor_id       : [0][0][0][0]&#xA;Input #1, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;D:/videos/mp4/processing/audio\Dropkick Murphys - Rose Tattoo (Video).mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6mp41&#xA;    creation_time   : 2020-04-04T10:16:00.000000Z&#xA;  Duration: 00:05:26.12, start: 0.000000, bitrate: 129 kb/s&#xA;  Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-04-04T10:16:00.000000Z&#xA;      handler_name    : ISO Media file produced by Google Inc.&#xA;      vendor_id       : [0][0][0][0]&#xA;D:/videos/mp4\Dropkick Murphys - "Rose Tattoo" (Video).mp4: Invalid argument&#xA;

    &#xA;

    For some reason, the FFmpeg say that my output name is invalid, but I don't understand why, given that I ran the code multiple times before and it worked perfectly.

    &#xA;

  • Where are there working exdamples for QSV enabled ffmpeg filters ?

    2 août 2021, par Bart Lederman

    I'm re-posting this question in a modified form because I'm told that stack overflow doesn't allow anyone to ask for the location of documentation. So now I'm not asking for documentation, I just want working examples of how the QSV enabled filters are used, with a specific question on why async doesn't work with vpp_qsv .

    &#xA;

    I have a PC running Windows which is QSV capable. I've found the codec and at least one QSV filter which really speed up decoding and encoding AVC (x264) videos.

    &#xA;

    But the experience is extremely aggravating, as I cannot find a list anywhere that I can find on what the filters and arguments actually are.

    &#xA;

    The closest I've come for vpp_qsv is this :

    &#xA;

    https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_vpp_qsv.c

    &#xA;

    It's a good start, but it has no examples of what the arguments actually are.&#xA;Source code doesn't explain how the filters actually work. However, this source code does say that async_depth is a valid qualifier.

    &#xA;

    The few examples I've been able to find in various places (including stackoverflow) do not work.

    &#xA;

    By experimentation, I've found that this works :

    &#xA;

    ffmpeg -hide_banner -init_hw_device qsv=qsv -hwaccel qsv -i "input.mts" -c:a aac -c:v h264_qsv -preset veryslow -vf "vpp_qsv=cw=628:cx=0:w=640:h=480" -q:v 30 "output.mp4"

    &#xA;

    I can add other things to the filter. For example :

    &#xA;

    "vpp_qsv=deinterlace=2:cw=628:cx=0:w=640:h=480"

    &#xA;

    will work. However, this will NOT work :

    &#xA;

    "vpp_qsv=cw=628:cx=0:w=640:h=480:async_depth=4"

    &#xA;

    even though there are examples posted that say it will.

    &#xA;

    [Parsed_vpp_qsv_0 @ 0000000005bff8c0] Option 'async_depth' not found [AVFilterGraph @ 0000000007327dc0] Error initializing filter 'vpp_qsv' with args 'cw=628:cx=0:w=640:h=480:async_depth=4' Error reinitializing filters ! Failed to inject frame into filter network : Option not found Error while processing the decoded data for stream #0:0

    &#xA;

    I also have been unable to find good examples of using more than one QSV enabled filter at the same time.

    &#xA;

    I'm using the newest version of ffmpeg I can find :

    &#xA;

    I :\ffmpeg -version ffmpeg version 4.4-full_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-libxml 2 —enable-gmp —enable-lzma —enable-libsnappy —enable-zlib —enable-librist —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-libbluray —enab le-libcaca —enable-sdl2 —enable-libdav1d —enable-libzvbi —enable-librav1e —enable-libsvtav1 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxvid —ena ble-libaom —enable-libopenjpeg —enable-libvpx —enable-libass —enable-frei0r —enable-libfreetype —enable-libfribidi —enable-libvidstab —enable-libvmaf —enable-lib zimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-d3d11va —enable-dxva2 —enable-libmfx —enable-libglslang - -enable-vulkan —enable-opencl —enable-libcdio —enable-libgme —enable-libmodplug —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libshine - -enable-libtheora —enable-libtwolame —enable-libvo-amrwbenc —enable-libilbc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libv orbis —enable-ladspa —enable-libbs2b —enable-libflite —enable-libmysofa —enable-librubberband —enable-libsoxr —enable-chromaprint 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

    &#xA;

    and the output of "ffmpeg -filters" says I have the various QSV enabled filters on my system.

    &#xA;

    I have searched dozens and dozens of sites including Intel and ffmpeg.org and I cannot find a clear explanation of how the various QSV enabled filters work, with examples that will actually execute on my system. Could someone please point me to where this filter is explained ? (This is NOT, I repeat, NOT a banned request for documentation. I'm asking how to use a specific qualifier in a specific filter.)

    &#xA;