Recherche avancée

Médias (91)

Autres articles (102)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (9136)

  • Android editing video files

    25 novembre 2013, par Kernald

    I'm working on an Android application in which the user should be able to edit a video (cut and reorder some parts of a video taken with the phone).

    I have no idea how to do this : the media package doesn't seems to contain anything related to this. The videoeditor package could probably help me, but it's not public in the SDK. ffmpeg could maybe be a solution, but I'd like to avoid using NDK if I can.

    Any directions on how to do it ?

  • Change video resolution in loop

    24 juillet 2020, par WoJo

    I am trying to decrease the resolution of a video to under 500x500. I don't want to change it to exactly 500x500 because that would mess up video quality. So what I am trying to do is to decrease the resolution by 75% in a loop, and that loop would only stop when the video is under 500x500. In theory that would not be hard, but I can't seem to figure it out.

    


    var vidwidth = 501; //Create variable and put it to 501
var vidheight = 501; //so that it won't go through the If Statement
fs.copyFile(filepath2, './media/media.mp4', (err: any) => { //Copy given file to directory
    console.log('filepath2 was copied to media.mp4'); //Log confirmation (Not appearing for some reason, but file is copied)
})
while (true) {
    getDimensions('./media/media.mp4').then(function (dimensions: any) { //Get dimensions of copied video
        var vidwidth = parseInt(dimensions.width)   //Parse to Int
        var vidheight = parseInt(dimensions.height) //and put in variables
    })
    ffmpeg('./media/media.mp4')                 //Call ffmpeg function with copied video path
        .output('./media/media.mp4')            //Set output to the same file so we can loop it
        .size('75%')                            //Reduce resolution by 75%
        .on('end', function() {                 //Log confirmation on end
            console.log('Finished processing'); //(Not appearing)
        })                                      //
        .run();                                 //Run function
    if (vidwidth < 500 && vidheight < 500) {    //Check if both the width and height is under 500px
        break;                                  //If true, break the loop and continue
    }
}


    


    This is the current code I am using with comments. Basically what happens is it gets stuck in the while loop because the dimensions of the video won't change. Tested with console.log() line. I think that if I can fix the ffmpeg problem somehow it will all be fixed.
I'd appreciate any help :)

    


    PS : This is all made in typescript, then build into js using npx tsc

    


  • Conditional formats in Laravel FFMPEG

    29 décembre 2020, par JJ The Second

    I'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