Recherche avancée

Médias (1)

Mot : - Tags -/berlin

Autres articles (69)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (9033)

  • How to serve dynamic m3u8 playlist (HLS files) via node.js server to React using axios requests ?

    30 septembre 2021, par dev_2k20

    I am devising a VOD streaming server with Node.js. Streaming server delegates creation of HLS playlist to fluent-ffmpeg that converts and encrypts mp4 video file to m3u8 playlist. I am using hls.js client library in React for playing HLS videos with the following code

    


    import React, { Component } from "react";
import Hls from "hls.js";

class Player extends Component {
  componentDidMount() {
    if (Hls.isSupported() && this.player) {
      const video = this.player;
      const hls = new Hls({ enableWorker: false });
      hls.loadSource(
        "somelink"
      );
      hls.attachMedia(video);
      hls.on(Hls.Events.MANIFEST_PARSED, function () {
        video.play();
      });
    }
  }

  render() {
    return (
      > (this.player = player)}
        autoPlay={true}
      />
    );
  }
}
export default Player;


    


    and I have created a node-server using hls-server, and I am serving static playlist as follows
I have yet to serve files to React, atm I am using simple html for serving video playlist

    


    app.get("/", (req, res) => {
  return res.status(200).sendFile(`${__dirname}/client.html`);
});


    


    I want to serve playlist to client-side in React, and one way of doing that would be to add a source to route link, but I am confused wrt adding an axios get request that requests node-server to serve m3u8 playlist in streams as response, and stream the data on React-side (as currently used on client.html). In client.html, I have assigned location to files as video source for hls.js.

    


    componentDidMount() {
  if (Hls.isSupported() && this.player) {
      const video = this.player;
      const hls = new Hls({ enableWorker: false });
      hls.loadSource("http://localhost:3002/live/videoStream/somePlaylist.m3u8");
      hls.attachMedia(video);
      hls.on(Hls.Events.MANIFEST_PARSED, function () {
         video.play();
        });
       }
      }


    


    Am I correct in assuming, that axios will request server for each chunk of video ?
In my mind, the process shall be as follows (pseudo-code)

    


    React-side

    


    componentDidMount() {
    if (Hls.isSupported() && this.player) {
      axios.get(`/live/video/courseA`).then((res) => {
        const video = this.player;
        const hls = new Hls({ enableWorker: false });
        hls.loadSource(
          res.data
        );
        hls.attachMedia(video);
        hls.on(Hls.Events.MANIFEST_PARSED, function () {
        video.play();
      });
      })
      
    }
  }


    


    Server-side

    


    app.get('/live/video/:videoPlaylist', async (req, res, next) => {
  const file = fs.createReadStream('path to playlist');
  file.pipe(res);
})


    


    Since the VOD server-side route will be used for playing select playlist, I am assuming that in react, axios will request server-side for video, and on server-side, via streaming I will pipe each file chunk as response.

    


    Any help will be appreciated !

    


    Thanks in advance.

    


  • How to use ffmpeg-python library to download a Twitch VOD with a link retrieved using the streamlink library

    28 octobre 2020, par Daniel Norfolk

    This is the whole code, for easy reference :

    


    import urllib.request
import streamlink
import ffmpeg
stream_url = streamlink.streams("https://www.twitch.tv/videos/783301562")['best'].url
print(stream_url)

try:
    urllib.request.urlretrieve(stream_url, "vod.m3u8")
except Exception as e:
    print(e)

stream = (
    ffmpeg
    .input('vod.m3u8')
    .output('output.mp4')
    .run
)
print(stream)


    


    I am looking at a way of downloading Twitch VODs. I started with the link to a VOD : https://www.twitch.tv/videos/783301562 . I then used the code :

    


    stream_url = streamlink.streams("https://www.twitch.tv/videos/783301562")['best'].url
print(stream_url)


    


    This gave me a new link which, when I go to this link it downloaded a file with a '.m3u8' extension. This link is : https://dqrpb9wgowsf5.cloudfront.net/ab3654a5992fbfa52ccb_briziana_40240109614_1603789265/chunked/index-dvr.m3u8

    


    From here, I first tried to put the link directly into the following code :

    


    stream = (
    ffmpeg
    .input(stream_url)
    .output('output.mp4')
    .run
)
print(stream)


    


    This didn't output any mp4 file but did give the output :

    


    


    >

    


    


    I then added the following code to download the file, I also change the ffmpeg code to use the downloaded file rather then the url :

    


    try:
    urllib.request.urlretrieve(stream_url, "vod.m3u8")
except Exception as e:
    print(e)

stream = (
    ffmpeg
    .input('vod.m3u8')
    .output('output.mp4')
    .run
)
print(stream)


    


    This gave the same result, no mp4 file with the same output as above. Any help would be greatly appreciated !

    


  • How to correctly specify the path to a file in -vf media ?

    15 juillet 2024, par Wintreist

    Good afternoon, please, I really need help.
I'm putting a watermark on the video :

    


    with tempfile.TemporaryFile("wb", delete=False, suffix=".png") as watermark_file:
    watermark_file.write(buff.read())
(
    ffmpeg
    .input(str(path))
    .output(
        os.environ.get("TEMP")+f"\\{uuid.hex}_{path.name}",
        vf=f"movie='{watermark_file.name}' [watermark]; [in][watermark] overlay='{overlay}' [out]"
    )
    .global_args('-copyts')
    .run()
)


    


    In a temporary folder, I create a file in which I write a watermark from io.BytesIO
using the ffmpeg-python library, I do not work directly with the console.

    


    The problem is that when running .run() to the console outputs the following :

    


    [Parsed_movie_0 @ 0000011b21b3e300] Failed to avformat_open_input 'C'
[AVFilterGraph @ 0000011b21b4d4c0] Error initializing filters
[vost#0:0/libvpx-vp9 @ 0000011b23a07500] Error initializing a simple filtergraph
Error opening output file C:\Users\smeta\AppData\Local\Temp\5e5a695966cf4d728edbd7f39c509d0e_000.webm.
Error opening output files: No such file or directory


    


    But if I copy a watermarked file from temp and upload it to the workspace :
vf=f"movie='{'test.png'}' [watermark]; [in][watermark] overlay='{overlay}' [out]"
then everything works as it should. I.e. apparently there is a problem with the path to the watermark, and I do not understand what to do.
I ask for help