Recherche avancée

Médias (91)

Autres articles (24)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • 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

Sur d’autres sites (7136)

  • ffmpeg burned-in subtitles render in the wrong font

    21 août 2024, par dv151

    Trying to burn in subtitles to a video in FFMPEG in GothamProBold font. No matter what I do it keeps reverting to Helvetica. From the console, I see that FFMPEG seems to load the font without error. Then switches over to font provider "coretext"

    


    [Parsed_subtitles_0 @ 0x7fed054048c0] Loading font file '/Projects/Fonts/GothaProBol.otf'
[Parsed_subtitles_0 @ 0x7fed054048c0] Using font provider coretext
[Parsed_subtitles_0 @ 0x7fed054048c0] fontselect: (GothaProBol.otf, 400, 0) -> /System/Library/Fonts/Helvetica.ttc, -1, Helvetica


    


    It seems like it has my font loaded, then loads what is likely a system default of Helvetica instead. My guess is that my chosen font isn't actually loading after all.

    


    FFMPEG command (called from python) is as follows :

    


    ffmpeg_cmd = ["ffmpeg", 
              "-i", self.source_video_uri, 
              "-y",
              "-c:v", "prores", "-profile:v", "1", 
              "-c:a", "pcm_s16be", 
              "-vf", f"subtitles={srt_uri}:fontsdir=/Projects/Fonts:force_style='Fontname=GothaProBol.otf'",
              f"{self.source_video_uri}_render.mov"]

subprocess.call(ffmpeg_cmd)


    


    Any ideas ?

    


    UPDATE : Found this setting in libass header file "ass.h" - which ffmpeg calls when using the subtitle filter. Don't know how to actually set this variable when ffmpeg calls libass, but here it is. Line 182 :

    


     * \brief Default Font provider to load fonts in libass' database
 *
 * NONE don't use any default font provider for font lookup
 * AUTODETECT use the first available font provider
 * CORETEXT force a CoreText based font provider (OS X only)
 * FONTCONFIG force a Fontconfig based font provider
 *
 * libass uses the best shaper available by default.
 */
typedef enum {
    ASS_FONTPROVIDER_NONE       = 0,
    ASS_FONTPROVIDER_AUTODETECT = 1,
    ASS_FONTPROVIDER_CORETEXT,
    ASS_FONTPROVIDER_FONTCONFIG,
    ASS_FONTPROVIDER_DIRECTWRITE,
} ASS_DefaultFontProvider;


    


    RE : ANSWER BELOW : For the most part, it seems that if your font is installed in /System/Fonts or /Library/Fonts then CoreText can find it. Though in some cases, the naming conventions can be quite particular and non-intuitive. It also can't seem to find all fonts, necessarily.

    


    For example : Gotham Pro Bold, in the /Library/Fonts folder on my system, file named "GothaProBol.otf" is correctly passed to fontname as : GothamPro-Bold or just Gotham Pro. Gotham Pro Bold, GothamPro, Gotham Pro-Bold, GothaProBol, and GothaProBol.otf do NOT work.

    


    For most fonts it seems the preferred convention is FontName-Style/Weight as displayed in Mac OS's FontBook, not the filename.

    


    That said, I have a novelty 'Game of Thrones.ttf' font in the same folder as Gotham Pro, and I can't get CoreText to connect to it under any of the above naming conventions.

    


  • 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