Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (88)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (8925)

  • What is the least CPU-intensive format to pass high resolution frames from ffmpeg to openCV ? [closed]

    3 octobre 2024, par Doctico

    I'm developing an application to process a high-resolution (2560x1440) RTSP stream from an IP camera using OpenCV.

    &#xA;

    What I've Tried

    &#xA;

      &#xA;
    1. OpenCV's VideoCapture :

      &#xA;

        &#xA;
      • Performance was poor, even with CAP_PROP_FFMPEG.
      • &#xA;

      &#xA;

    2. &#xA;

    3. FFmpeg with MJPEG :

      &#xA;

        &#xA;
      • Decoded the stream as MJPEG and created OpenCV Mats from the image2pipe JPEG buffer.
      • &#xA;

      • Resulted in lower CPU usage for OpenCV but higher for FFmpeg.
      • &#xA;

      &#xA;

    4. &#xA;

    5. Current Approach :

      &#xA;

        &#xA;
      • Output raw video in YUV420p format from FFmpeg.
      • &#xA;

      • Construct OpenCV Mats from each frame buffer.
      • &#xA;

      • Achieves low FFmpeg CPU usage and moderately high OpenCV CPU usage.
      • &#xA;

      &#xA;

    6. &#xA;

    &#xA;

    Current Implementation

    &#xA;

    import subprocess&#xA;import cv2&#xA;import numpy as np&#xA;&#xA;def stream_rtsp(rtsp_url):&#xA;    # FFmpeg command to stream RTSP and output to pipe&#xA;    ffmpeg_command = [&#xA;        &#x27;ffmpeg&#x27;,&#xA;        &#x27;-hwaccel&#x27;, &#x27;auto&#x27;,&#xA;        &#x27;-i&#x27;, rtsp_url,&#xA;        &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,  # Use YUV420p format&#xA;        &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;,&#xA;        &#x27;-an&#x27;,  # Disable audio&#xA;        &#x27;-sn&#x27;,  # Disable subtitles&#xA;        &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA;        &#x27;-&#x27;  # Output to pipe&#xA;    ]&#xA;&#xA;    # Start FFmpeg process&#xA;    process = subprocess.Popen(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)&#xA;&#xA;    # Frame dimensions&#xA;    width, height = 2560, 1440&#xA;    frame_size = width * height * 3 // 2  # YUV420p uses 1.5 bytes per pixel&#xA;&#xA;    while True:&#xA;        # Read raw video frame from FFmpeg output&#xA;        raw_frame = process.stdout.read(frame_size)&#xA;        if not raw_frame:&#xA;            break&#xA;&#xA;        yuv = np.frombuffer(raw_frame, np.uint8).reshape((height * 3 // 2, width))&#xA;        frame = cv2.cvtColor(yuv, cv2.COLOR_YUV2BGR_I420)&#xA;        &#xA;        processFrame(frame)&#xA;&#xA;    # Clean up&#xA;    process.terminate()&#xA;    cv2.destroyAllWindows()&#xA;

    &#xA;

    Question

    &#xA;

    Are there any other ways to improve performance when processing high-resolution frames from an RTSP stream ?

    &#xA;

  • Output resolution substantially below input resolution [closed]

    29 août 2024, par bobford

    I have written an Android app to overlay a watermark png using FFMpeg 6.0 which works fine on 1k and 4k videos. In both cases the output resolution substantially deteriorates albeit consistent with the reduction in file size. In both cases, the original width-height pixel sizes are retained.

    &#xA;

    The ffmpeg command is :

    &#xA;

    String[] array = new String[] {"-i ", inputFile, " -i ", watermarkFile, " -filter_complex ", overlayPosition, " -codec:a copy ", outputFile};&#xA;String delimiter = "";&#xA;String command = String.join(delimiter, array);&#xA;

    &#xA;

    I would like to retain the original resolution, or as close as possible, even with the larger file size.&#xA;It would seem there are default parameters which I am unaware of, and have absolutely no idea of how to find them, even after extensive searching. Thank you for your help !

    &#xA;

  • FFMPEG in Android Kotlin - processed video should have specific resolution

    31 mai 2024, par Utsav

    I'm recording video from both the front and back cameras and I get a PIP video and a horizontal stacked video. I need to merge both videos after that. The problem with merging is that it requires both the videos (PIP and stacked) to have the same resolution and aspect ratio. This is not the case. So the FFMPEG command being executed in code to generate both these videos needs to be modified to make the resolution and aspect ratio the same.

    &#xA;

    //app -> build.gradle&#xA;implementation "com.writingminds:FFmpegAndroid:0.3.2"&#xA;

    &#xA;

        private fun connectFfmPeg() {&#xA;        val overlayX = 10&#xA;        val overlayY = 10&#xA;        val overlayWidth = 200&#xA;        val overlayHeight = 350&#xA;&#xA;        outputFile1 = createVideoPath().absolutePath&#xA;        outputFile2 = createVideoPath().absolutePath&#xA;        //Command to generate PIP video&#xA;        val cmd1 = arrayOf(&#xA;            "-y",&#xA;            "-i",&#xA;            videoPath1,&#xA;            "-i",&#xA;            videoPath2,&#xA;            "-filter_complex",&#xA;            "[1:v]scale=$overlayWidth:$overlayHeight [pip]; [0:v][pip] overlay=$overlayX:$overlayY",&#xA;            "-preset",&#xA;            "ultrafast",&#xA;            outputFile1&#xA;        )&#xA;&#xA;        //Command to generate horizontal stack video&#xA;        val cmd2 = arrayOf(&#xA;            "-y",&#xA;            "-i",&#xA;            videoPath1,&#xA;            "-i",&#xA;            videoPath2,&#xA;            "-filter_complex",&#xA;            "hstack",&#xA;            "-preset",&#xA;            "ultrafast",&#xA;            outputFile2&#xA;        )&#xA;&#xA;        val ffmpeg = FFmpeg.getInstance(this)&#xA;        //Both commands are executed&#xA;        //Following execution code is OK&#xA;        //Omitted for brevity&#xA;    }&#xA;

    &#xA;

    Here is mergeVideos() executed lastly.

    &#xA;

        private fun mergeVideos(ffmpeg: FFmpeg) {&#xA;        //Sample command:&#xA;        /*&#xA;        ffmpeg -y -i output_a.mp4 -i output_b.mp4 \&#xA;        -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" \&#xA;        -map "[outv]" -map "[outa]" -preset "ultrafast" output.mp4&#xA;        */&#xA;        finalOutputFile = createVideoPath().absolutePath&#xA;&#xA;        val cmd = arrayOf(&#xA;            "-y",&#xA;            "-i",&#xA;            outputFile1,&#xA;            "-i",&#xA;            outputFile2,&#xA;            "-filter_complex",&#xA;            "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]",&#xA;            "-map", "[outv]",&#xA;            "-map", "[outa]",&#xA;            "-preset", "ultrafast",&#xA;            finalOutputFile&#xA;        )&#xA;        //Execution code omitted for brevity&#xA;}&#xA;

    &#xA;

    Error : Upon execution of mergeVideos(), there is no progress or failure method called. The Logcat stays where it is and the app does not crash either.

    &#xA;

    Possible solution :&#xA;Once I got the generated PIP and horizontal stacked videos to my device's local storage, I tried out some FFMPEG commands on the prompt to process them after moving them to my laptop and it works on the command line :

    &#xA;

    //First two commands can&#x27;t be executed in Kotlin code&#xA;//This is the main problem&#xA;ffmpeg -i v1.mp4 -vf "scale=640:640,setdar=1:1" output_a.mp4&#xA;ffmpeg -i v2.mp4 -vf "scale=640:640,setdar=1:1" output_b.mp4&#xA;ffmpeg -y -i output_a.mp4 -i output_b.mp4 -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" -preset "ultrafast" output.mp4&#xA;//Merge is successful via command prompt&#xA;

    &#xA;

    Please suggest a solution

    &#xA;