Recherche avancée

Médias (91)

Autres articles (24)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (3459)

  • How to make ffmpeg exit when rtmp input stream ends ?

    29 juillet 2021, par Remi

    I am using ffmpeg to transcode a stream from my local nginx rtmp server, and send the transcoded media back to the same local rtmp server. When the stream goes offline, ffmpeg stays active. When the stream starts again, ffmpeg picks up the transcoding work.

    


    I'd like ffmpeg to exit when the input rtmp stream stops, but I cannot find out to configure it to do that. I've looked through the manual page and the online documentation.

    


    For completeness, these are the arguments I currectly provide to ffmpeg :

    


    


    ffmpeg -i 'rtmp ://localhost/live/ijsbeer' -s '1280x720' -vcodec 'libx264' -preset 'veryfast' -crf '25' -maxrate '2000k' -bufsize '1000.0k' -force_key_frames '0:00:02' -max_muxing_queue_size '4096' -acodec 'copy' -copyts -copytb '0' -f 'flv' 'rtmp ://localhost/live/ijsbeer_720p'

    


    


    Making ffmpeg exit itself solves two of my problems. Firstly, ffmpeg sometimes experiences non-monotonous DTS issues when the encoder (OBS) streaming to the rtmp server restarts. Second, I'd like to implement a basic monitoring system to notify me of issues in the transcoder. Making ffmpeg exit when the input stream stops seems like to most reliable way to determine if ffmpeg is doing work. Parsing the stderr/stdout isn't reliable as there is no clear output format.

    


    When transcoding I receive these regular stderr lines :

    


    


    frame= 241 fps= 30 q=30.0 size= 38kB time=00:00:09.74 bitrate= 32.0kbits/s speed= 1.2x

    


    


    Which pause when I stop the source stream. There is no log output stating the source stream has exited.

    


  • Crontab starts again befor the process of conversion in ffmpeg ends(depending on time supose /2 minutes) How to Control that ?

    18 décembre 2016, par A Sahra

    I am running a bash .sh file every two minutes with crontab. the problem is that when crontab runs bash file the process of ffmpeg video conversion starts,the conversion time varies depending on length of videos, i have set the crontab to run every two minutes. crontab runs again after two minutes before end of ffmpeg conversion.

    How to Figure out :

    control of crontab and conversion process so the crontab doesn’t starts again until process of conversion is not completed.

    #!/bin/bash
    # set PATH to check existance of video file in this directory
    checkfiles=/home/webuser/public_html/shareportal/convert_Up_videos/*
    checkforfiles=/home/webuser/public_html/shareportal/convert_Up_videos
    movetodire=/home/webuser/public_html/shareportal/uploaded_videos/
    conversionprocessdir=/home/webuser/public_html/shareportal/conversion_process/
    movetoArchive=/home/webuser/public_html/shareportal/Video_Archive/
    blockpath=/home/webuser/public_html/shareportal/block.txt
    processid=/home/webuser/public_html/shareportal/processid.txt
    #format of output video file
    webm='webm'
    if [ "$(ls -A $checkforfiles)" ]
    then
    #check directory for files to convert
    for f in $checkfiles
       do  
           fullfilename="$f"
           filename=$(basename "$f")
           filewithoutextforimage="${filename%.*}"
           nametofile=$filewithoutextforimage | cut -c1-10;
           echo $filewithoutextforimage | cut -c1-10 1> $blockpath 2>&1
       filewithoutext="${f%.*}"
       fileextention="${f##*.}"
       image_path='/home/webuser/public_html/shareportal/video_images/'$filewithoutextforimage'.png'
       outputfilename=$conversionprocessdir"$filewithoutextforimage.webm"
       #ffmpeg conversion process starts here
       if (ffmpeg -i "$f" "$outputfilename" 1>> $blockpath 2>&1)
       then
           #Extract Image of video file on provided time stamp
           if (ffmpeg -ss 00:00:06 -i "$f" -vframes:v 1 "$image_path")
           then
               echo "Image Extracted"
           else
               echo "Could not Extract Image"
           fi
           echo "Video Converted";
       else
           echo "Could Not Convert Video"
       fi
       #conversion Ends!!
       mv "$outputfilename" $movetodire
       mv "$fullfilename" $movetoArchive
    done
    else
    echo "File Not Found Directory is empty!!!-----"
    fi
  • Combining png and mp3, why using -loop 1 on image and -shortest tag doesn't cut the output length when audio ends ?

    9 novembre 2022, par Alexander

    I have several image and audio files and I want to combine each of the set to a separate video file where image is stretched to audio file length. For example a lion image should be displayed as long as the lion voice is being played. The output file should end when lion audio ends.

    


    I also try to normalize output clips resolution since image files doesn't have same width/height.

    


    Here is the command I'm currently running. Command is on one line but I made some line breaks here for your convenience.

    


    -loop 1 
-i "C:\Temp\screenshot\clip_1.png"
-i "C:\Temp\audio\clip_1.mp3" 
-shortest 
-filter_complex "[0:v]scale=3000:-2:force_original_aspect_ratio=decrease" 
-c:v h264_nvenc 
-c:a aac 
-b:a 192k 
-y 
C:\Temp\clips\clip_1.mp4


    


    To my understanding the -loop 1 before image input should make it to loop infinite and -shortest should end the video when shortest input (audio in this case) ends. In following example, the audio file is 6 seconds long but the output is always 20 seconds.

    


    Here is the full output of ffmpeg :

    


    ffmpeg version 2022-11-03-git-5ccd4d3060-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (Rev2, 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-libdav1d --enable-libdavs2 --enabl
e-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --ena
ble-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --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 --e
nable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 40.100 / 57. 40.100
  libavcodec     59. 51.101 / 59. 51.101
  libavformat    59. 34.101 / 59. 34.101
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 49.101 /  8. 49.101
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100
Input #0, png_pipe, from 'C:\Temp\screenshot\clip_1.png':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: png, rgba(pc), 640x148, 25 fps, 25 tbr, 25 tbn
[mp3 @ 0000016c26784a80] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'C:\Temp\audio\clip_1.mp3':
  Duration: 00:00:06.10, start: 0.000000, bitrate: 32 kb/s
  Stream #1:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Stream mapping:
  Stream #0:0 (png) -> scale:default (graph 0)
  scale:default (graph 0) -> Stream #0:0 (h264_nvenc)
  Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0000016c267ab180] Too many bits 8192.000000 > 6144 per frame requested, clamping to max
Output #0, mp4, to 'C:\Temp\clips\clip_1.mp4':
  Metadata:
    encoder         : Lavf59.34.101
  Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), rgba(pc, gbr/unknown/unknown, progressive), 3000x694, q=2-31, 2000 kb/s, 25 fps, 12800 tbn
    Metadata:
      encoder         : Lavc59.51.101 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 144 kb/s
    Metadata:
      encoder         : Lavc59.51.101 aac
frame=  504 fps=149 q=11.0 Lsize=     925kB time=00:00:20.00 bitrate= 378.8kbits/s speed=5.91x
video:852kB audio:67kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.645776%
[aac @ 0000016c267ab180] Qavg: 65496.695