Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (82)

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

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (9967)

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

    


  • FFMPEG send new segment to NAS while backup localhost [duplicate]

    27 juillet 2020, par BudinDelCielo

    ffmpeg captures my device (Game Capture 4K60 Pro MK.2 Video) on my local disk "D" and generates new segments every 1 hour 24 hours. everything works perfect. I would like to suppose two examples of failures.

    


    Is it possible to send my segments to my brakes simultaneously while it is stored on my D disk ?

    


    What would happen if my NAS were disconnected from the Network ? Could I continue capturing on my D disk, until the smb service is fixed ?

    


    How can I indicate in another batch process that a new segment is now available to copy to the NAS ? File sizes are not always the same because they vary by compression or duration by the -f -segment_time 3600 command. files never have the exact duration of an hour, so I am a bit lost to manage my segments. The new segments are 0kb, but could be due to capture failures, so here is my problem how to get information in another batch about the state of the segments.
Sorry my bad English.

    


    Thank you so much

    


    ffmpeg -hide_banner -guess_layout_max 0 ^
-f dshow -rtbufsize 1024M -video_size 1280x720 -i %DEVICE% ^
-c: v h264 -r 30000/1001 -aspect 16: 9 ^
-preset: v ultrafast -tune zerolatency -pix_fmt yuv420p ^
-c: a aac -ac 1 -ar 48000 -af aresample = async = 250 ^
-f segment -segment_time 3600 -strftime 1 -reset_timestamps 1 ^
-segment_format mp4 D:\%%Y%%m%%d-%%H%%M%%S.mp4


    


    it has not worked for me
FFMPEG : How to stream to multiple outputs with the same encoding independently

    


    Output #0, tee, to '[f=fifo:fifo_format=segment:segment_time=60:segment_atclocktime=1:strftime=1:reset_timestamps=1:segment_format=mp4]%Y%m%d-%H%M%S.mp4|[f=fifo:fifo_format=segment:segment_time=60:segment_atclocktime=1:strftime=1:reset_timestamps=1:segment_format=mp4]C :\Users\Home\Desktop\2%Y%m%d-%H%M%S.mp4' :
Output file #0 does not contain any stream

    


  • ffmpeg 'av_seek_frame()' not work in bink video

    19 juillet 2020, par ghoflvhxj

    I'm trying to play video in my game by using ffmpeg-avformatlib library.

    


    'av_seek_frame()' work correctly when open '.avi' file.

    


    but if open .bik file, it's not work however the function return 0(success) and seek to 0 frame.

    


    anyone who know about this problem ? :( please tell me please...

    


    void CMovie::Play(const Time startFrame, const Time endFrame, const bool loop/* = false*/)
{
    ...
    if (m_bStart)
    {
        av_seek_frame(GetFormatContext(), GetVideoStreamIndex(), startFrame, AVSEEK_FLAG_FRAME);
        m_bStart = false;
    }
    ...
}


    


    i uploaded sample video player and video which call 'av_seek_frame()' to seek.

    


    play fire.bik and click left or right button, you can see seek to 0 frame. it's same as my program.

    


    check it please.
https://drive.google.com/file/d/1DVrX3EOzjxSfEA4EYpeSREaE2RLhB28Q/view?usp=sharing