Recherche avancée

Médias (91)

Autres articles (41)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (8572)

  • icecast2, nodejs, ffmpeg, radio, ogg

    25 juillet 2024, par Uximy

    I have a problem which is that when I start icecast server on ubuntu and not only on ubuntu but also on windows regardless of the operating system, when I first go to the radio station in icecast2 http://localhost:8000/radio the music plays but after restarting the page in the browser, the player stops loading, I tried the solution with nocache in the browser in the address bar, nothing helps, I looked at many users configs, they did not encounter such problems, I will leave my config below, I also wrote a code on nodejs I will also leave it below, the problem plays the same that if I go to a direct icecast link, what I will do through the node js code + ffmpeg, also about the logs, nothing outputs even a hint of any error that is related to this problem

    


    Config IceCast :

    


    <icecast>&#xA;    <location>Earth</location>&#xA;    <admin>icemaster@localhost</admin>&#xA;    <hostname>localhost</hostname>&#xA;&#xA;    <limits>&#xA;        <clients>100</clients>&#xA;        <sources>10</sources>&#xA;        524288&#xA;        60&#xA;        30&#xA;        10&#xA;        1&#xA;        65536&#xA;    </limits>&#xA;&#xA;    <authentication>&#xA;        hackme&#xA;        hackme&#xA;        admin&#xA;        hackme&#xA;    </authentication>&#xA;&#xA;    &#xA;        <port>8000</port>&#xA;        0.0.0.0&#xA;    &#xA;    &#xA;    &#xA;        <port>8443</port>&#xA;        0.0.0.0&#xA;        <ssl>1</ssl>&#xA;    &#xA;&#xA;    &#xA;        <header value="*"></header>&#xA;        <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;        <header value="GET, POST, OPTIONS"></header>&#xA;        <header value="no-cache, no-store, must-revalidate"></header>&#xA;        <header value="no-cache"></header>&#xA;        <header value="0"></header>&#xA;    &#xA;&#xA;    &#xA;    <mount type="normal">&#xA;        /radio&#xA;        <password>mypassword</password>&#xA;        <public>1</public>&#xA;        100&#xA;        Anime Vibes&#xA;        Anime Vibes&#xA;        <genre>various</genre>&#xA;        audio/ogg&#xA;        65536&#xA;        &#xA;        &#xA;            <header value="*"></header>&#xA;            <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;            <header value="GET, POST, OPTIONS"></header>&#xA;            <header value="no-cache, no-store, must-revalidate"></header>&#xA;            <header value="no-cache"></header>&#xA;            <header value="0"></header>&#xA;        &#xA;    </mount>&#xA;&#xA;    <fileserve>1</fileserve>&#xA;&#xA;    <paths>&#xA;        <logdir>/var/log/icecast2</logdir>&#xA;        <webroot>/etc/icecast2/web</webroot>&#xA;        <adminroot>/etc/icecast2/admin</adminroot>&#xA;       &#xA;        <alias source="/" destination="/status.xsl"></alias>&#xA;        &#xA;        /etc/icecast2/cert/icecast.pem&#xA;        &#xA;    </paths>&#xA;&#xA;    <logging>&#xA;        <accesslog>access.log</accesslog>&#xA;        <errorlog>error.log</errorlog>&#xA;        <playlistlog>playlist.log</playlistlog>&#xA;        <loglevel>1</loglevel> &#xA;        <logsize>10000</logsize> &#xA;        <logarchive>1</logarchive>&#xA;    </logging>&#xA;</icecast>&#xA;

    &#xA;

    Code Node.js :

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const { spawn } = require(&#x27;child_process&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;const https = require(&#x27;https&#x27;);&#xA;const app = express();&#xA;const port = 3000;&#xA;&#xA;const privateKey = fs.readFileSync(&#x27;./cert/privateKey.key&#x27;, &#x27;utf8&#x27;);&#xA;const certificate = fs.readFileSync(&#x27;./cert/certificate.crt&#x27;, &#x27;utf8&#x27;);&#xA;&#xA;const credentials = {&#xA;    key: privateKey,&#xA;    cert: certificate&#xA;};&#xA;&#xA;app.use(express.static(path.join(__dirname)));&#xA;&#xA;// Check if playlist file exists&#xA;const playlistPath = path.join(__dirname, &#x27;playlist.txt&#x27;);&#xA;if (!fs.existsSync(playlistPath)) {&#xA;    console.error(&#x27;Playlist file does not exist&#x27;);&#xA;    process.exit(1);&#xA;}&#xA;&#xA;console.log(`Playlist path: ${playlistPath}`);&#xA;&#xA;// Start FFmpeg process to create continuous stream from playlist&#xA;const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-re&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;concat&#x27;,&#xA;    &#x27;-safe&#x27;, &#x27;0&#x27;,&#xA;    &#x27;-protocol_whitelist&#x27;, &#x27;file,http,https,tcp,tls&#x27;,&#xA;    &#x27;-i&#x27;, playlistPath,&#xA;    &#x27;-c:a&#x27;, &#x27;libvorbis&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;ogg&#x27;,&#xA;    &#x27;-tls&#x27;, &#x27;1&#x27;,&#xA;    &#x27;icecast://source:mypassword@localhost:8443/radio&#x27;&#xA;]);&#xA;&#xA;ffmpegProcess.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(`FFmpeg stdout: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.stderr.on(&#x27;data&#x27;, (data) => {&#xA;    console.error(`FFmpeg stderr: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;    console.log(`FFmpeg process exited with code ${code}`);&#xA;});&#xA;&#xA;app.get(&#x27;/radio&#x27;, (req, res) => {&#xA;    res.setHeader(&#x27;Content-Type&#x27;, &#x27;audio/ogg&#x27;);&#xA;    res.setHeader(&#x27;Transfer-Encoding&#x27;, &#x27;chunked&#x27;);&#xA;&#xA;    const requestOptions = {&#xA;        hostname: &#x27;localhost&#x27;,&#xA;        port: 8443,&#xA;        path: &#x27;/radio&#x27;,&#xA;        method: &#x27;GET&#x27;,&#xA;        headers: {&#xA;            &#x27;Accept&#x27;: &#x27;audio/ogg&#x27;&#xA;        },&#xA;        rejectUnauthorized: false&#xA;    };&#xA;&#xA;    const request = https.request(requestOptions, (response) => {&#xA;        response.pipe(res);&#xA;&#xA;        response.on(&#x27;end&#x27;, () => {&#xA;            res.end();&#xA;        });&#xA;    });&#xA;&#xA;    request.on(&#x27;error&#x27;, (err) => {&#xA;        console.error(`Request error: ${err.message}`);&#xA;        res.status(500).send(&#x27;Internal Server Error&#x27;);&#xA;    });&#xA;&#xA;    request.end();&#xA;});&#xA;https.globalAgent.options.ca = [certificate];&#xA;// Create HTTPS server&#xA;const httpsServer = https.createServer(credentials, app);&#xA;&#xA;httpsServer.listen(port, () => {&#xA;    console.log(`Server is running at https://localhost:${port}`);&#xA;});&#xA;

    &#xA;

    I hope for your help and any advice, thanks in advance

    &#xA;

  • Latency in Gst-rtsp-server using appsrc

    18 décembre 2015, par alasin

    I’m trying to setup my own appsrc based Gst-rtsp-server which captures frames through Directshow, encodes to h264 stream and broadcasts the stream over LAN. Using this example as a reference, I have something like this :

    void need_data(GstElement *appsrc, guint unused, MyContext *ctx)
    {
       buffer = gst_buffer_new_allocate(NULL, size, NULL);

       captureThread->setMutex();

       gst_buffer_map (buffer, &amp;info, GST_MAP_WRITE);
       memcpy (info.data, captureThread->getFrame(), size);
       gst_buffer_unmap (buffer, &amp;info);

       /* Increment the timestamp for 25 fps */
       GST_BUFFER_PTS(buffer)      = ctx->timestamp;
       GST_BUFFER_DURATION(buffer) = gst_util_uint64_scale_int(1, GST_SECOND, 40);
       ctx->timestamp             += GST_BUFFER_DURATION(buffer);

       g_signal_emit_by_name(appsrc, "push-buffer", buffer, &amp;ret);

       captureThread->unsetMutex();
    }

    void media_configure(GstRTSPMediaFactory *factory, GstRTSPMedia *media, gpointer user_data)
    {
       GstElement *element, *appsrc;
       MyContext  *ctx;

       /* get the element used for providing the streams of the media */
       element = gst_rtsp_media_get_element(media);

       /* get our appsrc, we named it 'mysrc' with the name property */
       appsrc = gst_bin_get_by_name_recurse_up(GST_BIN(element), "mysrc");

       /* this instructs appsrc that we will be dealing with timed buffer */
       gst_util_set_object_arg(G_OBJECT(appsrc), "format", "time");

       /* configure the caps of the video */
       g_object_set(G_OBJECT(appsrc), "caps",
                gst_caps_new_simple("video/x-raw",
                                    "format", G_TYPE_STRING, "NV12",
                                    "width", G_TYPE_INT, 640,
                                    "height", G_TYPE_INT, 480,
                                    "framerate", GST_TYPE_FRACTION, 25, 1, NULL), NULL);

       ctx = g_new0(MyContext, 1);
       ctx->timestamp = 0;

       /* make sure the data is freed when the media is gone */
       g_object_set_data_full(G_OBJECT(media), "my-extra-data", ctx, (GDestroyNotify)g_free);

       /* install the callback that will be called when a buffer is needed */
       g_signal_connect(appsrc, "need-data", (GCallback)need_data, ctx);
       gst_object_unref(appsrc);
       gst_object_unref(element);
    }

    int main(int argc, char *argv[])
    {
       GMainLoop *loop;
       GstRTSPServer *server;
       GstRTSPMountPoints  *mounts;
       GstRTSPMediaFactory *factory;

       /* This thread captures frames from dshow source at 30fps */
       captureThread = new CaptureThread();
       captureThread->Launch();

       gst_init(&amp;argc, &amp;argv);

       loop   = g_main_loop_new(NULL, FALSE);
       server = gst_rtsp_server_new();

       /* get the mount points for this server, every server has a default object
        * that be used to map uri mount points to media factories */
       mounts  = gst_rtsp_server_get_mount_points(server);
       factory = gst_rtsp_media_factory_new();

       gst_rtsp_media_factory_set_launch(factory,
                                     "( appsrc name=mysrc ! x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay name=pay0 pt=96 )");

       gst_rtsp_media_factory_set_shared(GST_RTSP_MEDIA_FACTORY(factory), TRUE);

       //gst_rtsp_media_factory_set_latency(factory, 10);
       g_signal_connect(factory, "media-configure", (GCallback)media_configure, NULL);
       gst_rtsp_mount_points_add_factory(mounts, "/test", factory);

       /* don't need the ref to the mounts anymore */
       g_object_unref(mounts);

       /* attach the server to the default maincontext */
       gst_rtsp_server_attach(server, NULL);

       g_print("stream ready at rtsp://127.0.0.1:8554/test\n");
       g_main_loop_run(loop);

       return 0;
    }

    I’m able to test the live feed at 25fps from a client but there’s a constant lag offset of around 1 second. I’ve tried changing the fps, buffer timestamp and other things but the this lag still persists.

    Anything that could help me remove this lag would be much appreciated

  • vulkan : add support for encode and decode queues and refactor queue code

    7 novembre 2021, par Lynne
    vulkan : add support for encode and decode queues and refactor queue code
    

    This simplifies and makes queue family picking simpler and more robust.
    The requirements on the device context are relaxed. They made no sense
    in the first place.

    The video encode/decode extension is still in beta, at least on paper,
    but I really doubt they'd change needing a separate queue family.

    • [DH] libavfilter/vf_avgblur_vulkan.c
    • [DH] libavfilter/vf_chromaber_vulkan.c
    • [DH] libavfilter/vf_overlay_vulkan.c
    • [DH] libavfilter/vf_scale_vulkan.c
    • [DH] libavfilter/vulkan.h
    • [DH] libavutil/hwcontext_vulkan.c
    • [DH] libavutil/hwcontext_vulkan.h