
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (76)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (10989)
-
local.ERROR : ffmpeg failed to execute command
20 août 2024, par AMNA IQBALI am trying to draw points on a video.


The Video is 12 seconds long and for one second there are 17 data points which needs to be plotted on the video of one frame (1 second).

It works for 6 seconds but not for 12 seconds.

Why it's not working for longer videos ? Is there any limitations of commands in ffmpeg ?


public function overlayCoordinates(Request $request)
{
Log::info('Received request to overlay coordinates on video.');

 set_time_limit(600); // 600 seconds = 10 minutes
 try {

 $request->validate([
 'video' => 'required|file|mimes:mp4,avi,mkv,webm|max:102400', // Video max size 100MB
 'coordinates' => 'required|file|mimes:txt|max:5120', // Coordinates text file max size 5MB
 ]);

 $videoFile = $request->file('video');
 $coordinatesFile = $request->file('coordinates');

 $videoFilePath = $videoFile->getRealPath();
 $videoFileName = $videoFile->getClientOriginalName();

 // Move the video file to the desired location if needed
 $storedVideoPath = $videoFile->storeAs('public/videos', $videoFileName);

 // Open the video file using Laravel FFmpeg
 $media = FFMpeg::fromDisk('public')->open('videos/' . $videoFileName);
 $duration = $media->getDurationInSeconds();

 Log::info('Duration: ' . $duration);

 $coordinatesJson = file_get_contents($coordinatesFile->getPathname());
 $coordinatesArray = json_decode($coordinatesJson, true);

 $frameRate = 30; // Assuming a frame rate of 30 fps
 $visibilityDuration = 0.5; // Set duration to 0.5 second

 for ($currentTime = 0; $currentTime < 7; $currentTime++) {
 $filterString = ""; // Reset filter string for each frame
 $frameIndex = intval($currentTime * $frameRate); // Convert current time to an index

 if (isset($coordinatesArray['graphics'][$frameIndex])) {
 // Loop through the first 5 keypoints (or fewer if not available)
 $keypoints = $coordinatesArray['graphics'][$frameIndex]['kpts'];
 for ($i = 0; $i < min(12, count($keypoints)); $i++) {
 $keypoint = $keypoints[$i];

 $x = $keypoint['p'][0] * 1920; // Scale x coordinate to video width
 $y = $keypoint['p'][1] * 1080; // Scale y coordinate to video height

 $startTime = $frameIndex / $frameRate; // Calculate start time
 $endTime = $startTime + $visibilityDuration; // Set end time for 0.5 second duration

 // Add drawbox filter for the current keypoint
 $filterString .= "drawbox=x={$x}:y={$y}:w=10:h=10:color=red@0.5:t=fill:enable='between(t,{$startTime},{$endTime})',";
 }
 Log::info("Processing frame index: {$frameIndex}, Drawing first 5 keypoints.");
 }

 $filterString = rtrim($filterString, ',');
 
 // Apply the filter for the current frame
 if (!empty($filterString)) {
 $media->addFilter(function ($filters) use ($filterString) {
 $filters->custom($filterString);
 });
 }
 }

 $filename = uniqid() . '_overlayed.mp4';
 $destinationPath = 'videos/' . $filename;

 $format = new \FFMpeg\Format\Video\X264('aac');
 $format->setKiloBitrate(5000) // Increase bitrate for better quality
 ->setAdditionalParameters(['-profile:v', 'high', '-preset', 'veryslow', '-crf', '18']) // High profile, very slow preset, and CRF of 18 for better quality
 ->setAudioCodec('aac')
 ->setAudioKiloBitrate(192); // Higher audio bitrate
 

 // Export the video in one pass to a specific disk and directory
 $media->export()
 ->toDisk('public')
 ->inFormat($format)
 ->save($destinationPath);

 return response()->json([
 'message' => 'Video processed successfully with overlays.',
 'path' => Storage::url($destinationPath)
 ]);
 } catch (\Exception $e) {
 Log::error('Overlay process failed: ' . $e->getMessage());
 return response()->json(['error' => 'Overlay process failed. Please check logs for details.'], 500);
 }
}



-
ffmpeg commands execution failed when run from Java. Executed successfully when the command is run in the terminal
28 septembre 2022, par Kaung Myat KhaingI'm working on a java project which works with audio file manipulation(I'm newbie to Java). I want to get the start and end time of silence in the audio with ffmpeg "silencedetect" audio filter and write the results to a text file.
I run the filter command within the following function, but it always result in failure(prints "Silence Detection failed"). Then, I tried running the command in the terminal and it was successful(prints "Silence Detection successful"). I don't know what's wrong with my java code. I have other functions which execute other ffmpeg commands with the same flow as provided, but they works fine.
Here's the function.


public static void getSilence(String filePath) throws InterruptedException, IOException {
 // detect silence
 System.out.println("Silence Detection cmd: ffmpeg -i " + filePath
 + " -af silencedetect=d=1:noise=-60dB -f null - |& awk '/silencedetect/ {print $4,$5}' > "
 + SOURCE_PATH + "/silence_detections/silenceInfo.txt");
 Process silenceDetect = Runtime.getRuntime().exec("ffmpeg -i " + filePath
 + " -af silencedetect=d=1:noise=-60dB -f null - |& awk '/silencedetect/ {print $4,$5}' > "
 + SOURCE_PATH + "/silence_detections/silenceInfo.txt");

 if (silenceDetect.waitFor() == 0) {
 System.out.println("Silence Detection successful");
 } else System.out.println("Silence Detection failed");
 }



-
avformat/bethsoftvid : print error in case the side date failed to be allocated
27 octobre 2014, par Michael Niedermayer