Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (86)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5745)

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

  • Android : Recording and Streaming at the same time

    23 avril 2020, par Bruno Siqueira

    This is not really a question as much as it is a presentation of all my attempts to solve one of the most challenging functionalities I was faced with.

    &#xA;&#xA;

    I use libstreaming library to stream realtime videos to Wowza Server and I need to record it at the same time inside the SD card. I am presenting below all my attempts in order to collect new ideias from the community.

    &#xA;&#xA;

    Copy bytes from libstreaming stream to a mp4 file

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    We created an interception in libstreaming library to copy all the sent bytes to a mp4 file. Libstreaming sends the bytes to Wowza server through a LocalSocket. It users MediaRecorder to access the camera and the mic of the device and sets the output file as the LocalSocket's input stream. What we do is create a wrapper around this input stream extending from InputStream and create a File output stream inside it. So, every time libstreaming executes a reading over the LocaSocket's input stream, we copy all the data to the output stream, trying to create a valid MP4 file.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    When we tried to read the file, it is corrupted. We realized that there are meta information missing from the MP4 file. Specifically the moov atom. We tried to delay the closing of the streaming in order to give time to send this header (this was still a guessing) but it didn't work. To test the coherence of this data, we used a paid software to try to recover the video, including the header. It became playable, but it was mostly green screen. So this became an not trustable solution. We also tried using "untrunc", a free open source command line program and it couldn't even start the recovery, since there was no moov atom.

    &#xA;&#xA;

    Use ffmpeg compiled to android to access the camera

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    FFMPEG has a gradle plugin with a java interface to use it inside Android apps. We thought we could access the camera via command line (it is probably in "/dev/video0") and sent it to the media server.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    We got the error "Permission Denied" when trying to access the camera. The workaround would be to root the device to have access to it, but it make the phones loose their warranty and could brick them.

    &#xA;&#xA;

    Use ffmpeg compiled to android combined with MediaRecorder

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    We tried to make FFMPEG stream a mp4 file being recorded inside the phone via MediaRecorder

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    FFMPEG can not stream MP4 files that are not yet done with the recording.

    &#xA;&#xA;

    Use ffmpeg compiled to android with libstreaming

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    Libstreaming uses LocalServerSocket as the connection between the app and the server, so we thought that we could use ffmpeg connected with LocalServerSocket local address to copy the streaming directly to a local file inside the SD card. Right after the streaming started, we also ran the ffmpeg command to start recording the data to a file. Using ffmpeg, we believed that it would create a MP4 file in the proper way, which means with the moov atom header included.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    The "address" created is not readable via command line, as a local address inside the phone. So the copy is not possible.

    &#xA;&#xA;

    Use OpenCV

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    OpenCV is an open-source, cross-platform library that provides building blocks for computer vision experiments and applications. It offers high-level interfaces for capturing, processing, and presenting image data. It has their own APIs to connect with the device camera so we started studding it to see if it had the necessary functionalities to stream and record at the same time.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    We found out that the library is not really defined to do this, but more as image mathematical manipulation. We got even the recommendation to use libstreaming (which we do already).

    &#xA;&#xA;

    Use Kickflip SDK

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    Kickflip is a media streaming service that provides their own SDK for development in android and IOS. It also uses HLS instead of RTMP, which is a newer protocol.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    Their SDK requires that we create a Activity with camera view that occupies the entire screen of the device, breaking the usability of our app.

    &#xA;&#xA;

    Use Adobe Air

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    We started consulting other developers of app's already available in the Play Store, that stream to servers already.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    Getting in touch with those developers, they reassured that would not be possible to record and stream at the same time using this technology. What's more, we would have to redo the entire app from scratch using Adobe Air.

    &#xA;&#xA;

    UPDATE

    &#xA;&#xA;

    Webrtc

    &#xA;&#xA;

    Development

    &#xA;&#xA;

    We started using WebRTC following this great project. We included the signaling server in our NODEJS server and started doing the standard handshake via socket. We were still toggling between local recording and streaming via webrtc.

    &#xA;&#xA;

    Impediment

    &#xA;&#xA;

    Webrtc does not work in every network configuration. Other than that, the camera acquirement is all native code, which makes a lot harder to try to copy the bytes or intercept it.

    &#xA;

  • libavformat stuck in ff_network_wait_fd

    3 juin 2020, par Daniel

    I'm using libavformat for remuxing some live video feeds (rtsp).

    &#xA;&#xA;

    I can't really create a minimal reproducable example, because the issue is not reproducable, but I have an attached debugger and if I have any minimal chance to examine the root cause I'd not skip any chance.

    &#xA;&#xA;

    The stream is opened via avformat_open_input, and there is a custom IO for writing the output (avformat_alloc_output_context2).

    &#xA;&#xA;

    The problem is that avformat is stuck in ff_network_wait_fd, at least by gdb :

    &#xA;&#xA;

    #0  0xb673e120 in poll () at ../sysdeps/unix/syscall-template.S:84&#xA;#1  0x004a3ff4 in ff_network_wait_fd (fd=-1357954584, write=1) at libavformat/network.c:72&#xA;#2  0xaf0f428e in ?? ()&#xA;Backtrace stopped: previous frame identical to this frame (corrupt stack?)&#xA;

    &#xA;&#xA;

    There was a network failure during the connection or the stream and I have not got any aggressive stream closing mechanism (everything is non blocking, there is no waits, sleeps, everything is event-based by libev).

    &#xA;&#xA;

    This just happened once during one month so it's very hard to reproduce but it is still running and gdb is attached.

    &#xA;&#xA;

    I'm curious if I have any chance to dig deeper. The stack seems corrupted and also the fd seems invalid for what ff_network_wait_fd waits for.

    &#xA;&#xA;

    Also, I never call ff_network_wait_fd directly, but there is an alternative : ff_network_wait_fd_timeout. Is it possible to ask libavformat to use this alternative so it won't block my thread if there is unreliable network ?

    &#xA;