
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (35)
-
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 -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (5089)
-
JavaFX : ffmpeg process finishes writing the file only after closing the program
16 juin 2024, par The EngineerMy JavaFX application uses ffmpeg to extract the first frame from a video file. The ffmpeg command is run in a separate thread, and the process ends with a wait. However, despite the fact that the image is saved to a temporary directory (temp/video_preview.jpg ), it becomes available only after the forced termination of the entire program, and not immediately after the completion of the ffmpeg process. I need the image to be available for display in ImageView immediately after the ffmpeg process is completed.

https://github.com/Memory420/GifConverter/tree/master

I expected the ffmpeg process to quickly create a picture and I would apply it where I need it.


@FXML
 private void onDragOver(DragEvent event) {
 if (event.getDragboard().hasFiles()) {
 event.acceptTransferModes(TransferMode.ANY);
 }
 }

 @FXML
 private void onDragDropped(DragEvent event) {
 Dragboard db = event.getDragboard();
 boolean success = false;
 if (db.hasFiles()) {
 List<file> files = db.getFiles();
 File videoFile = files.get(0);
 Image image = extractFirstFrameFromVideo(videoFile.getAbsolutePath());
 mainImage.setImage(image);
 success = true;
 }
 event.setDropCompleted(success);
 event.consume();
 }
</file>


private Image extractFirstFrameFromVideo(String pathToVideo) {
 try {
 ProcessBuilder processBuilder = new ProcessBuilder(
 ffmpegPath,
 "-y",
 "-ss", "00:00:00",
 "-i", pathToVideo,
 "-frames:v", "1",
 outputFilePath // "temp/video_preview.jpg"
 );

 Process process = processBuilder.start();

 int exitCode = process.exitValue();
 if (exitCode != 0) {
 throw new IOException("ffmpeg process exited with error code: " + exitCode);
 }

 return new Image(new File(outputFilePath).toURI().toString());

 } catch (IOException e) {
 throw new RuntimeException(e);
 }
 }



-
Streaming audio over websockets and process it with ffmpeg, Invalid frame size error
12 avril 2024, par Nimrod SadehI am building an application in Python that processes audio data on a streaming connection with WebSockets. To work with it, I need to process it with ffmpeg on the server before passing it to some ML algorithms.


I have the following ffmpeg code setup to process each byte sequence that comes over WebSockets :


async def ffmpeg_read(bpayload: bytes, sampling_rate: int = 16000) -> np.array:
 ar = f"{sampling_rate}"
 ac = "1"
 format_for_conversion = "f32le"
 ffmpeg_command = [
 "ffmpeg",
 "-i", "pipe:0",
 "-ac", ac,
 "-acodec", f"pcm_{format_for_conversion}",
 "-ar", ar,
 "-f", format_for_conversion,
 "pipe:1"]
 try:
 process = await asyncio.create_subprocess_exec(
 *ffmpeg_command,
 stdin=asyncio.subprocess.PIPE,
 stdout=asyncio.subprocess.PIPE)

 process.stdin.write(bpayload)
 await process.stdin.drain() 
 process.stdin.close()

 out_bytes = await process.stdout.read(8000) # Read asynchronously
 audio = np.frombuffer(out_bytes, np.float32)

 if audio.shape[0] == 0:
 raise ValueError("Malformed soundfile")
 return audio

 except FileNotFoundError:
 raise ValueError(
 "ffmpeg was not found but is required to load audio files from filename")



In every test, this works for exactly one message and prints the desired output to the screen, but the second one gets the following :


[mp3 @ 0x1208051e0] Invalid frame size (352): Could not seek to 363.
[in#0 @ 0x600002214200] Error opening input: Invalid argument
Error opening input file pipe:0.



How do I fix this ?


-
Bash Scripting FFMPEG how to wait the process to complete
9 décembre 2013, par user1738671I have a strange problem. I have a folder monitor with incrontab that launches an automatic transcoding script on
CLOSE_WRITE
state of a file I dropped in. The problem is that the script doesn't wait until the ffmpeg process finishes before continuing with the rest of the script commands. This means that the original file get deleted before the transcoding is finished, which is bad.First question :
What is the root cause of this behaviour ?Second question : In a bash script, what is the best way to make sure an ffmpeg process is done before get going with the rest of the script ?
Script :
#/bin/bash
#transcoding
/usr/bin/ffmpeg -i "sourcefile push with incron as $1" -vcodec somecode -acodec somecodec "destination file"
#delete source
rm "path/to/file$1"Should I encapsulate my FFMPEG in a while statement ?