Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (58)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • 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 (15184)

  • FFmpeg - How to choose video stream based on resolution

    23 septembre 2023, par Sylven

    I want to choose the video stream based on it's quality, let's say I want to choose one video stream with certain resolution.

    


    Manually selecting the video stream is not good enough for me because I want to process many files in bulk and they have the video streams in different order, so always going for certain position would make me end up with different resolutions.

    


    I don't want to use filters as that would make me reencode which I don't need and would make it way slower.

    


    I've tried using the -map with metadata but the only key that is different is "variant_bitrate" which has slightly different values everytime, so unless I can use some wildcard or conditionals, I guess it won't work either.

    


    What I want to try now is to obtain the exact bitrate of the stream using ffmpeg or ffprobe and then pass it to the ffmpeg command so it ends in something like this :

    


    ffmpeg -i <url> -map m:variant_bitrate:1760000 ...</url>

    &#xA;

    PD : I've been reading the FFmpeg documentation and browsing the whole internet without luck.

    &#xA;

    Edit :&#xA;I managed to make it work by first using ffprobe to obtain stream info in json format (easier to parse), then I search for the string "height": 540 and extract next 50 lines (counted them manually so I'm sure I'll pick the value I need), then I search for the string variant_bitrate and then I use a regular expression to extract the bitrate. Once I have the bitrate I make use of the MacOS clipboard (with pbcopy and pbpaste) to pass the value to the final ffmpeg command through the -map option using a metadata selector.

    &#xA;

    ffprobe -v error -show_streams -of json "https://streamlink.com/master.m3u8?f=dash"&#xA;| grep -A 50 &#x27;"height": 540&#x27; &#xA;| grep variant_bitrate&#xA;| grep -oe &#x27;\([0-9.]*\)&#x27; &#xA;| pbcopy&#xA;&amp;&amp; ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "https://streamlink.com/master.m3u8?f=dash" -map "0:a:0" -map "m:variant_bitrate:$(pbpaste)" -c copy "Output.mp4"&#xA;

    &#xA;

    (added line breaks for readability)

    &#xA;

    I know it looks kinda dirty but I didn't find any other way to achieve my requirement.

    &#xA;

  • ffmpeg padding doesn't scale when changing resolution

    5 mars 2023, par Martin

    I have a ffmpeg command which takes a bunch of audio files, 3 image files, and renders a video with them.

    &#xA;

    Image Input Dimmensions :

    &#xA;

      &#xA;
    • 1_front.jpg 600w x 593h
    • &#xA;

    • 2_back.jpg 600w x 466h
    • &#xA;

    • 3_cd.jpg 600w x 598h
    • &#xA;

    &#xA;

    The video has a resolution of w=600 h=593, which is the resolution of the first img.

    &#xA;

    Here's the full command

    &#xA;

    ffmpeg&#xA; -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock &#x27;em All The Way Out.aiff"&#xA; -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" &#xA; -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" &#xA; &#xA; -filter_complex &#xA; "&#xA; [0:a][1:a][2:a]concat=n=3:v=0:a=1[a]; &#xA; &#xA; [3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3]; &#xA;&#xA; [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA; &#xA; [5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];&#xA; &#xA; [v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"&#xA; &#xA;  -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 &#xA;  "E:\filepath\vidOutPutCorrect.mkv"&#xA;&#xA;

    &#xA;

    For filter_complex this second part will add padding to the second image so that it does not get stretched or cropped.

    &#xA;

    [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA;

    &#xA;

    Specifically this part

    &#xA;

    pad=600:593:0:63:color=pink&#xA;

    &#xA;

    Which I understand means w=600 and h=593, but i dont know that the last part 0:63 means.

    &#xA;

    You can see the output has the pink padding correctly&#xA;enter image description here

    &#xA;

    but i want to render the video with a resolution of w=1920 h=1898 instead of w=600 h=593.

    &#xA;

    So i update the command to have this new resolution :

    &#xA;

    ffmpeg -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock &#x27;em All The Way Out.aiff" -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" &#xA;&#xA;-filter_complex "&#xA;[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];&#xA;&#xA;[3:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v3];&#xA;&#xA;[4:v]pad=1920:1898:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA;&#xA;[5:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v5];&#xA;&#xA;[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"&#xA;&#xA; -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 "E:\filepath\slidet.mkv"&#xA;

    &#xA;

    my video does in fact now have a resolution of 1920x1798 which is great, but the 2nd image padding portion has the image super small and in a corner

    &#xA;

    enter image description here

    &#xA;

    So this line works :

    &#xA;

    pad=600:593:0:63:color=pink&#xA;

    &#xA;

    but with a different resolution is looks bad with the image in the top left corner

    &#xA;

    pad=1920:1898:0:63:color=pink&#xA;

    &#xA;

    What do I need to change 0:63 to in order to have the image be centered ?

    &#xA;

    Download files : http://www.mediafire.com/folder/e8ja1n8elszk1lu,dxw4vglrz7polyh,ojjx6kcqruksv5r,lah9rano4svj46o,q5jg0083vbj9y1p,d3pt8ydf3ulqm5m/shared

    &#xA;

  • Best logical formula to determine perceptual / "experienced" quality of a video, given resolution / fps and bitrate ?

    20 mars 2023, par JamesK

    I am looking for a formula that can provide me with a relatively decent approximation of a Video's playback quality that can be calculated based off of four metrics : width, height, fps, and bitrate (bits/sec). Alternatively, I can also use FFMPEG or similar tools to calculate a Video's playback quality, if any of those tools provide something like what I am looking for here.

    &#xA;

    An example of what a Video might look like in my problem is as follows :

    &#xA;

    interface Video {&#xA;  /** The width of the Video (in pixels). */&#xA;  width: number&#xA;  /** The height of the Video (in pixels). */&#xA;  height: number&#xA;  /** The frame rate of the Video (frames per second). */&#xA;  fps: number&#xA;  /** The bitrate of the video, in bits per second (e.g. 5_000_000 = 5Mbit/sec) */&#xA;  bitrate: number&#xA;}&#xA;

    &#xA;

    I came up with the following function to compute the average amount of bits available for any given pixel per second :

    &#xA;

    const computeVideoQualityScalar = (video: Video): number => {&#xA;  // The amount of pixels pushed to the display, per frame.&#xA;  const pixelsPerFrame = video.width * video.height&#xA;  &#xA;  // The amount of pixels pushed to the display, per second.&#xA;  const pixelsPerSecond = pixelsPerFrame * video.fps&#xA;  &#xA;  // The average amount of bits used by each pixel, each second,&#xA;  // to convey all data relevant to that pixel (e.g. color data, etc)&#xA;  const bitsPerPixelPerSecond = video.bitrate / pixelsPerSecond&#xA;  &#xA;  return bitsPerPixelPerSecond&#xA;}&#xA;

    &#xA;

    While my formula does do a good job of providing a more-or-less "standardized" assessment of mathematical quality for any given video, it falls short when I try to use it to compare videos of different resolutions to one another. For example, a 1080p60fps video with a bitrate of 10Mbit/sec has a greater visual fidelity (at least, subjectively speaking, to my eyes) than a 720p30fps video with a bitrate of 9Mbit/sec, but my formula would score the 720p30fps video significantly higher than the 1080p60fps video because the 720p video has more bits available per pixel per second than the 1080p video.

    &#xA;

    I am struggling to come up with ideas as to how to either come up with a different way to calculate the "subjective video quality" for a given video, or extend upon my existing idea here.

    &#xA;