Recherche avancée

Médias (91)

Autres articles (68)

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

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (2425)

  • 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

    


    import ffmpeg

input_file_path = "D:/Projects/test2.mp4"
output_playlist = "'D:/Projects/playlist.m3u8"
segment_time = 5
file_name = "test"

ffmpeg.input(input_file_path).output(
    output_playlist,
    format='hls',
    hls_time=segment_time, 
    hls_list_size=0,  
    hls_playlist_type='vod',
    hls_segment_type='mpegts',
    hls_segment_filename=f'D:/Projects/{file_name}_%03d.ts', 
    force_key_frames=f'expr:gte(t,n_forced*{segment_time})'
).run()


    


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

    


    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

    


    from m3u8 import loads, 

video_one_m3u8 = """
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:10.166667,
test1_000.ts
#EXTINF:6.166667,
test1_001.ts
#EXTINF:6.433333,
test1_002.ts
#EXT-X-ENDLIST
"""

video_two_m3u8 = """
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:8.000000,
test2_000.ts
#EXTINF:8.333333,
test2_001.ts
#EXTINF:5.533333,
test2_002.ts
#EXT-X-ENDLIST
"""

playlist1 = loads(video_one_m3u8)
playlist2 = loads(video_two_m3u8)

combinedPlaylist = M3U8()
combinedPlaylist.segments.extend(playlist2.segments)
combinedPlaylist.segments.extend(playlist1.segments)

combinedPlaylist.version = playlist1.version
combinedPlaylist.target_duration = max(playlist1.target_duration, playlist2.target_duration)
combinedPlaylist.is_endlist = True

with open(r"D:\Projects\playlist_test.m3u8", "w") as f:
    f.writelines(combinedPlaylist.dumps())


    


    The result of combined m3u8 playlist is below

    


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


    


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

    


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


    


    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.
    
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.

    


  • How can I develop Image recognition program

    18 juillet 2017, par SeongHyun Lee

    My program will recognize the advertisement between each TV Programs.
    But I don’t know how to recognize the ads.
    I had Sound Recognition in mind but It’s so difficult.
    I’m using FFmpeg Library.
    There is VideoState struct Reference.

    typedef struct VideoState {
    SDL_Thread *read_tid;
    SDL_Thread *video_tid;
    SDL_Thread *refresh_tid;
    AVInputFormat *iformat;
    int no_background;
    int abort_request;
    int force_refresh;
    int paused;
    int last_paused;
    int que_attachments_req;
    int seek_req;
    int seek_flags;
    int64_t seek_pos;
    int64_t seek_rel;
    int read_pause_return;
    AVFormatContext *ic;

    int audio_stream;

    int av_sync_type;
    double external_clock; /* external clock base */
    int64_t external_clock_time;

    double audio_clock;
    double audio_diff_cum; /* used for AV difference average computation */
    double audio_diff_avg_coef;
    double audio_diff_threshold;
    int audio_diff_avg_count;
    AVStream *audio_st;
    PacketQueue audioq;
    int audio_hw_buf_size;
    DECLARE_ALIGNED(16,uint8_t,audio_buf2)[AVCODEC_MAX_AUDIO_FRAME_SIZE * 4];
    uint8_t silence_buf[SDL_AUDIO_BUFFER_SIZE];
    uint8_t *audio_buf;
    uint8_t *audio_buf1;
    unsigned int audio_buf_size; /* in bytes */
    int audio_buf_index; /* in bytes */
    int audio_write_buf_size;
    AVPacket audio_pkt_temp;
    AVPacket audio_pkt;
    struct AudioParams audio_src;
    struct AudioParams audio_tgt;
    struct SwrContext *swr_ctx;
    double audio_current_pts;
    double audio_current_pts_drift;
    int frame_drops_early;
    int frame_drops_late;
    AVFrame *frame;

    enum ShowMode {
       SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES,
    SHOW_MODE_RDFT, SHOW_MODE_NB
    } show_mode;
    int16_t sample_array[SAMPLE_ARRAY_SIZE];
    int sample_array_index;
    int last_i_start;
    RDFTContext *rdft;
    int rdft_bits;
    FFTSample *rdft_data;
    int xpos;

    SDL_Thread *subtitle_tid;
    int subtitle_stream;
    int subtitle_stream_changed;
    AVStream *subtitle_st;
    PacketQueue subtitleq;
    SubPicture subpq[SUBPICTURE_QUEUE_SIZE];
    int subpq_size, subpq_rindex, subpq_windex;
    SDL_mutex *subpq_mutex;
    SDL_cond *subpq_cond;

    double frame_timer;
    double frame_last_pts;
    double frame_last_duration;
    double frame_last_dropped_pts;
    double frame_last_returned_time;
    double frame_last_filter_delay;
    int64_t frame_last_dropped_pos;
    double video_clock;                          ///< pts of last decoded frame
    / predicted pts of next decoded frame
    int video_stream;
    AVStream *video_st;
    PacketQueue videoq;
    double video_current_pts;                    ///< current displayed pts
    (different from video_clock if frame fifos are used)
    double video_current_pts_drift;              ///< video_current_pts - time
    (av_gettime) at which we updated video_current_pts - used to have running
    video pts
    int64_t video_current_pos;                   ///< current displayed file pos
    VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
    int pictq_size, pictq_rindex, pictq_windex;
    SDL_mutex *pictq_mutex;
    SDL_cond *pictq_cond;
    #if !CONFIG_AVFILTER
    struct SwsContext *img_convert_ctx;
    #endif

    char filename[1024];
    int width, height, xleft, ytop;
    int step;

    #if CONFIG_AVFILTER
    AVFilterContext *in_video_filter;           ///< the first filter in the
    video chain
    AVFilterContext *out_video_filter;          ///< the last filter in the
    video chain
    int use_dr1;
    FrameBuffer *buffer_pool;
    #endif

    int refresh;
    int last_video_stream, last_audio_stream, last_subtitle_stream;

    SDL_cond *continue_read_thread;

    enum V_Show_Mode v_show_mode;
    } VideoState;

    What can I use for My Program.... I really need your help.. Thank you !!!

  • Revision 37300 : On documente cet inclure On lui ajoute une option et on corrige certaines ...

    15 avril 2010, par kent1@… — Log

    On documente cet inclure
    On lui ajoute une option et on corrige certaines erreurs