Recherche avancée

Médias (91)

Autres articles (32)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (3909)

  • 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

    


  • How to not allow upload of HD content ?More than 1920 x 1080 || 1080 x 1920 resolution files are not allowed since hardware reasons

    23 juillet 2020, par azaono

    Struggling with making limitation to uploade HD file/content. Intent is to have possibility to rotate content. Limits are required due to hardware reasons.

    


            val ffmpeg = FFmpeg("ffmpeg")
        val ffprobe = FFprobe("ffprobe")
        val probeResult = ffprobe.probe("$targetLocation")
        val stream: FFmpegStream = probeResult.getStreams()[0]
        val aspectRatio = stream.width.toDouble() / stream.height
        
        if (stream.width > 1920) {
            Files.delete(targetLocation)
            throw IncorrectResolutionFileException()
        } else if (stream.height > 1080) {
            Files.delete(targetLocation)
            throw IncorrectResolutionFileException()
        }

        if (type == "image") {
            part.transferTo(thumbnailLocation)
        }

        val builder: FFmpegBuilder = FFmpegBuilder()
            .setInput("$targetLocation")
            .addOutput("$thumbnailLocation")
            .setFrames(1)
            .setVideoFilter("select='gte(n\\,10)',scale=200:-1")
            .done()
        val executor = FFmpegExecutor(ffmpeg)
        executor.createJob(builder).run()

        return aspectRatio
    } catch (ex: Exception) {
        throw FileStorageException("Could not store file $cleanPath. Please try again!", ex)
    }
}


    


  • Edited video produces smaller image that original, even with higher resolution

    10 juillet 2020, par ceperman

    I've a .ts format recording from my Humax, which completely fills the window horizontally when played with VLC. In full-screen it fills the screen horizontally in letterbox style, and the same on the TV when played through my PS/3. All good so far.

    


    This is the ffprobe output :

    


    Duration: 02:16:37.72, start: 74238.902878, bitrate: 2554 kb/s
Stream #0:0[0x931]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 704x576 [SAR 16:11 DAR 16:9], max. 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc


    


    I used ffmpeg to change the audio track :

    


    ffmpeg -i movie.ts -c:v libx264 -c:a ac3 -crf 20 -map 0:v:0 -map 0:a:1 movie.mp4


    


    and produced an .mp4 which also plays correctly.

    


    ffprobe :

    


    Duration: 02:16:37.68, start: 0.005333, bitrate: 1129 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 704x576 [SAR 16:11 DAR 16:9], 932 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)


    


    However, if I edit it using OpenShot, I cannot find any export format that produces an image that fills the window horizontally in the same way, regardless of what resolution or aspect ratio I use.

    


    Example : export format "DV/DVD Widescreen PAL (720x576)" produces this (sample) file :

    


    Duration: 00:00:39.12, start: 0.040000, bitrate: 563 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576, 477 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)


    


    OpenShot appears not to set the AR, so it initially shows in VLC in 5:4 aspect, but even changing the VLC AR to the maximum of 2.39:1 does not stretch it fully from side-to-side.

    


    I've used ffmpeg to experiment with changing the aspect ratio, changing the resolution, and setting the SAR and DAR, all without success.

    


    This can't be a resolution issue, as I've exported 720p and 1080i, plenty of pixels but all produce roughly the same result - a small image that doesn't fill the window, and ditto on the TV. The original recording is only 704x576 but fills the window. Also the aspect ratio of the original recording is 16:9 (VLC agrees) but the actual measured AR of the screen image is closer to 2.04:1.

    


    I'm hoping that while this could be an OpenShot issue, the cause of the problem should be visible to ffprobe and perhaps fixable with ffmpeg. Help wil be appreciated.