Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (34)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

Sur d’autres sites (5828)

  • Frames from Video Using OpenCV in Ubuntu with Java 17

    2 août 2023, par bstrdn

    I've been trying to extract frames from a video using OpenCV in an Ubuntu environment with Java 17, but all my attempts have been unsuccessful so far. The main issue is that ffmpeg is not detected by the OpenCV library on ubuntu.

    


    Here's my test code :

    


    Main class

    


    import org.opencv.core.Core;
import org.opencv.videoio.VideoCapture;

public class Main {
  public static String videoPath = "";
  static {
    String osName = System.getProperty("os.name").toLowerCase();
    if (osName.contains("win")) {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      videoPath = ClassLoader.getSystemResource("video.mp4").getPath();
    } else {
      videoPath = "/video.mp4";
//      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      System.load("/usr/lib/opencv_java470.so");
    }
  }

  public static void main(String[] args) throws InterruptedException {
    VideoCapture videoCapture = new VideoCapture(videoPath);
    if (!videoCapture.isOpened()) {
      System.out.println("Error opening video file.");
    } else {
      System.out.println("Everything is fine.");
    }
    System.out.println(Core.getBuildInformation());
    Thread.sleep(1000000000000000000L);
  }
}


    


    Maven :

    


    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;<project xmlns="http://maven.apache.org/POM/4.0.0">&#xA;  <modelversion>4.0.0</modelversion>&#xA;  <parent>&#xA;    <groupid>org.springframework.boot</groupid>&#xA;    <artifactid>spring-boot-starter-parent</artifactid>&#xA;    <version>3.0.2</version>&#xA;    <relativepath></relativepath> &#xA;  </parent>&#xA;  <groupid>org.example</groupid>&#xA;  <artifactid>untitled</artifactid>&#xA;  <version>1.0-SNAPSHOT</version>&#xA;  <properties>&#xA;    17&#xA;    17&#xA;    UTF-8&#xA;  </properties>&#xA;&#xA;<dependencies>&#xA;<dependency>&#xA;  <groupid>org.bytedeco</groupid>&#xA;  <artifactid>opencv-platform</artifactid>&#xA;  <version>4.7.0-1.5.9</version>&#xA;</dependency>&#xA;&#xA;<dependency>&#xA;  <groupid>org.springframework.boot</groupid>&#xA;  <artifactid>spring-boot-starter-web</artifactid>&#xA;</dependency>&#xA;</dependencies>&#xA;<build>&#xA;<plugins>&#xA;  <plugin>&#xA;    <groupid>org.springframework.boot</groupid>&#xA;    <artifactid>spring-boot-maven-plugin</artifactid>&#xA;  </plugin>&#xA;</plugins>&#xA;</build>&#xA;</project>&#xA;

    &#xA;

    Dockerfile :

    &#xA;

    FROM ubuntu:20.04&#xA;RUN apt-get update &amp;&amp; apt-get install -y openjdk-17-jdk&#xA;RUN apt-get update &amp;&amp; apt-get install -y pkg-config&#xA;RUN apt-get update &amp;&amp; apt-get install -y ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavresample-dev&#xA;ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64&#xA;COPY target/*.jar /app.jar&#xA;COPY src/main/resources/video.mp4 /&#xA;COPY opencv_java470.so /usr/lib&#xA;ENV JAVA_TOOL_OPTIONS="-Djava.library.path=/usr/lib:/lib:/usr/local/lib:/usr/local:/usr/lib/x86_64-linux-gnu"&#xA;ENV LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib:/usr/local:/usr/lib/x86_64-linux-gnu&#xA;ENTRYPOINT [ "sh", "-c", "java $JAVA_TOOL_OPTIONS -jar /app.jar" ]&#xA;

    &#xA;

    The application displays the following text (video is not opened) :

    &#xA;

    Error opening video file.&#xA;&#xA;2023-08-02T13:30:58.448538297Z &#xA;2023-08-02T13:30:58.448572597Z General configuration for OpenCV 4.7.0 =====================================&#xA;2023-08-02T13:30:58.448587327Z   Version control:               v4.7.0&#xA;2023-08-02T13:30:58.448590607Z &#xA;2023-08-02T13:30:58.448593217Z   Platform:&#xA;2023-08-02T13:30:58.448596057Z     Timestamp:                   2023-03-27T23:13:34Z&#xA;2023-08-02T13:30:58.448598747Z     Host:                        Linux 5.4.0-1103-azure x86_64&#xA;2023-08-02T13:30:58.448601377Z     CMake:                       3.25.2&#xA;2023-08-02T13:30:58.448604277Z     CMake generator:             Unix Makefiles&#xA;2023-08-02T13:30:58.448606837Z     CMake build tool:            /usr/bin/make&#xA;2023-08-02T13:30:58.448609327Z     Configuration:               RELEASE&#xA;2023-08-02T13:30:58.448611867Z &#xA;.......there is a lot of text......&#xA;2023-08-02T13:30:58.448772865Z &#xA;2023-08-02T13:30:58.448775355Z   Video I/O:&#xA;2023-08-02T13:30:58.448777845Z     DC1394:                      NO&#xA;2023-08-02T13:30:58.448780535Z     FFMPEG:                      NO&#xA;2023-08-02T13:30:58.448783105Z       avcodec:                   NO&#xA;2023-08-02T13:30:58.448785725Z       avformat:                  NO&#xA;2023-08-02T13:30:58.448788295Z       avutil:                    NO&#xA;2023-08-02T13:30:58.448790755Z       swscale:                   NO&#xA;2023-08-02T13:30:58.448793295Z       avresample:                NO&#xA;2023-08-02T13:30:58.448795845Z     GStreamer:                   NO&#xA;2023-08-02T13:30:58.448798255Z     v4l/v4l2:                    YES (linux/videodev2.h)&#xA;2023-08-02T13:30:58.448800885Z &#xA;2023-08-02T13:30:58.448803525Z   Parallel framework:            pthreads&#xA;2023-08-02T13:30:58.448806345Z &#xA;............&#xA;2023-08-02T13:30:58.448859654Z   Java:                          export all functions&#xA;2023-08-02T13:30:58.448862024Z     ant:                         /usr/bin/ant (ver 1.10.5)&#xA;2023-08-02T13:30:58.448864504Z     JNI:                         /opt/hostedtoolcache/jdk/8.0.362/x64/include /opt/hostedtoolcache/jdk/8.0.362/x64/include/linux /opt/hostedtoolcache/jdk/8.0.362/x64/include&#xA;2023-08-02T13:30:58.448867224Z     Java wrappers:               YES&#xA;2023-08-02T13:30:58.448869804Z     Java tests:                  NO&#xA;2023-08-02T13:30:58.448872314Z &#xA;2023-08-02T13:30:58.448874734Z   Install to:                    /usr/local&#xA;

    &#xA;

    Moreover, ffmpeg is installed on Ubuntu.

    &#xA;

    How can i fix this ? I'm deathly tired(

    &#xA;

    Thank you in advance for your assistance !

    &#xA;

    First I tried installation following the official instructions.https://github.com/bytedeco/javacv#required-software

    &#xA;

    Then the solution provided in https://stackoverflow.com/a/76750478/8087508,

    &#xA;

    but the result is the same.

    &#xA;

  • How change ID in HLS origin manifest ?

    11 juillet 2023, par Kapiroto

    I'm using Nginx's RTMP module and wanted a way to change the m3u8 manifest ID.&#xA;My current setup is this :

    &#xA;

    Nginx config

    &#xA;

    hls_variant _1080p BANDWIDTH=8388608,AVERAGE-BANDWIDTH=8000000,RESOLUTION=1920x1080,FRAME-RATE=60,CODECS="avc1.640028,mp4a.40.2";&#xA;hls_variant _720p BANDWIDTH=6291456,AVERAGE-BANDWIDTH=6000000,RESOLUTION=1280x720,FRAME-RATE=60,CODECS="avc1.640028,mp4a.40.2";&#xA;hls_variant _480p BANDWIDTH=4194304,AVERAGE-BANDWIDTH=4000000,RESOLUTION=848x480,FRAME-RATE=30,CODECS="avc1.4d401f,mp4a.40.2";&#xA;

    &#xA;

    Using yt-dlp to retrieve the link information, we have :

    &#xA;

    ID   EXT RESOLUTION FPS │   TBR PROTO │ VCODEC      ACODEC&#xA;─────────────────────────────────────────────────────────────&#xA;4194 mp4 848x480     30 │ 4194k m3u8  │ avc1.4d401f mp4a.40.2&#xA;6291 mp4 1280x720    60 │ 6291k m3u8  │ avc1.640028 mp4a.40.2&#xA;8388 mp4 1920x1080   60 │ 8389k m3u8  │ avc1.640028 mp4a.40.2&#xA;

    &#xA;

    But using yt-dlp on a Twitch link for example, we retrieve the following information :

    &#xA;

    ID               EXT RESOLUTION FPS │   TBR PROTO │ VCODEC      ACODEC     ABR&#xA;──────────────────────────────────────────────────────────────────────────────&#xA;audio_only       mp4 audio only     │  160k m3u8  │ audio only  mp4a.40.2 160k&#xA;160p             mp4 284x160     30 │  230k m3u8  │ avc1.4D401F mp4a.40.2&#xA;360p             mp4 640x360     30 │  630k m3u8  │ avc1.4D401F mp4a.40.2&#xA;480p             mp4 852x480     30 │ 1428k m3u8  │ avc1.4D401F mp4a.40.2&#xA;720p60           mp4 1280x720    60 │ 3423k m3u8  │ avc1.4D401F mp4a.40.2&#xA;1080p60__source_ mp4 1920x1080   60 │ 9037k m3u8  │ avc1.64002A mp4a.40.2&#xA;

    &#xA;

    My doubt is whether there is a way to change the ID column in my configuration in Nginx or this configuration is something exclusive coming from another m3u8 manifest generator software.

    &#xA;

  • How can I sync the frames of multiple videos from a multi-camera capture system using FFMPEG

    9 février 2023, par user9114146

    I have a multi-camera capture setup with 2 canon cameras. Each of these cameras have a tentacle sync e timecode generator connected to them.

    &#xA;

    After a video capture with these 2 cameras, the generated timecode (SMPTE format) is stored in the video files metadata.

    &#xA;

    It looks like this 00:00:53;30

    &#xA;

    Is there a bash script that uses FFmpeg to trim the start time of the video that started earlier (based on timecode) to match the other and then trim the end time of the video that ended last to match the one that ended first ?

    &#xA;

    The two trimmed output videos should be synced based on the timecode and have the same duration.

    &#xA;

    So far, my bash script looks like this :

    &#xA;

    file1="A001C002_220101EB_CANON.MXF"&#xA;file2="A001C002_220101US_CANON.MXF"&#xA;&#xA;# Get the SMPTE timecodes of the two files&#xA;timecode1=$(ffmpeg -i "$file1" 2>&amp;1 | sed -n &#x27;s/timecode.*: \(.*\)/\1/p&#x27;)&#xA;timecode2=$(ffmpeg -i "$file2" 2>&amp;1 | sed -n &#x27;s/timecode.*: \(.*\)/\1/p&#x27;)&#xA;&#xA;# Convert the SMPTE timecode to start time in seconds&#xA;start_time_1=$(echo "$timecode1" | awk -F &#x27;:&#x27; &#x27;{print 3600*$1 &#x2B; 60*$2 &#x2B; $3}&#x27;)&#xA;start_time_2=$(echo "$timecode2" | awk -F &#x27;:&#x27; &#x27;{print 3600*$1 &#x2B; 60*$2 &#x2B; $3}&#x27;)&#xA;&#xA;# Trim the start of the video with the earlier start timecode so that both videos have the same start time&#xA;if [ "$start_time_1" -lt "$start_time_2" ]; then&#xA;  ffmpeg -i "$file1" -ss "$start_time_2" -c:v libx264 -crf 18 -preset veryfast trimmed_file1.mp4&#xA;  ffmpeg -i "$file2" -c:v libx264 -crf 18 -preset veryfast trimmed_file2.mp4&#xA;else&#xA;  ffmpeg -i "$file2" -ss "$start_time_1" -c:v libx264 -crf 18 -preset veryfast trimmed_file2.mp4&#xA;  ffmpeg -i "$file1" -c:v libx264 -crf 18 -preset veryfast trimmed_file1.mp4&#xA;fi&#xA;&#xA;# Get the duration of both files&#xA;duration_1=$(ffmpeg -i trimmed_file1.mp4 2>&amp;1 | grep "Duration" | cut -d &#x27; &#x27; -f 4 | sed s/,//)&#xA;duration_2=$(ffmpeg -i trimmed_file2.mp4 2>&amp;1 | grep "Duration" | cut -d &#x27; &#x27; -f 4 | sed s/,//)&#xA;&#xA;# Convert the duration to seconds&#xA;duration_1_secs=$(echo $duration_1 | awk -F: &#x27;{ print ($1 * 3600) &#x2B; ($2 * 60) &#x2B; $3 }&#x27;)&#xA;duration_2_secs=$(echo $duration_2 | awk -F: &#x27;{ print ($1 * 3600) &#x2B; ($2 * 60) &#x2B; $3 }&#x27;)&#xA;&#xA;# Trim the end time of the video that ended last to match the one that ended first&#xA;if [ "$duration_1_secs" -gt "$duration_2_secs" ]; then&#xA;  echo "Trimming end time of file1 to match file2"&#xA;  ffmpeg -i trimmed_file1.mp4 -t "$duration_2" -c:v libx264 -c:a aac trimmed_file1.mp4&#xA;else&#xA;  echo "Trimming end time of file2 to match file1"&#xA;  ffmpeg -i trimmed_file2.mp4 -t "$duration_1" -c:v libx264 -c:a aac trimmed_file2.mp4&#xA;fi&#xA;

    &#xA;

    But this does not make the videos have matching frames.

    &#xA;

    Thanks !

    &#xA;