Recherche avancée

Médias (91)

Autres articles (60)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • 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.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (10445)

  • how to set two video side by side and first video 60% and second video is 40% using ffmpeg

    19 mai 2017, par Jignesh.Parmar

    I try following command.its working fine.but its set 50-50% video.
    and i got 60-40%. please help me. thanks in advance.

    ffmpeg -i demo1.mp4 -i demo2.mp4 -filter_complex ’[0:v]pad=iw*2:ih[int] ;[int][1:v] overlay=W/2:0[vid]’ -map [vid] -map 1:a -c:v libx264 -crf 23 -preset veryfast output.mp4

  • Bash script for splitting video using ffmpeg outputs wrong video lengths

    19 juin 2018, par jonny

    I have a video that’s x seconds long. I want to split that video up into equal segments, where each segment is no longer than a minute. To do that, I cobbled together a fairly simple bash script which uses ffmprobe to get the duration of the video, find out how long each segment should be, and then iteratively split the video up using ffmpeg :

    INPUT_FILE=$1
    INPUT_DURATION="$(./bin/ffprobe.exe -i "$INPUT_FILE" -show_entries format=duration -v quiet -of csv="p=0")"

    NUM_SPLITS="$(perl -w -e "use POSIX; print ceil($INPUT_DURATION/60), qq{\n}")"

    printf "\nVideo duration: $INPUT_DURATION; "
    printf "Number of videos to output: $NUM_SPLITS; "
    printf "Approximate length of each video: $(echo "$INPUT_DURATION" "$NUM_SPLITS" | awk '{print ($1 / $2)}')\n\n"

    for i in `seq 1 "$NUM_SPLITS"`; do
       START="$(echo "$INPUT_DURATION" "$NUM_SPLITS" "$i" | awk '{print (($1 / $2) * ($3 - 1))}')"
       END="$(echo "$INPUT_DURATION" "$NUM_SPLITS" "$i" | awk '{print (($1 / $2) * $3)}')"

       echo ./bin/ffmpeg.exe -v quiet -y -i "$INPUT_FILE" \
       -vcodec copy -acodec copy -ss "$START" -t "$END" -sn test_${i}.mp4

       ./bin/ffmpeg.exe -v quiet -y -i "$INPUT_FILE" \
       -vcodec copy -acodec copy -ss "$START" -t "$END" -sn test_${i}.mp4
    done

    printf "\ndone\n"

    If I run that script on the 30MB / 02:50 duration Big Buck Bunny sample from here, the output of the program would suggest the videos should all be of equal length :

    λ bash split.bash .\media\SampleVideo_1280x720_30mb.mp4

    Video duration: 170.859000; Number of videos to output: 3; Approximate length of each video: 56.953

    ./bin/ffmpeg.exe -v quiet -y -i .\media\SampleVideo_1280x720_30mb.mp4 -vcodec copy -acodec copy -ss 0 -t 56.953 -sn test_1.mp4
    ./bin/ffmpeg.exe -v quiet -y -i .\media\SampleVideo_1280x720_30mb.mp4 -vcodec copy -acodec copy -ss 56.953 -t 113.906 -sn test_2.mp4
    ./bin/ffmpeg.exe -v quiet -y -i .\media\SampleVideo_1280x720_30mb.mp4 -vcodec copy -acodec copy -ss 113.906 -t 170.859 -sn test_3.mp4

    done

    As the duration of each partial video, i.e. the time between -ss and -t, are equal for each subsequent ffmpeg command. But the durations I get are closer to :

    test_1.mp4 = 00:56
    test_2.mp4 = 01:53
    test_3.mp4 = 00:56

    Where the contents of each partial video overlap. What am I missing here ?

  • ffmpeg converted video from s3 bucket downloads before playing the video

    12 octobre 2020, par Rutu

    I making a video streaming application with react and node js.
I am converting video into different resolution with ffmpeg and storing directly to S3 bucket with the help of piping.

    


    I am streaming uploaded resolution video from S3 bucket directly through cloudfront in HTML5 tag with video.js

    


    When i tried to play original video through cloudfront in player its working fine, But as soon i play ffmpeg converted video to video player in cloudfront i am facing issue :

    


    Video takes a lot load (Downloads in browser) before playing in player.

    


    Below is my ffmpeg command

    


    await loadProcess( [&#xA;&#x27;i&#x27;,<s3 url="url" of="of" original="original" video="video">,&#xA;  &#x27;-movflags&#x27;,&#xA;  &#x27;frag_keyframe&#x2B;empty_moov&#x27;,&#x27;-vf&#x27;, &#x27;scale=-2:360&#x27;,&#x27;-c:v&#x27;,&#x27;h264&#x27;,&#x27;-profile:v&#x27;,&#x27;baseline&#x27;,&#x27;-r&#x27;,30,&#x27;-g&#x27;, 60,&#x27;-b:v&#x27;,&#x27;1M&#x27;,&#x27;-f&#x27;,&#x27;mp4&#x27;,&#x27;-&#x27;]&#xA;, outPath,&#x27;video/mp4&#x27;)&#xA;&#xA;</s3>

    &#xA;

    this is my loadProcess function : i am using aws cli to direct upload resolution video to S3 bucket :

    &#xA;

    export function loadProcess(ffmpegOptions, outPath,contentType) {&#xA;    return new Promise((resolve, reject) => {&#xA;        const  videoPath = outPath.replace(/\\/g, "/");&#xA;        let ffmpeg = spawn(conf.ffmpeg, ffmpegOptions);&#xA;        let awsPipe = spawn(&#x27;aws&#x27;, [&#x27;s3&#x27;, &#x27;cp&#x27;, &#x27;--content-type&#x27;, `${contentType}`, &#x27;-&#x27;, `s3://${process.env.AWS_S3_BUCKET}/${process.env.AWS_S3_VIDEOS_FOLDER}${videoPath}` ])&#xA;        ffmpeg.stdout.pipe(awsPipe.stdin)&#xA;&#xA;        // ffmpeg write stream flow&#xA;        let ffmpegData = &#x27;&#x27;&#xA;        ffmpeg.stderr.on(&#x27;data&#x27;, (_data) => {&#xA;            ffmpegData &#x2B;= _data.toString();&#xA;        })&#xA;        ffmpeg.on(&#x27;close&#x27;, (code) => {&#xA;            if (code === 0) {&#xA;                resolve(outPath)&#xA;            }&#xA;            else {&#xA;                let _dataSplit=ffmpegData.split(&#x27;\n&#x27;);&#xA;                _dataSplit.pop();&#xA;                console.log({action: &#x27;close&#x27;, message:_dataSplit.pop(), more:[conf.ffmpeg].concat(ffmpegOptions).join(&#x27; &#x27;)&#x2B;&#x27;\n&#x27;&#x2B;ffmpegData, code})&#xA;            }&#xA;        });&#xA;        ffmpeg.on(&#x27;error&#x27;, (err) => {&#xA;            reject({action: &#x27; ffmpeg error&#x27;, message: err});&#xA;        });&#xA;        &#xA;        // aws s3 cli read stream pipe flow&#xA;        let awsPipeData = &#x27;&#x27;&#xA;        awsPipe.stderr.on(&#x27;data&#x27;, _data => {&#xA;            awsPipeData &#x2B;= _data.toString()&#xA;        });&#xA;        awsPipe.on(&#x27;close&#x27;, (code) => {&#xA;            if (code === 0) {&#xA;                resolve(outPath)&#xA;            }else{&#xA;                console.log({action: &#x27;close&#x27;, message: awsPipeData})&#xA;            }&#xA;        });&#xA;        awsPipe.on(&#x27;error&#x27;, (err) => {&#xA;            reject({action: &#x27;awsPipe error&#x27;, message: err});&#xA;        })&#xA;&#xA;    })&#xA;}&#xA;

    &#xA;

    I have tried using +faststart option in ffmpeg but getting command failed error.&#xA;Can someone please help me this ?

    &#xA;

    Thanks in advance

    &#xA;