
Recherche avancée
Médias (2)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (42)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne 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 (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)
Sur d’autres sites (5583)
-
HLS video not playing in Angular using Hls.js
5 avril 2023, par Jose A. MataránI 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 '@angular/core';
import Hls from 'hls.js';

@Component({
 selector: 'app-ver-recurso',
 templateUrl: './ver-recurso.component.html',
 styleUrls: ['./ver-recurso.component.css']
})
export class VerRecursoComponent implements AfterViewInit {
 @ViewChild('videoPlayer') videoPlayer!: ElementRef<htmlvideoelement>;
 hls!: Hls;

 ngAfterViewInit(): void {
 this.hls = new Hls();

 const video = this.videoPlayer.nativeElement;
 const watermarkText = 'MARCA_DE_AGUA';

 this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {
 this.hls.loadSource(`http://localhost:8080/video/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`);
 });

 this.hls.attachMedia(video);
 }

 loadVideo() {
 const watermarkText = 'Marca de agua personalizada';
 const video = this.videoPlayer.nativeElement;
 const hlsBaseUrl = 'http://localhost:8080/video';

 if (Hls.isSupported()) {
 this.hls.loadSource(`${hlsBaseUrl}/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`);
 this.hls.attachMedia(video);
 this.hls.on(Hls.Events.MANIFEST_PARSED, () => {
 video.play();
 });
 } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
 video.src = `${hlsBaseUrl}/playlist.m3u8?watermarkText=${encodeURIComponent(watermarkText)}`;
 video.addEventListener('loadedmetadata', () => {
 video.play();
 });
 }
 }
}
</htmlvideoelement>


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 ?


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


@RestController
public class VideoController {
 @Autowired
 private VideoService videoService;

 @GetMapping("/video/{segmentFilename}")
 public ResponseEntity<resource> getHlsVideoSegment(@PathVariable String segmentFilename, @RequestParam String watermarkText) {
 String inputVideoPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/202204M-20230111.mp4";
 String hlsOutputPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/temporal";
 String segmentPath = Paths.get(hlsOutputPath, segmentFilename).toString();

 if (!Files.exists(Paths.get(hlsOutputPath, "playlist.m3u8"))) {
 videoService.generateHlsStream(inputVideoPath, watermarkText, hlsOutputPath);
 }

 // Espera a que esté disponible el segmento de video necesario.
 while (!Files.exists(Paths.get(segmentPath))) {
 try {
 Thread.sleep(1000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 }

 Resource resource;
 try {
 resource = new UrlResource(Paths.get(segmentPath).toUri());
 } catch (Exception e) {
 return ResponseEntity.badRequest().build();
 }

 return ResponseEntity.ok()
 .contentType(MediaType.parseMediaType("application/vnd.apple.mpegurl"))
 .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
 .body(resource);
 }

 @GetMapping("/video/{segmentFilename}.ts")
 public ResponseEntity<resource> getHlsVideoTsSegment(@PathVariable String segmentFilename) {
 String hlsOutputPath = "/Users/jose/PROYECTOS/VARIOS/oposhield/oposhield-back/repo/temporal";
 String segmentPath = Paths.get(hlsOutputPath, segmentFilename + ".ts").toString();

 // Espera a que esté disponible el segmento de video necesario.
 while (!Files.exists(Paths.get(segmentPath))) {
 try {
 Thread.sleep(1000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 }

 Resource resource;
 try {
 resource = new UrlResource(Paths.get(segmentPath).toUri());
 } catch (Exception e) {
 return ResponseEntity.badRequest().build();
 }

 return ResponseEntity.ok()
 .contentType(MediaType.parseMediaType("video/mp2t"))
 .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
 .body(resource);
 }
</resource></resource>


package dev.mataran.oposhieldback.service;


import org.springframework.stereotype.Service;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Service
public class VideoService {
 private Process process;
 private ExecutorService executorService = Executors.newSingleThreadExecutor();

 public void generateHlsStream(String inputVideoPath, String watermarkText, String outputPath) {
 Runnable task = () -> {
 try {
 if (process != null) {
 process.destroy();
 }

 String hlsOutputFile = outputPath + "/playlist.m3u8";
 String command = String.format("ffmpeg -i %s -vf drawtext=text='%s':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+append_list -f hls %s", inputVideoPath, watermarkText, hlsOutputFile);
 process = Runtime.getRuntime().exec(command);
 BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
 String line;
 while ((line = reader.readLine()) != null) {
 System.out.println(line);
 }
 } catch (Exception e) {
 e.printStackTrace();
 }
 };
 executorService.submit(task);
 }
}



-
avcodec/amrwbdec : Fix division by 0 in voice_factor()
7 décembre 2017, par Michael Niedermayeravcodec/amrwbdec : Fix division by 0 in voice_factor()
The added value matches "Digital cellular telecommunications system (Phase 2+) (GSM) ; Universal Mobile Telecommunications System (UMTS) ; LTE ; Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec ; Floating-point ANSI-C code (3GPP TS 26.304 version 14.0.0 Release 14)
Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec ; Floating-point ANSI-C code"Fixes : runtime error : division by zero
Fixes : 4415/clusterfuzz-testcase-minimized-4677752314658816Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Révision 65657 : Oups !
7 septembre 2012, par marcimat@rezo.netSVP prenait parfois d’autres plugins en mettant à jour un plugin. En fait il manquait une relation dans la jointure entre le paquet et le plugin et il trouvait un paquet de même numéro version, mais pas forcément de même préfixe !! (Pascal (...)