Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (80)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (6047)

  • How to find the offset by which the each video must be delayed to sync them perfectly ?

    19 janvier 2023, par PirateApp

    enter image description here

    


    Let me explain my use case a bit here

    


      

    • We are 4 of us playing the same game

      


    • 


    • 3 of us recording mkv using OBS studio at 60 fps, 4th guy recording with some other tool at 30 fps

      


    • 


    • Each mission starts at a cutscene and ends with a cutscene

      


    • 


    • I would like to create a video like the image you see above starting at ending at the same points but the intermediate stuff is basically what each player is doing in the game

      


    • 


    • Currently, I follow a process slightly complicated to achieve this and was wondering if there is an easier way to do this

      


    • 


    • My current process

      


    • 


    • Take a screenshot from one of the videos of the cutscene

      


    • 


    


    Run a search for this screen inside the other videos using the command below

    


    ffmpeg 
  -i "video1.mkv"
  -r 1
  -loop 1
  -i 1.png
  -an -filter_complex "blend=difference:shortest=1,blackframe=90:32"
  -f null -


    


      

    • It gives me a result like this in each video

      


      [Parsed_blackframe_1 @ 0x600000c9c000] frame:263438 pblack:91 pts:4390633 t:4390.633000 type:P last_keyframe:263400

      


    • 


    


    Use the start time from each of the results to create a split screen video using the command below

    


    ffmpeg 
  -i first.mkv
  -i second.mkv
  -i third.mkv
  -i fourth.mp4
  -filter_complex " 
    nullsrc=size=640x360 [base];
    [0:v] trim=start=35.567,setpts=PTS-STARTPTS, scale=320x180 [upperleft]; 
    [1:v] trim=start=21.567,setpts=PTS-STARTPTS, scale=320x180 [upperright];
    [2:v] trim=start=41.233,setpts=PTS-STARTPTS, scale=320x180 [lowerleft]; 
    [3:v] trim=start=142.933333,setpts=PTS-STARTPTS, scale=320x180 [lowerright];
    [0:a] atrim=start=35.567,asetpts=PTS-STARTPTS [outa]; [base][upperleft] overlay=shortest=1 [tmp1];


    


      

    • As you can see, it is a complex process and depends completely a lot on what image I am capturing. Sometimes, I find out that stuff is still slightly off in the beginning or end because the images dont match a 100%. My guess is that the frame rate is different for each video not to mention 3 of them are mkv inputs and one is an mp4 input

      


    • 


    • Is there a better way to get the offset by how much each video should be moved to sync them perfectly ?

      


    • 


    • The only way that I can think of is to take 1 video

      


    • 


    • Take a starting timestamp and an ending timestamp, say with a total duration of 30s

      


    • 


    • Take the second video

      


    • 


    • Start from 0 to 30s and compare the frames in both videos, set a score

      


    • 


    • start from 0.001 to 30.001 and compare the frames, set a score

      


    • 


    • start from 0.002 to 30.002 and compare the frames, set a score

      


    • 


    • Basically increment the second video by 0.001 second each time and find out the part with the highest score

      


    • 


    • Any better way of doing this ? I need to run this on 100s if not 1000s of videos

      


    • 


    


  • How do I sync 4 videos in a grid to play the same frame at the same time ?

    28 décembre 2022, par PirateApp
      

    • 4 of us have recorded ourselves playing a game and want to create a 4 x 4 video grid
    • 


    • The game has cutscenes at the beginning followed by each person having their unique part for the rest of the video
    • 


    • I am looking to synchronize the grid such that it starts at the same place in the cutscene for everyone
    • 


    • Kindly take a look at what is happening currently. The cutscene is off by a few seconds for everyone
    • 


    • Imagine a time offset a,b,c,d such that when I add this offet to each video, the entire video grid will be in sync
    • 


    • How to find this a,b,c,d and more importantly how to add it in filter_complex
    • 


    


    I used the ffmpeg command below to generate a 4 x 4 video grid and it seems to work

    


    ffmpeg
    -i nano_prologue.mkv -i macko_nimble_guardian.mkv -i nano_nimble_guardian.mkv -i ghost_nimble_guardian_subtle_arrow_1.mp4
    -filter_complex "
        nullsrc=size=1920x1080 [base];
        [0:v] setpts=PTS-STARTPTS, scale=960x540 [upperleft];
        [1:v] setpts=PTS-STARTPTS, scale=960x540 [upperright];
        [2:v] setpts=PTS-STARTPTS, scale=960x540 [lowerleft];
        [3:v] setpts=PTS-STARTPTS, scale=960x540 [lowerright];
        [base][upperleft] overlay=shortest=1 [tmp1];
        [tmp1][upperright] overlay=shortest=1:x=960 [tmp2];
        [tmp2][lowerleft] overlay=shortest=1:y=540 [tmp3];
        [tmp3][lowerright] overlay=shortest=1:x=960:y=540
    "
    -c:v libx264 output.mkv


    


    My problem though is that since each of us starts recording at slightly different times, the cutscenes are out of sync

    


    As per the screenshot below, you can see that each video has the same scene starting at a slightly different time.

    


    Is there a way to find where the same frame will start on all videos and then sync each video to start from that frame or 20 seconds before that frame ?

    


    enter image description here

    


    UPDATE 1

    


    i have figured out the offset for each video in millisecond precision using the following technique

    


    take a screenshot of the first video at a particular point in the cutscene and save image as png and run the script below for the remaining 3 videos to find out where this screenshot appears in each video


ffmpeg -i "video2.mp4" -r 1 -loop 1 -i screenshot.png -an -filter_complex "blend=difference:shortest=1,blackframe=90:32" -f null -


    


    Use the command above to search for the offset in every video for that cutscene

    


    It gave me this

    


    VIDEO 3 OFFSET

    


    [Parsed_blackframe_1 @ 0x600003af00b0] frame:3144 pblack:92 pts:804861 t:52.399805 type:P last_keyframe:3120

[Parsed_blackframe_1 @ 0x600003af00b0] frame:3145 pblack:96 pts:805117 t:52.416471 type:P last_keyframe:3120


    


    VIDEO 2 OFFSET

    


    [Parsed_blackframe_1 @ 0x6000014dc0b0] frame:3629 pblack:91 pts:60483 t:60.483000 type:P last_keyframe:3500


    


    VIDEO 4 OFFSET

    


    [Parsed_blackframe_1 @ 0x600002f84160] frame:2885 pblack:93 pts:48083 t:48.083000 type:P last_keyframe:2880

[Parsed_blackframe_1 @ 0x600002f84160] frame:2886 pblack:96 pts:48100 t:48.100000 type:P last_keyframe:2880


    


    Now how do I use filter_complex to say start each video at either the frame above or the timestamp above ?. I would like to include say 10 seconds before the above frame in each video so that it starts from the beginning

    


    UPDATE 2

    


    This command currently gives me a 100% synced video, how do I make it start 15 seconds before the specified frame numbers and how to make it use the audio track from video 2 instead ?

    


    ffmpeg
    -i v_nimble_guardian.mkv -i macko_nimble_guardian.mkv -i ghost_nimble_guardian_subtle_arrow_1.mp4 -i nano_nimble_guardian.mkv
    -filter_complex "
        nullsrc=size=1920x1080 [base];
        [0:v] trim=start_pts=49117,setpts=PTS-STARTPTS, scale=960x540 [upperleft];
        [1:v] trim=start_pts=50483,setpts=PTS-STARTPTS, scale=960x540 [upperright];
        [2:v] trim=start_pts=795117,setpts=PTS-STARTPTS, scale=960x540 [lowerleft];
        [3:v] trim=start_pts=38100,setpts=PTS-STARTPTS, scale=960x540 [lowerright];
        [base][upperleft] overlay=shortest=1 [tmp1];
        [tmp1][upperright] overlay=shortest=1:x=960 [tmp2];
        [tmp2][lowerleft] overlay=shortest=1:y=540 [tmp3];
        [tmp3][lowerright] overlay=shortest=1:x=960:y=540
    "
    -c:v libx264 output.mkv


    


  • ffmpeg with cuda and concat videos [closed]

    15 septembre 2024, par Petr Šimůnek

    I have a ffmpeg command with nvidia hw support that I want to join two videos :

    


    /home/videotest/ffmpeg-dev/ffmpeg -benchmark -hide_banner -loglevel warning -y -hwaccel_device 0 -hwaccel cuda -hwaccel_output_format cuda -i /mnt/video-storage/test/cuda/surfing/intermediate1.mp4 -i /mnt/video-storage/test/cuda/surfing/intermediate2. mp4 -filter_complex 'hwupload_cuda,[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1 [outv] [outa]' -map [outv] -map [outa] -pix_fmt yuv420p -c:v h264_nvenc -preset p6 -profile: v high -force_key_frames 'expr:gte(t,n_forced*5)' -bf 0 -movflags +faststart -b:v 3000k -maxrate 4000k /mnt/video-storage/test/cuda/surfing/game.mp4

    


    I get an error message after starting :

    


    Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0' [fc#0 @ 0x61ae2b37a1c0] Error reinitializing filters!

    


    I can't figure out how to remove it. Can you help me ? Thank you.

    


    If I use nvdec/nvenc instead of cuda, this error does not appear and the video is created fine.