Recherche avancée

Médias (91)

Autres articles (86)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

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

  • Higher quality of JPEG frames extracted with FFMPEG from MP4 video [on hold]

    5 juin 2019, par 2006pmach

    I got a 4k mp4 video file and my goal is to extract the individual frames. Unfortunately, the video is quite big 10GB and storing all the frames lossless (e.g. using png, results in 12MB per frame) is not an option. Therefore, I tired to save directly JPEG images. For me quality is more important than a small file size around 1MB would be good.
    To do so I used FFMPEG as follows :

    ffmpeg -ss 00:04:52 -i video.MP4 -qscale:v $quality -frames:v 1 output-$quality.jpg

    I tried the full range from 2 to 31 for $quality and obtained the blue curve in the plot (PSNR vs. File size)

    Additionally, I extracted the frame and saved it as PNG and used convert from ImageMagick to compress the PNG file as follows :

    convert -quality $quality% frame.png output-$quality.jpg

    Again I tried the full range for $quality from 10 to 100 and obtained the orange line in the plot (The highest quality is 50dB but uses 6MB, so I only show the results up to 2MB).

    Now, my questions are as follows. Why is the quality of ffmpeg that much worse than when using ImageMagick ? Is it possible to increase the quality of the JPEG frames using ffmpeg directly or do I need to go via the PNG and then to JPEG. The later method is somehow suboptimal because it requires storing the png and will be much slower. Any suggestions ? My guess is that ffmpeg trades quality vs. speed...

    enter image description here

  • calling ffmpeg from python in a loop

    22 juin 2018, par Steffen Lesch

    I am currently writing my first python script to split large audio files into smaller ones. (Splitting Albums into individual tracks) :

    import subprocess

    def genList():
       with open("commands.txt") as file:
           ffmpeg_template_str = 'ffmpeg -i audio.FLAC -acodec copy -ss START_TIME -to END_TIME LITTLE_FILE'
           lines = file.readlines()
           results = []

           for line in lines:
               argument_list = line.split(' ')
               result = ffmpeg_template_str
               results.append(result.replace('START_TIME', argument_list[0]).replace('END_TIME', argument_list[1]).replace('LITTLE_FILE', argument_list[2]))
       return results;

    def split():
       commands = genList()
       for command in commands:
           subprocess.call(command.split(' '))

    split()

    When i execute the script, many command line windows will pop up, but only the last delivers the desired result.

    So if i want to split an audio file into smaller files only the last split operation seems to executed correctly.

    Additionally if i dont use a for loop and just paste subprocess.call multiple times into the code it works just fine.

    subprocess.call(command1)
    subprocess.call(command2)
    subprocess.call(command3)

    Any help will be greatly appreciated.

  • Extracting Y only (of YUV420p) frame from an MP4 file using fmpeg ?

    7 janvier 2020, par Anidh Singh

    My main objective is to extract the I’th, I+1’th (next), I-1’th (previous) frames in the form of Y only (of YUV 420) from an mp4 video. The procedure which I am using right now is

    1. I extracted the list of all the I frames from a video using the command - ffprobe "input.mp4" -show_frames | grep  'pict_type=I' -A 1 > frame_info.txt

    2. Next, I used a python script to parse through this txt file to find the numbers of all of the I frames and then extracting all of the frames using the command - ffmpeg -i input.mp4 -vf select='eq(n\,{1}),setpts=N/25/TB,extractplanes=y' -vsync 0 -pix_fmt gray {1}.yuv This is happening via a subprocess call from python.

    3. This is working fine for small resolution videos like 240p or 480p but as soon as I move to 1080p videos the time to extract even a single frame increases exponentially. As the ffmpeg seeks to that frame number to extract it and it has to decode the mp4 file till that point.

    I have a lot of 1080p files and I was looking to decrease the time. The solution which I was thinking was to extract all of the Y frames (of YUV 420) from mp4 and then selecting only I frames as I’ve got the list of all of the I frames from step 1.. The command I am using for this is - ffmpeg -y -i input.mp4 -vf "fps=59.94" -pix_fmt gray file_name.yuv

    • The problem with the above code is that it continuously appends the to yuv file only but I want an individual y file for one frame of the mp4 video.

    • My restriction is to use FFmpeg only as FFmpeg’s Y value is matching with what I want.

    TL:DR - I want to extract the Y part only (of YUV 420p) from an mp4 video. The y frames are the I’th and I-1th and I+1th frames.

    Thanks for helping out.