Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (40)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

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

Sur d’autres sites (4349)

  • FFMPEG Aligning Timestamps in m3u8 Stream

    16 septembre 2021, par maxwellray

    I'm receiving an m3u8 stream with the following structure

    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:YES
#EXT-X-MEDIA-SEQUENCE:1193
#EXT-X-PROGRAM-DATE-TIME:2021-09-15T22:57:30+00:00
#EXT-X-TARGETDURATION:11
#EXTINF:10.054589,
20210915220000/20210915225710.ts
#EXTINF:10.008855,
20210915220000/20210915225720.ts


    


    Every 10 seconds, the playlist is updated with a new media file path and the oldest media path is removed. Each media file path contains a clip that is approximately 10 seconds long (i.e., over a very long time, the average length of each clip should be 10 seconds). Each media path is timestamped, rounded to 10 seconds.

    


    I run a system where I record continuous 32-minute clips of this stream using ffmpeg, and I need to know the exact timestamp where I start to record and where I stop. I'm encountering a sort of race condition where ffmpeg will start recording at the beginning of the oldest clip in the playlist instead of when it actually gets kicked off. The problem is illustrated below

    


    Clip 1: |==========|
Clip 2:            |==========|
FFMPEG:    |==================| <= ffmpeg is kicked off at t=3
OUTPUT: |=====================| <= but video would actually start at t=0


    


    I'm wondering if there's a way to ensure that the clips I record actually start when ffmpeg is kicked off, not from the start of the earliest clip in the stream.

    


    Thanks !

    


  • How to run a bat file when clicking a button in an electron + react application ?

    12 novembre 2020, par Артем

    I am using Windows 7
    
I want to write a windows app using electron + react.
    
The essence of the application is to run bat files.
    
Bat files will execute their script.
    
In this case, I have already written baht files, they work with the FFMPEG.
    
I like FFMPEG and I would like to make it easy to use on Windows with such an application.
    
At this stage, I have two folders Your_files and Result, next to these folders are ready-made baht files and ffmpeg.exe.

    


      

    1. In the folder Your_files I put the files to convert.
    2. 


    3. I click on the desired baht file, it converts.
    4. 


    5. I take the finished files from the Result folder.
    6. 


    


    I would like to write a nice application now.
    
There will be one window with buttons in the CMD style - minimalism. On the buttons, the labels are similar (mp4 - mkv) and others.
    
I also plan to place two folders Your_files and Result next to the application.
    
The principle is the same, only here is a beautiful visual interface with buttons for the place of many baht files.
    
It will be easier to visually choose what you need.
    
The crux of the question : How to launch a baht file when you click on a button in the application ?
    Perhaps you have some ideas on how to implement this even better .. I welcome your suggestions with a detailed description.
    
------------------------
    
P.S. I originally planned the following... But I decided to abandon this implementation. ))
    
I recorded a cycle in a baht file.
    
The cycle was launched in the bat file mshta.exe with HTML layout (visual interface). lol
    
Received the value of a variable, which he entered in the visual interface of the mshta.exe window.
    
The variable returned to the loop and the baht file was executed.
    
But I don't think this is the best approach. Use a similar hybrid.
    
Take a look at this for fun.

    


    &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    <code class="echappe-js">&lt;script type=&quot;text/javascript&quot;&gt;&amp;#xA;        function myFunction() {&amp;#xA;            var copyText = document.getElementById(&quot;myInput&quot;);&amp;#xA;            copyText.select();&amp;#xA;            document.execCommand(&quot;copy&quot;);&amp;#xA;        }&amp;#xA;    &lt;/script&gt;&#xA;&#xA;&#xA;&#xA;    &lt;script language=&amp;#x27;javascript&amp;#x27;&gt;&amp;#xA;        window.resizeTo(800, 300);&amp;#xA;&amp;#xA;        function entperPressed(e) {&amp;#xA;            if (e.keyCode == 13) {&amp;#xA;                pipePass();&amp;#xA;            }&amp;#xA;        }&amp;#xA;&amp;#xA;        function pipePass() {&amp;#xA;            var pass = document.getElementById(&amp;#x27;pass&amp;#x27;).value;&amp;#xA;            var fso = new ActiveXObject(&amp;#x27;Scripting.FileSystemObject&amp;#x27;).GetStandardStream(1);&amp;#xA;            close(fso.Write(pass));&amp;#xA;&amp;#xA;        }&amp;#xA;    &lt;/script&gt;&#xA;    

    Enter time of frame. Введите время кадра

    &#xA;

    hh:mm:ss.mss – 00:00:00.000

    &#xA;

    (colons can be omitted as well as milliseconds)

    &#xA;

    (двоеточия при вводе можно опустить как и миллисекунды)

    &#xA;

    &#xA; &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA; &#xA;

    &#xA;&#xA;&#xA;&#xA;

    &#xA;

    Photo

    &#xA;

  • How can you combine multiple video files with FFMPEG and merging the audio track as well

    19 décembre 2023, par Codrut

    I'm trying to combine multiple MP4 files in Delphi with the FFMPEG video library. I have the headers unit with all the functions. All videos are MPEG-4, and so is the destination output file.

    &#xA;

    I found this question on Stack Overflow asking the same question. To combine video files while keeping the audio and video tracks.&#xA;I have translated the answers to Delphi, and while the code is executed successfully, the output file is invalid and cannot be played.

    &#xA;

    Here is my implementation :

    &#xA;

    var&#xA;  Files: TArray<pansichar>;&#xA;  Output: PAnsiChar;&#xA;&#xA;  I, S: integer;&#xA;&#xA;  i_fmt_ctx: PAVFormatContext;&#xA;  i_video_stream: PAVStream;&#xA;  o_fmt_ctx: PAVFormatContext;&#xA;  o_video_stream: PAVStream;&#xA;&#xA;  P: PPAVStream;&#xA;begin&#xA;  SetLength(Files, 2);&#xA;  Files[0] := PAnsiChar(&#x27;.\Clips\file9.mp4&#x27;);&#xA;  Files[1] := PAnsiChar(&#x27;.\Clips\file10.mp4&#x27;);&#xA;  Output := &#x27;.\Output\out.mp4&#x27;;&#xA;&#xA;  avcodec_register_all();   &#xA;  av_register_all();&#xA;&#xA;  (* should set to NULL so that avformat_open_input() allocate a new one *)&#xA;  i_fmt_ctx := nil;&#xA;&#xA;  if avformat_open_input(@i_fmt_ctx, Files[0], nil, nil) &lt;> 0 then&#xA;    raise Exception.Create(&#x27;Could not open file&#x27;);&#xA;&#xA;  if avformat_find_stream_info(i_fmt_ctx, nil) &lt; 0 then&#xA;    raise Exception.Create(&#x27;Could not find stream info&#x27;);&#xA;                &#xA;  (* Find 1st video stream *)&#xA;  i_video_stream := nil;&#xA;  P := i_fmt_ctx.streams;&#xA;  for i := 0 to i_fmt_ctx.nb_streams-1 do begin&#xA;    if P^.codec.codec_type = AVMEDIA_TYPE_VIDEO then&#xA;      begin&#xA;        i_video_stream := P^;&#xA;        Break;&#xA;      end;&#xA;    Inc(P);&#xA;  end;&#xA;  if i_video_stream = nil then&#xA;    raise Exception.Create(&#x27;Could not find video stream&#x27;);&#xA;&#xA;  avformat_alloc_output_context2(@o_fmt_ctx, nil, nil, Output);&#xA;&#xA;  (*&#xA;  since all input files are supposed to be identical (framerate, dimension, color format, ...)&#xA;  we can safely set output codec values from first input file&#xA;  *)&#xA;  o_video_stream := avformat_new_stream(o_fmt_ctx, nil);&#xA;  &#xA;  var c: PAVCodecContext;&#xA;  c := o_video_stream.codec;&#xA;  c.bit_rate := 400000;&#xA;  c.codec_id := i_video_stream.codec.codec_id;&#xA;  c.codec_type := i_video_stream.codec.codec_type;&#xA;  c.time_base.num := i_video_stream.time_base.num;&#xA;  c.time_base.den := i_video_stream.time_base.den;&#xA;  //fprintf(stderr, "time_base.num = %d time_base.den = %d\n", c->time_base.num, c->time_base.den);&#xA;  c.width := i_video_stream.codec.width;&#xA;  c.height := i_video_stream.codec.height;&#xA;  c.pix_fmt := i_video_stream.codec.pix_fmt;&#xA;  //printf("%d %d %d", c->width, c->height, c->pix_fmt);&#xA;  c.flags := i_video_stream.codec.flags;&#xA;  c.flags := c.flags or CODEC_FLAG_GLOBAL_HEADER;&#xA;  c.me_range := i_video_stream.codec.me_range;&#xA;  c.max_qdiff := i_video_stream.codec.max_qdiff;&#xA;&#xA;  c.qmin := i_video_stream.codec.qmin;&#xA;  c.qmax := i_video_stream.codec.qmax;&#xA;&#xA;  c.qcompress := i_video_stream.codec.qcompress;&#xA;&#xA;  c.extradata := i_video_stream.codec.extradata;&#xA;  c.extradata_size := i_video_stream.codec.extradata_size;&#xA;&#xA;  avio_open(@o_fmt_ctx.pb, Output, AVIO_FLAG_WRITE);&#xA;&#xA;  (* yes! this is redundant *)&#xA;  avformat_close_input(@i_fmt_ctx);&#xA;&#xA;  avformat_write_header(o_fmt_ctx, nil);&#xA;&#xA;  var last_pts: integer; last_pts := 0;&#xA;  var last_dts: integer; last_dts := 0;&#xA;  for i := 1 to High(Files) do begin&#xA;    i_fmt_ctx := nil;&#xA;&#xA;    if avformat_open_input(@i_fmt_ctx, Files[i], nil, nil) &lt;> 0 then&#xA;      raise Exception.Create(&#x27;Could not open input file&#x27;);&#xA;&#xA;    if avformat_find_stream_info(i_fmt_ctx, nil) &lt; 0 then&#xA;      raise Exception.Create(&#x27;Could not find stream info&#x27;);&#xA;&#xA;    av_dump_format(i_fmt_ctx, 0, Files[i], 0);&#xA;    &#xA;    (* we only use first video stream of each input file *)&#xA;    i_video_stream := nil;&#xA;&#xA;    P := i_fmt_ctx.streams;&#xA;    for S := 0 to i_fmt_ctx.nb_streams-1 do&#xA;      begin&#xA;        if (P^.codec.codec_type = AVMEDIA_TYPE_VIDEO) then&#xA;          begin&#xA;            i_video_stream := P^;&#xA;            break;&#xA;          end;&#xA;        &#xA;        Inc(P);&#xA;      end;&#xA;&#xA;    if i_video_stream = nil then&#xA;      raise Exception.Create(&#x27;Could not find video stream&#x27;);&#xA;    &#xA;    var pts, dts: int64;&#xA;    pts := 0; dts := 0;&#xA;    while true do begin&#xA;      var i_pkt: TAVPacket;&#xA;      av_init_packet( @i_pkt );&#xA;      i_pkt.size := 0;&#xA;      i_pkt.data := nil;&#xA;&#xA;      if av_read_frame(i_fmt_ctx, @i_pkt) &lt; 0 then&#xA;        break;&#xA;      (*&#xA;        pts and dts should increase monotonically&#xA;        pts should be >= dts&#xA;      *)&#xA;      i_pkt.flags := i_pkt.flags or AV_PKT_FLAG_KEY;&#xA;      pts := i_pkt.pts;&#xA;      Inc(i_pkt.pts, last_pts);&#xA;      dts := i_pkt.dts;&#xA;      Inc(i_pkt.dts, last_dts);&#xA;      i_pkt.stream_index := 0;&#xA;&#xA;      // Write&#xA;      av_interleaved_write_frame(o_fmt_ctx, @i_pkt);&#xA;    end;&#xA;&#xA;    Inc(last_dts, dts);&#xA;    Inc(last_pts, pts);  &#xA;  &#xA;    avformat_close_input(@i_fmt_ctx)&#xA;  end;&#xA;&#xA;  av_write_trailer(o_fmt_ctx);&#xA;&#xA;  avcodec_close(o_fmt_ctx.streams^.codec);&#xA;  av_freep(&amp;o_fmt_ctx.streams^.codec);&#xA;  av_freep(&amp;o_fmt_ctx.streams);&#xA;&#xA;  avio_close(o_fmt_ctx.pb);&#xA;  av_free(o_fmt_ctx);&#xA;</pansichar>

    &#xA;

    Which is a translation of Михаил Чеботарев's answer.

    &#xA;

    Even if the code worked, I see no handling of the AVMEDIA_TYPE_AUDIO stream, which means this answer is 1/2 of the problem, since It only combines the video stream.

    &#xA;

    Another approach I tried was using the UBitmaps2Video FFMPEG implementation, which is successfully able to merge the video files, but only the video stream, no audio.

    &#xA;

    I tried manually converting the audio stream with the Bass Audio Library. It was able to read the audio and write It in a single WAV file, which then I converted to MP3. Finally muxing the combined video file and the MP3 file with MuxStreams2. Unfortunately, the audio and video do not align properly. I was unable to pinpoint the issue.

    &#xA;

    Currently, the only functional option is using the precompiled FFMPEG Executables and using ShellExecute with the according parameters to combine the videos.&#xA;This more exactly :

    &#xA;

    ffmpeg -f concat -safe 0 -i video-list.txt -c copy output.mp4&#xA;

    &#xA;

    But I would still rather use the FFMPEG headers in Delphi to combine the videos that way, as that gives the option for Progress indicatiors, more control of the playback and the ability to pause the thread at any point.

    &#xA;

    So, why does my implementation to merge video files not work. And what is a good method to include the audio stream as well ?

    &#xA;