Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (110)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

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

Sur d’autres sites (12011)

  • Revision 5ebe94f9f1 : Build fixes to merge vp9-preview into master Various fixups to resolve issues w

    23 décembre 2012, par John Koleszar

    Changed Paths : Add /examples/decode_with_partial_drops.txt Modify /libs.mk Modify /test/test.mk Modify /test/test_libvpx.cc Modify /vp9/common/generic/vp9_systemdependent.c Modify /vp9/common/vp9_alloccommon.c Modify /vp9/common/vp9_blockd.h (...)

  • Memory issues when using ffmpeg and gloss to play videos

    21 décembre 2015, par Noughtmare

    I’m trying to make a video player with haskell using ffmpeg-light, JuicyPixels and gloss. I’m now able to play video, but frames that have been played stay in memory. This causes major memory issues. How can I avoid storing all the frames in memory ?

    Here is my code :

    {-# LANGUAGE FlexibleContexts #-}
    module Main where

    -- For my own code:
    import Graphics.Gloss
    import Codec.FFmpeg
    import Codec.FFmpeg.Juicy
    import Codec.Picture
    import Control.Applicative
    import Data.Maybe
    import Graphics.Gloss.Juicy
    import Control.Monad (when, join)
    import Codec.FFmpeg.Decode
    import Codec.FFmpeg.Enums
    import Control.Monad.Error.Class
    import Control.Arrow (first)
    import Control.Monad.Except (runExceptT)
    import Graphics.Gloss.Interface.IO.Animate
    import Data.IORef

    -- Temporary hardcoded resolution
    resolution :: (Int,Int)
    resolution = (640, 360)

    main :: IO ()
    main = do
       -- First initialize ffmpeg, this needs to be run before other ffmpeg functions
       initFFmpeg
       -- Open the samplevideo for reading. video :: IO (IO (Maybe (AVFrame, Double)), IO ())
       video <- runExceptT $ frameReaderTime' avPixFmtRgb24 "SampleVideo_640x360_1mb.flv"
       either
             -- This code gets called when the frameReader reports an error
             (const $ putStrLn "Can't read file")
             -- This opens a new window and plays the video in it on a white background
             (animateFixedIO (InWindow "Nice Window" resolution (10, 10)) white . frameAtWait . fst)

             video

    -- This finds the frame at given time
    frameAtWait :: IO (Maybe (AVFrame, Double)) -> Float -> IO Picture
    frameAtWait getFrame time = do
       -- This gets the next frame from the video
       (frame, t) <- fromJust <$> getFrame
       -- t has to be converted from Double to Float
       let t' = realToFrac t
           -- The difference between the requested time and the actual frame time
           difference = t' - time
       -- If the frame is not yet supposed to be shown
       if difference > 0 then do
           -- Wait until it is
           threadDelay . round . (* 1000000) $ difference
           -- then return it
           fromJust <$> frameToPicture frame
       else
           -- return it immediately
           fromJust <$> frameToPicture frame

    -- This function converts a ffmpeg internal AVFrame to a gloss picture
    frameToPicture :: AVFrame -> IO (Maybe Picture)
    frameToPicture frame = do
       -- convert it to a juicypixels dynamicimage
       dynImage <- toJuicy frame
       -- then convert it to a gloss picture and return it
       return . join $ fmap fromDynamicImage dynImage
  • Python and ffmpeg audio sync and screen recording issues

    9 août 2020, par odddollar

    I'm using ffmpeg and python to record my desktop screen. When the program is run, it starts recording, then when I press a key-combo it cuts off the last x amount of seconds and saves it then starts recording again ; similar to the "record that" functionality of windows game bar.

    


    I have it working so it records video just fine, but then I change the ffmpeg command to record audio from my desktop and I get an error saying ValueError: could not convert string to float: 'N/A' occurring when I try to calculate the length of the recorded video. It appears as though the recording isn't being stopped until after I try to calculate the video length, even though this exact same code works fine when not recording audio.

    


    Additionally, I also have an issue when recording audio in that the audio is a couple hundred milliseconds in front of the video. It's not a lot but it's enough to be noticeable.

    


    What I'm overall asking, is there a way I can modify the ffmpeg command to prevent the audio desync issues, and what might be causing the problems I'm getting when attempting to find the length of the video with audio ?

    


    import keyboard, signal
from os import remove
from os.path import isfile
from subprocess import Popen, getoutput
from datetime import datetime
import configparser

class Main:
    def __init__(self, save_location, framerate, duration):
        self.save_location = save_location
        self.framerate = int(framerate)
        self.duration = int(duration)
        self.working = self.save_location + '\\' + 'working.avi'
        self.start_recording()

    def start_recording(self):
        if isfile(self.working):
            remove(self.working)

        # start recording to working file at set framerate
        self.process = Popen(f'ffmpeg -thread_queue_size 578 -f gdigrab -video_size 1920x1080 -i desktop -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -b:v 7M -minrate 4M -framerate {self.framerate} {self.working}')
        #self.process = Popen(f'ffmpeg -f gdigrab -framerate {self.framerate} -video_size 1920x1080 -i desktop -b:v 7M -minrate 2M {self.working}')

    def trim_video(self):
        # stop recording working file
        self.process.send_signal(signal.CTRL_C_EVENT)

        # call 'cause I have to
        getoutput(f"ffprobe -i {self.working}")

        # get length of working video
        length = getoutput(f'ffprobe -i {self.working} -show_entries format=duration -v quiet -of csv="p=0"')

        # get time before desired recording time
        start = float(length) - self.duration

        # get save location and title
        title = self.save_location+'\\'+self.get_time()+'.avi'

        # cut to last amount of desired time
        Popen(f"ffmpeg -ss {start} -i {self.working} -c copy -t {self.duration} {title}")
        getoutput(f"ffprobe -i {self.working}")

        self.start_recording()

    def get_time(self):
        now = datetime.now()
        return now.strftime("%Y_%m_%d#%H-%M-%S")


if __name__ == "__main__":
    config = configparser.ConfigParser()
    config.read("settings.ini")
    config = config["DEFAULT"]

    run = Main(config["savelocation"].replace("\\", "\\\\"), config["framerate"], config["recordlast"])
    keyboard.add_hotkey("ctrl+shift+alt+g", lambda:run.trim_video())

    while True:
        try:
            keyboard.wait()
        except KeyboardInterrupt:
            pass


    


    The contents of the settings.ini file are listed below

    


    [DEFAULT]
savelocation = C:\
framerate = 30
recordlast = 10


    


    In the code block, the first line with self.process = Popen is the one that records audio and has the issues, the second line (the commented out one below) is the one that works fine.