Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (36)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • 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

Sur d’autres sites (6261)

  • Can't fix this ffmpeg, NoClassDefFoundError org.bytedeco.ffmpeg.global.avutil

    16 mars 2023, par noob234

    I am trying to get the video duration with this library import org.bytedeco.javacv.FFmpegFrameGrabber;

    


    When I upload this mp4 video (https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4), I get this error message :
java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil

    


    It will break when trying to get the 'grabber' :

    


    private void videoInfo(MultipartFile file) {
    try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(file.getInputStream())) { // on this line it will break :(
        grabber.start();
        long durationMs = grabber.getLengthInTime();
    } catch (FrameGrabber.Exception e) {
        throw new RuntimeException(e);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}


    


    This is my build.gradle :

    


    plugins {
    id 'java'
    id 'org.springframework.boot' version '2.7.9'
    id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'com.nob234'
version = '0.0.1-SNAPSHOT'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springdoc:springdoc-openapi-ui:1.6.9'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    runtimeOnly 'org.postgresql:postgresql'
    // for logging
    implementation 'org.slf4j:slf4j-api:1.7.30'
    implementation 'org.slf4j:jcl-over-slf4j:1.7.30'
    implementation 'org.slf4j:log4j-over-slf4j:1.7.30'
    implementation 'ch.qos.logback:logback-classic:1.2.3'
    implementation 'org.bytedeco:javacv:1.5.8'
}

tasks.named('test') {
    useJUnitPlatform()
}


    


    This is my ffmpeg version :

    


    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100


    


    Please keep in mind that I use Java 8 in this project and I hope this issue is reproducible. If you want more info please leave a comment.

    


  • HLS video not playing in Angular using Hls.js

    5 avril 2023, par Jose A. Matarán

    I am trying to play an HLS video using Hls.js in an Angular component. Here is the component code :

    


    import { Component, ElementRef, ViewChild, AfterViewInit } from &#x27;@angular/core&#x27;;&#xA;import Hls from &#x27;hls.js&#x27;;&#xA;&#xA;@Component({&#xA;  selector: &#x27;app-ver-recurso&#x27;,&#xA;  templateUrl: &#x27;./ver-recurso.component.html&#x27;,&#xA;  styleUrls: [&#x27;./ver-recurso.component.css&#x27;]&#xA;})&#xA;export class VerRecursoComponent implements AfterViewInit {&#xA;  @ViewChild(&#x27;videoPlayer&#x27;) videoPlayer!: ElementRef<htmlvideoelement>;&#xA;  hls!: Hls;&#xA;&#xA;  ngAfterViewInit(): void {&#xA;    this.hls = new Hls();&#xA;&#xA;    const video = this.videoPlayer.nativeElement;&#xA;    const watermarkText = &#x27;MARCA_DE_AGUA&#x27;;&#xA;&#xA;    this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {&#xA;      this.hls.loadSource(`http://localhost:8080/video/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`);&#xA;    });&#xA;&#xA;    this.hls.attachMedia(video);&#xA;  }&#xA;&#xA;  loadVideo() {&#xA;    const watermarkText = &#x27;Marca de agua personalizada&#x27;;&#xA;    const video = this.videoPlayer.nativeElement;&#xA;    const hlsBaseUrl = &#x27;http://localhost:8080/video&#x27;;&#xA;&#xA;    if (Hls.isSupported()) {&#xA;      this.hls.loadSource(`${hlsBaseUrl}/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`);&#xA;      this.hls.attachMedia(video);&#xA;      this.hls.on(Hls.Events.MANIFEST_PARSED, () => {&#xA;        video.play();&#xA;      });&#xA;    } else if (video.canPlayType(&#x27;application/vnd.apple.mpegurl&#x27;)) {&#xA;      video.src = `${hlsBaseUrl}/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`;&#xA;      video.addEventListener(&#x27;loadedmetadata&#x27;, () => {&#xA;        video.play();&#xA;      });&#xA;    }&#xA;  }&#xA;}&#xA;</htmlvideoelement>

    &#xA;

    I'm not sure what's going wrong, as the requests to the playlist and the segments seem to be working correctly, but the video never plays. Is there anything obvious that I'm missing here ?

    &#xA;

    On the backend side, I have a Spring Boot application that generates and returns the playlist file, as you can see.

    &#xA;

    @RestController&#xA;public class VideoController {&#xA;    @Autowired&#xA;    private VideoService videoService;&#xA;&#xA;    @GetMapping("/video/{segmentFilename}")&#xA;    public ResponseEntity<resource> getHlsVideoSegment(@PathVariable String segmentFilename, @RequestParam String watermarkText) {&#xA;        String inputVideoPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/202204M-20230111.mp4";&#xA;        String hlsOutputPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/temporal";&#xA;        String segmentPath = Paths.get(hlsOutputPath, segmentFilename).toString();&#xA;&#xA;        if (!Files.exists(Paths.get(hlsOutputPath, "playlist.m3u8"))) {&#xA;            videoService.generateHlsStream(inputVideoPath, watermarkText, hlsOutputPath);&#xA;        }&#xA;&#xA;        // Espera a que est&#xE9; disponible el segmento de video necesario.&#xA;        while (!Files.exists(Paths.get(segmentPath))) {&#xA;            try {&#xA;                Thread.sleep(1000);&#xA;            } catch (InterruptedException e) {&#xA;                e.printStackTrace();&#xA;            }&#xA;        }&#xA;&#xA;        Resource resource;&#xA;        try {&#xA;            resource = new UrlResource(Paths.get(segmentPath).toUri());&#xA;        } catch (Exception e) {&#xA;            return ResponseEntity.badRequest().build();&#xA;        }&#xA;&#xA;        return ResponseEntity.ok()&#xA;                .contentType(MediaType.parseMediaType("application/vnd.apple.mpegurl"))&#xA;                .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" &#x2B; resource.getFilename() &#x2B; "\"")&#xA;                .body(resource);&#xA;    }&#xA;&#xA;    @GetMapping("/video/{segmentFilename}.ts")&#xA;    public ResponseEntity<resource> getHlsVideoTsSegment(@PathVariable String segmentFilename) {&#xA;        String hlsOutputPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/temporal";&#xA;        String segmentPath = Paths.get(hlsOutputPath, segmentFilename &#x2B; ".ts").toString();&#xA;&#xA;        // Espera a que est&#xE9; disponible el segmento de video necesario.&#xA;        while (!Files.exists(Paths.get(segmentPath))) {&#xA;            try {&#xA;                Thread.sleep(1000);&#xA;            } catch (InterruptedException e) {&#xA;                e.printStackTrace();&#xA;            }&#xA;        }&#xA;&#xA;        Resource resource;&#xA;        try {&#xA;            resource = new UrlResource(Paths.get(segmentPath).toUri());&#xA;        } catch (Exception e) {&#xA;            return ResponseEntity.badRequest().build();&#xA;        }&#xA;&#xA;        return ResponseEntity.ok()&#xA;                .contentType(MediaType.parseMediaType("video/mp2t"))&#xA;                .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" &#x2B; resource.getFilename() &#x2B; "\"")&#xA;                .body(resource);&#xA;    }&#xA;</resource></resource>

    &#xA;

    package dev.mataran.oposhieldback.service;&#xA;&#xA;&#xA;import org.springframework.stereotype.Service;&#xA;&#xA;import java.io.BufferedReader;&#xA;import java.io.InputStreamReader;&#xA;&#xA;import java.util.concurrent.ExecutorService;&#xA;import java.util.concurrent.Executors;&#xA;&#xA;@Service&#xA;public class VideoService {&#xA;    private Process process;&#xA;    private ExecutorService executorService = Executors.newSingleThreadExecutor();&#xA;&#xA;    public void generateHlsStream(String inputVideoPath, String watermarkText, String outputPath) {&#xA;        Runnable task = () -> {&#xA;            try {&#xA;                if (process != null) {&#xA;                    process.destroy();&#xA;                }&#xA;&#xA;                String hlsOutputFile = outputPath &#x2B; "/playlist.m3u8";&#xA;                String command = String.format("ffmpeg -i %s -vf drawtext=text=&#x27;%s&#x27;:x=10:y=10:fontsize=24:fontcolor=white -codec:v libx264 -crf 21 -preset veryfast -g 50 -sc_threshold 0 -map 0 -flags -global_header -hls_time 4 -hls_list_size 0 -hls_flags delete_segments&#x2B;append_list -f hls %s", inputVideoPath, watermarkText, hlsOutputFile);&#xA;                process = Runtime.getRuntime().exec(command);&#xA;                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));&#xA;                String line;&#xA;                while ((line = reader.readLine()) != null) {&#xA;                    System.out.println(line);&#xA;                }&#xA;            } catch (Exception e) {&#xA;                e.printStackTrace();&#xA;            }&#xA;        };&#xA;        executorService.submit(task);&#xA;    }&#xA;}&#xA;

    &#xA;

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

    &#xA;

    Here's my test code :

    &#xA;

    Main class

    &#xA;

    import org.opencv.core.Core;&#xA;import org.opencv.videoio.VideoCapture;&#xA;&#xA;public class Main {&#xA;  public static String videoPath = "";&#xA;  static {&#xA;    String osName = System.getProperty("os.name").toLowerCase();&#xA;    if (osName.contains("win")) {&#xA;      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);&#xA;      videoPath = ClassLoader.getSystemResource("video.mp4").getPath();&#xA;    } else {&#xA;      videoPath = "/video.mp4";&#xA;//      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);&#xA;      System.load("/usr/lib/opencv_java470.so");&#xA;    }&#xA;  }&#xA;&#xA;  public static void main(String[] args) throws InterruptedException {&#xA;    VideoCapture videoCapture = new VideoCapture(videoPath);&#xA;    if (!videoCapture.isOpened()) {&#xA;      System.out.println("Error opening video file.");&#xA;    } else {&#xA;      System.out.println("Everything is fine.");&#xA;    }&#xA;    System.out.println(Core.getBuildInformation());&#xA;    Thread.sleep(1000000000000000000L);&#xA;  }&#xA;}&#xA;

    &#xA;

    Maven :

    &#xA;

    &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;