Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (16)

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

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (4018)

  • FFMPEG Audio/Video out of sync after transcoding video in segments

    25 mai 2017, par Idan

    My system transcodes videos in a very specific way.

    1. separating the video and the audio
    2. transcoding the audio stream
    3. segmenting the video
    4. transcoding each of the segments of the video
    5. concat all segments back to 1 video
    6. merging the new transcoded video and audio back together

    While at 99% of the times the process works as it should and the result is a valid video+audio file. in 1% of the times, I get the video and audio out of sync.

    When investigated the issue I noticed that the sync issue appears in a specific segment/s. Meaning, if the video was sliced into 100 segments, the sync can be ok for the first 50 segments, then something happens and the audio or video gets an offset and goes out of sync. It can occur in any number of segments in one video.

    I guess it’s something to do with timestamps getting lost in the process and segments changing their length in the process but I have no idea how I can overcome it. Open for suggestions.

    The commands I use for each step (paths were shorten and may not match, not real issue there) :

    Segmenting the video :

    ffmpeg -fflags +genpts -i $INPUT_FILE -c copy -map 0:0 -flags -global_header -segment_time 10 -break_non_keyframes 0 -reset_timestamps 1 -segment_list segments.list -segment_list_type ffconcat -write_empty_segments 0 -segment_format mp4 -f segment seg-%d.mp4

    Transcoding audio :

    ffmpeg -i $INPUT_FILE  -vn -c:a aac -threads 1 -ac 2 -b:a 125588 audio.mp4

    Transcoding each of the segments :

    ffmpeg -y -i $f -an -vcodec libx264 -threads 4 -r 30 -pix_fmt yuv420p -crf 20 -preset:v fast -profile:v main -level:v 4.1 transcoded/$f

    Concat segments :

    ffmpeg -y -f concat -i segments.list  -c copy -movflags +faststart file_video.mp4

    Combine video and audio :

    ffmpeg -y -i file_video.mp4 -i file_audio.mp4 -c copy -shortest file_out.mp4
  • OpenCV+ffmpeg : Set max_analyze_duration ?

    3 avril 2013, par Christian Jonassen
    import sys
    import cv

    video = "http://192.168.1.15:8000/video.mjpg" # from motion
    capture = cv.CaptureFromFile(video)
    print capture
    cv.NamedWindow('Stream', 1 )

    while True:
     frame = cv.QueryFrame(capture)

     if frame is None:
       print "No frame, exiting program"
       break
     else:
       cv.ShowImage('Stream', frame)
       cv.WaitKey(20)

    , which sort of works. Meaning that after a while, I get

    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    [mjpeg @ 0xb46720] max_analyze_duration reached
    [mjpeg @ 0xb46720] Estimating duration from bitrate, this may be inaccurate
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    [mjpeg @ 0xb46720] max_analyze_duration reached
    [mjpeg @ 0xb46720] Estimating duration from bitrate, this may be inaccurate
    <capture 0x7f0aed25c630="0x7f0aed25c630">
    </capture>

    The stream then works fine (it's a bit speedy in the start).

    It makes sense : FFMPEG finds the stream mysterious, and therefore analyzes it for the maximum duration, which makes the buffer full, and hence the speediness at the start. Now, is there a way I can (without recompiling FFMPEG) set max_analyze_duration, or otherwise pass some hints to FFMPEG so that it doesn't analyse the stream until max_analyze_duration has passed ?

    The stream is from the motion program : an MJPEG stream of 10 FPS with 640x480.

  • FFMPEG libraries : Bitstream "h264_mp4toannexb" filter does not work

    25 décembre 2013, par user2677612

    We are using FFmpeg libraries git-ee94362 libavformat v55.2.100. Our purpose is to mux two streams (video and audio) into M3U8 playlist using HLS.

    We are using AV_CODEC_ID_H264 output encoder, AV_PIX_FMT_YUV420P output video pixel format and CODEC_FLAG_GLOBAL_HEADER flag for the encoder.

    The last causes us to use "h264_mp4toannexb" bit stream filter.

    So, here is the code snippet :

    AVPacket outpkt = {0};
    int isGotVideoPacket = 0;

    av_init_packet(&amp;outpkt);

    out_video_frame->pts = (int64_t) (video_frame_count * in_video_frame_duration / av_q2d(out_video_stream->time_base));

    int ret = avcodec_encode_video2(enc_out_video_ctx, &amp;outpkt, out_video_frame[i], &amp;isGotVideoPacket);

    assert(0 &lt;= ret);

    if ((1 == isGotVideoPacket) &amp;&amp; (0 &lt; outpkt.size)) {

        AVPacket new_outpkt = outpkt;

        if ((AVBitStreamFilterContext*) 0 != vbsf_ctx) {
             AVPacket new_outpkt = outpkt;

              ret = av_bitstream_filter_filter(vbsf_ctx, enc_out_video_ctx, (const char*)0, &amp;new_outpkt.data, &amp;new_outpkt.size, outpkt.data, outpkt.size, outpkt.flags &amp; AV_PKT_FLAG_KEY);

              if (ret > 0)
              {
                 outpkt = new_outpkt;
              }
              else
              {
                 // We get ret = -22
                 char errbuf[128] = "";

                 // Both the functions get "Error number -22 occurred" that don&#39;t explain anything
                 av_strerror (ret, errbuf, 128);
                 av_make_error_string (errbuf, 128, ret);          
               }

               assert(0 &lt;= ret);

        }

        outpkt->stream_index = output_video_stream->index;

        // If to comment av_bitstream_filter_filter() and "if-else", then
        // At frame #37 we get the following error from av_interleaved_write_frame():
        // [mpegts @ 09628140] H.264 bitstream malformed, no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb).
        ret = av_interleaved_write_frame(ofmt_ctx, &amp;outpkt);

        assert(0 &lt;= ret);                          
    }

    Our questions :

    1. What is the meaning of the "-22" error from av_bitstream_filter_filter()?
    2. Where can we get full FFMPEG error code description list?
    3. If we are using av_bitstream_filter_filter() right? If no, what is the right way?

    Andrey Mochenov.