Recherche avancée

Médias (91)

Autres articles (86)

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (12016)

  • compiling ffmpeg libs with libvpx enabled on windows

    12 juin 2021, par Satishsuman

    Need some regarding compiling ffmpeg with libvpx enabled on windows. Here is the steps i followed and error i got

    



      

    1. installed msys2 on windows and installed required packages(git,pkg-config,gcc compiler etc)
    2. 


    3. cloned libvpx from "https://github.com/webmproject/libvpx.git" and created a vs15 solution(command : ./configure —disable-vp8 —disable-vp9-encoder —target=x86_64-win64-vs15)
    4. 


    5. open vpx.sln and compiled vpxmd.lib sucessfully(created a vpx.pc file and kept include and libs at proper place)
    6. 


    7. cloned ffmpeg from https://github.com/FFmpeg/FFmpeg.git and from msys2 i tried building it(command : ./configure —enable-asm —enable-yasm —arch=x86_64 —target-os=win64 —disable-encoders —disable-muxers —enable-libvpx —disable-doc —disable-ffplay —disable-ffprobe —disable-ffmpeg —enable-shared —disable-static —disable-bzlib —disable-libopenjpeg —disable-iconv —disable-zlib —prefix=/d/Stadia/FFmpeg —toolchain=msvc —disable-debug)
    8. 


    



    ffmpeg libs a building fine but it doesn't include libvpx.
config.log is below :

    



    


    ./ffconf.NEscC1Fm/test.c(4) : warning C4311 : 'type cast' : pointer
 truncation from 'vpx_codec_iface_t *(__cdecl *)(void)' to 'long'

    
 


    ./compat/windows/mslink /usr/local/lib -nologo -I/usr/local/include
 -libpath :/usr/local/lib -out :./ffconf.NEscC1Fm/test.exe ./ffconf.NEscC1Fm/test.o vpx.lib

    
 


    LINK : warning LNK4044 : unrecognized option
 '/IC :/msys64/usr/local/include' ; ignored lib.obj(vp8_vp8_dx_iface.obj)
 : MSIL .netmodule or module compiled with /GL found ; restarting link
 with /LTCG ; add /LTCG to the link command line to improve linker
 performance

    
 


    LINK : warning LNK4044 : unrecognized option
 '/IC :/msys64/usr/local/include' ; ignored

    
 


    LINK : warning LNK4098 : defaultlib 'MSVCRT' conflicts with use of
 other libs ; use /NODEFAULTLIB:library lib.obj(vpx_mem_vpx_mem.obj) : 
 error LNK2001 : unresolved external symbol __imp_malloc
 lib.obj(vp8_decoder_threading.obj) : error LNK2001 : unresolved
 external symbol __imp__beginthreadex
 lib.obj(vp8_decoder_decodeframe.obj) : error LNK2001 : unresolved
 external symbol __imp_fopen ./ffconf.NEscC1Fm/test.exe : fatal error
 LNK1120 : 3 unresolved externals

    
 


    my msys2 is installed at C :/msys2/ and /home/ correspond to
 C/msys2/home if i use —extra-ldflags="-L/home/usr/local/lib" , linker
 treates it as /LC :/msys2/usr/local/lib and hence fails.

    


    



    A step by step guide would be very much appreciated here

    


  • Obtaining frames from IP Camera with low latency

    5 février 2023, par Russ1337

    I am currently using this command to get frames from my RTSP stream and reading frames from stdout :

    


    ffmpeg -nostdin -rtsp_transport tcp -i  -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -


    


    However, I would like to get the same latency as when I see it via ffplay :

    


    ffplay -fflags nobuffer -flags low_delay -tune zerolatency -framedrop -rtsp_transport tcp 


    


    or when I play it via VLC Media > Open Network Stream with :network_caching=300ms.

    


    I would like to know what other parameters I can use with my ffmpeg command to get an equivalent (or better) result compared to the ffplay command.

    


    I have made references from : How to dump raw RTSP stream to file ?, Open CV RTSP camera buffer lag, How to pipe output from ffmpeg using python ?, bad ffmpeg performace compared to ffplay and VLC, How to minimize the delay in a live streaming with ffmpeg

    


    My current implmentation :

    


    FFMPEG_CMD = "ffmpeg -nostdin -rtsp_transport tcp -i  -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -".split(" ")&#xA;WIDTH = 2560&#xA;HEIGHT = 1440&#xA;&#xA;process = subprocess.Popen(FFMPEG_CMD, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)&#xA;&#xA;while True:&#xA;    raw_frame = process.stdout.read(WIDTH*HEIGHT*3)&#xA;    frame = np.frombuffer(raw_frame, np.uint8) &#xA;    frame = frame.reshape((HEIGHT, WIDTH, 3))&#xA;&#xA;    <do stuff="stuff" with="with" frame="frame"></do> show frame etc.>&#xA;

    &#xA;

    Thanks for reading.

    &#xA;


    &#xA;

    ffmpeg command I am now using for < 1s latency.

    &#xA;

    ffmpeg -nostdin -flags low_delay -rtsp_transport tcp -i  -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -&#xA;

    &#xA;


    &#xA;

    Implementation with suggestion(s) from Answers :

    &#xA;

    import subprocess&#xA;import numpy as np&#xA;&#xA;FFMPEG_CMD = "ffmpeg -nostdin -flags low_delay -rtsp_transport tcp -i  -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -".split(" ")&#xA;WIDTH = 2560&#xA;HEIGHT = 1440&#xA;&#xA;process = subprocess.Popen(FFMPEG_CMD, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)&#xA;&#xA;raw_frame = np.empty((HEIGHT, WIDTH, 3), np.uint8) &#xA;frame_bytes = memoryview(raw_frame).cast("B")&#xA;&#xA;while process.poll() is None:&#xA;    process.stdout.readinto(frame_bytes)&#xA;    frame = raw_frame.reshape((HEIGHT, WIDTH, 3))&#xA;&#xA;    <do stuff="stuff" with="with" frame="frame"></do> show frame etc.>&#xA;

    &#xA;

  • Can't view and record graph at the same time using FFMpegWriter [closed]

    7 juillet 2024, par Barkın Özer

    So this code is used for graphing and logging sensor data coming from bluetooth ports. I wanted to add an function that will record the graph in mp4 format. In order to achieve this I used ffmpegWriter. The issue is while this code records the graph I can't view the graph at the same time.

    &#xA;

    import serial&#xA;import matplotlib.pyplot as plt&#xA;from matplotlib.animation import FuncAnimation, FFMpegWriter&#xA;import openpyxl&#xA;from datetime import datetime&#xA;&#xA;# Constants&#xA;GRAVITY = 9.81  # Standard gravity in m/s&#xB2;&#xA;&#xA;# Initialize serial connections to HC-06 devices&#xA;ser_x_accel = serial.Serial(&#x27;COM4&#x27;, 9600, timeout=1)  # X-axis acceleration data&#xA;ser_y_angle = serial.Serial(&#x27;COM11&#x27;, 9600, timeout=1)  # Y-axis angle data&#xA;&#xA;# Initialize empty lists to store data&#xA;x_accel_data = []&#xA;y_angle_data = []&#xA;timestamps = []&#xA;&#xA;# Initialize Excel workbook&#xA;wb = openpyxl.Workbook()&#xA;ws = wb.active&#xA;ws.title = "Sensor Data"&#xA;ws.append(["Timestamp", "X Acceleration (m/s&#xB2;)", "Y Angle (degrees)"])&#xA;&#xA;# Function to update the plot and log data&#xA;def update(frame):&#xA;    # Read data from serial connections&#xA;    line_x_accel = ser_x_accel.readline().decode(&#x27;utf-8&#x27;).strip()&#xA;    line_y_angle = ser_y_angle.readline().decode(&#x27;utf-8&#x27;).strip()&#xA;    &#xA;    try:&#xA;        # Parse and process X-axis acceleration data&#xA;        x_accel_g = float(line_x_accel)  # Acceleration in g read from serial&#xA;        x_accel_ms2 = x_accel_g * GRAVITY  # Convert from g to m/s&#xB2;&#xA;        x_accel_data.append(x_accel_ms2)&#xA;        &#xA;        # Parse and process Y-axis angle data&#xA;        y_angle = float(line_y_angle)&#xA;        y_angle_data.append(y_angle)&#xA;        &#xA;        # Append timestamp&#xA;        timestamps.append(datetime.now())&#xA;&#xA;        # Limit data points to show only the latest 100&#xA;        if len(x_accel_data) > 100:&#xA;            x_accel_data.pop(0)&#xA;            y_angle_data.pop(0)&#xA;            timestamps.pop(0)&#xA;&#xA;        # Log data to Excel with timestamp&#xA;        timestamp_str = timestamps[-1].strftime("%H:%M:%S")&#xA;        ws.append([timestamp_str, x_accel_data[-1], y_angle_data[-1]])&#xA;&#xA;        # Clear and update plots&#xA;        ax1.clear()&#xA;        ax1.plot(timestamps, x_accel_data, label=&#x27;X Acceleration&#x27;, color=&#x27;b&#x27;)&#xA;        ax1.legend(loc=&#x27;upper left&#x27;)&#xA;        ax1.set_ylim([-20, 20])  # Adjust based on expected acceleration range in m/s&#xB2;&#xA;        ax1.set_title(&#x27;Real-time X Acceleration Data&#x27;)&#xA;        ax1.set_xlabel(&#x27;Time&#x27;)&#xA;        ax1.set_ylabel(&#x27;Acceleration (m/s&#xB2;)&#x27;)&#xA;        ax1.grid(True)&#xA;&#xA;        ax2.clear()&#xA;        ax2.plot(timestamps, y_angle_data, label=&#x27;Y Angle&#x27;, color=&#x27;g&#x27;)&#xA;        ax2.legend(loc=&#x27;upper left&#x27;)&#xA;        ax2.set_ylim([-180, 180])&#xA;        ax2.set_title(&#x27;Real-time Y Angle Data&#x27;)&#xA;        ax2.set_xlabel(&#x27;Time&#x27;)&#xA;        ax2.set_ylabel(&#x27;Angle (degrees)&#x27;)&#xA;        ax2.grid(True)&#xA;&#xA;        # Update text boxes with latest values&#xA;        text_box.set_text(f&#x27;X Acceleration: {x_accel_data[-1]:.2f} m/s&#xB2;&#x27;)&#xA;        text_box2.set_text(f&#x27;Y Angle: {y_angle_data[-1]:.2f}&#xB0;&#x27;)&#xA;        &#xA;        # Save the workbook periodically (every 100 updates)&#xA;        if frame % 100 == 0:&#xA;            wb.save("sensor_data.xlsx")&#xA;        &#xA;    except ValueError:&#xA;        pass  # Ignore lines that are not properly formatted&#xA;&#xA;# Setup the plots&#xA;fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 8))&#xA;text_box = ax1.text(0.05, 0.95, &#x27;&#x27;, transform=ax1.transAxes, fontsize=12, verticalalignment=&#x27;top&#x27;, bbox=dict(boxstyle=&#x27;round&#x27;, facecolor=&#x27;wheat&#x27;, alpha=0.5))&#xA;text_box2 = ax2.text(0.05, 0.95, &#x27;&#x27;, transform=ax2.transAxes, fontsize=12, verticalalignment=&#x27;top&#x27;, bbox=dict(boxstyle=&#x27;round&#x27;, facecolor=&#x27;wheat&#x27;, alpha=0.5))&#xA;&#xA;# Animate the plots&#xA;ani = FuncAnimation(fig, update, interval=100)  # Update interval of 100ms&#xA;&#xA;# Save the animation as a video file&#xA;writer = FFMpegWriter(fps=10, metadata=dict(artist=&#x27;Me&#x27;), bitrate=1800)&#xA;ani.save("sensor_data.mp4", writer=writer)&#xA;&#xA;plt.tight_layout()&#xA;plt.show()&#xA;&#xA;# Save the workbook at the end of the session&#xA;wb.save("sensor_data.xlsx")&#xA;&#xA;

    &#xA;

    I tried using OpenCV to record the graph but then I didn't even got any recording. I think solving this issue with my original code would be a better approach.

    &#xA;