
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (59)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (10436)
-
h265_videotoolbox for Apple Chips Not working with ffmpeg
22 janvier 2024, par Martin JulienI have a 16-inch Macbook Pro.
System :
Model Name : MacBook Pro
Chip : Apple M1 Max
Total Number of Cores : 10 (8 performance and 2 efficiency)
Memory : 64 GB


You can take advantage of apple chips to encode faster by replacing the usual line :

-c:v libx265
by-c:v h265_videotoolbox
.

Here's an example.
Since h265 doesn't work at the moment, here's a line that works just fine :


for i in *.mp4; do ffmpeg -i "$i" -c:v h264_videotoolbox -b:v 2000k -c:a aac -b:a 192k -s 1920x1080 -threads 8 "${i%.*}_1.mp4"; done


The version of ffmpeg installed on my mac is the latest : 6.1.1


My problem :
I want to encode in h265. My command line is :

for i in *.mp4; do ffmpeg -i "$i" -c:v h265_videotoolbox -b:v 2000k -c:a aac -b:a 192k -s 1920x1080 -threads 8 "${i%.*}_1.mp4"; done


Everything should work in theory. But I get this from the Shell :


[vost#0:0 @ 0x150f06fd0] Unknown encoder 'h265_videotoolbox' [vost#0:0 @ 0x150f06fd0] Error selecting an encoder Error opening output file Denis_1.mp4. Error opening output files: Encoder not found


My attempts :


I spent a lot of time with ChatGPT to solve the problem, but nothing worked. So I'm asking the question here to see if anyone has had the same problem as me and if there's a solution to fix it.


Thank you for your help,


best regards,
Martin


-
How to determine when FFmpeg process completes
18 avril 2017, par ajbeavenvar origFilePath = "C:/MyOriginalFile.webm";
var processedFilePath = "C:/MyProcessedFile.webm";
RunFfmpeg($"-i \"{origFilePath}\" -af \"silenceremove=1:0.1:0.001, areverse, silenceremove=1:0.1:0.001, areverse\" \"{processedFilePath}\" -y");
// fails with IOException as the file presumably not been released by FFmpeg
System.IO.File.Delete(origFilePath);When the file is deleted, the following exception is frequently (maybe 80% of the time) thrown :
IOException : The process cannot access the file ’C :\MyOriginalFile.webm’ because it is being used by another process.
The call to create and run the FFmpeg process goes like this :
private List<string> RunFfmpeg(string arguments)
{
using (var process = new Process())
{
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.FileName = _hostingEnvironment.ContentRootPath + _settings.FfmpegPath;
process.StartInfo.Arguments = arguments;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
// ffmpeg only uses strerr for its output
var output = new List<string>();
process.ErrorDataReceived += new DataReceivedEventHandler((s, e) => {
if (e.Data != null)
output.Add(e.Data);
});
process.Start();
process.BeginErrorReadLine();
process.WaitForExit();
return output;
}
}
</string></string>It appears that even though the process has completed when the file is deleted, FFmpeg is still processing or has otherwise not released it.
Is this behaviour expected ? How do I go about ensuring that FFmpeg has finished processing the files before continuing ?
-
Why does subprocess.run() have unexpected behavior in try else block ?
27 novembre 2023, par Nikita SavenkovTrying to make a "to mp4" converter function using ffmpeg that is going to convert a file to mp4, delete the original file, and return True or False for specific conditions.
But I get some unexpected behavior of a subprocess.


Initially I used this construction :


def to_mp4_converter(file):

 input_file = file
 output_file = f"{re.sub(r'\..+$', "", file)}.mp4"

 try:
 subprocess.run(['ffmpeg', '-i', input_file, output_file])
 except subprocess.SubprocessError as e:
 print(f"Subprocess Error: {e}")
 return False
 else:
 try:
 os.remove(path=file)
 except OSError as e:
 print(f"Can't remove {file} file: {e}")
 finally:
 return True



Original file is removed, but output file is half of the expected size and quality of video is low.


But if I place subprocess.run() and os.remove() into separate try else blocks like that :


def to_mp4_converter(file):

 input_file = file
 output_file = f"{re.sub(r'\..+$', "", file)}.mp4"

 try:
 subprocess.run(['ffmpeg', '-i', input_file, output_file])
 except subprocess.SubprocessError as e:
 print(f"Subprocess Error: {e}")
 return False
 else:
 pass

 try:
 os.remove(path=file)
 except OSError as e:
 print(f"Can't remove {file} file: {e}")
 finally:
 return True



Everything works fine.


Isn't subprocess.run() should be a blocking operation, so the else statement in 1st example is unreachable until conversion is done ?