Recherche avancée

Médias (91)

Autres articles (11)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (4214)

  • unity recorder use at runtime in C#

    5 février 2020, par bluejayke

    I’m using the unity recorder package in the editor, but I wasn’t sure / didn’t see in the docs if its possible to use the unity recorder package to capture video at runtime — meaning after the project is built to webGL etc., can unity record, and perhaps send / stream the video result to a server ? If not how else would this be accomplished ?

  • There was error in the HLS Video stram endpoin in springBoot

    12 août 2024, par Abir Sarkar

    This is my controller When I call for the first time with the actual endpoint with the proper ID, it gives the output but when I send it, it gets error-prone. It will automatically change the video ID with the segment_000.ts

    


    @GetMapping("/stream/{videoId}")&#xA;public ResponseEntity<resource> streamVideo(&#xA;        @PathVariable String videoId,&#xA;        @RequestHeader(value = HttpHeaders.RANGE, required = false) String rangeHeader) {&#xA;&#xA;    try {&#xA;        System.out.println("Video Id : "&#x2B;videoId);&#xA;        // Fetch the video metadata&#xA;        Video video = videoService.findById(videoId);&#xA;&#xA;        if (video == null) {&#xA;            return ResponseEntity.notFound().build();&#xA;        }&#xA;&#xA;        // Construct the path to the HLS playlist&#xA;        Path playlistPath = Paths.get(video.getFilePath());&#xA;&#xA;        // Check if the playlist file exists&#xA;        if (!Files.exists(playlistPath)) {&#xA;            return ResponseEntity.notFound().build();&#xA;        }&#xA;&#xA;        // Load the file as a resource&#xA;        Resource resource = new FileSystemResource(playlistPath);&#xA;        String contentType = "application/vnd.apple.mpegurl";&#xA;        long fileLength = Files.size(playlistPath);&#xA;&#xA;        if (rangeHeader != null) {&#xA;            try {&#xA;                // Handle range requests for seeking&#xA;                String[] ranges = rangeHeader.replace("bytes=", "").split("-");&#xA;                long rangeStart = Long.parseLong(ranges[0]);&#xA;                long rangeEnd = ranges.length > 1 ? Long.parseLong(ranges[1]) : fileLength - 1;&#xA;&#xA;                // Validate range end&#xA;                if (rangeEnd >= fileLength) {&#xA;                    rangeEnd = fileLength - 1;&#xA;                }&#xA;&#xA;                // Validate range start&#xA;                if (rangeStart > rangeEnd) {&#xA;                    return ResponseEntity.status(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE)&#xA;                            .header(HttpHeaders.CONTENT_RANGE, "bytes */" &#x2B; fileLength)&#xA;                            .build();&#xA;                }&#xA;&#xA;                // Calculate content length&#xA;                long contentLength = rangeEnd - rangeStart &#x2B; 1;&#xA;&#xA;                // Prepare headers&#xA;                HttpHeaders headers = new HttpHeaders();&#xA;                headers.add(HttpHeaders.CONTENT_RANGE, "bytes " &#x2B; rangeStart &#x2B; "-" &#x2B; rangeEnd &#x2B; "/" &#x2B; fileLength);&#xA;                headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(contentLength));&#xA;                headers.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");&#xA;                headers.add(HttpHeaders.PRAGMA, "no-cache");&#xA;                headers.add(HttpHeaders.EXPIRES, "0");&#xA;                headers.add(HttpHeaders.CONTENT_TYPE, contentType);&#xA;&#xA;                // Serve the partial content&#xA;                InputStream inputStream = Files.newInputStream(playlistPath);&#xA;                inputStream.skip(rangeStart);&#xA;&#xA;                return ResponseEntity.status(HttpStatus.PARTIAL_CONTENT)&#xA;                        .headers(headers)&#xA;                        .body(new InputStreamResource(inputStream));&#xA;            } catch (NumberFormatException e) {&#xA;                return ResponseEntity.status(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE)&#xA;                        .header(HttpHeaders.CONTENT_RANGE, "bytes */" &#x2B; fileLength)&#xA;                        .build();&#xA;            }&#xA;        } else {&#xA;            // Serve the full content&#xA;            HttpHeaders headers = new HttpHeaders();&#xA;            headers.add(HttpHeaders.CONTENT_TYPE, contentType);&#xA;            headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(fileLength));&#xA;            headers.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");&#xA;            headers.add(HttpHeaders.PRAGMA, "no-cache");&#xA;            headers.add(HttpHeaders.EXPIRES, "0");&#xA;            System.out.println(resource.toString());&#xA;            return ResponseEntity.ok()&#xA;                    .headers(headers)&#xA;                    .body(resource);&#xA;        }&#xA;&#xA;    } catch (IOException e) {&#xA;        // Handle IOException&#xA;        e.printStackTrace();&#xA;        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();&#xA;    } catch (Exception e) {&#xA;        // Handle other exceptions&#xA;        e.printStackTrace();&#xA;        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();&#xA;    }&#xA;}&#xA;</resource>

    &#xA;

    I am attaching the error image : IMAGE

    &#xA;

    In the front end i am using the angular application :

    &#xA;

    This is the app.jsx file

    &#xA;

    import "./App.css";&#xA;import VideoPlayer from "./VideoPlayer";&#xA;import { useRef } from "react";&#xA;&#xA;function App() {&#xA;  const playerRef = useRef(null);&#xA;  const videoLink =&#xA;    "http://localhost:8080/api/v1/video/stream/66b9e7853c9b530810bdf4f4";&#xA;  const videoPlayerOptions = {&#xA;    controls: true,&#xA;    responsive: true,&#xA;    fluid: true,&#xA;    sources: [&#xA;      {&#xA;        src: videoLink,&#xA;        type: "application/x-mpegURL",&#xA;      },&#xA;    ],&#xA;  };&#xA;  const handlePlayerReady = (player) => {&#xA;    playerRef.current = player;&#xA;&#xA;    // You can handle player events here, for example:&#xA;    player.on("waiting", () => {&#xA;      videojs.log("player is waiting");&#xA;    });&#xA;&#xA;    player.on("dispose", () => {&#xA;      videojs.log("player will dispose");&#xA;    });&#xA;  };&#xA;  return (&#xA;    &lt;>&#xA;      <div>&#xA;        <h1>Video player</h1>&#xA;      </div>&#xA;&#xA;      &#xA;    >&#xA;  );&#xA;}&#xA;&#xA;export default App;&#xA;

    &#xA;

    This is the VideoPlayer.jsx file :

    &#xA;

    import React, { useRef, useEffect } from "react";&#xA;import videojs from "video.js";&#xA;import "video.js/dist/video-js.css";&#xA;&#xA;export const VideoPlayer = (props) => {&#xA;  const videoRef = useRef(null);&#xA;  const playerRef = useRef(null);&#xA;  const { options, onReady } = props;&#xA;&#xA;  useEffect(() => {&#xA;    // Make sure Video.js player is only initialized once&#xA;    if (!playerRef.current) {&#xA;      // The Video.js player needs to be _inside_ the component el for React 18 Strict Mode.&#xA;      const videoElement = document.createElement("video-js");&#xA;&#xA;      videoElement.classList.add("vjs-big-play-centered");&#xA;      videoRef.current.appendChild(videoElement);&#xA;&#xA;      const player = (playerRef.current = videojs(videoElement, options, () => {&#xA;        videojs.log("player is ready");&#xA;        onReady &amp;&amp; onReady(player);&#xA;      }));&#xA;&#xA;      // You could update an existing player in the `else` block here&#xA;      // on prop change, for example:&#xA;    } else {&#xA;      const player = playerRef.current;&#xA;&#xA;      player.autoplay(options.autoplay);&#xA;      player.src(options.sources);&#xA;    }&#xA;  }, [options, videoRef]);&#xA;&#xA;  // Dispose the Video.js player when the functional component unmounts&#xA;  useEffect(() => {&#xA;    const player = playerRef.current;&#xA;&#xA;    return () => {&#xA;      if (player &amp;&amp; !player.isDisposed()) {&#xA;        player.dispose();&#xA;        playerRef.current = null;&#xA;      }&#xA;    };&#xA;  }, [playerRef]);&#xA;&#xA;  return (&#xA;    &#xA;      <div ref="{videoRef}"></div>&#xA;    &#xA;  );&#xA;};&#xA;&#xA;export default VideoPlayer;&#xA;

    &#xA;

    I am trying to play the video in the player. But the video is not playing in the browser. and when I hit the endpoint with Postman, it gives me the content of the index.m3u8 file. In the player, the video length is coming, but the video is not playing. Please help me to play the video.

    &#xA;

    *

    &#xA;

    Github Project Link : GITHUB*

    &#xA;

  • openCV VideoCapture doesn't work with gstreamer x264

    18 juin 2014, par nschoe

    I’d like to display a rtp / vp8 video stream that comes from gstreamer, in openCV.

    I have already a working solution which is implemented like this :

    gst-launch-0.10 udpsrc port=6666 ! "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)VP8-DRAFT-IETF-01,payload=(int)120" ! rtpvp8depay ! vp8dec ! ffmpegcolorspace ! ffenc_mpeg4 ! filesink location=videoStream

    Basically it grabs incoming data from a UDP socket, depacketize rtp, decode vp8, pass to ffmpegcolorspace (I still don’t understand what this is for, I see it everywhere in gstreamer).

    The videoStream is a pipe I created with mkfifo. On the side, I have my openCV code that does :

    VideoCapture cap("videoStream");

    and uses cap.read() to push into a Mat.

    My main concern is that I use ffenc_mpeg4 here and I believe this alters my video quality. I tried using x264enc in place of ffenc_mpeg4 but I have no output : openCV doesn’t react, neither does gstreamer, and after a couple of seconds, gst-launch just stops.

    Any idea what I could use instead of ffenc_mpeg4 ? I looked for "lossless codec" on the net, but it seems I am confusing things such as codec, contains, format, compression and encoding ; so any help would be (greatly) appreciated !

    Thanks in advance !