Recherche avancée

Médias (91)

Autres articles (106)

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (11709)

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

    


    Image Input Dimmensions :

    


      

    • 1_front.jpg 600w x 593h
    • 


    • 2_back.jpg 600w x 466h
    • 


    • 3_cd.jpg 600w x 598h
    • 


    


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

    


    Here's the full command

    


    ffmpeg
 -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock '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" 
 
 -filter_complex 
 "
 [0:a][1:a][2:a]concat=n=3:v=0:a=1[a]; 
 
 [3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3]; 

 [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];
 
 [5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];
 
 [v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"
 
  -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\vidOutPutCorrect.mkv"



    


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

    


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


    


    Specifically this part

    


    pad=600:593:0:63:color=pink


    


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

    


    You can see the output has the pink padding correctly
enter image description here

    


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

    


    So i update the command to have this new resolution :

    


    ffmpeg -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock '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" 

-filter_complex "
[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];

[3:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v3];

[4:v]pad=1920:1898:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];

[5:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v5];

[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"

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


    


    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

    


    enter image description here

    


    So this line works :

    


    pad=600:593:0:63:color=pink


    


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

    


    pad=1920:1898:0:63:color=pink


    


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

    


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

    


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

    


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

    


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


    


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

    


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


    


    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.

    


    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.

    


  • How to scale watermark based on video resolution in android using FFmpeg command ?

    16 février 2023, par Ravi Sorathiya

    I want to scale the watermark size based on the given video resolution. but this cmd scales the watermark without respect to the original video.

    


    I want to scale the watermark based on the resolution of the video. if
the video is in high resolution then the watermark will adjust that accordingly. visa versa in lower resolution it will scale accordingly.

    


    please suggest me FFmpeg cmd the dynamically cmd that helps to scale the watermark based on video's resolution

    


    val cmd = arrayOf(
            "-y",
            "-i",
            sourcePath,
            "-i",
            watermarkImagePath,
            "-filter_complex",
            "[1][0]scale2ref=w=oh*mdar:h=ih*0.06[logo][video];[video][logo]overlay=${position}",
            "-map",
            "0:a",
            "-c:v",
            "libx264",
            "-crf",
            "$bitrate",
            "-preset",
            "ultrafast",
            outputLocation.path
        )