Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (75)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (6549)

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

    


  • 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


    


  • 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

      


    •