Recherche avancée

Médias (91)

Autres articles (74)

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (10987)

  • Converting multiple audio files in different subdirectories using ffmpeg

    4 avril 2022, par Amartya Roy Choudhury

    I am trying to convert multiple .mp3 files stored in different folders to .wav file using ffmpeg. The .wav files will be stored in the folder where the .mp3 file is located

    


    import os
folder = r'D:\S2ST_DataCollection-main\public\recordings' ##### root folder


count = 0
for dirname, dirs, files in os.walk(folder):
    for filename in files:
        filename_without_extension, extension = os.path.splitext(filename)
        if extension == '.mp3':       ######## get all the mp3 files
            count +=1
            os.system(r"C:\Users\amart\Downloads\Compressed\S2ST_DataCollection-main\public\music.bat") ###### use the mp3 to wav conversion stored as batch file


    


    My music.bat file

    


    for %%a in ("*.mp3") do ffmpeg -i "%%a" -vn -c:a pcm_s16le  -ar 44100 "%%~na.wav"


    


    Note : I have used pydub but it is not working

    


    If i use the batch command only in a folder it is working fine but my .mp3 files are located in multiple folder

    


    Any kind of help would be greatly appreciated

    


  • Recording RTSP steam with Python

    6 mai 2022, par ロジャー

    Currently I am using MediaPipe with Python to monitor RTSP steam from my camera, working as a security camera. Whenever the MediaPipe holistic model detects humans, the script writes the frame to a file.

    


    i.e.

    


    # cv2.VideoCapture(RTSP)
# read frame
# while mediapipe detect
#   cv2.VideoWriter write frame
# store file


    


    Recently I want to add audio recording support. I have done some research that it is not possible to record audio with OpenCV. It has to be done with FFMPEG or PyAudio.

    


    I am facing these difficulities.

    


      

    1. When a person walk through in front of the camera, it takes maybe less than 2 seconds. For the RTSP stream being read by OpenCV, human is detected with MediaPipe, and start FFMPEG for recording, that human should have walked far far away already. So FFMPEG method seems not working for me.

      


    2. 


    3. For PyAudio method I am currently studying, I need to create 2 threads establishing individual RTSP connections. One thread is for video to be read by OpenCV and MediaPipe. The other thread is for audio to be recorded when the OpenCV thread notice human is detected. I have tried using several devices to read the RTSP streams. The devices are showing timestamps (watermark on the video) with several seconds in difference. So I doubt if I can get video from OpenCV and audio from PyAudio in sync when merging them into one single video.

      


    4. 


    


    Is there any suggestion how to solve this problem ?

    


    Thanks.

    


  • Can't scrub frame by frame through .mp4 files in VLC created using FFmpeg command line, but changing container to .avi can scrub frame by frame in VLC

    16 juin 2022, par ICBanMI

    I wrote a really simple demonstration of the issue. I create a 4k video that is 150 frames, and output it to mp4. When I open that in VLC(Vent 3.0.17.4), I can scrub forward a few frames at the beginning(e key) before it stops entirely. If I move it towards the end of the file( 4 secs), it can't scrub forward at all.

    


    What I found out through testing. I can scrub forward/backward 3 seconds normal in vlc. I can scrub forward frame by frame using quicktime's latest version(2016). If I mux it to .avi file format, scrubbing using the e key works as expected in VLC. Copying the meta data from an mp4 that can scrub forward frame by frame doesn't change anything. Renaming the .mp4 file to .avi doesn't fix the issue... only muxing out to an avi does. Using a build of version 5.0.1 of ffmpeg.

    


    I included both VLC commands in code. I'd be more than happy to walk way from this with just muxing everything to avi... but .mp4 is a requirement along with being able to scrub forward frame by frame in VLC. Not sure if code or command line is where the issue is... as sample mp4s from the net used in VLC don't appear to have this issue.

    


    #include <iostream>&#xA;#include &#xA;&#xA;int main()&#xA;{&#xA;   FILE *m_pFFmpeg;&#xA;&#xA;   // Working - Can scrub forward frame by frame in latest version of vlc&#xA;   //const char *cmdOutput = "ffmpeg -hide_banner -y -r 30 -s 3840x2160 -f rawvideo -pix_fmt rgb24 -i - -framerate 30 -an -vcodec libx264 -pix_fmt yuv420p -video_track_timescale 30 -vf vflip -preset veryslow -qp 0 output.avi";&#xA;   &#xA;   // Not working - Can&#x27;t scrub forward frame by frame in latest version of vlc. Only difference is the .mp4 at the end&#xA;   const char *cmdOutput = "ffmpeg -hide_banner -y -r 30 -s 3840x2160 -f rawvideo -pix_fmt rgb24 -i - -framerate 30 -an -vcodec libx264 -pix_fmt yuv420p -video_track_timescale 30 -vf vflip -preset veryslow -qp 0 output.mp4";&#xA;  &#xA;   int g_x_dis_res = 3840;&#xA;   int g_y_dis_res = 2160;&#xA;&#xA;   m_pFFmpeg = _popen(cmdOutput, "wb");&#xA;&#xA;   uint8_t *export_buffer = new uint8_t[g_x_dis_res * g_y_dis_res * 3];&#xA;&#xA;   for (int i = 0; i &lt; (g_x_dis_res * g_y_dis_res * 3); i&#x2B;&#x2B;) {&#xA;      export_buffer[i] = 127;&#xA;   }&#xA;&#xA;   for (int j = 0; j &lt; 150; j&#x2B;&#x2B;) {&#xA;      fwrite(export_buffer, 3 * g_x_dis_res * g_y_dis_res, 1, m_pFFmpeg);&#xA;&#xA;      printf("Export Frame %d\n", j &#x2B; 1);&#xA;   }&#xA;&#xA;   delete[] export_buffer;&#xA;&#xA;   fflush(m_pFFmpeg);&#xA;   _pclose(m_pFFmpeg);&#xA;&#xA;   return 0;&#xA;}&#xA;</iostream>

    &#xA;