Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (86)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (6368)

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

  • 3 million downloads for Piwik Analytics

    11 janvier 2017, par Matthieu Aubry — Community

    A testament to the power of our mission statement…

    “To create, as a community, the leading international open source digital analytics platform, that gives every user full control of their data.”

    … Piwik has been downloaded more than 3 million times !

    Piwik is the most popular open analytics platform

    Piwik is the number one most popular open analytics platform, used on more than 1 million websites in 200 different countries, and the 7th overall most popular analytics tool.

    Together we can make Piwik even better !

    Piwik is a community project. We are so proud of what we have created and would love your help too ! Help us by filling in our community survey (takes just 5 minutes !), by getting involved or becoming a sponsor.

    Thank you so much for using Piwik and respecting privacy while keeping control of your data.

    Happy Analytics !

  • Getting "TypeError : must be real number, not NoneType" whenever trying to run write_videofile to a clip in moviepy

    9 novembre 2024, par Sato

    Example code :

    


    from moviepy.editor import *
clip = VideoFileClip('video.mp4')
clip.write_videofile('video2.mp4', fps=30)


    


    After showing the following messages, showing that the video is being built and written,

    


    Moviepy - Building video video2.mp4.
Moviepy - Writing video video2.mp4


    


    The following error message occurs :

    


    Traceback (most recent call last):&#xA;  File "<stdin>", line 1, in <module>&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration&#xA;    return f(clip, *a, **k)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 135, in use_clip_fps_by_default&#xA;    return f(clip, *new_a, **new_kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB&#xA;    return f(clip, *a, **k)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\VideoClip.py", line 300, in write_videofile&#xA;    ffmpeg_write_video(self, filename, fps, codec,&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 213, in ffmpeg_write_video&#xA;    with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 88, in __init__&#xA;    &#x27;-r&#x27;, &#x27;%.02f&#x27; % fps,&#xA;TypeError: must be real number, not NoneType&#xA;</module></stdin>

    &#xA;

    This occurs whenever I try to perform write_videofile to any kinds of clip in moviepy. It is strange since the exact same code worked for me yesterday, but suddenly not anymore today. Are there any suggestions what the cause is and how to resolve this ?

    &#xA;