Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (58)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (7671)

  • How to make an automated video of changing webpage

    21 mars 2023, par jonas wouters

    I'm currently working on a project where I need to make a recording of a webpage without opening this browser. (headless browser)
The file I'm working on is stored locally on my machine and is generated with a Python script. It's generated because it will be different for every user and will be deleted after the recording is made.

    


    I'm currently stuck with trying to make a recording of a webpage.
Does somebody know how I can record a webpage.

    


    Currently I'm doing this

    


    # Make a video
def create_video(duration, name):
    # Path of the HTML file you want to record
    html_file_path = os.path.join(py_dir_path, 'templates/video/', f'{name}.html')
    width = 1080
    height = 1920
    framerate = 30
    
    options = Options()
    options.headless = True
    options.add_experimental_option('mobileEmulation', {'deviceName': 'iPhone SE'})
    driver = webdriver.Chrome(options=options)
    driver.get(f'file://{html_file_path}')
    print(driver)
    outputName = f'{name}.mp4'

    cmd= f'ffmpeg -y -f xcbgrab -s {width}x{height} -framerate {framerate} -i :0.0+0,0 -f alsa -i default -vcodec libx264 -pix_fmt yuv420p -preset ultrafast {outputName}'
    p = subprocess.Popen(cmd, shell=True)

    import time
    time.sleep(duration)

    p.kill()


    


    This code makes a headless browser and plays the website, but the recording process is not working for me

    


    I've already have had working code, but this was based on making screenshots of the webpage and then pasting these screenshots after each other, this code was difficult to read and worst of all very slow.

    


    Working bad code

    


    # Make a video
def create_video(duration, name, timesFaster):
    # Path of the HTML file you want to record
    html_file_path = os.path.join(py_dir_path, 'templates/video/', f'{name}.html')
    # Use function create_driver to create a driver and use this driver
    try:
        # Make a chrome window with size --> width: 390px, height: 850px
        options = webdriver.ChromeOptions()
        options.add_argument("--headless")
        options.add_experimental_option('mobileEmulation', {'deviceName': 'iPhone SE'})
        driver = webdriver.Chrome(options=options)
        driver.get(f'file://{html_file_path}')
        
        # Use function capture_screenshots to take screenshots for 
        capture_screenshots(driver, int(duration), name, timesFaster)
    finally:
        driver.quit

# Make as many screens as possible in ... amount of time (... = animation_duration)
def capture_screenshots(driver, animation_duration, name, timesFaster):
    screenshots = []
    # Calculate the ending time
    end_time = time.time() + animation_duration
    # Keeps track of amount of screenshots
    index = 1

    try:
        # Take as many screenshots as possible until the current time exceeds the end_time
        while time.time() < end_time:
            # Each time a new filename (so it does not overwrite)
            screenshot_file_name = f'capture{index}.png'
            # Save the screenshot on device
            driver.save_screenshot(screenshot_file_name)
            # Append the screenshot in screenshots ([])
            screenshots.append(screenshot_file_name)
            index += 1
        
        
        # Calculate the FPS
        fps = (len(screenshots)/animation_duration) * timesFaster
        print("sec: ", animation_duration/timesFaster)
        print("fps: ", fps)
        # Make the video with the FPS calculated above
        clip = ImageSequenceClip(screenshots, fps=fps)
        # File name of the result (video)
        output_file_path = os.path.join(mp4_dir_path, f"part/{name}.mp4")
        # Write the videoFile to the system
        clip.write_videofile(output_file_path, codec='libx264', bitrate="2M")
    finally:
        # Delete all screenshots
        for screenshot in screenshots:
            try:
                os.remove(screenshot)
            except:
                pass


    


    At the moment it's not that important for me that it's a local file, if I would be able to record a webpage (for example https://jonaswouters.sinners.be/3d-animatie/) this will be equally helpfull

    


    Thanks in advance
Jonas

    


  • Respecter les rotations des vidéos

    2 mai 2011

    Les vidéos prises avec des dispositifs mobiles (Apple Iphone notamment) disposent d’une métadata de Rotation que Mediainfo peut récupérer.

    Il serait donc mieux d’inverser les hauteurs / largeurs à ce moment là et d’encoder avec rotation ... Peut être

    cf :

  • swscale/arm : re-enable neon rgbx to nv12 routines

    22 février 2016, par Xiaolei Yu
    swscale/arm : re-enable neon rgbx to nv12 routines
    

    Commit ’842b8f4ba2e79b9c004a67f6fdb3d5c5d05805d3’ fixed clang/iphone
    build but failed on some versions of cygwin. It has now been verified
    to work on both platforms.

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libswscale/arm/Makefile
    • [DH] libswscale/arm/swscale_unscaled.c