Recherche avancée

Médias (91)

Autres articles (89)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (15008)

  • Stream publishing using ffmpeg rtmp : network bandwidth not fully utilized

    14 février 2017, par DeducibleSteak

    I’m developing an application that needs to publish a media stream to an rtmp "ingestion" url (as used in YouTube Live, or as input to Wowza Streaming Engine, etc), and I’m using the ffmpeg library (programmatically, from C/C++, not the command line tool) to handle the rtmp layer. I’ve got a working version ready, but am seeing some problems when streaming higher bandwidth streams to servers with worse ping. The problem exists both when using the ffmpeg "native"/builtin rtmp implementation and the librtmp implementation.

    When streaming to a local target server with low ping through a good network (specifically, a local Wowza server), my code has so far handled every stream I’ve thrown at it and managed to upload everything in real time - which is important, since this is meant exclusively for live streams.

    However, when streaming to a remote server with a worse ping (e.g. the youtube ingestion urls on a.rtmp.youtube.com, which for me have 50+ms pings), lower bandwidth streams work fine, but with higher bandwidth streams the network is underutilized - for example, for a 400kB/s stream, I’m only seeing 140kB/s network usage, with a lot of frames getting delayed/dropped, depending on the strategy I’m using to handle network pushback.

    Now, I know this is not a problem with the network connection to the target server, because I can successfully upload the stream in real time when using the ffmpeg command line tool to the same target server or using my code to stream to a local Wowza server which then forwards the stream to the youtube ingestion point.

    So the network connection is not the problem and the issue seems to lie with my code.

    I’ve timed various parts of my code and found that when the problem appears, calls to av_write_frame / av_interleaved_write_frame (I never mix & match them, I am always using one version consistently in any specific build, it’s just that I’ve experimented with both to see if there is any difference) sometimes take a really long time - I’ve seen those calls sometimes take up to 500-1000ms, though the average "bad case" is in the 50-100ms range. Not all calls to them take this long, most return instantly, but the average time spent in these calls grows bigger than the average frame duration, so I’m not getting a real time upload anymore.

    The main suspect, it seems to me, could be the rtmp Acknowledgement Window mechanism, where a sender of data waits for a confirmation of receipt after sending every N bytes, before sending any more data - this would explain the available network bandwidth not being fully used, since the client would simply sit there and wait for a response (which takes a longer time because of the lower ping), instead of using the available bandwidth. Though I haven’t looked at ffmpeg’s rtmp/librtmp code to see if it actually implements this kind of throttling, so it could be something else entirely.

    The full code of the application is too much to post here, but here are some important snippets :

    Format context creation :

    const int nAVFormatContextCreateError = avformat_alloc_output_context2(&m_pAVFormatContext, nullptr, "flv", m_sOutputUrl.c_str());

    Stream creation :

    m_pVideoAVStream = avformat_new_stream(m_pAVFormatContext, nullptr);
    m_pVideoAVStream->id = m_pAVFormatContext->nb_streams - 1;

    m_pAudioAVStream = avformat_new_stream(m_pAVFormatContext, nullptr);
    m_pAudioAVStream->id = m_pAVFormatContext->nb_streams - 1;

    Video stream setup :

    m_pVideoAVStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
    m_pVideoAVStream->codecpar->codec_id = AV_CODEC_ID_H264;
    m_pVideoAVStream->codecpar->width = nWidth;
    m_pVideoAVStream->codecpar->height = nHeight;
    m_pVideoAVStream->codecpar->format = AV_PIX_FMT_YUV420P;
    m_pVideoAVStream->codecpar->bit_rate = 10 * 1000 * 1000;
    m_pVideoAVStream->time_base = AVRational { 1, 1000 };

    m_pVideoAVStream->codecpar->extradata_size = int(nTotalSizeRequired);
    m_pVideoAVStream->codecpar->extradata = (uint8_t*)av_malloc(m_pVideoAVStream->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
    // Fill in the extradata here - I'm sure I'm doing that correctly.

    Audio stream setup :

    m_pAudioAVStream->time_base = AVRational { 1, 1000 };
    // Let's leave creation of m_pAudioCodecContext out of the scope of this question, I'm quite sure everything is done right there.
    const int nAudioCodecCopyParamsError = avcodec_parameters_from_context(m_pAudioAVStream->codecpar, m_pAudioCodecContext);

    Opening the connection :

    const int nAVioOpenError = avio_open2(&m_pAVFormatContext->pb, m_sOutputUrl.c_str(), AVIO_FLAG_WRITE);

    Starting the stream :

    AVDictionary * pOptions = nullptr;
    const int nWriteHeaderError = avformat_write_header(m_pAVFormatContext, &pOptions);

    Sending a video frame :

    AVPacket pkt = { 0 };
    av_init_packet(&pkt);
    pkt.dts = nTimestamp;
    pkt.pts = nTimestamp;
    pkt.duration = nDuration; // I know what I have the wrong duration sometimes, but I don't think that's the issue.
    pkt.data = pFrameData;
    pkt.size = pFrameDataSize;
    pkt.flags = bKeyframe ? AV_PKT_FLAG_KEY : 0;
    pkt.stream_index = m_pVideoAVStream->index;
    const int nWriteFrameError = av_write_frame(m_pAVFormatContext, &pkt); // This is where too much time is spent.

    Sending an audio frame :

    AVPacket pkt = { 0 };
    av_init_packet(&pkt);
    pkt.pts = m_nTimestampMs;
    pkt.dts = m_nTimestampMs;
    pkt.duration = m_nDurationMs;
    pkt.stream_index = m_pAudioAVStream->index;
    const int nWriteFrameError = av_write_frame(m_pAVFormatContext, &pkt);

    Any ideas ? Am I on the right track with thinking about the Acknowledgement Window ? Am I doing something else completely wrong ?

  • How can I make ffmpeg open my raw video file ?

    5 février 2017, par Mandy Weiss

    I’m trying to convert a raw video-only file to some other formats but all I’m getting ffmpeg to produce is a black video.
    There are no error messages displayed and this is what ffprobe shows when analyzing the file :

    ffprobe version 3.2.2 Copyright (c) 2007-2016 the FFmpeg developers
    built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
    configuration : —prefix=/usr/local/Cellar/ffmpeg/3.2.2 —enable-shared
    —enable-pthreads —enable-gpl —enable-version3 —enable-hardcoded-tables —enable-avresample —cc=clang —host-cflags= —host-ldflags= —enable-libmp3lame —enable-libx264 —enable-libxvid —enable-opencl —disable-lzma —enable-vda libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 /
    57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 /
    4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, avi, from ’1.avi’ : Metadata :
    encoder : Lavf54.20.4 Duration : 00:00:57.43, start : 0.000000, bitrate : 83196 kb/s
    Stream #0:0 : Video : rawvideo, pal8, 720x480, 83238 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc

    Other input files can be transcoded to a playable outfile file with the same ffmpeg convert command :

    ffmpeg -i 1.avi -vcodec h264 output.avi

    I know the input video is not corrupted because VLC plays it successfully and can even convert it to other formats, but I want to preserve the original one when trying different configurations using ffmpeg.

    Thanks in advance for helping !

  • Adding 'timeout' flag to ffprobe/ffmpeg causes it to fail immediately

    23 janvier 2017, par user779159

    If I run ffprobe -timeout 20 -v trace -print_format json -show_format -show_streams 'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_2mb.mp4', the command fails immediately with a Connection timed out error even though I set the timeout to 20 seconds. It doesn’t wait anywhere near 20 seconds, just exits right away with an exit code of 1. Here’s the trace output.

    ffprobe version 3.2.2 Copyright (c) 2007-2016 the FFmpeg developers
     built with gcc 6.2.1 (GCC) 20160830
     configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    {
    [http @ 0x5598e7df1e20] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
    [http @ 0x5598e7df1e20] request: GET /video/mp4/720/big_buck_bunny_720p_2mb.mp4 HTTP/1.1
    User-Agent: Lavf/57.56.100
    Accept: */*
    Range: bytes=0-
    Connection: close
    Host: www.sample-videos.com
    Icy-MetaData: 1


    http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_2mb.mp4: Connection timed out

    }

    If I remove the -timeout 20 flag the command works fine. How can I get ffprobe to work with timeouts ?