Recherche avancée

Médias (1)

Mot : - Tags -/illustrator

Autres articles (100)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (8799)

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

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

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

    This is my build.gradle :

    &#xA;

    plugins {&#xA;    id &#x27;java&#x27;&#xA;    id &#x27;org.springframework.boot&#x27; version &#x27;2.7.9&#x27;&#xA;    id &#x27;io.spring.dependency-management&#x27; version &#x27;1.0.15.RELEASE&#x27;&#xA;}&#xA;&#xA;group = &#x27;com.nob234&#x27;&#xA;version = &#x27;0.0.1-SNAPSHOT&#x27;&#xA;&#xA;configurations {&#xA;    compileOnly {&#xA;        extendsFrom annotationProcessor&#xA;    }&#xA;}&#xA;&#xA;repositories {&#xA;    mavenCentral()&#xA;}&#xA;&#xA;dependencies {&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-web&#x27;&#xA;    compileOnly &#x27;org.projectlombok:lombok&#x27;&#xA;    annotationProcessor &#x27;org.projectlombok:lombok&#x27;&#xA;    testImplementation &#x27;org.springframework.boot:spring-boot-starter-test&#x27;&#xA;    implementation &#x27;org.springdoc:springdoc-openapi-ui:1.6.9&#x27;&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-data-jpa&#x27;&#xA;    runtimeOnly &#x27;org.postgresql:postgresql&#x27;&#xA;    // for logging&#xA;    implementation &#x27;org.slf4j:slf4j-api:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:jcl-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:log4j-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;ch.qos.logback:logback-classic:1.2.3&#x27;&#xA;    implementation &#x27;org.bytedeco:javacv:1.5.8&#x27;&#xA;}&#xA;&#xA;tasks.named(&#x27;test&#x27;) {&#xA;    useJUnitPlatform()&#xA;}&#xA;

    &#xA;

    This is my ffmpeg version :

    &#xA;

    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;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&#xA;libavutil      58.  2.100 / 58.  2.100&#xA;libavcodec     60.  3.100 / 60.  3.100&#xA;libavformat    60.  3.100 / 60.  3.100&#xA;libavdevice    60.  1.100 / 60.  1.100&#xA;libavfilter     9.  3.100 /  9.  3.100&#xA;libswscale      7.  1.100 /  7.  1.100&#xA;libswresample   4. 10.100 /  4. 10.100&#xA;libpostproc    57.  1.100 / 57.  1.100&#xA;

    &#xA;

    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.

    &#xA;

  • Can't fix this ffmpeg, NoClassDefFoundError

    15 mars 2023, par noob234

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

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

    This is my build.gradle :

    &#xA;

    plugins {&#xA;    id &#x27;java&#x27;&#xA;    id &#x27;org.springframework.boot&#x27; version &#x27;2.7.9&#x27;&#xA;    id &#x27;io.spring.dependency-management&#x27; version &#x27;1.0.15.RELEASE&#x27;&#xA;}&#xA;&#xA;group = &#x27;com.nob234&#x27;&#xA;version = &#x27;0.0.1-SNAPSHOT&#x27;&#xA;&#xA;configurations {&#xA;    compileOnly {&#xA;        extendsFrom annotationProcessor&#xA;    }&#xA;}&#xA;&#xA;repositories {&#xA;    mavenCentral()&#xA;}&#xA;&#xA;dependencies {&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-web&#x27;&#xA;    compileOnly &#x27;org.projectlombok:lombok&#x27;&#xA;    annotationProcessor &#x27;org.projectlombok:lombok&#x27;&#xA;    testImplementation &#x27;org.springframework.boot:spring-boot-starter-test&#x27;&#xA;    implementation &#x27;org.springdoc:springdoc-openapi-ui:1.6.9&#x27;&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-data-jpa&#x27;&#xA;    runtimeOnly &#x27;org.postgresql:postgresql&#x27;&#xA;    // for logging&#xA;    implementation &#x27;org.slf4j:slf4j-api:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:jcl-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:log4j-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;ch.qos.logback:logback-classic:1.2.3&#x27;&#xA;    implementation &#x27;org.bytedeco:javacv:1.5.8&#x27;&#xA;}&#xA;&#xA;tasks.named(&#x27;test&#x27;) {&#xA;    useJUnitPlatform()&#xA;}&#xA;

    &#xA;

    This is my ffmpeg version :

    &#xA;

    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;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&#xA;libavutil      58.  2.100 / 58.  2.100&#xA;libavcodec     60.  3.100 / 60.  3.100&#xA;libavformat    60.  3.100 / 60.  3.100&#xA;libavdevice    60.  1.100 / 60.  1.100&#xA;libavfilter     9.  3.100 /  9.  3.100&#xA;libswscale      7.  1.100 /  7.  1.100&#xA;libswresample   4. 10.100 /  4. 10.100&#xA;libpostproc    57.  1.100 / 57.  1.100&#xA;

    &#xA;

    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.

    &#xA;