Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (51)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (5191)

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

    


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

    


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

    


    The ffmpeg command is :

    


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


    


    I would like to retain the original resolution, or as close as possible, even with the larger file size.
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 !