Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (83)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

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

  • ffmpeg mp4 to hls vod with extract segment duration without re-encoding

    11 juillet 2021, par Jeremy

    Hello I have h264 mp4 files. What I want to do is convert it to hls without re-encoding. This can be achieve by :

    


    ffmpeg -i input.mp4 -c copy -force_key_frames "expr:gte(t,n_forced*4)" -hls_time 4 -hls_playlist_type vod -hls_segment_type mpegts vid.m3u8


    


    But this problem with this is that it doesn't create extract segment duration :

    


    $ for f in *.ts; do echo -n "$f,"; ffprobe -v error -show_entries format=duration -sexagesimal -of csv=p=0 "$f"; done
vid0.ts,0:00:04.837700
vid1.ts,0:00:05.587200
vid2.ts,0:00:06.006200
vid3.ts,0:00:01.368200
vid4.ts,0:00:02.693867


    


    I don't believe I can't insert keyframes without encoding.

    


    When I run :

    


    ffmpeg -i input.mp4 -codec:v libx264 -force_key_frames "expr:gte(t,n_forced*4)" -hls_time 4 -hls_playlist_type vod -hls_segment_type mpegts vid.m3u8


    


    its works but this is resource intensive as it re-encode the video.

    


    So I am looking for the best way to achieve this while using minimal resource as possible.

    


  • NodeJS fluent-ffmpeg error : Output stream closed

    30 décembre 2020, par Japser36

    We are running a NodeJS server that does some audio processing. Specifically, we have audio data returned by google's text to speech API, which we have in the form of a Buffer.

    


    In our application, we have to send this audio data through FFMPEG to format it and extract audio duration. We do this by first converting it into a stream, piping it into ffmpeg, and then storing the data in an output buffer :

    


    const toWav = function (input: Buffer): Promise<buffer> {&#xA;    return new Promise((res, rej): void => {&#xA;        const bufs = [];&#xA;        const myReadable = new Readable();&#xA;        myReadable._read = (): void => {}; // we already have all data in memory, so no-op this function;&#xA;        myReadable.push(input); // stream all data in the buffer to the stream&#xA;        myReadable.push(null); // end the stream&#xA;        const output = ffmpeg(myReadable)&#xA;            .inputFormat(&#x27;mp3&#x27;)&#xA;            .toFormat(&#x27;wav&#x27;)&#xA;            .on(&#x27;start&#x27;, function (commandLine) {&#xA;                console.log(&#x27;SPAWNED ARG: &#x27; &#x2B; commandLine);&#xA;            })&#xA;            .on(&#x27;error&#x27;, (err: object): void => {&#xA;                console.error(&#x27;FFMPEG error on wav transform&#x27;);&#xA;                rej(err);&#xA;            })&#xA;            .on(&#x27;end&#x27;, (): void => {&#xA;                console.debug(&#x27;FFMPEG finished wav transform&#x27;);&#xA;                res(Buffer.concat(bufs));&#xA;            })&#xA;            .pipe();&#xA;        output.on(&#x27;data&#x27;, (d: object): void => {&#xA;            bufs.push(d);&#xA;        });&#xA;    });&#xA;};&#xA;</buffer>

    &#xA;

    This code is one of our functions that does the formatting, that our data gets passed through. Most of the time, this code works fine, but sometimes an error is thrown :error and stack trace

    &#xA;

    Looking up this error on google, I found an issue on the FFMPEG library we use, that seems to suggest that using an input and output stream just isn't recommended and doesn't work. Rather, one of the two needs to be a file resource.

    &#xA;

    Some more about this error, it seems to happen consistently when it does happen, but it doesn't happen consistently overall. For me, I got this error every time the code ran, I went and took lunch, and when I came back it was gone.

    &#xA;

    For us it is important that this error won't pop up randomly in production, so the question is, does anyone have any suggestions on how we can be the most certain this error won't happen ?

    &#xA;

    For completeness in how this function is being invoked to result in the error in the screenshot, the structure of the code where the error is caught is like so :

    &#xA;

    await Promise.all(&#xA;    myArray.map(async (item, idx) => {&#xA;        // ...&#xA;        const wavBuffer = await toWav(myBuffer); // toWav is invoked at this level&#xA;    })&#xA;)&#xA;.then(() => {/* ... */})&#xA;.catch((e) => {&#xA;    // ...&#xA;    logger.error(&#x27;[LOOP CRASH] Error at main promise:&#x27;, e);&#xA;    // ...&#xA;});&#xA;

    &#xA;

    Any help would be appreciated, thank you ! Please let me know if I can provide more details, though I cannot share a repo or full source code or anything since this is a private repo.

    &#xA;

  • AVPlayer won't play audio files from FFMPEG

    18 janvier 2021, par Marcus

    Before requesting audio data AVPlayer requests byte range 0-1 from FFMPEG.

    &#xA;

    FFMPEG gives a 200 response, but AVPlayer requires a 206 response.

    &#xA;

    This results in the request failing and audio can't be played.

    &#xA;

    Expected behavior :&#xA;Play tracks when streaming through ffmpeg

    &#xA;

    Current behavior : When trying to stream with ffmpeg we get "Operation Stopped"

    &#xA;

    Sample FFMPEG command :

    &#xA;

    ffmpeg -i "/path/to/audio/track.mp3" -vn -strict -2 -acodec pcm_u8 -f wav -listen 1 -seekable 1 http://localhost:8090/restream.wav&#xA;

    &#xA;

    Player Log :

    &#xA;

    Error Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSLocalizedFailureReason=The server is not correctly configured., NSLocalizedDescription=Operation Stopped, NSUnderlyingError=0x600003bcc4b0 {Error Domain=NSOSStatusErrorDomain Code=-12939 "(null)"}}&#xA;!av_interleaved_write_frame(): Broken pipe&#xA;&#xA;!Connection to tcp://localhost:8090 failed: Connection refused&#xA;&#xA;!Connection to tcp://localhost:8090 failed: Connection refused&#xA;&#xA;!Connection to tcp://localhost:8090 failed: Connection refused&#xA;&#xA;!Error writing trailer of http://localhost:8090/restream.wav: Broken pipe&#xA;

    &#xA;

    This error is defined by Apple as :

    &#xA;

    &#x2B;"The HTTP server sending the media resource is not configured as expected. This might mean that the server does not support byte range requests."&#xA;

    &#xA;

    And summarised nicely in this StackOverflow post :

    &#xA;

    when AVPlayerItem receive a video URL , it do the following task:&#xA;&#xA;    Send a bytes request HTTP Request, and range = 0 -1&#xA;    If the response code is 206 and return 1 bytes data, It do the 3th task, if not, AVErrorServerIncorrectlyConfigured error occurred.&#xA;    continue send other HTTP Request, to download segment of All duration. and the response of VideoData code must be 206&#xA;&#xA;In my situation , when send range[0-1] HTTP request, the server side give me a 200 OK response, So error occurred.&#xA;

    &#xA;

    Network Log :

    &#xA;

    GET /file.wav HTTP/1.1&#xA;Host: localhost:1234&#xA;X-Playback-Session-Id: F72F1139-6F4C-4A22-B334-407672045A86&#xA;Range: bytes=0-1&#xA;Accept: */*&#xA;User-Agent: AppleCoreMedia/1.0.0.18C61 (iPhone; U; CPU OS 14_3 like Mac OS X; en_us)&#xA;Accept-Language: en-us&#xA;Accept-Encoding: identity&#xA;Connection: keep-alive&#xA;&#xA;HTTP/1.1 200 OK&#xA;Content-Type: application/octet-stream&#xA;Transfer-Encoding: chunked&#xA;

    &#xA;

    Reproduce using this sample app :

    &#xA;

    This can also be reproduced using standard ffmpeg and adding URL to local or remote ffmpeg URL

    &#xA;

    Can we solve this by making changes to FFMPEG or AVPlayer ?

    &#xA;