Recherche avancée

Médias (91)

Autres articles (69)

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

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (4720)

  • Ffmpeg HLS conversion error on AWS Lambda - ffmpeg was killed with signal SIGSEGV

    20 octobre 2023, par RtiM0

    I'm trying to convert video files into HLS streams on a AWS Lambda. The ffmpeg configuration I have setup works for normal (Non HLS) transcoding, but in case of HLS it throws the following error :

    


    stderr:
frame=  341 fps= 84 q=34.0 q=32.0 q=28.0 size=N/A time=00:00:12.52 bitrate=N/A speed= 3.1x    
frame=  385 fps= 85 q=34.0 q=31.0 q=27.0 size=N/A time=00:00:13.97 bitrate=N/A speed=3.08x    
frame=  433 fps= 86 q=33.0 q=30.0 q=27.0 size=N/A time=00:00:15.55 bitrate=N/A speed=3.08x    
[hls @ 0x702c480] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[hls @ 0x702c480] Opening '/tmp/stream_0.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/stream_1.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/stream_2.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/master.m3u8' for writing
ffmpeg was killed with signal SIGSEGV


    


    And I error thrown by fluent-ffmpeg is this :

    


    2023-03-06T10:21:44.555Z    15a0a43b-5e24-42ac-ae72-fe04f0c72a3e    ERROR   Invoke Error    &#xA;{&#xA;    "errorType": "Error",&#xA;    "errorMessage": "ffmpeg was killed with signal SIGSEGV",&#xA;    "stack": [&#xA;        "Error: ffmpeg was killed with signal SIGSEGV",&#xA;        "    at ChildProcess.<anonymous> (/var/task/node_modules/fluent-ffmpeg/lib/processor.js:180:22)",&#xA;        "    at ChildProcess.emit (node:events:513:28)",&#xA;        "    at ChildProcess._handle.onexit (node:internal/child_process:291:12)"&#xA;    ]&#xA;}&#xA;</anonymous>

    &#xA;

    This is the code I run on AWS Lambda to convert video files into HLS :

    &#xA;

    export const compressToHLS = (sourcePath, outputFolder) =>&#xA;  new Promise((resolve, reject) => {&#xA;    Ffmpeg(sourcePath)&#xA;      .complexFilter([&#xA;        {&#xA;          filter: "split",&#xA;          options: "3",&#xA;          inputs: "v:0",&#xA;          outputs: ["v1", "v2", "v3"],&#xA;        },&#xA;        {&#xA;          filter: "scale",&#xA;          options: {&#xA;            w: 1280,&#xA;            h: 720,&#xA;          },&#xA;          inputs: "v1",&#xA;          outputs: "v1out",&#xA;        },&#xA;        {&#xA;          filter: "scale",&#xA;          options: {&#xA;            w: 960,&#xA;            h: 540,&#xA;          },&#xA;          inputs: "v2",&#xA;          outputs: "v2out",&#xA;        },&#xA;        {&#xA;          filter: "scale",&#xA;          options: {&#xA;            w: 640,&#xA;            h: 360,&#xA;          },&#xA;          inputs: "v3",&#xA;          outputs: "v3out",&#xA;        },&#xA;      ])&#xA;      .outputOptions([&#xA;        "-map [v1out]",&#xA;        "-c:v:0",&#xA;        "libx264",&#xA;        "-b:v 3000000",&#xA;        "-map [v2out]",&#xA;        "-c:v:1",&#xA;        "libx264",&#xA;        "-b:v 2000000",&#xA;        "-map [v3out]",&#xA;        "-c:v:2",&#xA;        "libx264",&#xA;        "-b:v 1000000",&#xA;      ])&#xA;      .outputOptions([&#xA;        "-map a:0",&#xA;        "-c:a:0 aac",&#xA;        "-b:a:0 96000",&#xA;        "-ar 48000",&#xA;        "-ac 2",&#xA;        "-map a:0",&#xA;        "-c:a:1 aac",&#xA;        "-b:a:1 96000",&#xA;        "-ar 48000",&#xA;        "-ac 2",&#xA;        "-map a:0",&#xA;        "-c:a:2 aac",&#xA;        "-b:a:2 96000",&#xA;        "-ar 48000",&#xA;        "-ac 2",&#xA;      ])&#xA;      .outputOptions([&#xA;        "-f hls",&#xA;        "-hls_time 10",&#xA;        "-hls_playlist_type vod",&#xA;        "-hls_flags independent_segments",&#xA;        "-hls_segment_type mpegts",&#xA;        `-hls_segment_filename ${outputFolder}/%v_%d.ts`,&#xA;        "-master_pl_name master.m3u8",&#xA;      ])&#xA;      .outputOption("-var_stream_map", "v:0,a:0 v:1,a:1 v:2,a:2")&#xA;      .outputOption("-preset veryfast")&#xA;      .output(`${outputFolder}/stream_%v.m3u8`)&#xA;      .on("start", (cmdline) => console.log(cmdline))&#xA;      .on("progress", (progress) => {&#xA;        let prog = Math.floor(progress.percent * 10) / 10;&#xA;        if (Math.round(prog) % 10 == 0) {&#xA;          console.log(`${prog}% complete`);&#xA;        }&#xA;      })&#xA;      .on("error", (err, stdout, stderr) => {&#xA;        if (err) {&#xA;          console.log(err.message);&#xA;          console.log("stdout:\n" &#x2B; stdout);&#xA;          console.log("stderr:\n" &#x2B; stderr);&#xA;          reject(err);&#xA;        }&#xA;      })&#xA;      .on("end", () => resolve())&#xA;      .run();&#xA;  });&#xA;

    &#xA;

    In this code the sourcePath is usually a presigned URL from S3 (But I have also tried to download a file on /tmp and setting sourcePath as the path to the downloaded file) and outputFolder is tmpdir() which is /tmp.

    &#xA;

    I have the lambda settings configured to have 10GB of memory and 10GB of ephemeral storage (the maximum allowed).

    &#xA;

  • ffMPEG write two outputs with one encoder and several filters (segmentation, timecode)

    4 mai 2023, par Francois

    need some help after trying days on this. I'm able to process one input to two outputs with two encodings :

    &#xA;

    ffmpeg -f dshow -i video="Integrated Camera" -c:v mpeg2video -b:v 50000k -vf "scale=1920:1080" -an -flags &#x2B;global_header -f segment -segment_time 60 -segment_format mxf -strftime 1 -reset_timestamps 1 -minrate 50000k -maxrate 50000k -bufsize 50000k "C:\ffmpeg\Master\Master_%Y-%m-%d_%H-%M-%S.mxf" -b:v 50000k -vf "scale=1920:1080" -an -flags &#x2B;global_header -f segment -segment_time 60 -segment_wrap 3 -segment_format mxf -reset_timestamps 1 -minrate 50000k -maxrate 50000k -bufsize 50000k "C:\ffmpeg\Backup\backup_%02d.mxf"&#xA;

    &#xA;

    But when i try to do something to get rid of the second encoding and working with "tee" filter, i run into the problem that the other filters will not work anymore. If i run this without the extra filters :

    &#xA;

    ffmpeg -f dshow -i video="Integrated Camera" -c:v mpeg2video -an -f tee -map 0:v -an "Main.mxf|[f=mxf]Backup.mxf"&#xA;

    &#xA;

    This works but trying to add this filters after the -f tee filter will lead into an error. As well to define this before the tee filter will not work due to different filter settings in segmentation.

    &#xA;

    I think the way how it could work is to split the output and use afterwards the tee filter. But i wasn't able to do. Maybe someone could help me here.

    &#xA;

    Best

    &#xA;

    Francois

    &#xA;

  • Unable to find a suitable output format for 'is' is : Invalid argument in fmmpeg

    26 janvier 2023, par Test000

    I want to make a python script to make a video in FFmpeg. I try a lot of solutions for example but I do not know Why I do not have permission to write. I have not any idea because ffmpeg errors are a little bit tricky

    &#xA;

    my code :

    &#xA;

    import os&#xA;import cv2&#xA;&#xA;def calculate_quote_position(quote, max_length, video_width, video_height):&#xA;    if len(quote) > max_length:&#xA;        print("Quote is too long for the video.")&#xA;        return&#xA;    &#xA;    # Determine font size and alignment&#xA;    font = cv2.FONT_HERSHEY_SIMPLEX&#xA;    font_scale = 1.0&#xA;    thickness = 2&#xA;    (text_width, text_height), _ = cv2.getTextSize(quote, font, font_scale, thickness)&#xA;    &#xA;    # Calculate position for the quote&#xA;    x = int((video_width - text_width) / 2)&#xA;    y = int((video_height &#x2B; text_height) / 2)&#xA;    &#xA;    return (x, y, text_width, text_height)&#xA;&#xA;def create_video_from_audio_quote_picture(music_file, quote, font, font_size, font_color, background_picture, output_file, video_duration, video_width, video_height, max_length):&#xA;    quote_position = calculate_quote_position(quote, max_length, video_width, video_height)&#xA;    if not quote_position:&#xA;        print("The quote is too long for the video.")&#xA;        return&#xA;    # Create the FFmpeg command&#xA;    command = f"ffmpeg -loop 1 -t {video_duration} -i {background_picture} -i {music_file} -vf drawtext=&#x27;fontfile={font}&#x27;:text={quote}:fontcolor={font_color}:fontsize={font_size}:x={quote_position[0]}:y={quote_position[1]}&#x27; -shortest -c:v libx264 -c:a aac {output_file}"&#xA;&#xA;    # Execute the command&#xA;    os.system(command)&#xA;&#xA;music_file = "music.mp3"&#xA;quote = "This is a quote"&#xA;font = "Raleway-Bold.ttf"&#xA;font_size = 20&#xA;font_color = "white"&#xA;background_picture = "nature.png"&#xA;output_file = r"C:\Users\Lukas\Dokumenty\python_scripts\Billionare livestyle\output.mp4"&#xA;video_duration = 30&#xA;video_width = 1920&#xA;video_height = 1080&#xA;max_length = 30&#xA;&#xA;create_video_from_audio_quote_picture(music_file, quote, font, font_size, font_color, background_picture, output_file, video_duration, video_width, video_height, max_length)&#xA;

    &#xA;

    my error :

    &#xA;

    Input #0, image2, from &#x27;nature.png&#x27;:&#xA;  Duration: 00:00:00.04, start: 0.000000, bitrate: 569438 kb/s&#xA;  Stream #0:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc&#xA;Input #1, mp3, from &#x27;music.mp3&#x27;:&#xA;  Metadata:&#xA;    date            : 2020:12:15 01:00:00&#xA;    title           : Otnicka - Peaky Blinder (lyrics) | i am not outsider i&#x27;m a peaky blinder&#xA;    artist          : Jigzaw&#xA;    encoder         : Lavf58.29.100&#xA;  Duration: 00:02:31.78, start: 0.023021, bitrate: 128 kb/s&#xA;  Stream #1:0: Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavf&#xA;  Stream #1:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 320x240 [SAR 1:1 DAR 4:3], 90k tbr, 90k tbn, 90k tbc (attached pic)&#xA;    Metadata:&#xA;      comment         : Other&#xA;[NULL @ 000001575c0b0100] Unable to find a suitable output format for &#x27;is&#x27;&#xA;is: Invalid argument&#xA;

    &#xA;