Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (61)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

Sur d’autres sites (12551)

  • Merge commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’

    15 novembre 2013, par Michael Niedermayer
    Merge commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’
    

    * commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’ :
    lavc : Edge emulation with dst/src linesize

    Conflicts :
    libavcodec/cavs.c
    libavcodec/h264.c
    libavcodec/hevc.c
    libavcodec/mpegvideo_enc.c
    libavcodec/mpegvideo_motion.c
    libavcodec/rv34.c
    libavcodec/svq3.c
    libavcodec/vc1dec.c
    libavcodec/videodsp.h
    libavcodec/videodsp_template.c
    libavcodec/vp3.c
    libavcodec/vp8.c
    libavcodec/wmv2.c
    libavcodec/x86/videodsp.asm
    libavcodec/x86/videodsp_init.c

    Changes to the asm are not merged, they are left for volunteers or
    in their absence for later.
    The changes this merge introduces are reordering of the function
    arguments

    See : face578d56c2d1375e40d5e2a28acc122132bc55
    Merged-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavcodec/cavs.c
    • [DH] libavcodec/diracdec.c
    • [DH] libavcodec/h264.c
    • [DH] libavcodec/hevc.c
    • [DH] libavcodec/mpegvideo.c
    • [DH] libavcodec/mpegvideo_enc.c
    • [DH] libavcodec/mpegvideo_motion.c
    • [DH] libavcodec/rv34.c
    • [DH] libavcodec/snow.c
    • [DH] libavcodec/svq3.c
    • [DH] libavcodec/vc1dec.c
    • [DH] libavcodec/videodsp.h
    • [DH] libavcodec/videodsp_template.c
    • [DH] libavcodec/vp3.c
    • [DH] libavcodec/vp56.c
    • [DH] libavcodec/vp8.c
    • [DH] libavcodec/vp9.c
    • [DH] libavcodec/wmv2.c
    • [DH] libavcodec/x86/dsputil_mmx.c
    • [DH] libavcodec/x86/videodsp_init.c
  • Why is the last frame not showing in an MP4 generated by libav ?

    31 octobre 2023, par Ben

    Note : I have a working example of the problem here.

    &#xA;

    I'm using the libav/ffmpeg API to generate an MP4 with the h264 codec. In my specific situation I'm generating the files with a max number of 2 "B" frames. I'm able to generate an Mp4 with the right number of frames so that a single, lone "B" frame is the very last frame being written. When this happens, the encoder sets that frame's packet to be discarded (I've verified this with ffprobe). The net result is that some players (say, when dropping the MP4 into Edge or Chrome) will display only n-1 total frames (ignoring the discarded packet). Other players, such as VLC, will play the full n frames (not ignoring the discarded packet). So, the result is inconsistent.

    &#xA;

    ffmpeg.exe itself doesn't appear to have this problem. Instead, it will set what would be the lone "B" frame to a "P" frame. This means the file will play the same regardless of what player is used.

    &#xA;

    The problem is : I don't know how to mimic ffmpeg's behavior using the SDK so the last frame will play regardless of the player. As far as I can tell I'm closing out the file properly by flushing out the encoder buffers. I must be doing something wrong somewhere.

    &#xA;

    I provided a link to the full source above, but at a high level I'm initializing the codec context and stream like this :

    &#xA;

    newStream->codecpar->codec_id = AV_CODEC_ID_H264;&#xA;newStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;newStream->codecpar->width = Width;&#xA;newStream->codecpar->height = Height;&#xA;newStream->codecpar->format = AV_PIX_FMT_YUV420P;&#xA;newStream->time_base = { 1, 75 };&#xA;avcodec_parameters_to_context(codecContext, newStream->codecpar);&#xA;&#xA;&#xA;codecContext->time_base = { 1, 75 };&#xA;codecContext->gop_size = 30;&#xA;

    &#xA;

    I then sit in a loop and use OpenCV to generate frames (each frame has its frame number drawn on it) :

    &#xA;

    auto matrix = cv::Mat(Height, Width, CV_8UC3, cv::Scalar(0, 0, 0));&#xA;&#xA;std::stringstream ss;&#xA;ss &lt;&lt; f; &#xA;&#xA;cv::putText(matrix, ss.str().c_str(), textOrg, fontFace, fontScale, cv::Scalar(255, 255, 255), thickness, 8);&#xA;

    &#xA;

    I then write out the frame like this (looping if more data is needed) :

    &#xA;

    if ((ret = avcodec_send_frame(codecContext, frame)) == 0) {&#xA;&#xA;   ret = avcodec_receive_packet(codecContext, &amp;pkt); &#xA;&#xA;   if (ret == AVERROR(EAGAIN))&#xA;   {&#xA;       continue; &#xA;   }&#xA;   else&#xA;   {&#xA;       av_interleaved_write_frame(pFormat, &amp;pkt);&#xA;   }&#xA;   av_packet_unref(&amp;pkt);&#xA;}&#xA;

    &#xA;

    And finally I flush out the file at the end like this :

    &#xA;

    if ((ret = avcodec_send_frame(codecContext, NULL)) == 0)&#xA;{&#xA;  for (;;)&#xA;  {&#xA;     if ((ret = avcodec_receive_packet(codecContext, &amp;pkt)) == AVERROR_EOF)&#xA;     {&#xA;       break;&#xA;     }&#xA;     else&#xA;     {&#xA;       ret = av_interleaved_write_frame(pFormat, &amp;pkt);&#xA;       av_packet_unref(&amp;pkt);&#xA;     }&#xA;  }&#xA;&#xA;  av_write_trailer(pFormat);&#xA;  avio_close(pFormat->pb);&#xA;}&#xA;

    &#xA;

    Yet when I play in Chrome, the player ends on frame 6758,

    &#xA;

    enter image description here

    &#xA;

    And in VLC, the player ends on frame 6759.

    &#xA;

    enter image description here

    &#xA;

    What am I doing wrong ?

    &#xA;

  • How to combine many m3u8 hls playlists into one using python

    16 juillet 2024, par Дмитрий Кравчук

    I have several videos of mp4 formats. I created HLS (playlists and segments) from them using this code

    &#xA;

    import ffmpeg&#xA;&#xA;input_file_path = "D:/Projects/test2.mp4"&#xA;output_playlist = "&#x27;D:/Projects/playlist.m3u8"&#xA;segment_time = 5&#xA;file_name = "test"&#xA;&#xA;ffmpeg.input(input_file_path).output(&#xA;    output_playlist,&#xA;    format=&#x27;hls&#x27;,&#xA;    hls_time=segment_time, &#xA;    hls_list_size=0,  &#xA;    hls_playlist_type=&#x27;vod&#x27;,&#xA;    hls_segment_type=&#x27;mpegts&#x27;,&#xA;    hls_segment_filename=f&#x27;D:/Projects/{file_name}_%03d.ts&#x27;, &#xA;    force_key_frames=f&#x27;expr:gte(t,n_forced*{segment_time})&#x27;&#xA;).run()&#xA;

    &#xA;

    Then I put segments to s3 storage and save m3u8 playlist structure for each video in database.

    &#xA;

    Now I need on some request combine some video that appropriate user's criteria as one full video and return it. I suppose that I could just combine one common playlist using the videos playlists but it failed. I used this code for this

    &#xA;

    from m3u8 import loads, &#xA;&#xA;video_one_m3u8 = """&#xA;#EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:10&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXT-X-PLAYLIST-TYPE:VOD&#xA;#EXTINF:10.166667,&#xA;test1_000.ts&#xA;#EXTINF:6.166667,&#xA;test1_001.ts&#xA;#EXTINF:6.433333,&#xA;test1_002.ts&#xA;#EXT-X-ENDLIST&#xA;"""&#xA;&#xA;video_two_m3u8 = """&#xA;#EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:8&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXT-X-PLAYLIST-TYPE:VOD&#xA;#EXTINF:8.000000,&#xA;test2_000.ts&#xA;#EXTINF:8.333333,&#xA;test2_001.ts&#xA;#EXTINF:5.533333,&#xA;test2_002.ts&#xA;#EXT-X-ENDLIST&#xA;"""&#xA;&#xA;playlist1 = loads(video_one_m3u8)&#xA;playlist2 = loads(video_two_m3u8)&#xA;&#xA;combinedPlaylist = M3U8()&#xA;combinedPlaylist.segments.extend(playlist2.segments)&#xA;combinedPlaylist.segments.extend(playlist1.segments)&#xA;&#xA;combinedPlaylist.version = playlist1.version&#xA;combinedPlaylist.target_duration = max(playlist1.target_duration, playlist2.target_duration)&#xA;combinedPlaylist.is_endlist = True&#xA;&#xA;with open(r"D:\Projects\playlist_test.m3u8", "w") as f:&#xA;    f.writelines(combinedPlaylist.dumps())&#xA;

    &#xA;

    The result of combined m3u8 playlist is below

    &#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:10&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXT-X-PLAYLIST-TYPE:VOD&#xA;#EXTINF:10.166667,&#xA;test1_000.ts&#xA;#EXTINF:6.166667,&#xA;test1_001.ts&#xA;#EXTINF:6.433333,&#xA;test1_002.ts&#xA;#EXTINF:8.000000,&#xA;test2_000.ts&#xA;#EXTINF:8.333333,&#xA;test2_001.ts&#xA;#EXTINF:5.533333,&#xA;test2_002.ts&#xA;#EXT-X-ENDLIST&#xA;

    &#xA;

    When launch this playlist in VLS it works until the edge of another video then it crashes. The VLS log shows this errors

    &#xA;

    main error: Timestamp conversion failed for 5433334: no reference clock&#xA;main error: Could not convert timestamp 0 for FFmpeg&#xA;ts error: libdvbpsi error (PSI decoder): TS discontinuity (received 0, expected 5) for PID 17&#xA;ts error: libdvbpsi error (PSI decoder): TS discontinuity (received 0, expected 5) for PID 0&#xA;ts error: libdvbpsi error (PSI decoder): TS discontinuity (received 0, expected 5) for PID 4096&#xA;direct3d11 error: SetThumbNailClip failed: 0x800706f4&#xA;

    &#xA;

    I trying to solve this problem of timestamps while preparing initial video playlists using ffmpeg.output argumets (start_at_zero=True and reset_timestamps) but it doesn't help.
    &#xA;Also I was trying to add tag EXT-X-DISCONTINUITY, it works but the video plays as separate (each starts from the beggining) not as common.

    &#xA;