
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (46)
-
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 (4812)
-
Conditional formats in Laravel FFMPEG
29 décembre 2020, par JJ The SecondI'm currently using Laravel FFMPEG in a Laravel project and running followings which works well https://github.com/protonemedia/laravel-ffmpeg


Here is an example of code that is working :


$lowBitrate = (new X264)->setKiloBitrate(250);
 $midBitrate = (new X264)->setKiloBitrate(500);
 $highBitrate = (new X264)->setKiloBitrate(1000);
 $superBitrate = (new X264)->setKiloBitrate(1500);

 FFMpeg::open('steve_howe.mp4')
 ->exportForHLS()
 ->addFormat($lowBitrate, function($media) {
 $media->addFilter('scale=640:480');
 })

 ->addFormat($midBitrate, function($media) {
 $media->scale(960, 720);
 })
 ->addFormat($highBitrate, function ($media) {
 $media->addFilter(function ($filters, $in, $out) {
 $filters->custom($in, 'scale=1920:1200', $out); // $in, $parameters, $out
 });
 })
 ->addFormat($superBitrate, function($media) {
 $media->addLegacyFilter(function ($filters) {
 $filters->resize(new \FFMpeg\Coordinate\Dimension(2560, 1920));
 });
 })
 ->save('adaptive_steve.m3u8');



Now, my challenge is that on client side, my users need to select what formats they'd like to include in transcoding job and one job may contain 2 bitrate variation or more so there is a need to have a conditional statement before calling ->addFromat()


Ideally I'd need to approach this :


$lowBitrate = (new X264)->setKiloBitrate(250);
 $midBitrate = (new X264)->setKiloBitrate(500);
 $highBitrate = (new X264)->setKiloBitrate(1000);
 $superBitrate = (new X264)->setKiloBitrate(1500);

 FFMpeg::open('steve_howe.mp4')
 ->exportForHLS()
 ->addFormat($lowBitrate, function($media) {
 $media->addFilter('scale=640:480');
 })
 /// adding if statement here
 ->addFormat($midBitrate, function($media) {
 $media->scale(960, 720);
 })
 ->addFormat($highBitrate, function ($media) {
 $media->addFilter(function ($filters, $in, $out) {
 $filters->custom($in, 'scale=1920:1200', $out); // $in, $parameters, $out
 });
 })
 ->addFormat($superBitrate, function($media) {
 $media->addLegacyFilter(function ($filters) {
 $filters->resize(new \FFMpeg\Coordinate\Dimension(2560, 1920));
 });
 })
 ->save('adaptive_steve.m3u8');



No idea how to add a if/else statement here. How do you think I should approach this ?


Thanks


-
Is there a way to strip B frames from a .mp4 with ffmpeg script
14 décembre 2020, par QWKSILVERI have a series of videos that run in a very stuttery way on my hardware. In avidemux I get an error about B frames not being linearly correct, do I wish to open, may take a long time. I open it, and then resave it, without re-encoding anything, but it fixes the issue in the new file, and the stutteryness goes away in playback.


I would like to do this with ffmpeg so i can just run a script on the files that have the issue, and not have to go one at a time.


So the question is, Can I strip the b-frame data, or fix it, remove any duplicate frames, leave the time/date data alone, and resave it in the same format (.mp4) without file size growing, or quality degrading, option would be to actually reencode to x265 but not required.


i would also entertain a move to another format mkv, webm, if I could keep the rest stable, and have smaller or equal files. Videos will exist in multiple resolutions, but usually typical 16:9 dimension.


Any help would be appreciated.


-
Error FFMpeg Laravel Filters on HLS conversion
3 novembre 2020, par TwistCodeI'm trying to transform a mp4 to m3u8 video format using ffmpeg library on Laravel.


Currently it works with the bitrates and the size of the generated videos, but when I try to add the filters to define the resolutions, it generates the following log error.




20-11-03 16:55:19] local.ERROR : custom_filter filter is supported
starting from 0.3 ffmpeg version ; your ffmpeg version is
git-2020-08-26-8f2c1f2 "userId":1,"exception" :"[object]
(FFMpeg\Exception\RuntimeException(code : 0) : custom_filter filter is
supported starting from 0.3 ffmpeg version ; your ffmpeg version is
git-2020-08-26-8f2c1f2 at
C :\laragon\www\maquillate\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Media\AdvancedMedia.php:344)




This is my current implementation


$lowBitrate = (new \FFMpeg\Format\Video\X264('libfaac', 'libx264'))->setKiloBitrate(250);
 $midBitrate = (new \FFMpeg\Format\Video\X264('libfaac', 'libx264'))->setKiloBitrate(500);
 $highBitrate = (new \FFMpeg\Format\Video\X264('libfaac', 'libx264'))->setKiloBitrate(1000);


 FFMpeg::FromDisk('local')->open($media)
 ->exportForHLS()
 ->setSegmentLength(10) // optional
 ->setKeyFrameInterval(48) // optional
 ->addFormat($lowBitrate, function ($video) {
 $video->addLegacyFilter(function ($filters) {
 $filters->resize(new \FFMpeg\Coordinate\Dimension(640, 480));
 });
 })
 ->addFormat($midBitrate)
 ->addFormat($highBitrate)
 ->save('public/hls/' . $video->id . '/video.m3u8');



If I remove the filters from this code, they work without any problem, but I need to add these dimensions.


this is the documentation of Laravel FFmpeg what I need to do : https://github.com/protonemedia/laravel-ffmpeg#hls


Note : my operating system is Windows 10