Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (23)

  • Prérequis à l’installation

    31 janvier 2010, par

    Préambule
    Cet article n’a pas pour but de détailler les installations de ces logiciels mais plutôt de donner des informations sur leur configuration spécifique.
    Avant toute chose SPIPMotion tout comme MediaSPIP est fait pour tourner sur des distributions Linux de type Debian ou dérivées (Ubuntu...). Les documentations de ce site se réfèrent donc à ces distributions. Il est également possible de l’utiliser sur d’autres distributions Linux mais aucune garantie de bon fonctionnement n’est possible.
    Il (...)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • À propos des documents

    21 juin 2013, par

    Que faire quand un document ne passe pas en traitement, dont le rendu ne correspond pas aux attentes ?
    Document bloqué en file d’attente ?
    Voici une liste d’actions ordonnée et empirique possible pour tenter de débloquer la situation : Relancer le traitement du document qui ne passe pas Retenter l’insertion du document sur le site MédiaSPIP Dans le cas d’un média de type video ou audio, retravailler le média produit à l’aide d’un éditeur ou un transcodeur. Convertir le document dans un format (...)

Sur d’autres sites (3710)

  • ffmpeg command not interpreted correctly 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 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.&#xA;I tried fixing the root problem without any success so far, so an easier and valid workaround is to just restart the stream.

    &#xA;

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

    &#xA;

    #!/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;

  • Cross Fade Arbitrary Number of Videos ffmpeg Efficiently

    15 avril 2022, par jippyjoe4

    I have a series of videos named 'cut_xxx.mp4' where xxx represents a number 000 through 999. I want to do a cross fade on an arbitrary number of them to create a compilation, and each fade should last 4 seconds long. Currently, I'm doing this with Python, but I suspect this is not the most efficient way :

    &#xA;

    import subprocess    &#xA;def get_length(filename):&#xA;  result = subprocess.run(["ffprobe", "-v", "error", "-show_entries",&#xA;                          "format=duration", "-of",&#xA;                          "default=noprint_wrappers=1:nokey=1", filename],&#xA;    stdout=subprocess.PIPE,&#xA;    stderr=subprocess.STDOUT)&#xA;  return float(result.stdout)&#xA;&#xA;CROSS_FADE_DURATION = 4&#xA;&#xA;basevideo = &#x27;cut_000.mp4&#x27;&#xA;for ii in range(total_videos - 1):&#xA;  fade_start = math.floor(get_length(basevideo) - CROSS_FADE_DURATION) # new one&#xA;  outfile = f&#x27;cross_fade_{ii}.mp4&#x27;&#xA;  append_video = f&#x27;cut_{str(ii&#x2B;1).zfill(3)}.mp4&#x27;&#xA;  cfcmd = f&#x27;ffmpeg -y -i {basevideo} -i {append_video} -filter_complex "xfade=offset={fade_start}:duration={CROSS_FADE_DURATION}" -an {outfile}&#x27;&#xA;  basevideo = outfile&#xA;  subprocess.call(cfcmd)&#xA;  print(fade_start)&#xA;

    &#xA;

    I specifically remove the audio with -an because I'll add an audio track later. The issue I see here is that I'm compressing the video over and over again with each individual video file I add to the compilation because I'm only adding one video at a time and then re-encoding.

    &#xA;

    There should be a way to cross fade multiple videos together into a compilation, but I'm not sure what this would look like or how I would get it to work for an arbitrary number of video files of different durations. Any idea on what that monolithic ffmppeg command would look like or how I could automatically generate it given a list of videos and their durations ?

    &#xA;