Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (79)

  • 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

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (7417)

  • What is the correct way to calculate SSIM ?

    19 mai 2023, par jamacoe

    On Windows 10, I have installed ImageMagick, Version 7.1.1-Q16-HDRI.

    


    I have a high resolution .png image that I convert to jpg with 75% quality :

    


    magick myImage.png -quality 75 myImage.jpeg


    


    Now I want to calculate SSIM to judge the quality of the .jpeg in comparison to the original .png.

    


    First, I am using ffmpeg.exe version 4.2.3 from the very same ImageMagick installation :

    


    ffmpeg.exe -i myImage.jpeg -i myImage.png -lavfi ssim=stats_file=ssim_logfile.txt -f null -


    


    Results in ssim_logfile.txt :

    


    n:1 Y:0.959684 U:0.957603 V:0.976335 All:0.962112 (14.215018)


    


    So I assume that the SSIM value has been calculated as 0.962112

    


    Now I'll use magick to calculate the same metric :

    


    magick myImage.jpeg myImage.png -metric SSIM -compare -format "%[distortion]" info:


    


    Output is :

    


    0.925167


    


    That's a huge difference ! So I think I'm making an error here with one or the other way.

    


    What is the correct way to calculate SSIM ?

    


  • bash : correct syntax to get framerate and add to ffmpeg command [duplicate]

    2 mars 2023, par daedalus

    I have a bash script to do AI video upscaling but I am having problems getting the framerate in the source file and then using it in the ffmpeg command for the encode of the upscaled frames. I'm a bash newb so not sure what syntax i'm using is wrong.

    


    #!/bin/sh
PS4='$LINENO: '
set -x
for arg
do
    mkdir "${arg%.*}"
    mkdir "${arg%.*}US"
    cd "${arg%.*}"
    fps = $(/usr/bin/mediainfo "$arg" "--inform=Video;%FrameRate%")
    nice -19 /bin/ffmpeg -i "$arg" -qscale:v 1 -qmin 1 -qmax 1 -vsync passthrough frame%04d.jpg
    cd ..
    /Programs/realesrgan-ncnn-vulkan -i "${arg%.*}" -o "${arg%.*}US" -n realesrgan-x4plus -s 4 -f jpg
    cd "${arg%.*}US"
    nice -19 /bin/ffmpeg -framerate $fps -i frame%04d.jpg -pix_fmt yuv420p -c:v libx265 -crf 20 "${arg%.*}US.mkv" 
    rm -rf "${arg%.*}"
    rm -rf "${arg%.*}US"
done


    


    when I debug it looks like it gets the frame rate but then say command not found for some reason, when the ffmpeg command is used the frame rate is missing even tho I specify the $fps variable .

    


    99: /usr/bin/mediainfo '/media/M2/vid.mkv' '--inform=Video;%FrameRate%'
9: fps = 30.000
/scripts/batchVideoUpscale: line 9: fps: command not found


    


    and at the end>

    


    nice -19 /bin/ffmpeg -framerate -i frame%04d.jpg -pix_fmt yuv420p -c:v libx265 -crf 20 vidUS.mkv


    


    note that the frame rate of 30.00 is missing even tho I include $fps in bash script after -framerate.

    


  • Using ffmpeg to trim HEVC video : correct duration, but output file size too large

    29 novembre 2022, par ddessert

    I have a digitized 8mm 16fps HEVC .mp4 that I'm trying to split into clips using ffmpeg (5.1.2) on MacOS terminal. The output file trims to the correct duration but the filesize is too large.

    


    ffmpeg -ss 05:09 -i input.mp4 -t 02:19 -an -sn -dn -c copy output.mp4


    


    input.mp4 : 11:56 in duration and 8.24 GB in filesize (bitrate 674251 kbits/s).
    
output.mp4 : 02:19 in duration and 5.15 GB in filesize (too large).

    


    5.15 GB is the filesize I'd expect for a clip that is 05:09 + 02:19 in duration at input.mp4's 674251 Kbits/s :
    
(05:09+02:19) * 674251 kbits/sec = 5.16 GB

    


    I've tried various -ss start_pos and -t duration values with similar results. The output file is correctly duration in time and unexpectedly (start_pos+duration)*bitrate in filesize.

    


    I've consulted this ShotStack.io article on trimming with ffmpeg and this ffmpeg wiki section on cutting small sections from files. Neither specifically states that the resulting file size will be trimmed to match the duration of the clip, but I'd think that'd be useful.

    


    Addendum :
    
My input file has only one keyframe at t=0.000s. Likely the root of all my problems.

    


    ffmpeg stdout :

    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x14ff04760] Using non-standard frame rate 16384/1024
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2021-07-24T11:23:44.000000Z
    encoder         : Lavf58.45.100
  Duration: 00:11:56.13, start: 0.000000, bitrate: 92041 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/bt709/unknown, progressive), 5120x3840 [SAR 1:1 DAR 4:3], 91715 kb/s, 16 fps, 16 tbr, 16384 tbn (default)
    Metadata:
      creation_time   : 2021-07-24T11:23:44.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      timecode        : 17:15:11:05
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 159 kb/s (default)
    Metadata:
      creation_time   : 2021-07-24T11:23:44.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 159 kb/s (default)
    Metadata:
      creation_time   : 2021-07-24T11:23:44.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:3[0x4](eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2021-07-24T11:23:44.000000Z
      handler_name    : TimeCodeHandler
      timecode        : 17:15:11:05
File 'output.mp4' already exists. Overwrite? [y/N] y
[mp4 @ 0x14ff08660] Using non-standard frame rate 16/1
    Last message repeated 1 times
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.27.100
  Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/bt709/unknown, progressive), 5120x3840 [SAR 1:1 DAR 4:3], q=2-31, 91715 kb/s, 16 fps, 16 tbr, 16384 tbn (default)
    Metadata:
      creation_time   : 2021-07-24T11:23:44.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      timecode        : 17:15:11:05
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 4290 fps=0.0 q=-1.0 Lsize= 2988507kB time=00:02:18.93 bitrate=176207.6kbits/s speed= 189x    
video:2988420kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002924%


    


    ffprobe output.mp4

    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x130804080] Using non-standard frame rate 16384/1024
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.27.100
  Duration: 00:02:19.31, start: 0.000000, bitrate: 175732 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/bt709/unknown, progressive), 5120x3840 [SAR 1:1 DAR 4:3], 91304 kb/s, 16 fps, 16 tbr, 16384 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      timecode        : 17:15:11:05
  Stream #0:1[0x2](eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : VideoHandler
      timecode        : 17:15:11:05
Unsupported codec with id 0 for input stream 1