Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (15117)

  • FFmpeg RTSP drop rate increases when frame rate is reduced

    13 avril 2024, par Avishka Perera

    I need to read an RTSP stream, process the images individually in Python, and then write the images back to an RTSP stream. As the RTSP server, I am using Mediamtx [1]. For streaming, I am using FFmpeg [2].

    


    I have the following code that works perfectly fine. For simplification purposes, I am streaming three generated images.

    


    import time
import numpy as np
import subprocess

width, height = 640, 480
fps = 25
rtsp_server_address = f"rtsp://localhost:8554/mystream"

ffmpeg_cmd = [
    "ffmpeg",
    "-re",
    "-f",
    "rawvideo",
    "-pix_fmt",
    "rgb24",
    "-s",
    f"{width}x{height}",
    "-i",
    "-",
    "-r",
    str(fps),
    "-avoid_negative_ts",
    "make_zero",
    "-vcodec",
    "libx264",
    "-threads",
    "4",
    "-f",
    "rtsp",
    rtsp_server_address,
]
colors = np.array(
    [
        [255, 0, 0],
        [0, 255, 0],
        [0, 0, 255],
    ]
).reshape(3, 1, 1, 3)
images = (np.ones((3, width, height, 3)) * colors).astype(np.uint8)

if __name__ == "__main__":

    process = subprocess.Popen(ffmpeg_cmd, stdin=subprocess.PIPE)
    start = time.time()
    exported = 0
    while True:
        exported += 1
        next_time = start + exported / fps
        now = time.time()
        if next_time > now:
            sleep_dur = next_time - now
            time.sleep(sleep_dur)

        image = images[exported % 3]
        image_bytes = image.tobytes()

        process.stdin.write(image_bytes)
        process.stdin.flush()

    process.stdin.close()
    process.wait()


    


    The issue is, that I need to run this at 10 fps because the processing step is heavy and can only afford 10 fps. Hence, as I reduce the frame rate from 25 to 10, the drop rate increases from 0% to 100%. And after a few iterations, I get a BrokenPipeError: [Errno 32] Broken pipe. Refer to the appendix for the complete log.

    


    As an alternative, I can use OpenCV compiled from source with GStreamer [3], but I prefer using FFmpeg to make the shipping process simple. Since compiling OpenCV from source can be tedious and dependent on the system.

    


    References

    


    [1] Mediamtx (formerly rtsp-simple-server) : https://github.com/bluenviron/mediamtx

    


    [2] FFmpeg : https://github.com/FFmpeg/FFmpeg

    


    [3] Compile OpenCV with GStreamer : https://github.com/bluenviron/mediamtx?tab=readme-ov-file#opencv

    


    Appendix

    


    Creating the source stream

    


    To instantiate the unprocessed stream, I use the following command. This streams the content of my webcam as and RTSP stream.

    


    ffmpeg -video_size 1280x720 -i /dev/video0  -avoid_negative_ts make_zero -vcodec libx264 -r 10 -f rtsp rtsp://localhost:8554/webcam


    


    Error log

    


    ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with gcc 12.3.0 (conda-forge gcc 12.3.0-5)&#xA;  configuration: --prefix=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_build_env/bin/x86_64-conda-linux-gnu-cc --cxx=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_build_env/bin/x86_64-conda-linux-gnu-c&#x2B;&#x2B; --nm=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_build_env/bin/x86_64-conda-linux-gnu-nm --ar=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_build_env/bin/x86_64-conda-linux-gnu-ar --disable-doc --disable-openssl --enable-demuxer=dash --enable-hardcoded-tables --enable-libfreetype --enable-libharfbuzz --enable-libfontconfig --enable-libopenh264 --enable-libdav1d --enable-gnutls --enable-libmp3lame --enable-libvpx --enable-libass --enable-pthreads --enable-vaapi --enable-libopenvino --enable-gpl --enable-libx264 --enable-libx265 --enable-libaom --enable-libsvtav1 --enable-libxml2 --enable-pic --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libopus --pkg-config=/home/conda/feedstock_root/build_artifacts/ffmpeg_1712656518955/_build_env/bin/pkg-config&#xA;  libavutil      58. 29.100 / 58. 29.100&#xA;  libavcodec     60. 31.102 / 60. 31.102&#xA;  libavformat    60. 16.100 / 60. 16.100&#xA;  libavdevice    60.  3.100 / 60.  3.100&#xA;  libavfilter     9. 12.100 /  9. 12.100&#xA;  libswscale      7.  5.100 /  7.  5.100&#xA;  libswresample   4. 12.100 /  4. 12.100&#xA;  libpostproc    57.  3.100 / 57.  3.100&#xA;Input #0, rawvideo, from &#x27;fd:&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 184320 kb/s&#xA;  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 640x480, 184320 kb/s, 25 tbr, 25 tbn&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))&#xA;[libx264 @ 0x5e2ef8b01340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0x5e2ef8b01340] profile High 4:4:4 Predictive, level 2.2, 4:4:4, 8-bit&#xA;[libx264 @ 0x5e2ef8b01340] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=4 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;Output #0, rtsp, to &#x27;rtsp://localhost:8554/mystream&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf60.16.100&#xA;  Stream #0:0: Video: h264, yuv444p(tv, progressive), 640x480, q=2-31, 10 fps, 90k tbn&#xA;    Metadata:&#xA;      encoder         : Lavc60.31.102 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;[vost#0:0/libx264 @ 0x5e2ef8b01080] Error submitting a packet to the muxer: Broken pipe   &#xA;[out#0/rtsp @ 0x5e2ef8afd780] Error muxing a packet&#xA;[out#0/rtsp @ 0x5e2ef8afd780] video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;frame=    1 fps=0.1 q=-1.0 Lsize=N/A time=00:00:04.70 bitrate=N/A dup=0 drop=70 speed=0.389x    &#xA;[libx264 @ 0x5e2ef8b01340] frame I:16    Avg QP: 6.00  size:   147&#xA;[libx264 @ 0x5e2ef8b01340] frame P:17    Avg QP: 9.94  size:   101&#xA;[libx264 @ 0x5e2ef8b01340] frame B:17    Avg QP: 9.94  size:    64&#xA;[libx264 @ 0x5e2ef8b01340] consecutive B-frames: 50.0%  0.0% 42.0%  8.0%&#xA;[libx264 @ 0x5e2ef8b01340] mb I  I16..4: 81.3% 18.7%  0.0%&#xA;[libx264 @ 0x5e2ef8b01340] mb P  I16..4: 52.9%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:47.1%&#xA;[libx264 @ 0x5e2ef8b01340] mb B  I16..4:  0.0%  5.9%  0.0%  B16..8:  0.1%  0.0%  0.0%  direct: 0.0%  skip:94.0%  L0:56.2% L1:43.8% BI: 0.0%&#xA;[libx264 @ 0x5e2ef8b01340] 8x8 transform intra:15.4% inter:100.0%&#xA;[libx264 @ 0x5e2ef8b01340] coded y,u,v intra: 0.0% 0.0% 0.0% inter: 0.0% 0.0% 0.0%&#xA;[libx264 @ 0x5e2ef8b01340] i16 v,h,dc,p: 97%  0%  3%  0%&#xA;[libx264 @ 0x5e2ef8b01340] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%  0%  0%  0%  0%  0%&#xA;[libx264 @ 0x5e2ef8b01340] Weighted P-Frames: Y:52.9% UV:52.9%&#xA;[libx264 @ 0x5e2ef8b01340] ref P L0: 88.9%  0.0%  0.0% 11.1%&#xA;[libx264 @ 0x5e2ef8b01340] kb/s:8.27&#xA;Conversion failed!&#xA;Traceback (most recent call last):&#xA;  File "/home/avishka/projects/read-process-stream/minimal-ffmpeg-error.py", line 58, in <module>&#xA;    process.stdin.write(image_bytes)&#xA;BrokenPipeError: [Errno 32] Broken pipe&#xA;</module>

    &#xA;

  • FFmpeg unable to save file on Android : Output file #0 does not contain any stream

    16 mai 2022, par John M.

    I'm having difficulty when saving a RTSP stream into internal storage using ffmpeg-kit -i rtsp://192.168.100.60:554/stream1 -c:v copy -c:a copy -t 5 /data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4. The command is called using FFmpegKit.executeAsync(command, ...). There're issues with the circular_buffer_size option, but I read that the warnings could be ignored. The command runs fine on desktop using ffmpeg. Please find below the log.

    &#xA;

    Any advice would be appreciated.

    &#xA;

    ffmpeg started on 2022-05-16 at 15:27:54&#xA;Report written to "/data/user/0/com.arthenica.ffmpegkit.test/cache/ffreport.txt"&#xA;Log level: 48&#xA;Command line:&#xA;ffmpeg-kit -i rtsp://192.168.100.60:554/stream1 -c:v copy -c:a copy -t 5 /data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4&#xA;ffmpeg version v4.5-dev-3393-g30322ebe3c Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)&#xA;  configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/light/projects/ffmpeg-kit/prebuilt/android-x86-lts/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --target-os=android --disable-neon --disable-asm --disable-inline-asm --ar=i686-linux-android-ar --cc=i686-linux-android16-clang --cxx=i686-linux-android16-clang&#x2B;&#x2B; --ranlib=i686-linux-android-ranlib --strip=i686-linux-android-strip --nm=i686-linux-android-nm --extra-libs=&#x27;-L/storage/light/projects/ffmpeg-kit/prebuilt/android-x86-lts/cpu-features/lib -lndk_compat&#x27; --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --  libavutil      57. 13.100 / 57. 13.100&#xA;  libavcodec     59. 15.102 / 59. 15.102&#xA;  libavformat    59. 10.100 / 59. 10.100&#xA;  libavdevice    59.  1.100 / 59.  1.100&#xA;  libavfilter     8. 21.100 /  8. 21.100&#xA;  libswscale      6.  1.102 /  6.  1.102&#xA;  libswresample   4.  0.100 /  4.  0.100&#xA;Splitting the commandline.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;rtsp://192.168.100.60:554/stream1&#x27;.&#xA;Reading option &#x27;-c:v&#x27; ... matched as option &#x27;c&#x27; (codec name) with argument &#x27;copy&#x27;.&#xA;Reading option &#x27;-c:a&#x27; ... matched as option &#x27;c&#x27; (codec name) with argument &#x27;copy&#x27;.&#xA;Reading option &#x27;-t&#x27; ... matched as option &#x27;t&#x27; (record or transcode "duration" seconds of audio/video) with argument &#x27;5&#x27;.&#xA;Reading option &#x27;/data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4&#x27; ... matched as output url.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url rtsp://192.168.100.60:554/stream1.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: rtsp://192.168.100.60:554/stream1.&#xA;[tcp @ 0xa21d3a80] No default whitelist set&#xA;[tcp @ 0xa21d3a80] Original list of addresses:&#xA;[tcp @ 0xa21d3a80] Address 192.168.100.60 port 554&#xA;[tcp @ 0xa21d3a80] Interleaved list of addresses:&#xA;[tcp @ 0xa21d3a80] Address 192.168.100.60 port 554&#xA;[tcp @ 0xa21d3a80] Starting connection attempt to 192.168.100.60 port 554&#xA;[tcp @ 0xa21d3a80] Successfully connected to 192.168.100.60 port 554&#xA;[rtsp @ 0xb25b5a00] SDP:&#xA;v=0&#xA;o=- 14665860 31787219 1 IN IP4 192.168.100.60&#xA;s=Session streamed by "MERCURY RTSP Server"&#xA;t=0 0&#xA;a=smart_encoder:virtualIFrame=1&#xA;m=video 0 RTP/AVP 96&#xA;c=IN IP4 0.0.0.0&#xA;b=AS:4096&#xA;a=range:npt=0-&#xA;a=control:track1&#xA;a=rtpmap:96 H264/90000&#xA;a=fmtp:96 packetization-mode=1; profile-level-id=4D4020; sprop-parameter-sets=Z01AIJWgFAF34maIAAADAAgAAAMBlCA=,aO48gA==&#xA;&#xA;Failed to parse interval end specification &#x27;&#x27;&#xA;[rtsp @ 0xb25b5a00] video codec set to: h264&#xA;[rtsp @ 0xb25b5a00] RTP Packetization Mode: 1&#xA;[rtsp @ 0xb25b5a00] RTP Profile IDC: 4d Profile IOP: 40 Level: 20&#xA;[rtsp @ 0xb25b5a00] Extradata set to 0xb25abdf0 (size: 35)&#xA;[rtp @ 0xb25abe60] No default whitelist set&#xA;[udp @ 0xb25abed0] No default whitelist set&#xA;[udp @ 0xb25abed0] &#x27;circular_buffer_size&#x27; option was set but it is not supported on this build (pthread support is required)&#xA;[udp @ 0xb25abed0] end receive buffer size reported is 524288&#xA;[udp @ 0xb25abf40] No default whitelist set&#xA;[udp @ 0xb25abf40] &#x27;circular_buffer_size&#x27; option was set but it is not supported on this build (pthread support is required)&#xA;[udp @ 0xb25abf40] end receive buffer size reported is 524288&#xA;[rtsp @ 0xb25b5a00] setting jitter buffer size to 500&#xA;[rtsp @ 0xb25b5a00] hello state=0&#xA;Failed to parse interval end specification &#x27;&#x27;&#xA;[h264 @ 0x907e5b00] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x907e5b00] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 0x907e5b00] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x907e5b00] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[rtsp @ 0xb25b5a00] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; (0) and &#x27;probesize&#x27; (5000000) options&#xA;Input #0, rtsp, from &#x27;rtsp://192.168.100.60:554/stream1&#x27;:&#xA;  Metadata:&#xA;    title           : Session streamed by "MERCURY RTSP Server"&#xA;  Duration: N/A, start: 0.000000, bitrate: N/A&#xA;  Stream #0:0, 0, 1/90000: Video: h264, none, 90k tbr, 90k tbn&#xA;Successfully opened the file.&#xA;Parsing a group of options: output url /data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4.&#xA;Applying option c:v (codec name) with argument copy.&#xA;Applying option c:a (codec name) with argument copy.&#xA;Applying option t (record or transcode "duration" seconds of audio/video) with argument 5.&#xA;Successfully parsed a group of options.&#xA;Opening an output file: /data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4.&#xA;Output #0, mp4, to &#x27;/data/user/0/com.arthenica.ffmpegkit.test/files/test.mp4&#x27;:&#xA;Output file #0 does not contain any stream&#xA;

    &#xA;

  • lavc/riscv : depend on RVB and simplify accordingly

    27 juillet 2024, par Rémi Denis-Courmont
    lavc/riscv : depend on RVB and simplify accordingly
    

    There is no known (real) hardware with V and without the complete B
    extension. B was indeed required in the RISC-V application profile from
    2022, earlier than V. There should not be any relevant hardware in the
    future either.

    In practice, different R-V Vector optimisations in FFmpeg already depend on
    every constituent of the B extension anyhow, so it would not work well.

    • [DH] libavcodec/riscv/aacencdsp_init.c
    • [DH] libavcodec/riscv/aacpsdsp_init.c
    • [DH] libavcodec/riscv/alacdsp_init.c
    • [DH] libavcodec/riscv/audiodsp_init.c
    • [DH] libavcodec/riscv/exrdsp_init.c
    • [DH] libavcodec/riscv/flacdsp_init.c
    • [DH] libavcodec/riscv/fmtconvert_init.c
    • [DH] libavcodec/riscv/h264_chroma_init_riscv.c
    • [DH] libavcodec/riscv/h264dsp_init.c
    • [DH] libavcodec/riscv/huffyuvdsp_init.c
    • [DH] libavcodec/riscv/jpeg2000dsp_init.c
    • [DH] libavcodec/riscv/llauddsp_init.c
    • [DH] libavcodec/riscv/lpc_init.c
    • [DH] libavcodec/riscv/opusdsp_init.c
    • [DH] libavcodec/riscv/rv40dsp_init.c
    • [DH] libavcodec/riscv/sbrdsp_init.c
    • [DH] libavcodec/riscv/svqenc_init.c
    • [DH] libavcodec/riscv/takdsp_init.c
    • [DH] libavcodec/riscv/utvideodsp_init.c
    • [DH] libavcodec/riscv/vorbisdsp_init.c
    • [DH] libavcodec/riscv/vp7dsp_init.c
    • [DH] libavcodec/riscv/vp8dsp_init.c