Recherche avancée

Médias (0)

Mot : - Tags -/navigation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (73)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • 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 (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (9659)

  • upload and stream ffmpeg stream chunk and mpd file in s3

    29 juin 2024, par Kamruzzaman Rabeen

    i want to make ann web app where i can upload a video. After uploading video its should be compress by ffmpeg after that i want to keep the data on aws S3.

    


    I can compress by ffmpeg. but i have no idea which file i should keep in s3 because after compress its create many chunk file and one mpd xml file.

    


    Also i want to stream the video from mpd file after fetching data from s3.
here is my upload function code.
const videoPath = req.file.path; const outputDir = path.join(__dirname, 'dash'); const uniqueId = uuidv4(); const outputFilePath = path.join(outputDir, $uniqueId_stream.mpd); const bucketName = process.env.S3_BUCKET_NAME; const s3Key = dash/$uniqueId_stream.mpd` ;

    


    // Ensure the output directory exists
if (!fs.existsSync(outputDir)) {
    fs.mkdirSync(outputDir, { recursive: true });
}

ffmpeg(videoPath)
    .outputOptions([
        '-profile:v main',
        '-use_template 1',
        '-use_timeline 1',
        '-b:v 1000k',
        '-b:a 128k',
        '-f dash'
    ])
    .on('end', async () => {
        console.log('DASH file created successfully');
        try {
            const s3Url = await uploadToS3(outputFilePath, bucketName, s3Key);
            res.status(200).json({ message: 'Video uploaded and DASH file created', url:    s3Url });
        } catch (err) {
            console.error('Error uploading to S3: ', err);
            res.status(500).json({ message: 'Error uploading to S3', error: err.message });
        }
    })
    .on('error', (err) => {
        console.error('Error processing video: ', err);
        res.status(500).json({ message: 'Error processing video', error: err.message });
    })
    .save(outputFilePath);`

`const uploadToS3 = (filePath, bucketName, key) => {
return new Promise((resolve, reject) => {
    fs.readFile(filePath, (err, data) => {
        if (err) return reject(err);

        const params = {
            Bucket: bucketName,
            Key: key,
            Body: data,
            ContentType: 'application/dash+xml'
        };

        s3.upload(params, (err, data) => {
            if (err) return reject(err);
            resolve(data.Location);
        });
    });
});


    


     ;`

    


    i have tried this version of code.

    


    now i want to know what is the best to way to keep data in s3 for compress video after ffmpeg.

    


  • Mux ts segments to fragmented mp4 in realtime

    10 avril 2021, par bsack

    I have an HLS stream which plays in the browser. What I want to do is have a URL like /stream.mp4 that plays the livestream back as a fragmented mp4 from the current point in time. This way you could download the stream as a single file and it would work without any js dependencies.

    


    The method I thought of is :

    


      

    1. send an mp4 header
    2. 


    3. wait for a new segment
    4. 


    5. convert the segment into an mp4 fragment with ffmpeg
    6. 


    7. send the mp4 fragment
    8. 


    9. go to 2.
    10. 


    


    (I know you can concatenate .ts segments but they don't play in Firefox.)

    


    This answer describes how to create a fragmented mp4 when you have all the segments at hand (tl ;dr use -movflags frag_keyframe+emptymoov). But I want to do this on the fly so each new HLS segment is converted to an mp4 fragment as soon as it's created.

    


    I think this is similar to what DASH does natively, where any chunk chunk-$n.m4s can be appended to init.m4s and it'll be a proper fragmented mp4. But can this be done without using DASH ?

    


    How can I transmux a ts segment into an mp4 fragment ?

    


    Edit : I found a way of doing what I wanted, but not through transmuxing mpegts segments to fmp4. It turns out that later versions of HLS do support fragmented mp4 (like DASH does), and FFmpeg provides the -hls_segment_type fmp4 option for this.

    


  • Webcam Serverless Live stream

    23 juillet 2021, par curiouscoder

    I'm trying to live stream my webcam in a serverless way in the following flow :

    


    webcam browser >> s3 bucket >> lambda/ffmpeg encoding >> s3 output bucket >> dash player

    


    This is working really good so far but I'm facing the following problem :

    


    ffmpeg will only encode those seconds received (I stream the webcam to s3 each X seconds with some 300kb .webm file). So the .mpd file generated by ffmpeg encoder will have the type 'static' when ffmpeg finishes encoding and not the 'dynamic' type desired. Therefore, the dash player won't request the other files from s3 and the streaming will stop. For example, if I let the webcam streaming running for 15 seconds, the viewer is able to watch the 15 minutes. But if I keep sending the streams each 2 seconds the viewer will be able to watch only the first 2 seconds because browser won't request any other .m4s files.

    


    So, I have the following question :

    


    Is there a way to force the dash player to reload the .mpd file that is stored in s3 even when the type is static instead of dynamic ?

    


    Thanks in advance !