Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (46)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • Problem playing a sound with pydub Error : pydub.exceptions.CouldntDecodeError : Decoding failed. ffmpeg returned error code : 1

    28 mai 2020, par studioDKR

    I have a problem getting a file played in the browser with pydub. I think the function is working, but I just don't get the right file path to it, or something else is missing. Would love to get your help !

    



    I get the pydob error message : pydub.exceptions.CouldntDecodeError : Decoding failed. ffmpeg returned error code : 1

    



    Here is the error I get :

    



    [2020-05-28 16:04:33,023] ERROR in app: Exception on /overview [POST]
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/Micha/Documents/GitHub/podprod/app.py", line 109, in overview
    sound = AudioSegment.from_file(filepath)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydub/audio_segment.py", line 723, in from_file
    raise CouldntDecodeError(
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1

Output from ffmpeg/avlib:

b'ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers\n  built with Apple clang version 11.0.3 (clang-1103.0.32.59)\n  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack\n  libavutil      56. 31.100 / 56. 31.100\n  libavcodec     58. 54.100 / 58. 54.100\n  libavformat    58. 29.100 / 58. 29.100\n  libavdevice    58.  8.100 / 58.  8.100\n  libavfilter     7. 57.100 /  7. 57.100\n  libavresample   4.  0.  0 /  4.  0.  0\n  libswscale      5.  5.100 /  5.  5.100\n  libswresample   3.  5.100 /  3.  5.100\n  libpostproc    55.  5.100 / 55.  5.100\n/Users/Micha/documents/github/podprod/uploads/test2.wav: Invalid data found when processing input\n'


    



    This is the Flask route with the function I am writing.

    



    @app.route("/overview", methods=["GET", "POST"])
def overview():

    entries = []

    # Open a file
    path = app.config["FILE_UPLOADS"]

    with os.scandir(path) as dirs:
        for entry in dirs:
            entries.append(entry.name)

    if request.method == "POST":
        filename = request.form['filename']

        filepath = os.path.join(app.config["FILE_UPLOADS"], filename)

        # Play the sound
        sound = AudioSegment.from_file(filepath)
        play(sound)

        return render_template('overview.html', entries=entries)


    



    Here is the HTML template :

    



        {% extends &#x27;main_template.html&#x27; %}&#xA;&#xA;    {% block title %}PodProd Podcast Overview{% endblock %}&#xA;&#xA;    {% block main %}&#xA;&#xA;    <div class="container">&#xA;&#xA;        <h1>Here is an overview of your files</h1>&#xA;&#xA;        <table class="table table-striped">&#xA;            <tr>&#xA;                <th>Filename</th>&#xA;                <th>Action</th>&#xA;            </tr>&#xA;        {% for result in entries %}&#xA;            {% if ".wav" in result %}&#xA;                <tr>&#xA;                    <td>{{ result }}</td>&#xA;                    <td><form action="" method="POST"> <button type="submit" class="btn btn-primary" value="{{" result="result">Play</button></form>&#xA;                </td></tr>&#xA;            {% endif %}&#xA;        {% endfor %}&#xA;        </table>&#xA;&#xA;    </div>&#xA;&#xA;    {% endblock %}&#xA;

    &#xA;

  • FFmpeg downloading entire live stream when making a small clip

    6 février 2021, par stevendesu

    Setup

    &#xA;

    I'm using FFmpeg to generate video clips from M3U8 videos. The command looks like this :

    &#xA;

    ffmpeg -ss <start> -i &lt;1080p-chunklist-url> -c:v copy -c:a copy -t <duration> -f mp4 -y out.mp4&#xA;</duration></start>

    &#xA;

    For example, to create a 30-second clip starting at the 5-minute mark for a particular video, the command would be :

    &#xA;

    ffmpeg -ss 300 -i https://example.com/path/to/1080p/index.m3u8 -c:v copy -c:a copy -t 30 -f mp4 -y out.mp4&#xA;

    &#xA;

    Some caveats I'm already aware of :

    &#xA;

      &#xA;
    • If -ss comes after -i then FFmpeg will attempt to download the entire M3U8 instead of just the relevant TS files, and will parse the entire video contents looking for the exact timestamp. By putting -ss before -i FFmpeg uses "seek points", which with HLS videos means it looks at the M3U8 and only downloads relevant TS files
    • &#xA;

    • TS file boundaries function as "seek points" in HLS, so if a TS file starts at 4:51 and the next TS file starts at 5:01, this command will start the clip at 4:51 instead of 5:01 (it prefers the first seek point before the requested time)
    • &#xA;

    • The -t parameter sets an exact clip duration instead of an ending position, so in the above example of a clip starting at 4:51 the same clip would end at 5:21 instead of 5:30
    • &#xA;

    &#xA;

    In theory I can utilize -to instead of -t to specify an ending time of 5:30, however in practice this hasn't worked. Also in theory I can force -accurate_seeking to discard the contents from 4:51 to 5:00 and start the clip where I wanted it, but I learned this only works for transcodes and not transmux

    &#xA;

    Now to the meat of my problem :

    &#xA;

    Problem

    &#xA;

    When the M3U8 URL provided is a live stream (no #EXT-X-ENDLIST tag) then FFmpeg does not behave correctly. On FFmpeg versions 4.2.1 and earlier, it starts by downloading the TS file containing my clip segment, then proceeds to download every TS file in the M3U8 then hangs while waiting for new TS files to become available, downloading them as they appear - even hours after the end of the section I wanted to clip. On FFmpeg version 4.2.2 and later, I can create clips so long as they end before the second-to-last TS file. If the live stream currently has 20 minutes of video data and I create a clip from 19:30 - 19:40 (ending right at the start of the second-to-last TS file, assuming a 10-second TS file duration) then it will behave the same as 4.2.1 : waiting infinitely to download the entire video.

    &#xA;

    The "2 TS files from the end" rule I believe is related to FFmpeg's initial probe of the video to get stream data. In the aforementioned 20-minute long video, if I make a clip from 3:00 to 3:30 (well before the end of the stream) it will first download TS files 119 and 120 (19:40-19:50 and 19:50-20:00), then it displays a list of the streams in the video (audio, video, metadata), then it downloads TS files 19 - 21 (containing the actual data I want for my clip)

    &#xA;

    Is there a way to fix it so I can properly make clips of sections near the "end" of live M3U8s ?

    &#xA;

  • avcodec/utvideodec/enc : Fix edge case of creating Huffman table

    24 septembre 2020, par Andreas Rheinhardt
    avcodec/utvideodec/enc : Fix edge case of creating Huffman table
    

    The Ut Video format stores Huffman tables in its bitstream by coding
    the length of a given symbol ; it does not code the actual code directly,
    instead this is to be inferred by the rule that a symbol is to the left
    of every shorter symbol in the Huffman tree and that for symbols of the
    same length the symbol is descending from left to right. With one
    exception, this is also what our de- and encoder did.

    The exception only matters when there are codes of length 32, because
    in this case the first symbol of this length did not get the code 0,
    but 1 ; this is tantamount to pretending that there is a (nonexistent)
    leaf of length 32. This is simply false. The reference software agrees
    with this [1].

    [1] : https://github.com/umezawatakeshi/utvideo/blob/2700a471a78402e5c340150b38e8a793ef3676f1/utv_core/HuffmanCode.cpp#L280

    Reviewed-by : Paul B Mahol <onemda@gmail.com>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/utvideodec.c
    • [DH] libavcodec/utvideoenc.c