Recherche avancée

Médias (91)

Autres articles (111)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Prérequis à l’installation

    31 janvier 2010, par

    Préambule
    Cet article n’a pas pour but de détailler les installations de ces logiciels mais plutôt de donner des informations sur leur configuration spécifique.
    Avant toute chose SPIPMotion tout comme MediaSPIP est fait pour tourner sur des distributions Linux de type Debian ou dérivées (Ubuntu...). Les documentations de ce site se réfèrent donc à ces distributions. Il est également possible de l’utiliser sur d’autres distributions Linux mais aucune garantie de bon fonctionnement n’est possible.
    Il (...)

Sur d’autres sites (10555)

  • Elastic Transcoder output duration doesnt match with the sum of my Input duration

    28 mars 2019, par auricless

    I have multiple media file to concatenate into a single video file. Composed of different media types including video, audio and image. I use FFMPEG to convert audio and images to a video then finally, will use Elastic Transcoder to stitch/concatenate the video files in a single one. On creating transcoder job, whenever I placed the input video which is originally an image, converted by FFMPEG, to be the last input in order, it shrinks the duration of its exposure in the final output by 5 seconds whenever its original duration is > 5. This happens only with that condition.

    Example :
    (1) video1 - 10s
    (2) image1 - 10s
    (3) video2 - 15s
    (4) image2 - 20s
    output : video - 40s
    (image2’s duration or exposure in the output shrinks to approx. 5s)

    Clearly, the sum of Input duration and the Output duration does not match. It is even explicitly stated on the Job result of elastic transcoder.


    Thought I had a wrong conversion settings in FFMPEG so I changed some options. After some changes and comparing the image converted to video (V1) with an authentic video to stitch with (V2), their settings are almost the same. In this I use ffmpeg -i myVideo.mp4 to check its details. They differ only on SAR, DAR, tbr and tbn and I dont really know what are their use.

    Already checked the duration of the converted images after ffmpeg conversion and it is accurate, it only messed up after feeding it to the elastic transcoder and placed as the last input.

    Here is my conversion command with FFMPEG(image to video) :
    ffmpeg -r 29.97 -i [input.jpg] -f lavfi -i anullsrc=r=48000:cl:stereo -t [duration] -acodec aac -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -t [duration] -vf scale=854:480 -strict -2 [output.mp4]

    The expected result should be that the output file is consistent with the actual duration it has.

    [EDIT]

    Here’s real videos I feed on Elastic Transcoder using ffprobe filename :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip2.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.71.100
     Duration: 00:00:10.05, start: 0.042667, bitrate: 476 kb/s
       Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:1(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 2136:2135 DAR 89:50], 341 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'image2.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.12.100
     Duration: 00:02:10.03, start: 0.033333, bitrate: 130 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1943:1004 DAR 829661:240960], 2636 kb/s, SAR 283440:146461 DAR 1181:343, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
  • ffmpeg Input link in1:v0 parameters do not match the corresponding output link in0:v0 parameters

    13 décembre 2017, par Anuj TBE

    I’m using ffmpeg to generate slideshow with images input from web

    ffmpeg  \
    -loop 1 -t 5 -i https://eample.com/image_1.jpg \
    -loop 1 -t 5 -i https://eample.com/image_2.jpg \
    -loop 1 -t 5 -i https://eample.com/image_3.jpg \
    -loop 1 -t 5 -i https://eample.com/image_4.jpg \
    -loop 1 -t 5 -i https://eample.com/image_5.jpg \
    -filter_complex \
    "[0:v]setdar=16/9,fade=t=out:st=4:d=1[v0]; \
    [1:v]setdar=16/9,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v1]; \
    [2:v]setdar=16/9,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v2]; \
    [3:v]setdar=16/9,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v3]; \
    [4:v]setdar=16/9,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v4]; \
    [v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4

    But after processing the videos, it gives error as

    [Parsed_concat_14 @ 0x3e5e9e0] Input link in1:v0 parameters (size 1024x709, SAR 709:576) do not match the corresponding output link in0:v0 parameters (500x281, SAR 1124:1125)
    [Parsed_concat_14 @ 0x3e5e9e0] Failed to configure output pad on Parsed_concat_14
    Error configuring complex filters.
    Invalid argument

    Is it related to scaling of images, since images could be different dimensions.

    Also, how to scale the images to fit 16:9 ratio may be using crop or fit ?

  • ffmpeg : match audio video duration post concatenation

    20 janvier 2020, par Massimo Vantaggio

    I wrote this bash to automate concatentation of videos for dash mpeg streaming infinite loop.
    Im unable to obtain same duration for audio and video, with the videos that i’m using for testing i get always 6 ms more for audio track.
    May ask help to debug it and understand how to get same duration for both audio and video track ?

    #!/bin/bash
    #CANCAT 0.3

    cd input
    fps=()
    # GET FPS OF EACH VIDEO INTO ARRAY
    for f in *.mp4; do
       _f=$(ffmpeg -i "$f" 2>&1 | sed -n "s/.*, \\(.*\\) fp.*/\\1/p")
       fps+=("$_f")
    done

    #GET NUMBER OF ELEMENTS IN FPS ARRAY  
    tLen=${#fps[@]}
    #CHECK FPS EQUALITY    
    for tLen in "${fps[@]:1}"; do
       if [[ $tLen != ${fps[0]} ]]; then
           printf "WARNING: VIDEO’S FRAME-RATE ARE NOT EQUALS, THE PROCESS CAN’T START."
           printf "%s\\0" "${fps[@]}" |
               sort -zu |
               xargs -0 printf " %s"
           printf "\\n"
          exit 1
       fi
    done

    #AUDIO ENCODING
    for f in *.mp4;
    do
    NAME=$(echo "$f" | cut -d'.' -f1)
    ffmpeg -y -i "$f" -c copy -video_track_timescale 90k -c:a aac -b:a 384k -ar 44100 -ac 2 -shortest -af aresample=async=1 ../buffer/${NAME}_buffer.mp4
    done
    #-af aresample=async=1000
    #-filter_complex " [1:0] apad "

    cd ..
    cd buffer
    times=()
    for f in *.mp4;
    do
    echo "file '$f'" >> list.txt;

    # GET DURATION OF EACH VIDEO
    _t=$(ffprobe -i "$f" -show_entries format=duration -v quiet -of csv="p=0")
    times+=("$_t")
    done

    #SUM ALL DURATIONS
    TOTALDURATION=$( echo "${times[@]}" | sed 's/ /+/g' | bc )
    DURROUND=$(echo "$TOTALDURATION" | cut -d'.' -f1)
    TOTDELTA="$((DURROUND%2))"
    TOTDUR="$(($DURROUND-$TOTDELTA))"

    #GET FPS
    FPS="$(ffmpeg -i ${f[0]} 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p")"
    #ROUND FPS
    FPSC=$( echo "($FPS+0.5)/1" | bc )
    #GET GOP
    GOP="$((FPSC*2))"

    #ENCODING MASTER TRACK
    ffmpeg -f concat -safe 0 -y -i list.txt -loop 1 -i ../logo/logo.png -c:a copy -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -r $FPSC -b:v 4800k -maxrate 9600k -bufsize 19200k -profile:v main -crf 22 -filter_complex "[0:v][1:v]overlay=main_w-overlay_w-10:10,scale=1920:1080,setsar=1" -t $TOTDUR 1080set.mp4

    #EXTRACTING AUDIO FROM MASTER VIDEO TRACK
    ffmpeg -y -i 1080set.mp4 -c copy -vn ../output/output_audio.mp4

    #REMOVE AUDIO FROM MASTER VIDEO TRACK
    ffmpeg -y -i 1080set.mp4 -c copy -an ../output/output_1080.mp4

    #CLEAN BUFFER
    rm *.mp4
    rm *.txt

    cd ..
    cd output

    #ENCODE 720p
    ffmpeg -y -i output_1080.mp4 -an -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 1280x720 -r $FPSC -b:v 2400k -maxrate 4800k -bufsize 9600k -profile:v main -crf 22 output_720.mp4

    #ENCODE 360p
    ffmpeg -y -i output_1080.mp4 -an -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 640x360 -r $FPSC -b:v 800k -maxrate 1600k -bufsize 3200k -profile:v main -crf 22 output_360.mp4

    #VALIDATOR
    echo 1080p ENCODING
    echo GOP:   $GOP
    echo VIDEO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_1080.mp4
    echo VIDEO STREAM DURATION:
    ffprobe -v error -select_streams v:0 -show_entries stream=duration \
     -of default=noprint_wrappers=1:nokey=1 output_1080.mp4
    echo AUDIO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_audio.mp4

    echo ______________________________________________________________

    echo 720p ENCODING
    echo GOP:   $GOP
    echo VIDEO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_720.mp4
    echo VIDEO STREAM DURATION:
    ffprobe -v error -select_streams v:0 -show_entries stream=duration \
     -of default=noprint_wrappers=1:nokey=1 output_720.mp4
    echo DONE
    exit 1

    Here the script with my videos for test and relative folders :
    https://gofile.io/?c=WPAC0Q