Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (97)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (9589)

  • Using ffmpeg to generate dash manifest and it cannot be played by dash.js

    18 mars 2019, par Punkhead

    I’m using ffmpeg to encode incoming stream via rtmp protocol, the code as following :

    ffmpeg -re -i rtmp://localhost:1935${StreamPath} -use_timeline 1 /
    -use_template 1 -window_size 10 -min_seg_duration 5000 -f dash out.mpd

    The manifest looks like this :

    <?xml version="1.0" encoding="utf-8"?>
    <mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT1M36.4S" minbuffertime="PT8.3S">
       <programinformation>
       </programinformation>
       <period start="PT0.0S">
           <adaptationset contenttype="video" segmentalignment="true" bitstreamswitching="true" framerate="30/1">
           <representation mimetype="video/mp4" codecs="avc1.640028" width="1920" height="1080" framerate="30/1">
               <segmenttemplate timescale="15360" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="4">
                   <segmenttimeline>
                       <s t="384000" d="128000"></s>
                       <s d="71680"></s>
                       <s d="128000" r="4"></s>
                       <s d="56832"></s>
                       <s d="128000"></s>
                       <s d="72704"></s>
                   </segmenttimeline>
               </segmenttemplate>
           </representation>
       </adaptationset>
       <adaptationset contenttype="audio" segmentalignment="true" bitstreamswitching="true">
           <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audiosamplingrate="44100">
               <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
               <segmenttemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="4">
                   <segmenttimeline>
                       <s t="1099755" d="367616"></s>
                       <s d="205824"></s>
                       <s d="367616" r="4"></s>
                       <s d="162816"></s>
                       <s d="367616"></s>
                       <s d="207872"></s>
                   </segmenttimeline>
               </segmenttemplate>
           </representation>
       </adaptationset>
    </period>
    </mpd>

    When I try to play it on dash.js player, a error occured :

    [112] Parsing complete: ( xml2json: 3.50ms, objectiron: 1.76ms, total: 0.00526s) Debug.js:127
    [116] SegmentTimeline detected using calculated Live Edge Time Debug.js:127
    [118] MediaSource attached to element.  Waiting on open... Debug.js:127
    [119] Manifest has been refreshed at Tue Jan 02 2018 01:57:35 GMT+0800 [1514829455.1] Debug.js:127
    [155] MediaSource is open! Debug.js:127
    [156] Duration successfully set to: 96.4 Debug.js:127
    [157] Added 0 inline events Debug.js:127
    [158] video codec: video/mp4;codecs="avc1.640028" Stream.js:225
    Uncaught TypeError: Cannot read property 'type' of null
       at z (Stream.js:225)
       at C (Stream.js:285)
       at D (Stream.js:373)
       at E (Stream.js:398)
       at Object.d [as activate] (Stream.js:107)
       at y (StreamController.js:363)
       at MediaSource.c (StreamController.js:342)

    then it fails to playback...

    Is it because I didn’t set the parameters right on ffmpeg or this is a bug in dash.js ?

    I really stuck here !

  • Haskell - Converting multiple images into a video file - ffmpeg-lights' frameWriter-function fails

    26 octobre 2017, par oRole

    Situation
    Currently I am working on an application for image-processing that uses ffmpeg-light to fetch all the frames of a given video-file so that the program afterwards can apply grayscaling, as well as edge detection alogrithms to each of the frames.

    With the help of friendly stackoverflowers I was able to set up a method capable of converting several images into one video file using ffmpeg-lights’ frameWriter function.

    Problem
    The application runs fine to the moment it hits the frameWriterfunction and I don’t really know why as there are no errors or exception-messages thrown. (OS : Win 10 64bit)

    What did I try ?
    I tried..

    - different versions of ffmpeg (from 3.2 to 3.4).

    - ffmpeg.exe using the command line to test if there are any codecs missing, but any conversion I tried worked.

    - different EncodingParams-combinations : like.. EncodingParams width height fps (Nothing) (Nothing) "medium"

    Question
    Unfortunately, none of above worked and the web lacks on information to that specific case. Maybe I missed something essential (like ghc flags or something) or made a bigger mistake within my code. That is why I have to ask you : Do you have any suggestions/advice for me ?

    Haskell Packages

    - ffmpeg-light-0.12.0

    - JuicyPixels-3.2.8.3

    Code

    {--------------------------------------------------------------------------------------------
    Applies "juicyToFFmpeg'" and "getFPS" to a list of images and saves the output-video
    to a user defined location.
    ---------------------------------------------------------------------------------------------}    
    saveVideo :: String -> [Image PixelYA8] -> Int -> IO ()
    saveVideo path imgs fps = do
            -- program stops after hitting next line --
            frame &lt;- frameWriter ep path
            ------------------------------------------------
            Prelude.mapM_ (frame . Just) ffmpegImgs
            frame Nothing
            where ep = EncodingParams width height fps (Just avCodecIdMpeg4) (Just avPixFmtGray8a) "medium"
                  width      = toCInt $ imageWidth  $ head imgs
                  height     = toCInt $ imageHeight $ head imgs
                  ffmpegImgs = juicyToFFmpeg' imgs
                  toCInt x   = fromIntegral x :: CInt

    {--------------------------------------------------------------------------------------------
    Converts a single image from JuicyPixel-format to ffmpeg-light-format.
    ---------------------------------------------------------------------------------------------}      
    juicyToFFmpeg :: Image PixelYA8 -> (AVPixelFormat, V2 CInt, Vector CUChar)
    juicyToFFmpeg img = (avPixFmtGray8a, V2 (toCInt width) (toCInt height), ffmpegData)
                     where toCInt   x   = fromIntegral x :: CInt
                           toCUChar x   = fromIntegral x :: CUChar
                           width        = imageWidth img
                           height       = imageHeight img
                           ffmpegData   = VS.map toCUChar (imageData img)

    {--------------------------------------------------------------------------------------------
    Converts a list of images from JuicyPixel-format to ffmpeg-light-format.
    ---------------------------------------------------------------------------------------------}                        
    juicyToFFmpeg' :: [Image PixelYA8] -> [(AVPixelFormat, V2 CInt, Vector CUChar)]
    juicyToFFmpeg' imgs = Prelude.foldr (\i acc -> acc++[juicyToFFmpeg i]) [] imgs

    {--------------------------------------------------------------------------------------------
    Simply calculates the FPS for image-to-video conversion.
    -> frame :: (Double, DynamicImage) where Double is a timestamp of when it got extracted
    ---------------------------------------------------------------------------------------------}
    getFPS :: [(Double, DynamicImage)] -> Int
    getFPS frames = div (ceiling $ lastTimestamp - firstTimestamp) frameCount :: Int
                 where firstTimestamp = fst $ head frames
                       lastTimestamp  = fst $ last frames
                       frameCount     = length frames
  • 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;