Recherche avancée

Médias (91)

Autres articles (41)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

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

Sur d’autres sites (9123)

  • How to make HLS start from the begining

    15 septembre 2020, par Ariel Argañaraz

    I need some help with HLS streaming, I'm trying to create a playlist for streaming,

    



    I'm using ffmpeg to generate the files and the .m3u8 files. And for playing i'm using a web page with videojs player

    



    The idea is to simulate a live streaming using files already created.

    



    The problem is that in some version of iphone works and in another does not work.
The problem is that when I start play the video in the Safari browser of my phone it freezes for a while and then download and play the last segment.

    



    for example if the video is split in 4 differents .ts files.
It starts playing from the 4th .ts file and then stop.

    



    The problem is that I have 2 iphone mobile phone, one of them works perfectly but the other one not

    



    The not working cell phone is a iphone 6 (version 9.2.1)

    



    Here is my m3u8 file. Note that I'm using the #EXT-X-PLAYLIST-TYPE:EVENT and I remove the #EXT-X-ENDLIST from the botton. So it should be played as an live streaming.

    



    It works for another phones, it begins from the 0 second when I set the #EXT-X-START:TIME-OFFSET=0

    



    but in this version (9.2.1) the video freezes and then jumps to the last segment (webinar-3.ts) plays that segment and finally stop.

    



    #EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-START:TIME-OFFSET=0
#EXT-X-TARGETDURATION:6
#EXTINF:5.046444,
webinar-0.ts
#EXTINF:5,
webinar-1.ts
#EXTINF:5,
webinar-2.ts
#EXTINF:5,
webinar-3.ts


    



    Have anybody got an idea of what i'm doing wrong or how to get a m3u8 config that works for this iphone version ?

    


  • What are supported ffmpeg rtp_mpegts Muxer options ? (mpegts Muxer options are ignored)

    7 mars 2020, par drake7

    I created a UDP stream with -f mpegts and some options like -mpegts_transport_stream_id.

    I received the stream with "StreamXpert - Real-time stream analyzer" that shows all options are in the output. See my ffmpeg parameters and the StreamXpert at the end.

    The same Muxer options seem to be ignored with -f rtp_mpegts.

    I have tried to use -f mpegts and pipe it to -f rtp_mpegts like so :

    ffmpeg -i ... -f mpegts pipe: | ffmpeg pipe: -c copy -f rtp_mpegts "rtp://239.1.1.9:1234?pkt_size=1316"

    The options are still ignored.

    This ticket "support options for MPEGTS muxer when using RTP_MPEGTS" also notices the ignored option. Furthermore in this comment, "thovo" gives an analysis and suggests a solution.

    Obviously the problem still exists. Anybody found a workaround for this ?

    My additional question : I have not questioned if my project really needs rtp in the first place. Maybe my coworker didn’t know better and requested rtp when udp would be sufficient as well.

    The aim was to receive the RTP stream with a TV using DVB via IP. This was successful an a Panasonic TV.

    The SAT>IP Specification on page 10 requires rtp for Media Transport :

    The SAT>IP protocol makes use of :

    • UPnP for Addressing, Discovery and Description,
    • RTSP or HTTP for Control,
    • RTP or HTTP for Media Transport.

    Is udp out of the equation ?


    ffmpeg : (all options are in the output with -f mpegts)

    (HEX to decimal : 0x005A = 90, 0x005B = 91 0x005C = 92, 0x005D = 93, 0x005E= 94)

    ffmpeg -f lavfi -i testsrc \
    -r 25 \
    -c:v libx264 \
    -pix_fmt yuv420p \
    -profile:v main -level 3.1 \
    -preset veryfast \
    -vf scale=1280:720,setdar=dar=16/9 \
    -an \
    -bsf:v h264_mp4toannexb \
    -flush_packets 0 \
    -b:v 4M \
    -muxrate 8M \
    -pcr_period 20 \
    -pat_period 0.10 \
    -sdt_period 0.25 \
    -metadata:s:a:0 language=nya \
    -mpegts_flags +pat_pmt_at_frames \
    -mpegts_transport_stream_id 0x005A \
    -mpegts_original_network_id 0x005B \
    -mpegts_service_id 0x005C \
    -mpegts_pmt_start_pid 0x005D \
    -mpegts_start_pid 0x005E \
    -mpegts_service_type advanced_codec_digital_hdtv \
    -metadata service_provider='WI' \
    -metadata service_name='W' \
    -mpegts_flags system_b -flush_packets 0 \
    -f mpegts "udp://239.1.1.10:1234?pkt_size=1316"

    StreamXpert Output :

    -mpegts_transport_stream_id = Transport Stream ID (yellow text highlight)

    -mpegts_original_network_id = Original Network ID, onw (green text highlight)

    -mpegts_service_id = Program, service (pink text highlight)

    -mpegts_pmt_start_pid = PMT PID, Table PID (turquoise text highlight)

    -mpegts_start_pid = PID, PCR PID (red text highlight)

    -mpegts_service_type = service type (blue text)

    service_name = Service name (orange text)

    service_provider = Service provider (pink text)

    enter image description here

  • How to create video using avcodec from jpeg images of type OpenCV::Mat ?

    23 juillet 2015, par theateist

    I have colored jpeg images of OpenCV::Mat type and I create from them video using avcodec. The video that I get is upside-down, black & white and each row of each frame is shifted and I got diagonal line. What could be the reason for such output ?
    Follow this link to watch the video I get using avcodec.
    I’m using acpicture_fill function to create avFrame from cv::Mat frame !

    P.S.
    Each cv::Mat cvFrame has width=810, height=610, step=2432
    I noticed that avFrame (that is filled by acpicture_fill) has linesize[0]=2430
    I tried manually setting avFrame->linesizep0]=2432 and not 2430 but it still didn’t helped.

    ======== CODE =========================================================

    AVCodec *encoder = avcodec_find_encoder(AV_CODEC_ID_H264);
    AVStream *outStream = avformat_new_stream(outContainer, encoder);
    avcodec_get_context_defaults3(outStream->codec, encoder);

    outStream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
    outStream->codec->width = 810;
    outStream->codec->height = 610;
    //...

    SwsContext *swsCtx = sws_getContext(outStream->codec->width, outStream->codec->height, PIX_FMT_RGB24,
                                       outStream->codec->width, outStream->codec->height,  outStream->codec->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);

    for (uint i=0; i < frameNums; i++)
    {
       // get frame at location I using OpenCV
       cv::Mat cvFrame;
       myReader.getFrame(cvFrame, i);
       cv::Size frameSize = cvFrame.size();    
       //Each cv::Mat cvFrame has  width=810, height=610, step=2432


    1.  // create AVPicture from cv::Mat frame
    2.  avpicture_fill((AVPicture*)avFrame, cvFrame.data, PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
    3avFrame->width = frameSize.width;
    4.  avFrame->height = frameSize.height;

       // rescale to outStream format
       sws_scale(swsCtx, avFrame->data, avFrame->linesize, 0, outStream->codec->height, avFrameRescaledFrame->data, avFrameRescaledFrame ->linesize);
    encoderRescaledFrame->pts=i;
    avFrameRescaledFrame->width = frameSize.width;
       avFrameRescaledFrame->height = frameSize.height;

    av_init_packet(&avEncodedPacket);
       avEncodedPacket.data = NULL;
       avEncodedPacket.size = 0;

       // encode rescaled frame
       if(avcodec_encode_video2(outStream->codec, &avEncodedPacket, avFrameRescaledFrame, &got_frame) < 0) exit(1);
       if(got_frame)
       {
           if (avEncodedPacket.pts != AV_NOPTS_VALUE)
               avEncodedPacket.pts =  av_rescale_q(avEncodedPacket.pts, outStream->codec->time_base, outStream->time_base);
           if (avEncodedPacket.dts != AV_NOPTS_VALUE)
               avEncodedPacket.dts = av_rescale_q(avEncodedPacket.dts, outStream->codec->time_base, outStream->time_base);

           // outContainer is "mp4"
           av_write_frame(outContainer, & avEncodedPacket);

           av_free_packet(&encodedPacket);
       }
    }

    UPDATED

    As @Alex suggested I changed the lines 1-4 with the code below

    int width = frameSize.width, height = frameSize.height;
    avpicture_alloc((AVPicture*)avFrame, AV_PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
    for (int h = 0; h < height; h++)
    {
        memcpy(&(avFrame->data[0][h*avFrame->linesize[0]]), &(cvFrame.data[h*cvFrame.step]), width*3);
    }

    The video (here) I get now is almost perfect. It’s NOT upside-down, NOT black & white, BUT it seems that one of the RGB components is missing. Every brown/red colors became blue (in original images it should be vice-verse).
    What could be the problem ? Could rescaling(sws_scale) to AV_PIX_FMT_YUV420P format causes this ?