Recherche avancée

Médias (91)

Autres articles (67)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (11105)

  • H264/MP4 live stream from ffmpeg does not work in browser

    22 septembre 2018, par paunescuionica

    I cannot visualize a H264/MP4 stream generated by ffmpeg in Chrome, IE, Edge. It works only in Firefox.

    My testing environment is Windows 10, all updates done, all browsers up to date.

    I have a source MJPEG stream, which I need to transcode to H264/MP4 and show it in browser in a HTML5 element.
    In order to provide a working example, I use here this MJPEG stream : http://200.36.58.250/mjpg/video.mjpg?resolution=320x240. In my real case I have MJPEG input from different sources like IP cameras.
    I use the following command line :

    ffmpeg.exe -use_wallclock_as_timestamps 1 -f mjpeg -i "http://200.36.58.250/mjpg/video.mjpg?resolution=320x240" -f mp4 -c:v libx264 -an -preset ultrafast -tune zerolatency -movflags frag_keyframe+empty_moov+faststart -reset_timestamps 1 -vsync 1 -flags global_header -r 15 "tcp ://127.0.0.1:5000 ?listen"

    If I try to visualize the output in VLC, I use this link : tcp ://127.0.0.1:5000 and it works.
    Then I try to visualize the stream in browser, so I put this into a html document :

    <video autoplay="autoplay" controls="controls">
    <source src="http://127.0.0.1:5000" type="video/mp4">
    </source></video>

    If I open the document in Firefox it works just fine.
    But it does not work when trying to open in Chrome, IE or Edge. It seems that the browser tries to connect to the TCP server exposed by ffmpeg, but something happens because ffmpeg exits after few seconds.

    In ffmpeg console I can see this :

    av_interleaved_write_frame(): Unknown error
    Error writing trailer of tcp://127.0.0.1:5000?listen: Error number -10053 occurred

    If I inspect the video element in Chrome is can see this error :

    Failed to load resource: net::ERR_INVALID_HTTP_RESPONSE

    As far as I know all these browsers should support H264 encoded streams transported in MP4 containers. If in the element I replace the link http://127.0.0.1:5000 with a local link to a mp4/H264 encoded file, it is played just fine in each browser. The problem seems to be related to live streaming.

    Does anyone know why this happens and how it can be solved ?

    Thank you !

  • How to make a MPEG-DASH MPD which starts the playback in the middle of the first segment ?

    18 septembre 2018, par ravin.wang

    Here are the reproduce steps :

    1. Normalize an H.264 video stream

      ffmpeg -i 2.h264 -c:v libx264 -intra -r 25 -vf scale=640x360,setdar=16:9 2@25fps@intra@640x360.h264

      (*) After that, I got an H.264 stream where all pictures are H.264 IDR frames, and fps is 25, resolution is 640x360, aspect-ratio is 16:9.

    2. Generate an MP4 file

      MP4Box -add 2@25fps@intra@640x360.h264:timescale=1000 -fps 25 2@25fps@intra@640x360.mp4

    3. Make dash MP4 fragmented content, including init mp4, .m4s files and one .mpd file

      MP4Box -dash 5000 -frag 5000 -dash-scale 1000 -frag-rap -segment-name ’seg_second$Number$’ -segment-timeline -profile live 2@25fps@intra@640x360.mp4

    4. Copy and publish all these files to a folder under one HTTPD server
    5. I want to play from 4s of the first segment, and don’t display any frames before 4s, so I changed the .MPD file to modify the fields "SegmentTemplate@presentationTimeOffset", "SegmentTimeline:S@d/t", like as :

      &lt;?xml version="1.0"?>
      <mpd xmlns="urn:mpeg:dash:schema:mpd:2011" minbuffertime="PT1.500S" type="static" mediapresentationduration="PT0H0M26.000S" maxsegmentduration="PT0H0M5.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
      <period duration="PT0H0M26.000S">
      <adaptationset segmentalignment="true" maxwidth="640" maxheight="360" maxframerate="25" par="16:9" lang="und">
       <segmenttemplate presentationtimeoffset="4000" media="seg_second$Number$.m4s" timescale="1000" startnumber="1" initialization="seg_secondinit.mp4">
         <segmenttimeline>
             <s d="1000" t="4000"></s>
             <s d="5000" r="4"></s>
         </segmenttimeline>
        </segmenttemplate>
      <representation mimetype="video/mp4" codecs="avc3.64101E" width="640" height="360" framerate="25" sar="1:1" startwithsap="1" bandwidth="2261831">
      </representation>
      </adaptationset>
      </period>
      </mpd>


    6. Play the MPD url from VLC player, or Edge browser, it always starts the the first frame of the first segment, the frames between 0s 4s are also displayed unexpectedly.

    What’s wrong with my steps ? Or any other options for it ?

  • How do I set ffmpeg pipe output ?

    5 décembre 2019, par mr_blond

    I need to read ffmpeg output as pipe.
    There is a code example :

       public static void PipeTest()
       {
           Process proc = new Process();
           proc.StartInfo.FileName = Path.Combine(WorkingFolder, "ffmpeg");
           proc.StartInfo.Arguments = String.Format("$ ffmpeg -i input.mp3 pipe:1");
           proc.StartInfo.UseShellExecute = false;
           proc.StartInfo.RedirectStandardInput = true;
           proc.StartInfo.RedirectStandardOutput = true;
           proc.Start();

           FileStream baseStream = proc.StandardOutput.BaseStream as FileStream;
           byte[] audioData;
           int lastRead = 0;

           using (MemoryStream ms = new MemoryStream())
           {
               byte[] buffer = new byte[5000];
               do
               {
                   lastRead = baseStream.Read(buffer, 0, buffer.Length);
                   ms.Write(buffer, 0, lastRead);
               } while (lastRead > 0);

               audioData = ms.ToArray();
           }

           using(FileStream s = new FileStream(Path.Combine(WorkingFolder, "pipe_output_01.mp3"), FileMode.Create))
           {
               s.Write(audioData, 0, audioData.Length);
           }
       }

    It’s log from ffmpeg, the first file is readed :

    Input #0, mp3, from ’norm.mp3’ :
    Metadata :
    encoder : Lavf58.17.103
    Duration : 00:01:36.22, start : 0.023021, bitrate : 128 kb/s
    Stream #0:0 : Audio : mp3, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata :
    encoder : Lavc58.27

    Then pipe :

    [NULL @ 0x7fd58a001e00] Unable to find a suitable output format for ’$’
    $ : Invalid argument

    If I run "-i input.mp3 pipe:1", the log is :

    Unable to find a suitable output format for ’pipe:1’ pipe:1 : Invalid
    argument

    How do I set correct output ? And how should ffmpeg know what the output format is at all ?