Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (112)

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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (7918)

  • Getting the "Invalid data found when processing input" error when I try to convert a raw pcm file to mp3 ?

    10 août 2023, par Jiron

    I tried to convert a file from pcm into mp3 with ffmpeg and the npm package fluent-ffmpeg. This is my code :

    


    const ffmpeg = require('fluent-ffmpeg');

function convert(input, output, callback) {
    ffmpeg(input)
        .output(output)
        .on('end', function() {                    
            console.log('conversion ended');
            callback(null);
        }).on('error', function(err){
           console.log('error: ' + err);
           callback(err);
        }).run();
   }

   convert('./test.pcm', './converted.mp3', function(err){
   if(!err) {
      console.log('conversion complete');
   }
});


    


    But every time I execute the script, I get this error :

    


    error: Error: ffmpeg exited with code 1: ./test.pcm: Invalid data found when processing input


    


    When I tired running :

    


    ffmpeg -f s16le -ar 48k -ac 2 -i test.pcm converted.mp3


    


    Everything worked though. Is there something wrong with the npm package ? Is there something I missed out or something I did wrong on my code ?

    


    Edit :

    


    My code works when I try to convert an mp3 to a wav file (for example). So it's only struggling with pcm files.

    


  • Live stream is gets delayed while processing frame in opencv + python

    18 mars 2021, par Himanshu sharma

    I capture and process an IP camera RTSP stream in a OpenCV 4.4.0.46 on Ubuntu.
Unfortunately the processing takes quite a lot of time, roughly 0.2s per frame, and the stream quickly gets delayed.
Video file have to save for 5 min but by this delaying video file is saved for 3-4 min only.

    


    Can we process faster to overcome delays ?

    


    I have two IP camera which have two diffrent fps_rate(Camera 1 have 18000 and camera 2 have 20 fps)

    


    I am implementing this code in difference Ubuntu PCs

    


      

    • Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux
    • 


    • Django==3.1.2
    • 


    • Ubuntu = 18.04 and 20.04
    • 


    • opencv-contrib-python==4.4.0.46
    • 


    • opencv-python==4.4.0.46
    • 


    


    input_stream = 'rtsp://'+username+':'+password+'@'+ip+'/user='+username+'_password='+password+'_channel=0channel_number_stream=0.sdp'
input_stream---> rtsp://admin:Admin123@192.168.1.208/user=admin_password=Admin123_channel=0channel_number_stream=0.sdp

input_stream---> rtsp://Admin:@192.168.1.209/user=Admin_password=_channel=0channel_number_stream=0.sdp

vs = cv2.VideoCapture(input_stream)
fps_rate = int(vs.get(cv2.CAP_PROP_FPS))
I have two IP camera which have two diffrent fps_rate(Camera 1 have 18000 and camera 2 have 20 fps)

video_file_name = 0
start_time = time.time()
while(True):
    ret, frame = vs.read()
    time.sleep(0.2)     # <= Simulate processing time (mask detection, face detection and many detection is hapning)


    ###  Start of  writing a video to disk          
    minute = 5  ## saving a file for 5 minute only then saving another file for 5 min
    second  = 60
    minite_to_save_video = int(minute) * int(second)


    # if we are supposed to be writing a video to disk, initialize
    if time.time() - start_time >= minite_to_save_video or  video_file_name == 0 :
        ## where H = heigth, W = width, C = channel 
        H, W, C = frame.shape
        
        print('time.time()-->',time.time(),'video_file_name-->', video_file_name,  ' #####')
        start_time = time.time()

        video_file_name = str(time.mktime(datetime.datetime.now().timetuple())).replace('.0', '')
        output_save_directory = output_stream+str(int(video_file_name))+'.mp4'


        fourcc = cv2.VideoWriter_fourcc(*'avc1')
        
        writer = cv2.VideoWriter(output_save_directory, fourcc,20.0,(W, H), True)

    # check to see if we should write the frame to disk
    if writer is not None:
        
        try:
            writer.write(frame)

        except Exception as e:
            print('Error in writing video output---> ', e)


    


  • FFmpeg does not exit even though processing has finished

    23 mars 2021, par LTR

    I'm starting ffmpeg.exe from C# on Windows. Then I send some frames for encoding via the stdin stream. When all frames have been sent, I close the stdin stream. This tells FFmpeg to exit. I have used this method in other projects before, and it has always worked before.

    


    In this case, it doesn't work. FFmpeg realizes the standard input stream has been closed, and finishes the output file. But then, the ffmpeg.exe process just remains open without exiting.

    


    What's wrong here ?

    


        [TestMethod]
    public void FfmpegNotReacting()
    {
        Size frameSize = new Size(854, 480);
        

        var ffmpegProcess = new Process();
        ffmpegProcess.StartInfo
             = new ProcessStartInfo("ffmpeg_64.exe")
             {
                 Arguments = $"-loglevel verbose -report -f rawvideo -vcodec rawvideo -pixel_format rgb32 -video_size {frameSize.Width}x{frameSize.Height} -r 30 -i pipe:0 -c:v libx264 -vf format=yuv420p -preset medium -y -crf 18 output.mp4",
                 RedirectStandardError = true,
                 RedirectStandardInput = true,
                 RedirectStandardOutput = true,
                 CreateNoWindow = true,
                 UseShellExecute = false
             };
        ffmpegProcess.Start();

        // Just add one empty frame
        int bytesPerFrame = frameSize.Width * frameSize.Height * 4;
        ffmpegProcess.StandardInput.BaseStream.Write(new byte[bytesPerFrame], 0, bytesPerFrame);

        ffmpegProcess.StandardInput.BaseStream.Close();

        ffmpegProcess.WaitForExit();

    }


    


    According to How to stop ffmpeg process after it has finished processing in C# ? ShellExecute=true might fix the problem. However, I can't do that here because I need ShellExecute in order to redirect StdInput.

    


    Here's the last couple of lines from the ffmpeg output (with some irrelevant messages removed) :

    


    [output stream 0:0 @ 000002632cf844c0] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
[libx264 @ 000002632cf79c20] frame=   0 QP=9.00 NAL=3 Slice:I Poc:0   I:1620 P:0    SKIP:0    size=125 bytes
frame=    1 fps=0.0 q=24.0 Lsize=       2kB time=00:00:00.03 bitrate= 387.4kbits/s speed=3.33x    
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 98.280098%
Input file #0 (pipe:0):
  Input stream #0:0 (video): 1 packets read (1639680 bytes); 1 frames decoded; 
  Total: 1 packets (1639680 bytes) demuxed
Output file #0 (output.mp4):
  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (814 bytes); 
  Total: 1 packets (814 bytes) muxed
1 frames successfully decoded, 0 decoding errors