Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (89)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • 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" ;

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (8095)

  • m3u8 playback issue with VLC player and ffmpeg [closed]

    2 avril, par YUZ

    I’m creating a timelapse video from a folder of images using FFmpeg, generating two HLS (m3u8) playlists : one at 1080p and another at 2K resolution. The playlists and .ts segments appear to be generated correctly, but when I play the m3u8 files in media players like VLC or PotPlayer, the video does not play seamlessly. Instead, it plays in a segment-by-segment manner (e.g., it stops after each segment and doesn’t automatically continue to the next one). I expect the entire video to play continuously without interruptions. What could be the issue ?

    


    I ran these commands on cmd :

    


    for %i in (*.jpeg) do echo file '%cd%\%i' >> C:\Users\stitch_img\test\input_list.txt

ffmpeg -y -f concat -safe 0 -i "C:\Users\stitch_img\test\input_list.txt" -vf "scale=1920x1080" -c:v libx264 -r 16 -hls_time 4 -hls_playlist_type vod -hls_segment_filename "C:\Users\stitch_img\test\1080_video_%03d.ts" "C:\Users\stitch_img\test\1080_playlist.m3u8"

ffmpeg -y -f concat -safe 0 -i "C:\Users\stitch_img\test\input_list.txt" -vf 
"scale=2560x1440" -c:v libx264 -r 16 -hls_time 4 -hls_playlist_type vod -hls_segment_filename "C:\Users\stitch_img\test\2k_video_%03d.ts" "C:\Users\stitch_img\test\2k_playlist.m3u8"

echo #EXTM3U > "C:\Users\stitch_img\test\master_playlist.m3u8"
echo #EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080 >> "C:\Users\stitch_img\test\master_playlist.m3u8"
echo 1080_playlist.m3u8 >> "C:\Users\stitch_img\test\master_playlist.m3u8"
echo #EXT-X-STREAM-INF:BANDWIDTH=8000000,RESOLUTION=2560x1440 >> "C:\Users\stitch_img\test\master_playlist.m3u8"
echo 2k_playlist.m3u8 >> "C:\Users\stitch_img\test\master_playlist.m3u8"


    


    What I’ve Tried :

    


      

    • Verified that the .ts files are playable individually (e.g., opening 1080p_000.ts in VLC works fine).

      


    • 


    • Ensured the m3u8 files are structured correctly with #EXT-X-ENDLIST (indicating a VOD playlist).

      


    • 


    • Used HTTP playback to rule out local path resolution issues, but the issue persists

      


    • 


    


    m3u8 masters :

    


    #EXTM3U
#EXT-X-STREAM-INF: BANDWIDTH=5000000, RESOLUTION=1920x1080 1080_playlist.m3u8
#EXT-X-STREAM-INF: BANDWIDTH=8000000, RESOLUTION=2560x1440 2k_playlist.m3u8


    


    m3u8_2k :

    


    #EXTM3U
#EXT-X-VERSION: 3
#EXT-X-TARGETDURATION: 4 
#EXT-X-MEDIA-SEQUENCE:0 
#EXT-X-PLAYLIST-TYPE: VOD
#EXTINF: 4.125000, 
2k_video_000.ts 
#EXTINF:3.312500,
2k_video_001.ts
#EXT-X-ENDLIST


    


    m3u8_1080p :

    


    #EXTM3U
#EXT-X-VERSION: 3
#EXT-X-TARGETDURATION: 4 
#EXT-X-MEDIA-SEQUENCE:0 
#EXT-X-PLAYLIST-TYPE: VOD
#EXTINF: 4.125000, 
1080_video_000.ts 
#EXTINF:3.312500,
1080_video_001.ts
#EXT-X-ENDLIST


    


  • Video player scroll doesn't work after ffmpeg audio and video merge (NodeJS)

    1er novembre 2022, par Pietro Leto

    I made youtube downloader to download video from youtube using nodejs library ytdl-core. If I wanted to download video with best quality I had to download them without sound. So, in my script, I download audio and video separately and I merge them into an mp4 file.
What's the problem ? Video player scroll doesn't work. I can see the video but I can't going back or move on, and I can't see video duration.

    


    const express = require("express");
const cors = require("cors");
const app = express();
const ffmpeg = require('ffmpeg-static');
const cp = require('child_process');
const ytdl = require("ytdl-core");

app.use(cors());

app.listen(3000, () => {
    console.log("Server is working at port 3000 !!");
});

app.get('/download', (req,res) => {
    var url = req.query.URL;
    var formato = req.query.FORMAT;

    try {
        let vid = ytdl(url,{filter:'videoonly', quality:'highestvideo'})
        let aud = ytdl(url, {filter: 'audioonly', quality:'highestaudio'});

        ytdl.getInfo(url).then(info => {
            titolo = info.videoDetails.title;

            res.header("Content-Disposition", 'attachment;  filename=' + titolo + '.mp4');

            const ffmpegProcess = cp.spawn(ffmpeg, [
                '-i', `pipe:3`,
                '-i', `pipe:4`,
                '-map','0:v:0',
                '-map','1:a:0',
                '-c:v', 'copy',
                '-c:a', 'aac',
                '-crf','27',
                '-preset','veryfast',
                '-movflags','frag_keyframe+empty_moov',
                '-f','mp4',
                '-loglevel','error',
                '-'
            ], {
                stdio: [
                'pipe', 'pipe', 'pipe', 'pipe', 'pipe',
                ],
            });
              
            aud.pipe(ffmpegProcess.stdio[4]);
            vid.pipe(ffmpegProcess.stdio[3]);
            ffmpegProcess.stdio[1].pipe(res);
        });
    }
    catch(err) {
        console.log("Error with URL: " + url + "\nERROR: " + err + "\n\n");
    }
});


    


    I have not found alternatives to do this. I need a working script to download youtube videos with good quality.

    


  • after restarting the page in the browser, the player stops loading

    28 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;