Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (97)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

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

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

    


    What I've Tried

    


      

    1. OpenCV's VideoCapture :

      


        

      • Performance was poor, even with CAP_PROP_FFMPEG.
      • 


      


    2. 


    3. FFmpeg with MJPEG :

      


        

      • Decoded the stream as MJPEG and created OpenCV Mats from the image2pipe JPEG buffer.
      • 


      • Resulted in lower CPU usage for OpenCV but higher for FFmpeg.
      • 


      


    4. 


    5. Current Approach :

      


        

      • Output raw video in YUV420p format from FFmpeg.
      • 


      • Construct OpenCV Mats from each frame buffer.
      • 


      • Achieves low FFmpeg CPU usage and moderately high OpenCV CPU usage.
      • 


      


    6. 


    


    Current Implementation

    


    import subprocess
import cv2
import numpy as np

def stream_rtsp(rtsp_url):
    # FFmpeg command to stream RTSP and output to pipe
    ffmpeg_command = [
        'ffmpeg',
        '-hwaccel', 'auto',
        '-i', rtsp_url,
        '-pix_fmt', 'yuv420p',  # Use YUV420p format
        '-vcodec', 'rawvideo',
        '-an',  # Disable audio
        '-sn',  # Disable subtitles
        '-f', 'rawvideo',
        '-'  # Output to pipe
    ]

    # Start FFmpeg process
    process = subprocess.Popen(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)

    # Frame dimensions
    width, height = 2560, 1440
    frame_size = width * height * 3 // 2  # YUV420p uses 1.5 bytes per pixel

    while True:
        # Read raw video frame from FFmpeg output
        raw_frame = process.stdout.read(frame_size)
        if not raw_frame:
            break

        yuv = np.frombuffer(raw_frame, np.uint8).reshape((height * 3 // 2, width))
        frame = cv2.cvtColor(yuv, cv2.COLOR_YUV2BGR_I420)
        
        processFrame(frame)

    # Clean up
    process.terminate()
    cv2.destroyAllWindows()


    


    Question

    


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

    


  • FFprobe reading incorrect resolution value despite players rendering it correctly

    28 octobre 2024, par Boehmi

    I'm creating a video from a stream with the help of FFMPEG and I also use FFPROBE to gather information for use on a status page like resolution, codecs et cetera.

    



    When FFProbe parses my video for information, I get a resolution value of 544x576 (almost a square !), but an aspect ratio of 16:9.

    



    These values are consistent on both the input stream and my saved video.

    



    When I watch the video in the standard HTML5 Player, VLC or FFPLAY however, I get a video with the proportions of 16:9 and a resolution (measured using an image editing program) of 1024x576 that does look native and not stretched in any way.

    



    Even if I re-encode the video using slightly different codecs, this incorrect resolution value persists, even though every player I use displays it correctly.

    



    This is slightly inconvenient because I am relying on getting the correct resolution value from the video for further processing.

    



    I'm also using a recent FFMPEG+FFPROBE version that was compiled on the 15th of July.

    



    Is this a bug within FFMPEG or is there anything I'm doing wrong ?

    



    Used command lines :

    



    FFMPEG :

    



    ffmpeg -i source -loglevel debug -vcodec copy -acodec copy -bsf:a aac_adtstoasc -movflags +faststart -t 360 -y video.mp4


    



    FFPROBE (I parse the output of this directly and save the values) :

    



    ffprobe -i source -show_format -show_streams 


    



    FFProbe output :

    



    width=544
height=576
coded_width=544
coded_height=576
has_b_frames=2
sample_aspect_ratio=32:17
display_aspect_ratio=16:9


    



    I can see that the sample aspect ratio is different from the display aspect ratio, but how come the video looks proper in 16:9 when it's supposedly encoded at a near square resolution ?

    


  • ffmpeg ignores input svg files resolution and produces 100x100 video [closed]

    11 novembre 2024, par Francesco Potortì

    I have used this command for some years to produce .ogg files (or any other format) from a series of .svg files on Linux :

    


    ffmpeg -y -r 1.2 -i %06d.svg -qscale:v 10 path.ogg

    


    It has worked flawlessly until now, when it produces a video with 100x100 resolution, rather then the 1920x1080 resolution of the input files.

    


    If I force the output resolution to be 1920x1080 using the -s option, the resulting video is a magnified version of the 100x100 video output I obtain without the -s option. If I convert the svg files to png using inkscape everything is well, but I'd like to avoid making my workflow more complex.

    


    Here you can find some of the .svg files.

    


    Any ideas ?