Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (67)

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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (7191)

  • How to download .m3u8 in once time

    11 octobre 2024, par Nabi K.A.Z.

    I have a .m3u8 file on remote host, with contain fixed numbers of chunk .ts file name, and not stream :

    



    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:9.736,
media_0.ts
#EXTINF:9.96,
media_1.ts
#EXTINF:10.0,
media_2.ts
#EXTINF:10.0,
media_3.ts
#EXTINF:10.0,
media_4.ts
#EXTINF:10.2,
media_5.ts
#EXTINF:10.0,


    



    When I use this command :

    



    # ffmpeg -i "http://example.com/chunklist.m3u8" file.mp4

frame=  582 fps=9.4 q=28.0 size=    1536kB time=00:00:23.21 bitrate= 542.1kbits/s dup=2 drop=4 speed=0.375x


    



    It works. But It get frame by frame video and very long time needed. (It takes time almost to playback the video.)

    



    But since the path of all the .ts files are known. (http://example.com/media_0.ts, http://example.com/media_1.ts, ...) There must be a way to get and merge them all at the same time.

    



    But How in ffmpeg directly ?!

    



    EDIT (try a solution) :

    



    For one solution, I know how can concatenation files with ffmpeg.

    



    ffmpeg -i "concat:0.ts|1.ts|2.ts|3.ts|4.ts|5.ts" -c copy output.mp4


    



    This ffmpeg command was great, and works in less 1 sec time !

    



    So try to download all .ts files with CURL with this command :

    



    curl \
http://example.com/media_0.ts -o 0.ts \
http://example.com/media_1.ts -o 1.ts \
http://example.com/media_2.ts -o 2.ts \
http://example.com/media_3.ts -o 3.ts \
http://example.com/media_4.ts -o 4.ts \
http://example.com/media_5.ts -o 5.ts


    



    But you can see result :

    



      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  687k  100  687k    0     0  75108      0  0:00:09  0:00:09 --:--:-- 74111
100  652k  100  652k    0     0  59404      0  0:00:11  0:00:11 --:--:-- 53400
100  673k  100  673k    0     0  48675      0  0:00:14  0:00:14 --:--:-- 55781
100  657k  100  657k    0     0  63573      0  0:00:10  0:00:10 --:--:-- 62494
100  671k  100  671k    0     0  39019      0  0:00:17  0:00:17 --:--:-- 40863
100  692k  100  692k    0     0  63480      0  0:00:11  0:00:11 --:--:-- 80049


    



    See, total download time was 72 sec, while the total duration of all parts is 59 sec ! that this time is very long !

    



    So sorry, download all parts and then concat that, was not good solution.

    



    EDIT 2

    



    I try for another .m3u8 file on the another server with difference URL :

    



    Download and concat together :

    



    ffmpeg -i "concat:\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_0.ts|\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_1.ts|\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_2.ts|\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_3.ts|\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_4.ts|\
http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_5.ts\
" -c copy -y output.ts


    



    Another command with input.txt URLs file.

    



    ffmpeg -f "concat" -i "input.txt" -c copy -y output.ts


    



    input.txt file :

    



    file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_0.ts'
file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_1.ts'
file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_2.ts'
file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_3.ts'
file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_4.ts'
file 'http://184.72.239.149/vod/smil:BigBuckBunny.smil/media_w442897525_b560000_5.ts'


    



    Or this command some time if needed :

    



    ffmpeg -f "concat" -safe "0" -protocol_whitelist "file,http,https,tcp,tls" -i "input.txt" -c copy -y output.ts


    



    Finally, for that download speed was good, MAYBE my server target has limited bandwidth. :-(

    


  • how to download portion of video which was uploaded into AWS s3 bucket, though Nodejs SDKs

    22 février 2024, par rama rangeswara reddy

    I have uploaded a 1GB .mp4 file to an AWS S3 bucket. Using the AWS-SDK provided by the npm package, I am able to download the entire video. However, I have a specific requirement to generate a thumbnail at the 6-second mark of the video. Currently, I download the entire 1GB video to my local machine and then generate the thumbnail at the desired duration.

    


    To optimize server resources and reduce disk load, I plan to download only the first 10 seconds of the video, which should be approximately 10MB or less in size. By doing so, I can significantly reduce download time and server load while still fulfilling my requirement of generating the thumbnail at the 6-second mark. Therefore, instead of downloading the entire 1GB video, I aim to download only the 10MB segment corresponding to the first 10 seconds of the video.

    


    I am using nodejs, expressJS, as backed Technologies.

    


    `

    


    `async function downloadS3FileToLocalDirAndReturnPath(videoKey) {
    return new Promise(async (resolve, reject) => {
        try {
            AWS.config.update({
                accessKeyId: config.AWS.KEYS.accessKeyId,
                secretAccessKey: config.AWS.KEYS.secretAccessKey,
                region: config.AWS.KEYS.region,
                httpOptions: config.AWS.KEYS.httpOptions
            });
            const s3 = new AWS.S3();

            // Specify the local file path where you want to save the downloaded video
            const localFilePath = `${os.tmpdir()}/${Date.now()}_sre.mp4`;

            // Configure the parameters for the S3 getObject operation
            const params = {
                Bucket: config.AWS.S3_BUCKET,
                Key: videoKey
            };

            const result = await s3.getObject(params).promise();
            const fileContent = result.Body;
            fs.writeFileSync(localFilePath, fileContent);
            resolve(localFilePath);
        } catch (error) {
            reject(error);
        }
    });
}`


    


    this code was working fine to download the whole video , but i need to download only first 10 seconds duration

    


    S3 : How to do a partial read / seek without downloading the complete file ?

    


    I tried this ,before posting this question with above post, video was downloading , it was not playing , by throwing this error , the file contains no playable streams

    


    async function generateThumbnails(videoKey) {

const s3 = new AWS.S3();

const params = {
    Bucket: KEYS.bucket,
    Key: videoKey, // Specify the key of the video file in S3
    Range: `bytes=0-${1024 * 800}`, // Specify the range of bytes you want to retrieve
};

const file = fs.createWriteStream(`/tmp/${Date.now()}_rama.mp4`);

const s3Stream = s3.getObject(params).createReadStream();

s3Stream.pipe(file);

s3Stream.on("error", (error) => {
    console.log("Error Occured while File downloading!! ");
});

s3Stream.on("finish", () => {
    console.log("File downloaded Successfully ");
});


    


    }

    


  • How to download audio and video as separate files and specify the output format and filename for each ?

    14 novembre 2023, par Taako

    I'd like to download a video as separate files for both audio and video and have them named [video_id]-audio.wav and [video_id]-video.mp4

    


    How do i get yt-dlp to download the video and audio separately, then convert each to the specified output format and rename them as such ?

    


    Right now I can get them each downloaded separately but the naming isnt working out.

    


    I could also use ffmpeg separately to convert the video and audio formats after they are downloaded, so all i really need is to have the audio and video files downloaded and named

    


    Right now my args are

    


    YT_OPTIONS = {
    'format': 'bestvideo[height<=720]+bestaudio/best[height<=720]',
    'extractaudio': True,
    'keepvideo': True,
    'outtmpl': '%(id)s-%(format)s.%(ext)s',
    'restrictfilenames': True,
    'noplaylist': True
}


    


    but the format is just coming out as 247_-_1280x720_720p_+251_-_audio_only_medium and whats worse is it is the same for both the audio only and video only files just one has 251 and the other has 247.