
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (100)
-
MediaSPIP en mode privé (Intranet)
17 septembre 2013, parÀ partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...) -
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...) -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...)
Sur d’autres sites (12075)
-
FFmpeg.wasm demuxing - Get encodedChunks in Javascript
16 mars 2023, par Kevin BavingI am building a video editor whose process looks like this :


Demuxing -> Decoding -> Editing -> Encoding -> Muxing.


The demuxing and muxing process is currently done with mp4box.js. I would like to replace mp4box.js with ffmpeg.wasm. Unfortunately, I can't get along with the process.


What should FFmpeg.wasm do in the demuxing process ?


- 

- load a .mp4 file
- extract the encodedVideoChunks and store them as EncodedVideoChunk objects in an array
- extract the encodedAudioChunks and store them as EncodedAudioChunk objects in an array
- get some metadata like : duration, timescale, fps, track_width, track_height, codec, audio_channel_count, sample_rate ....










public async loadFile(file: File) {
 let data = await fetchFile(file)
 let blob = new Blob();
 await this.ffmpeg.setProgress(({ratio }) => console.log(`Extracting frames: ${Math.round(ratio * 100)}%`));
 this.ffmpeg.FS('writeFile', 'videoTest.mp4', data);
 //Here is where I am struggling
 //Should look like this: 
 //const command = '-i videoTest.mp4 -c:v copy .... '
 //await this.ffmpeg.run(command);
 //....
}



Lets get deeper into my problem :


Because FFmpeg.wasm is still a cli tool, I have no idea what the best way to safe the encodedChunks into a file is (and what kind of filetype I should use). Further I would like to know how to read that file propertly so that i can safe the input of the file into seperate EncodedVideo- and AudioChunks.


-
Getting Error message Unknown encoder 'libx264' , any help appreciated
16 janvier 2022, par Alex.FosterI am trying to compress videos files to a target size within python using ffmpeg-python for an A level project as part of my coursework, I keep getting this error saying it doesn't know the encoder. Not sure what I'm meant to do as this is literally an entirely new space to me. Am I meant to have installed the codec or something, or is there an alternative I can use ?


import os, ffmpeg
##import section:this part is where I import all of the modules I will use
import tkinter
import shutil
from tkinter import filedialog
import os


def fileSelect(): #start of fileSelect function
 global startingLocation #declares startingLocation as global variable
 global originalName #declares originalName as global variable
 global fileType #declares fileType as global variable
 startingLocation = filedialog.askopenfilename(initialdir="/", title="Select file", #tkinter function that opens file explorer, lets user select file saves the file path as a variable
 filetypes=(("video files", "*.mp4"),("images", "*.jpg*")))
 originalName = os.path.basename(startingLocation) #os function that gets the actaul file name from the path string
 print (originalName) #print statement to check if originalName has been found
 fileType = startingLocation.split('.') #splits original name where any full stop in found and saves array as variable
 fileType = fileType[-1] #changes variable to have the str value of the final item in the array; the file type
 fileType = '.' + fileType #adds fullstop to the start of the file type so i dont have to repeatedly do it
 print (fileType) #print statement to check file type is found correctly

def outputSelect(): #start of outputSelect function
 global outputLocation #declares outputLocation as global variable
 outputLocation = filedialog.askdirectory(initialdir="/", title="Select folder") #tkinter function that opens file explorer, lets the user select of folder as saves the folder path as a variable

def fileNewName(): #start of fileNewName function
 global customName #declares customName as global variable
 customName = input("Enter the end name of your file") #simple code assigning user input to the custom name vairable
 customName = customName + fileType #add the fileType onto the end of the custom name

def compress(): #start of compress function
 fileSelect() #calls the fileSelect function
 outputSelect() #calls the outputSelect function
 fileNewName()
 global src
 global dst #calls the fileNewName function
 src = startingLocation #assigns startingLocation str as src, so the shutil module is able to use it in a cleaner way
 dst = outputLocation #assigns outputLocation dst as src, so the shutil module is able to use it in a cleaner way
 shutil.copy(src, dst) #shutil command that copies the file from src to dst
 src = outputLocation + '/' + originalName #reassigns src as the location of the file copy
 dst = outputLocation + '/' + customName #reassigns dst as the location of the file copy but with a new name
 shutil.move(src,dst)


def compress_video(video_full_path, output_file_name, target_size):
 # Reference: https://en.wikipedia.org/wiki/Bit_rate#Encoding_bit_rate
 min_audio_bitrate = 32000
 max_audio_bitrate = 256000

 probe = ffmpeg.probe(video_full_path)
 # Video duration, in s.
 duration = float(probe['format']['duration'])
 # Audio bitrate, in bps.
 audio_bitrate = float(next((s for s in probe['streams'] if s['codec_type'] == 'audio'), None)['bit_rate'])
 # Target total bitrate, in bps.
 target_total_bitrate = (target_size * 1024 * 8) / (1.073741824 * duration)

 # Target audio bitrate, in bps
 if 10 * audio_bitrate > target_total_bitrate:
 audio_bitrate = target_total_bitrate / 10
 if audio_bitrate < min_audio_bitrate < target_total_bitrate:
 audio_bitrate = min_audio_bitrate
 elif audio_bitrate > max_audio_bitrate:
 audio_bitrate = max_audio_bitrate
 # Target video bitrate, in bps.
 video_bitrate = target_total_bitrate - audio_bitrate

 i = ffmpeg.input(video_full_path)
 ffmpeg.output(i, os.devnull,
 **{'c:v': 'libx264', 'b:v': video_bitrate, 'pass': 1, 'f': 'mp4'}
 ).overwrite_output().run()
 ffmpeg.output(i, output_file_name,
 **{'c:v': 'libx264', 'b:v': video_bitrate, 'pass': 2, 'c:a': 'aac', 'b:a': audio_bitrate}
 ).overwrite_output().run()

compress()
compress_video(dst, outputLocation, 3 * 1000)



-
Rendering video by ffmpeg.wasm in browser occured an error
15 septembre 2022, par James BorWhen a local video renderer uses the ffmpeg.wasm library in the Chrome browser, very often an error with the SBOX_FATAL_MEMORY_EXCEEDED code occurs during the rendering process. The standard command set is used. The code below is half fake because it is very long, but describes an approximate action algorithm. Computer performance and RAM capacity do not affect the video, files used - minimal size. Has anyone experienced this and how can we solve it ?
Error screen


const videoGenerate = async (project) => {
 const ffmpeg = createFFmpeg({
 corePath: 'ffmpeg/ffmpeg-core.js',
 workerPath: 'ffmpeg/ffmpeg-core.worker.js'
 });
 await loadFfmpeg(ffmpeg);
 project.projectName = "Default";
 project.fileType = "video/mp4";

 const resultVideo = {
 title: `${project.projectName}ConcatenatedVideo.mp4`,
 };
 // *For fetchFile method and ffmpeg.FS('writeFile', title, file);
 await uploadObjects(project.projectName, ffmpeg);
 // *
 const command = ['-i', project.video, resultVideo.title];
 await ffmpeg.run(...command);
 await ffmpeg.FS("unlink", resultVideo.title);
 resultVideo["blob"] = ffmpeg.FS('readFile', title);
 return resultVideo.blob;
};



These dependencies are used : "@ffmpeg/core" : " 0.8.5", "@ffmpeg/ffmpeg" : " 0.9.7". Upgrading the library to the latest version does not work either.