Recherche avancée

Médias (91)

Autres articles (103)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

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

  • webm local udp streaming using FFMPEG

    1er octobre 2013, par siniv

    I was just started to use ffmpeg recently and stumbled on this streaming problem.
    Scenario : i want to live stream a webcam in local network. Both server and client will be using windows platform.

    Current feasible solution : using ffmpeg simple command line

    to test it quickly i tried to locally stream it (the input doesn't really matter btw in this question).

    On server -> ffmpeg -f dshow -i video="cam1":audio="mic1" -r 30 -g 0 -vcodec h264 -acodec libmp3lame -tune zerolatency -preset ultrafast -f mpegts udp://localhost:6789
    On client(the same computer) -> ffplay udp://localhost:6789

    The above works just fine, except for the latency, which i'm getting at about 1-2 second delay.

    Now i want to try to change the encoder to use libvpx (vp8) for video and vorbis for audio (i changed the input to a pre-recorded h264 video, but it really doesn't matter)

    On server
       >ffmpeg -i "suits.mp4" -r 30 -g 0 -vcodec libvpx -acodec vorbis -strict -2 -f webm -f mpegts udp://localhost:6789
        On client(the same computer) -> ffplay udp://localhost:6789
    However this doesn't work... And below are console outputs:
       > onserver ->
       > ffmpeg version N-56165-gae12d65 Copyright (c) 2000-2013 the FFmpeg
       > developers   built on Sep 10 2013 19:42:46 with gcc 4.7.3 (GCC)  
       > configuration: --enable-gpl --enable-version3 --disable-w32threads
       > --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib   libavutil      52. 43.100 / 52. 43.100   libavcodec     55. 31.101 / 55. 31.101   libavformat    55. 16.102 / 55. 16.102   libavdevice    55.  3.100 / 55.  3.100   libavfilter     3. 84.100 /  3. 84.100   libswscale      2.  5.100 /
       > 2.  5.100   libswresample   0. 17.103 /  0. 17.103   libpostproc    52.  3.100 / 52.  3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Suits.mp4':   Metadata:
       >     major_brand     : isom
       >     minor_version   : 1
       >     compatible_brands: isom
       >     creation_time   : 2011-09-08 11:43:25   Duration: 00:42:14.87, start: 0.000000, bitrate: 882 kb/s
       >     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x402 [SAR 1:1 DAR 120:67], 750 kb/s, 23.98 fps,
       > 23.98 tbr, 24k tbn, 47.95 tbc (default)
       >     Metadata:
       >       creation_time   : 2011-09-08 11:43:25
       >     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
       >     Metadata:
       >       creation_time   : 2011-09-08 11:43:25 [libvpx @ 05392a80] v1.2.0 Output #0, mpegts, to 'udp://localhost:6789':   Metadata:
       >     major_brand     : isom
       >     minor_version   : 1
       >     compatible_brands: isom
       >     encoder         : Lavf55.16.102
       >     Stream #0:0(und): Video: vp8 (libvpx), yuv420p, 720x402 [SAR 1:1 DAR 120:67], q=-1--1, 200 kb/s, 90k tbn, 30 tbc (default)
       >     Metadata:
       >       creation_time   : 2011-09-08 11:43:25
       >     Stream #0:1(und): Audio: vorbis, 48000 Hz, stereo, fltp (default)
       >     Metadata:
       >       creation_time   : 2011-09-08 11:43:25 Stream mapping:   Stream #0:0 -> #0:0 (h264 -> libvpx)   Stream #0:1 -> #0:1 (aac -> vorbis) Press [q] to stop, [?] for help frame=42535 fps= 51 q=0.0 Lsize=
       > 143539kB time=00:23:38.28 bitrate= 829.1kbits/s dup=8541 drop=0    
       > video:99155kB audio:28125kB subtitle:0 global headers:3kB muxing
       > overhead 12.772155% Received signal 2: terminating.

    > on client    
    > ffplay version N-56165-gae12d65 Copyright (c) 2003-2013 the FFmpeg
    > developers   built on Sep 10 2013 19:42:46 with gcc 4.7.3 (GCC)  
    > configuration: --enable-gpl --enable-version3 --disable-w32threads
    > --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib   libavutil      52. 43.100 / 52. 43.100   libavcodec     55. 31.101 / 55. 31.101   libavformat    55. 16.102 / 55. 16.102   libavdevice    55.  3.100 / 55.  3.100   libavfilter     3. 84.100 /  3. 84.100   libswscale      2.  5.100 /
    > 2.  5.100   libswresample   0. 17.103 /  0. 17.103   libpostproc    52.  3.100 / 52.  3.100
    >     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   [mpegts @ 02eb8620] probed stream 0 failed
    >     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   [mp3 @ 02ed75a0] Header missing
    >     Last message repeated 1 times [mp3 @ 02ed75a0] Header missing
    >     La    Last message repeated 13 times
    >     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   [mp3 @ 02ed75a0] Header missing  Last message repeated 13 times
    >     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   [mp3 @ 02ed75a0] Header missing    Last message repeated 9 times
    >     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   [mp3 @ 02ed75a0] Header missing [mpegts @ 02eb8620] decoding for
    > stream 1 failed [mpegts @ 02eb8620] Could not find codec parameters
    > for stream 0 (Unknown: none ([6][0][0][0] / 0x0006)): unknown codec
    > Consider increasing the value for the 'analyzeduration' and
    > 'probesize' options [mpegts @ 02eb8620] Could not find codec
    > parameters for stream 1 (Audio: mp3 ([6][0][0][0] / 0x0006), 0
    > channels, s16p): unspecified frame size Consider increasing the value
    > for the 'analyzeduration' and 'probesize' options
    > udp://localhost:6789: could not find codec parameters

    So does the point to point streaming for ffmpeg just doesn't work for vp8 or am i missing something ? Btw, the end goal is to create a similar video chat based framework and i'll appreciate any suggestion. I'm reading up on webRTC now.

  • Query on ffmpeg's concat demuxer parameters to end segments at outpoint timestamps and retain most properties same as input (fps, time_base etc)

    17 octobre 2024, par code

    In order to concatenate video files of matching fps, codec, resolution, time_base (in fact some are segments from same video), ffmpeg concat demuxer (to prevent re-encoding) approach has been used.
But ffmpeg did not stop concatenating segments at outpoint time specified in input demuxer text file !

    


    (Note : From Python code programmatically via sub-process approach, ffmpeg has been invoked )

    


    input.txt file for concat demuxer contained :

    


    ffconcat version 1.0
file 'numbered.mp4'
inpoint  2.083333
outpoint 2.166667



    


    (the time stamps provided above are of 50th (frame pts 49 in video, this is a keyframe) to 52nd (frame pts 51 in video, non-key frame), total 3 consecutive frames, inpoints given in this query are of a key-frame

    


    (video file referred in it i.e 'numbered.mp4' has each frame displaying its frame number ; it has h264 high coded 480p resolution, 10-seconds long with 240 frames and 24fps , <1MB in size shared at : https://filetransfer.io/data-package/F5caZ0xT#link )

    &#xA;

    ffmpeg command invoked programmatically with parameters :

    &#xA;

    &#xA;

    ffmpeg -f concat -safe 0 -fflags +genpts -i -c copy -video_track_timescale 24

    &#xA;

    &#xA;

    Output snippet contained :

    &#xA;

    &#xA;

    frame= 5 fps=0.0 q=-1.0 Lsize= 28KiB time=00:00:00.12 bitrate=1857.8kbits/s speed= 56x

    &#xA;

    &#xA;

    Problem 1 : It Shows there are 5 frames ! ffmpeg has concatenated 2 more frames beyond outpoint timestamp !

    &#xA;

    Query 1) : What are right parameter values to be given to ffmpeg concat demuxer method(or in concat demuxer input file) to make ffmpeg concatenate segments accurately till frames matching outpoint timestamp without overshooting or concatenating frames beyond outpoint timestamps ?

    &#xA;

    Problem2 : When another segment from same input file is referenced in concat demuxer input file, frame pts and timestamps were messed up in resultant output !

    &#xA;

    concat demuxer input file content(updated) :

    &#xA;

    ffconcat version 1.0&#xA;file &#x27;numbered.mp4&#x27;&#xA;inpoint  0&#xA;outpoint 0.125000&#xA;file &#x27;numbered.mp4&#x27;&#xA;inpoint  2.083333&#xA;outpoint 2.166667&#xA;&#xA;

    &#xA;

    command invoked was :

    &#xA;

    ffmpeg -f **concat **-safe 0 -fflags &#x2B;genpts   -i \ -c copy &#xA;  -video_track_timescale 24  \&#xA;

    &#xA;

    ffprobe output (on above output file, edited to reduce size) :

    &#xA;

    &#xA;key_frame=1, pts=0&#xA;    pts_time=0.000000&#xA;key_frame=0, pts=1&#xA;    pts_time=0.041667&#xA;key_frame=0, pts=2&#xA;    pts_time=0.083333&#xA;key_frame=0, pts=3&#xA;    pts_time=0.125000&#xA;key_frame=0, pts=4&#xA;    pts_time=0.166667&#xA;key_frame=1, pts=3&#xA;    pts_time=0.125000&#xA;key_frame=0, pts=6&#xA;    pts_time=0.250000&#xA;key_frame=0, pts=5&#xA;    pts_time=0.208333&#xA;key_frame=0, pts=7&#xA;    pts_time=0.291667&#xA;key_frame=0, pts=7&#xA;    pts_time=0.291667&#xA;

    &#xA;

    Confirms both pts and pts_time values are messed up (though segments referred in demuxer input file were several frames away with no overlapping ).

    &#xA;

    Query 2) What are accurate parameters to be given to concatenate segments represented by input demuxer file without causing this pts or pts_time issues ?

    &#xA;

    (In this test, all segments referred by demuxer have same parameters and are different segments of same video file itself ! so mismatch in codec parameters may not be the cause )

    &#xA;

    problem 3 : while input video had bitrate of 412654 (412.654kbps), concat demuxer resulted in output file with bitrate 1318777 (1.318 Mbps) over 3x the input bitrate.

    &#xA;

    Query 3) : What are accurate parameters to be given to retain all (almost) codec parameters same as input video and only perform concatenation without modifying time_base or framerate ?

    &#xA;

    Note : when -video_track_timescale 24 parameter is not provided as input parameter to concat demuxer, time_base in resultant output was different value (1/1000 ) instead of input files' time_base 1/24 !

    &#xA;

    ( when the Pts times are messed up, Non-monotonic DTS .. errors were observed in output : [vost#0:0/copy @ 000002c1b9b41140] Non-monotonic DTS ; previous : 2, current : 1 ; changing to 3. This may result in incorrect timestamps in the output file..)

    &#xA;

    To clarify, reason to use concat demuxer is to prevent re-encoding video, final usage would be to concatenate some segments of input video file with a few more video files all containing same codec parameters like fps,resolution,time_base etc.

    &#xA;

    Query 4) : Is it accurate at frame level to take pts_time values from ffprobe output and use these in ffmpeg concat demuxer input file for inpoint/outpoint values ?

    &#xA;

    (as ffprobe pts_time values possibly might be aligned with ffmpeg expectations, thought of taking pts_time values from ffprobe command output instead of venturing into computing frame start time)

    &#xA;

    the small (<1MB) input video file used in this test has been shared at : https://filetransfer.io/data-package/F5caZ0xT#link

    &#xA;

    input video file's ffprobe output has been pasted(trimmed to save space) :

    &#xA;

    "codec_name": "h264",&#xA;"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",&#xA;"profile": "High",&#xA;"codec_type": "video",&#xA;"codec_tag_string": "avc1",&#xA;"codec_tag": "0x31637661",&#xA;"width": 640,&#xA;"height": 480,&#xA;"coded_width": 640,&#xA;"coded_height": 480,&#xA;"closed_captions": 0,&#xA;"film_grain": 0,&#xA;"has_b_frames": 2,&#xA;"sample_aspect_ratio": "1:1",&#xA;"display_aspect_ratio": "4:3",&#xA;"pix_fmt": "yuv420p",&#xA;"level": 41,&#xA;"color_range": "tv",&#xA;"color_space": "smpte170m",&#xA;"chroma_location": "left",&#xA;"field_order": "progressive",&#xA;"refs": 1,&#xA;"is_avc": "true",&#xA;"nal_length_size": "4",&#xA;"id": "0x1",&#xA;"r_frame_rate": "24/1",&#xA;"avg_frame_rate": "24/1",&#xA;"time_base": "1/24",&#xA;"start_pts": 0,&#xA;"start_time": "0.000000",&#xA;"duration_ts": 240,&#xA;"duration": "10.000000",&#xA;"bit_rate": "409628",&#xA;"bits_per_raw_sample": "8",&#xA;"nb_frames": "240",&#xA;"extradata_size": 49,&#xA;

    &#xA;

    Searched quite a lot online for a solution but searches didnot result in finding a fix for this concat demuxer situation&#xA;I seek helpful answers to the queries presented above, Thanks All

    &#xA;

    (while some workarounds like converting to raw h264 and then applying time scale again to each segment is suggested in other discussions, in current scenario, the input video file is just 1 so it appears accurate parameters to ffmpeg concat demuxer method are needed and be helpful to others facing similar issue)

    &#xA;

  • ffmpeg's concat demuxer parameters to limit segments at outpoint timestamps [closed]

    17 octobre 2024, par code

    In order to concatenate video files of matching fps, codec, resolution, time_base (in fact some are segments from same video), ffmpeg concat demuxer (to prevent re-encoding) approach has been used.&#xA;But ffmpeg did not stop concatenating segments at outpoint time specified in input demuxer text file !

    &#xA;

    (Note : From Python code programmatically via sub-process approach, ffmpeg has been invoked )

    &#xA;

    input.txt file for concat demuxer contained :

    &#xA;

    ffconcat version 1.0&#xA;file &#x27;numbered.mp4&#x27;&#xA;inpoint  2.083333&#xA;outpoint 2.166667&#xA;&#xA;

    &#xA;

    (the time stamps provided above are of 50th (frame pts 49 in video, this is a keyframe) to 52nd (frame pts 51 in video, non-key frame), total 3 consecutive frames, inpoints given in this query are of a key-frame

    &#xA;

    (video file referred in it i.e 'numbered.mp4' has each frame displaying its frame number ; it has h264 high coded 480p resolution, 10-seconds long with 240 frames and 24fps , <1MB in size shared at : https://filetransfer.io/data-package/F5caZ0xT#link )

    &#xA;

    ffmpeg command invoked programmatically with parameters :

    &#xA;

    &#xA;

    ffmpeg -f concat -safe 0 -fflags +genpts -i -c copy -video_track_timescale 24

    &#xA;

    &#xA;

    Output snippet contained :

    &#xA;

    &#xA;

    frame= 5 fps=0.0 q=-1.0 Lsize= 28KiB time=00:00:00.12 bitrate=1857.8kbits/s speed= 56x

    &#xA;

    &#xA;

    Problem 1 : It Shows there are 5 frames ! ffmpeg has concatenated 2 more frames beyond outpoint timestamp !

    &#xA;

    Query 1) : What are right parameter values to be given to ffmpeg concat demuxer method(or in concat demuxer input file) to make ffmpeg concatenate segments accurately till frames matching outpoint timestamp without overshooting or concatenating frames beyond outpoint timestamps ?

    &#xA;

    Problem2 : When another segment from same input file is referenced in concat demuxer input file, frame pts and timestamps were messed up in resultant output !

    &#xA;

    concat demuxer input file content(updated) :

    &#xA;

    ffconcat version 1.0&#xA;file &#x27;numbered.mp4&#x27;&#xA;inpoint  0&#xA;outpoint 0.125000&#xA;file &#x27;numbered.mp4&#x27;&#xA;inpoint  2.083333&#xA;outpoint 2.166667&#xA;&#xA;

    &#xA;

    command invoked was :

    &#xA;

    ffmpeg -f **concat **-safe 0 -fflags &#x2B;genpts   -i \ -c copy &#xA;  -video_track_timescale 24  \&#xA;

    &#xA;

    ffprobe output (on above output file, edited to reduce size) :

    &#xA;

    &#xA;key_frame=1, pts=0&#xA;    pts_time=0.000000&#xA;key_frame=0, pts=1&#xA;    pts_time=0.041667&#xA;key_frame=0, pts=2&#xA;    pts_time=0.083333&#xA;key_frame=0, pts=3&#xA;    pts_time=0.125000&#xA;key_frame=0, pts=4&#xA;    pts_time=0.166667&#xA;key_frame=1, pts=3&#xA;    pts_time=0.125000&#xA;key_frame=0, pts=6&#xA;    pts_time=0.250000&#xA;key_frame=0, pts=5&#xA;    pts_time=0.208333&#xA;key_frame=0, pts=7&#xA;    pts_time=0.291667&#xA;key_frame=0, pts=7&#xA;    pts_time=0.291667&#xA;

    &#xA;

    Confirms both pts and pts_time values are messed up (though segments referred in demuxer input file were several frames away with no overlapping ).

    &#xA;

    Query 2) What are accurate parameters to be given to concatenate segments represented by input demuxer file without causing this pts or pts_time issues ?

    &#xA;

    (In this test, all segments referred by demuxer have same parameters and are different segments of same video file itself ! so mismatch in codec parameters may not be the cause )

    &#xA;

    problem 3 : while input video had bitrate of 412654 (412.654kbps), concat demuxer resulted in output file with bitrate 1318777 (1.318 Mbps) over 3x the input bitrate.

    &#xA;

    Query 3) : What are accurate parameters to be given to retain all (almost) codec parameters same as input video and only perform concatenation without modifying time_base or framerate ?

    &#xA;

    Note : when -video_track_timescale 24 parameter is not provided as input parameter to concat demuxer, time_base in resultant output was different value (1/1000 ) instead of input files' time_base 1/24 !

    &#xA;

    ( when the Pts times are messed up, Non-monotonic DTS .. errors were observed in output : [vost#0:0/copy @ 000002c1b9b41140] Non-monotonic DTS ; previous : 2, current : 1 ; changing to 3. This may result in incorrect timestamps in the output file..)

    &#xA;

    To clarify, reason to use concat demuxer is to prevent re-encoding video, final usage would be to concatenate some segments of input video file with a few more video files all containing same codec parameters like fps,resolution,time_base etc.

    &#xA;

    Query 4) : Is it accurate at frame level to take pts_time values from ffprobe output and use these in ffmpeg concat demuxer input file for inpoint/outpoint values ?

    &#xA;

    (as ffprobe pts_time values possibly might be aligned with ffmpeg expectations, thought of taking pts_time values from ffprobe command output instead of venturing into computing frame start time)

    &#xA;

    the small (<1MB) input video file used in this test has been shared at : https://filetransfer.io/data-package/F5caZ0xT#link

    &#xA;

    input video file's ffprobe output has been pasted(trimmed to save space) :

    &#xA;

    "codec_name": "h264",&#xA;"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",&#xA;"profile": "High",&#xA;"codec_type": "video",&#xA;"codec_tag_string": "avc1",&#xA;"codec_tag": "0x31637661",&#xA;"width": 640,&#xA;"height": 480,&#xA;"coded_width": 640,&#xA;"coded_height": 480,&#xA;"closed_captions": 0,&#xA;"film_grain": 0,&#xA;"has_b_frames": 2,&#xA;"sample_aspect_ratio": "1:1",&#xA;"display_aspect_ratio": "4:3",&#xA;"pix_fmt": "yuv420p",&#xA;"level": 41,&#xA;"color_range": "tv",&#xA;"color_space": "smpte170m",&#xA;"chroma_location": "left",&#xA;"field_order": "progressive",&#xA;"refs": 1,&#xA;"is_avc": "true",&#xA;"nal_length_size": "4",&#xA;"id": "0x1",&#xA;"r_frame_rate": "24/1",&#xA;"avg_frame_rate": "24/1",&#xA;"time_base": "1/24",&#xA;"start_pts": 0,&#xA;"start_time": "0.000000",&#xA;"duration_ts": 240,&#xA;"duration": "10.000000",&#xA;"bit_rate": "409628",&#xA;"bits_per_raw_sample": "8",&#xA;"nb_frames": "240",&#xA;"extradata_size": 49,&#xA;

    &#xA;

    Searched quite a lot online for a solution but searches didnot result in finding a fix for this concat demuxer situation.&#xA;To reiterate again, ffmpeg concat demuxer approach is chosen to prevent re-encoding !&#xA;(End usage would be on 20000+ frames in video files, so concat demuxer approach would be significantly faster than re-encoding alternatives)

    &#xA;

    I seek helpful answers to technical queries presented above,&#xA;Thanks All

    &#xA;

    (while some workarounds like converting to raw h264 and then applying time scale again to each file was suggested in other discussions, in current scenario the input video file is 1 and segments are extracted from it so it appears accurate parameters to ffmpeg concat demuxer method are to be found )

    &#xA;