Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (111)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (15340)

  • How to run ffmpeg as a subprocess and wait for the task to finish (fastapi)

    4 octobre 2023, par leejh

    I'm creating a site that runs ffmpeg on the web using fastapi.

    


    @router.post("/dir/Conver") 
async def ffmpeg_Conversion(request: Request):
    data = await request.json()

    file_path = data.get('file_path')
    saturation = float(data.get('saturation', 1.0))  
    brightness = float(data.get('brightness', 0.0))  
    contrast = float(data.get('contrast', 1.0))
    size = data.get('size','3840x2160')
    bitlayer = data.get('bitlayer',8000)
    codec = data.get('codec','libx264')
    formatstr=data.get('format','MP4')


    savepath = './UserFolder' + file_path

    directory = os.path.dirname(savepath)
    last_directory = os.path.basename(savepath)
    
    last_directory=str(last_directory).split('.')[0]
    print("last_directory : ---------------------" + last_directory)

    current_datetime = datetime.datetime.now()
    formatted_datetime = current_datetime.strftime('%Y-%m-%d-%H-%M-%S-%f')


    ffmpeg_command = [
        'ffmpeg',
        '-i', savepath,
        '-vf', f'eq=saturation={1+saturation/100}:brightness={brightness/100}:contrast={1+contrast/100}',
        '-s', size,
        '-c:v', codec,
        '-preset', 'medium',
        '-b:v', bitlayer,
        directory+'/'+last_directory+"_"+formatted_datetime+"."+formatstr
    ]

    subprocess.check_output(ffmpeg_command, text=True)



    


    Using the code above, I created a function to convert the video.
And this function was given to a button on the web.

    


    FileChan_yes.addEventListener('click', async () => { 
            startRotation();


            const file_path = 'path_to_your_file';  
            const contrastValue = contrastSlider.value;
            const brightnessValue = lightnessSlider.value;
            const saturationValue = saturationSlider.value;

            const Dir=document.getElementById('last_action_link');
            const savepath = Dir.value;

            const codecDropValue = codecDrop.value; 
            const formatDropValue = formatDrop.value;
            const FileSizeDropValue = FileSizeDrop.value;
            const bitDropValue  =   bitDrop.value;


            try {
                const response = await fetch(`/dir/Conver`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify({
                        file_path: savepath,
                        saturation: saturationValue,
                        brightness: brightnessValue,
                        contrast: contrastValue,
                        size: FileSizeDropValue,
                        bitlayer : bitDropValue,
                        codec : codecDropValue,
                        formatstr : formatDropValue
                    })
                    
                });

                
                if (response.ok) {
                    const result = await response.json();
                    console.log("Conversion successful:", result);
                } else {
                    throw new Error("Failed to convert the file.");
                }

            } catch (error) {
                console.error("Error converting the file:", error);
            } finally {
                stopRotation();
            }
            

        });



    


    When you press the button, first
startRotation() ; the function is executed

    


    When all tasks are completed, the stopRotation() ; function is configured to be executed.

    


    But currently it's not working properly...

    


    stopRotation() ; The function is executed as soon as the button is pressed.

    


    await doesn't seem to work. What is the problem ?

    


  • Revision da9db83270 : Revert "Fill buffer speed up" This reverts commit 9b4f9f45eee4d63cef3cd10f24923

    13 juillet 2015, par Jim Bankoski

    Changed Paths :
     Modify /vp9/decoder/vp9_reader.c


     Delete /vpx_util/endian_inl.h


     Modify /vpx_util/vpx_util.mk



    Revert "Fill buffer speed up"

    This reverts commit 9b4f9f45eee4d63cef3cd10f24923ed0bdd5ab7b.

    Change-Id : I23545ac8c7464127f7466fc6a58de517874fe0cf

  • ffmpeg does not fill in my provided buffer

    14 avril 2018, par thelearner

    I’m trying to pipe a mp4 video to ffmpeg to generate a thumbnail. Unfortunately, ffmpeg does not fill in my provided buffer, even though the whole command execution is successful.

    I’m reading the video from a http request body :

    videoData, err := ioutil.ReadAll(r.Body)

    This is how I push it to ffmpeg :

    log.Print("Creating thumbnail..")

    width := 640
    height := 360
    log.Print("Size of the video: ", len(videoData))


    cmd := exec.Command("ffmpeg", "-i", "pipe:0", "-vframes", "1", "-s", fmt.Sprintf("%dx%d", width, height), "-f",  "singlejpeg", "-frame_size", fmt.Sprintf("%d", totalVideoBytes), "-")

    cmd.Stdin = bytes.NewReader(videoData)

    var imageBuffer bytes.Buffer
    cmd.Stdout = &imageBuffer
    err := cmd.Run()

    if err != nil {
       log.Panic("ERROR")
    }

    imageBytes := imageBuffer.Bytes()

    This is the error output :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff05d002600]stream 0, offset 0x5ded : partial file

    pipe:0 : Invalid data found when processing input

    Finishing stream 0:0 without any data written to it.

    frame= 0 fps=0.0 q=0.0
    Lsize= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
    muxing overhead : unknown

    Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

    Thanks a lot, any help is appreciated.