Recherche avancée

Médias (91)

Autres articles (78)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (11541)

  • OpenCV Videocapture vs FFMPEG irregularities in PTS / PTS_TIME calculation

    9 décembre 2022, par rmalchow

    I am using FFMPEG scene detection to split videos on edits. The scene detection isn't perfect, but good enough for the purpose. The trouble starts when I try to extract frames using OpenCV.

    


    With scene detection, the frames are filtered, so the frame numbers are just the ones selected. What I still get is the PTS though, and the PTS_TIME. I checked some of those calculations from FFMPEG, and they all appear correct. To see pairs of frame number to PTS, I use this :

    


    ffmpeg -i $CLIP -filter:v "showinfo" -f null -


    


    If now use

    


      vc.set(cv2.CAP_PROP_POS_MSEC, int(pts_time*1000.0))


    


    I then test the frame number with :

    


      vc.get(cv2.CAP_PROP_POS_FRAMES)


    


    i get the same frame number that ffmpeg would show at this point. However - for some clips, this is slightly off - usually 1 or sometimes 2 frames.

    


    So where FFMPEG sees this (without any filtering) :

    


      Stream #0:0(und)
  24 fps, 24 tbr, 24k tbn, 48 tbc (default)
  [...]
  n:1175 pts:1177000 pts_time:49.0417


    


    OpenCV sees this :

    


      pts_time: 49.04178 / frame: 1177


    


    as you can see, this is 2 frames off. For a "good" clip, I get from FFMPEG :

    


      Stream #0:0(eng): 
  23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default) (original)
  [...]
  n:3122 pts: 130213 pts_time:130.213


    


    and OpenCV sees the same :

    


      pts_time: 130.2130 / frame: 3122


    


    The offset in the "bad" clip is constant (2 frames) throughout the entire clip, so I think this is not a rounding error of some sort. Is this OpenCV making a BooBoo ?

    


    I could use the Information from FFMPEG to pick a frame number in OpenCV and set CAP_PROP_POS_FRAMES instead of CAP_PROP_POS_MSEC ... but it would be a bit troublesome, since i would need to parse out the TBN, and since "-print_format json" still is a cruel joke rather than anything useful, I am trying to avoid that ...

    


    How can I make this frame accurate ?

    


    .rm

    


  • Using FFMPEG in C#

    16 janvier 2024, par kdott

    I am trying to strip audio from a video file using FFMPEG in C#. I know what the code is for doing such an operation (as far as I know) but I am not 100% sure where I need to keep the ffmpeg.exe file in my project and how to access it.

    


    My code so far is as follows :

    


    public void stripAudioTest(string videoFilename, ExportProgressWindow callback, string destinationAudioFile)
{
    string FFMPEG_PATH = "*************"; //not sure what to put here?????
    string strParam = " -i " + videoFileName + " -ab 160k -ar 44100 -f wav -vn " +   destinationAudioFile;
    process(FFMPEG_PATH, strParam);
    callback.Increment(100); 
}

public void process(string Path_FFMPEG, string strParam)
{
    try
    {
        Process ffmpeg = new Process();
        
        ffmpeg.StartInfo.UseShellExecute = false;
        ffmpeg.StartInfo.RedirectStandardOutput = true;
        ffmpeg.StartInfo.FileName = Path_FFMPEG;
        ffmpeg.StartInfo.Arguments = strParam;
        ffmpeg.Start();
        ffmpeg.WaitForExit();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}


    


    If anyone has any ideas please let me know. Anything helps !

    


  • Maintaining timecode using -ss trim tool

    1er février 2016, par Alex Noble

    I’m currently using this FFMPEG script (using "run shell script" in Automator) on QT ProRes files to strip off the first six channels of audio, pass through for audio and video, and trim the first 6.5 seconds off the beginning of the video :

    for f in "$@"
    do
    /usr/local/bin/ffmpeg -ss 6.5 -i "$f" -c:v copy -map 0:0 -c:a copy -map 0:7  "${f%.*}_ST.mov"
    done

    When I use this script, it successfully trims the file but then moves the original timecode up to the new beginning of the clip. So if 00:59:48:00 was my timecode at the beginning of the original clip, it’s now also the starting timecode of the beginning of my trimmed clip.

    My question is how can I trim 6.5 seconds off the beginning while also trimming that same amount of time off my timecode as well ?

    So instead of my trimmed clip (let’s say 23.98 fps) starting at 00:59:48:00, it would start at 00:59:54:12 since 6.5 seconds (roughly 156 frames) have been trimmed.