
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 (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (4456)
-
Video conversion on different server than app server
13 mars 2016, par yakuzafuI’ve got my application running on server A.
When a user uploads a video via that application, the video should be transferred via FTP to another server B. I don’t know how to make something like this work :
- User uploads a video (like
.avi
,.webm
,.mkv
) - Application puts it on the FTP server
- FTP server converts that video to
.mp4
I’ve tried using FFmpeg on PHP, but it executes only on the server where the application is located, but I need it to run on the FTP server.
How can I make it work like that ?
- User uploads a video (like
-
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>