Recherche avancée

Médias (91)

Autres articles (52)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Initialisation de MediaSPIP (préconfiguration)

    20 février 2010, par

    Lors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
    Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
    Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
    Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (8040)

  • Is there a faster way to generate video from pixel arrays using python and ffmpeg ?

    8 mai 2019, par devneal17

    I’ve found a few sources which use python and ffmpeg to generate video from pixel arrays by passing the -f rawvideo flag 1 2. However, this is very slow for high-definition video since each individual pixel must be piped into ffmpeg.

    In fact this is provably wasteful, as I’ve found that 2.5Gb of pixel arrays generates about 80Kb of video. I’ve also chanced upon some examples where javascript can render high quality animations in near-real time 1, which makes me even more suspicious that I’m doing something wrong.

    Is there a way to do this more efficiently, perhaps by piping the differences between pixel arrays into ffmpeg rather than the pixels themselves ?

    (edit) This is the line I’m using. Most executions take the else path that follows.

  • Django ImageFiled thumbnail from video

    11 septembre 2022, par Serguei A

    I need to make a thumbnail from a video and save it to Django's ImageField.

    


    I already have the working code which saves the thumbnail to a specified folder but what I want is to redirect the output of FFmpeg directly to Imagefield (or to a in memory uploaded file and then to Imagefield)

    


    This is my current code :

    


    def clean(self):
    video_file = self.files['file']
    output_thumb = os.path.join(settings.MEDIA_ROOT, 'post/videos/thumbs', video_file.name)
    video_input_path = video_file.temporary_file_path()
    subprocess.call(
        ['ffmpeg', '-i', video_input_path, '-ss', '00:00:01', '-vf', 'scale=200:220', 
        '-vframes', '1', output_thumb])
    self.instance.video = video_file
    self.instance.video_thumb = output_thumb  


    


    Model :

    


    video = models.FileField(upload_to='post/videos/', blank=True,
                         validators=[FileExtensionValidator(allowed_extensions=['mp4', 'webm'])])
video_thumb = models.ImageField(upload_to='post/videos/thumbs', blank=True)


    


    I'd like to do it so that I wouldn't need to specify the folder to save the thumb in (output_thumb in the code) and for Django to save it automatically using the upload_to='post/videos/thumbs option in the model definition

    


    Please point me in the right direction of how to do this.

    


  • Audio delay after resuming FFmpeg on Windows

    27 mars, par Iman Sajadpur

    I'm building a screen recording software for Windows using Python. I use FFmpeg for recording and psutil to pause and resume the process.

    


    Here is a sample of my code :

    


    import psutil
import subprocess

process = subprocess.Popen([
        'ffmpeg', '-y',
        '-rtbufsize', '100M',
        '-f', 'gdigrab',
        '-thread_queue_size', '1024',
        '-probesize', '50M',
        '-r', '24',
        '-draw_mouse', '1',
        '-video_size', '1920x1080',
        '-i', 'desktop', 
        '-f', 'dshow',
        '-channel_layout', 'stereo',
        '-thread_queue_size', '1024',
        '-i', 'audio=Microphone (2- High Definition Audio Device)', # my audio device
        '-c:v', 'h264_nvenc', # encoding via Nvidia
        '-r', '24',
        '-preset', 'p1',
        '-pix_fmt', 'yuv444p',
        '-fps_mode', 'cfr',
        '-c:a', 'aac', 
        '-ac', '2',
        '-b:a', '128k',
        'output.mp4'])

ffmpeg_proc = psutil.Process(process.pid)

# pause
ffmpeg_proc.suspend()

# resume
ffmpeg_proc.resume() 


    


    The issue is that after resuming, the audio becomes choppy and delayed, while the video continues smoothly.

    


    I have tried using following flags, but they didn't solve the issue :

    


    -analyzeduration
-fflags +genpts
-async
-use_wallclock_as_timestamps
-af aresample=async=1


    


    How can I properly pause and resume FFmpeg without causing audio delay ?
Is there any other method to handle this properly ?

    


    Thanks for any suggestions.