
Recherche avancée
Autres articles (47)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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 (5451)
-
How to losslessly compress a sequence of slowly-changing images into a video ?
26 juillet 2023, par Claude CI have a sequence of jpeg images captured like a timelapse, with the same dimension and changing slowly in order. I want to compress the size of the whole sequence while still able to recover each individual image with their raw pixel information unchanged.


I googled and found that a possible solution is to compress it into a video, which exploits the strong temporal correlation (inter-frame redundancy) between consecutive frames, as suggested here. I tried ffmpeg libx264 but none of the option combinations seem to preserve frame quality and compress total size at the same time (
-crf 0
keeps the quality but the size of the video is even larger than the input sequence).

So my questions is,


- 

- What is the correct way to losslessly compress a sequence of slowly-changing images ?




I can accept using softwares other than ffmpeg (as long as it is on windows or linux), doing color space conversion on raw images (if necessary). It is OK if a the compression is done without converting to videos. Thank you.


-
Converting video with php-ffmpeg
10 mai 2023, par BoychikSo am using php-ffmpeg/php-ffmpeg 1.1 version to convert video. my goal is that when i select 1080p video it must convert to, 1080p, 720p and 480p. it must return 3 videos. But I have a strange problem, When it starts converting the first video to 1080p, it uploads like 80mb (I think it must be 80mb ), and when it finishes on 80 mb it overwrites 1080p video again. It doesn't continue converting other resolutions ( 720p and 480p ) I think the problem is here


$video->addFilter($resizeFilter)->save($format['format'], $outputPath);



it does not save when it's converted. It starts overwritten, in one request...


this is my File Model function :


public function convertToResolution($filePath, $formats)
 {
 if (count($formats) === 0) {
 return 'All formats have been converted successfully.';
 }

 $format = $formats[0];

 $randomVideoName = uniqid();

 $outputPath = storage_path("app/videos/{$randomVideoName}-{$format['resolution']}.mp4");
 $resizeFilter = new ResizeFilter($format['dimension']);

 $ffmpeg = FFMpeg::create();
 $video = $ffmpeg->open($filePath);
 $video->addFilter($resizeFilter)->save($format['format'], $outputPath);

 $eventClass = match ($format['resolution']) {
 '1080p' => VideoConvertedTo1080p::class,
 '720p' => VideoConvertedTo720p::class,
 '480p' => VideoConvertedTo480p::class,
 };

 $event = new $eventClass($outputPath);
 Event::dispatch($event);

 // Sleep for 10 seconds to add a delay between conversions
 sleep(10);

 return $this->convertToResolution($filePath, array_slice($formats, 1));
 }



and my controller method :


public function convertVideo(Request $request)
 {
 try {
 // Get the uploaded file from the request
 $file = $request->file('video');

 // Store the uploaded video file and get its path
 $filePath = $file->storeAs('temp', $file->getClientOriginalName(), 'local');
 $filePath = storage_path('app/' . $filePath);

 $formats = [
 ['resolution' => '1080p', 'format' => new X264('aac', 'libx264', 'mp4'), 'event' => 'video.converted.1080p', 'dimension' => new Dimension(1920, 1080)],
 ['resolution' => '720p', 'format' => new X264('aac', 'libx264', 'mp4'), 'event' => 'video.converted.720p', 'dimension' => new Dimension(1280, 720)],
 ['resolution' => '480p', 'format' => new X264('aac', 'libx264', 'mp4'), 'event' => 'video.converted.480p', 'dimension' => new Dimension(854, 480)],
 ];

 $instance = new File();
 $result = $instance->convertToResolution($filePath, $formats);

 return response()->json(
 $result,
 200
 );
 } catch (\Exception $e) {
 return response()->json([
 'ERROR:' => $e->getMessage(),
 ], 500);
 }



Am like struggling with this problem for 4 days... Please if someone can help me with this...


-
Call to undefined method FFMpeg\Media\Video::addWatermark()
13 avril 2023, par Amir KhanI m trying to add a watermark to a video that I have but it's giving me this error while applying a watermark


The library is installed and working with the code commented but not when trying to add watermark


use FFMpeg\FFMpeg;
use ProtoneMedia\LaravelFFMpeg\Filters\WatermarkFactory;
 
$ffmpeg = FFMpeg::create();
$video = $ffmpeg->open(public_path('video-making-test/test1.mp4'));
// $video
// ->filters()
// ->resize(new \FFMpeg\Coordinate\Dimension(320, 240))
// ->synchronize();
// $video
// ->frame(\FFMpeg\Coordinate\TimeCode::fromSeconds(10))
// ->save(public_path('video-making-test/results/frame.jpg'));
 $video->addWatermark(function(WatermarkFactory $watermark) {
 $watermark->fromDisk('public')
 ->open('video-making-test/logo.png')
 ->right(25)
 ->bottom(25);
});