Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (36)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • L’espace de configuration de MediaSPIP

    29 novembre 2010, par

    L’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
    Il permet de configurer finement votre site.
    La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (4625)

  • lavfi/concat : allow to support inputs with different frame rates

    30 août 2019, par Calvin Walton
    lavfi/concat : allow to support inputs with different frame rates
    

    Right now, the concat filter does not set the frame_rate value on any of
    the out links. As a result, the default ffmpeg behaviour kicks in - to
    copy the framerate from the first input to the outputs.

    If a later input is higher framerate, this results in dropped frames ; if
    a later input is lower framerate it might cause judder.

    This patch checks if all of the video inputs have the same framerate, and
    if not it sets the out link to use '1/0' as the frame rate, the value
    meaning "unknown/vfr".

    A test is added to verify the VFR behaviour. The existing test for CFR
    behaviour passes unchanged.

    • [DH] libavfilter/avf_concat.c
    • [DH] tests/fate/filter-video.mak
    • [DH] tests/filtergraphs/concat-vfr
    • [DH] tests/ref/fate/filter-concat-vfr
  • FFmpeg Zoom and Rotate Causes Image Cropping Instead of Allowing It to Go Beyond Frame Edges [closed]

    6 octobre 2024, par XVersi

    I am trying to create a zoom-in video with a gentle rotation effect using FFmpeg. My goal is to zoom in on the center of the image while allowing parts of the image to "go beyond" the frame boundaries during the zoom and rotation. However, what I see is that FFmpeg seems to crop the image to fit within the output frame, and instead of keeping the full image intact, it fills the rest of the frame with black sections, effectively trimming parts of my image.

    


    Here is the code I'm using in Go to generate the video using FFmpeg :

    


    func createZoomInVideoWithRotation(ffmpegPath, imagePath, outputPath string) error {
cmd := exec.Command(ffmpegPath, "-i", imagePath, "-vf", `[0:v]scale=9000x5000,zoompan=z='min(zoom+0.002,1.5)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=125,rotate='PI/800*t',trim=duration=20[v1];[v1]scale=1080:1920[v]`, "-c:v", "libx264", "-crf", "18", "-preset", "slow", outputPath)
err := cmd.Run()
if err != nil {
    return fmt.Errorf("error executing ffmpeg command: %w", err)
}

fmt.Println("Zoom-in and rotation video created successfully!")
return nil
}

func main() {
    ffmpegPath := `C:\Users\username\Downloads\ffmpeg-7.0.2-essentials_build\ffmpeg-7.0.2-essentials_build\bin\ffmpeg.exe`
    imagePath := `C:\Users\username\video_proj\image.jpg` 
    outputPath := `C:\Users\username\video_proj\output_zoom_rotate.mp4`



err := createZoomInVideoWithRotation(ffmpegPath, imagePath, outputPath)
if err != nil {
    fmt.Println("Error creating zoom and rotate video:", err)
}
}


    


    Removing the final scale=1080:1920 : I removed the scale part at the end of the filter chain to prevent FFmpeg from resizing the video to a fixed size, hoping that this would allow the image to remain at its original size without being cropped to fit the frame.

    


    The image would zoom in on its center and rotate, and during this process, parts of the image would be allowed to move beyond the boundaries of the video output frame.
There would be no cropping or resizing of the image, meaning the full original image would be intact even if it extends beyond the video frame.
Essentially, I wanted the image to "overflow" outside of the set dimensions during the rotation, without being forced to fit within the output frame and without adding black borders that indicate missing parts of the image.

    


  • How Do I Get Python To Capture My Screen At The Right Frame Rate

    14 juillet 2024, par John Thesaurus

    I have this python script that is supposed to record my screen, on mac os.

    


    import cv2
import numpy as np
from PIL import ImageGrab
import subprocess
import time

def record_screen():
    # Define the screen resolution
    screen_width, screen_height = 1440, 900  # Adjust this to match your screen resolution
    fps = 30  # Target FPS for recording

    # Define the ffmpeg command
    ffmpeg_cmd = [
        'ffmpeg',
        '-y',  # Overwrite output file if it exists
        '-f', 'rawvideo',
        '-vcodec', 'rawvideo',
        '-pix_fmt', 'bgr24',
        '-s', f'{screen_width}x{screen_height}',  # Size of one frame
        '-r', str(fps),  # Input frames per second
        '-i', '-',  # Input from pipe
        '-an',  # No audio
        '-vcodec', 'libx264',
        '-pix_fmt', 'yuv420p',
        '-crf', '18',  # Higher quality
        '-preset', 'medium',  # Encoding speed
        'screen_recording.mp4'
    ]

    # Start the ffmpeg process
    ffmpeg_process = subprocess.Popen(ffmpeg_cmd, stdin=subprocess.PIPE)

    frame_count = 0
    start_time = time.time()

    while True:
        # Capture the screen
        img = ImageGrab.grab()
        img_np = np.array(img)

        # Convert and resize the frame
        frame = cv2.cvtColor(img_np, cv2.COLOR_RGB2BGR)
        resized_frame = cv2.resize(frame, (screen_width, screen_height))

        # Write the frame to ffmpeg
        ffmpeg_process.stdin.write(resized_frame.tobytes())

        # Display the frame
        cv2.imshow('Screen Recording', resized_frame)

        # Stop recording when 'q' is pressed
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    # Close the ffmpeg process
    ffmpeg_process.stdin.close()
    ffmpeg_process.wait()

    # Release everything when job is finished
    cv2.destroyAllWindows()

if __name__ == "__main__":
    record_screen()




    


    As you can see, it should be 30 frames per second, but the problem is that when I open the file afterwards its all sped up. I think it has to do with the frame capture rate as oppose to the encoded rate. I'm not quite sure though. If I try to speed the video down afterwards so that it plays in real time the video is just really choppy. And the higher I make the fps, the faster the video plays, meaning the more I have to slow it down and then its still choppy. I'm pretty sure that it captures frames at a really slow rate and then puts them in a video and plays it back at 30fps. Can anyone fix this ? Anything that gets a working screen recorder on mac os I will take.