Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (62)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (7968)

  • 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 runs in terminal but returns error in subprocess.run from flatpak-installed pycharm

    19 juin 2024, par name

    I want to run this command in python :

    &#xA;

    ffmpeg -ss 00:00:30 -i "/home/exl/—1—ARCHIVE—1—/video/music videos/author --- a2 - name (text).webm" -vf scale=150:-2 -vframes 1 -c:v libwebp -compression_level 6 -quality 100 /home/exl/—1—ARCHIVE—1—/—3—previews—3—/734a8a0bac3a83e0f6c69416a26ec5cd211a6d742f3df63bb72bdbe6431b57c30677bc11551ba4aaaecac15ed2c48de51340a09020b7e9d9479e1e81ff766191.webp&#xA;

    &#xA;

    In terminal it works fine, but in subprocess returns error. Python code :

    &#xA;

    finished_process = subprocess.run(&#xA;                    [&#xA;                        &#x27;/usr/bin/ffmpeg&#x27;,&#xA;                        &#x27;-ss&#x27;, f&#x27;00:00:{seconds_shift}&#x27;,&#xA;                        &#x27;-i&#x27;, original_path,&#xA;                        &#x27;-vf&#x27;, &#x27;scale=150:-2&#x27;,&#xA;                        &#x27;-vframes&#x27;, &#x27;1&#x27;,&#xA;                        &#x27;-c:v&#x27;, &#x27;libwebp&#x27;,&#xA;                        &#x27;-compression_level&#x27;, &#x27;6&#x27;,&#xA;                        &#x27;-quality&#x27;, &#x27;100&#x27;,&#xA;                        preview_path&#xA;                    ],&#xA;                    #stdout=subprocess.DEVNULL,&#xA;                    #stderr=subprocess.DEVNULL,&#xA;                    check=False,&#xA;                    capture_output=True&#xA;                )&#xA;

    &#xA;

    finished_process.stderr.decode() :

    &#xA;

    ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 12.1.0 (GCC)&#xA;  configuration: --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-debug --disable-doc --disable-static --enable-optimizations --enable-shared --disable-everything --enable-ffplay --enable-ffprobe --enable-gnutls --enable-libaom --enable-libdav1d --enable-libfdk-aac --enable-libmp3lame --enable-libfontconfig --enable-libfreetype --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-openal --enable-opengl --enable-sdl2 --enable-vulkan --enable-zlib --enable-libv4l2 --enable-libxcb --enable-vdpau --enable-vaapi --enable-encoder=&#x27;ac3,alac,flac,libfdk_aac,g723_1,mp2,libmp3lame,libopus,libspeex,pcm_alaw,pcm_mulaw,pcm_f32le,pcm_s16be,pcm_s24be,pcm_s16le,pcm_s24le,pcm_s32le,pcm_u8,tta,libvorbis,wavpack,&#x27; --enable-encoder=&#x27;ass,ffv1,libaom_av1,libvpx_vp8,libvpx_vp9,mjpeg_vaapi,rawvideo,theora,vp8_vaapi,libopenh264&#x27; --enable-decoder=&#x27;adpcm_g722,alac,flac,g723_1,g729,libfdk_aac,libopus,libspeex,mp2,mp3,m4a,pcm_alaw,pcm_mulaw,pcm_f16le,pcm_f24le,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_s16be,pcm_s16be_planar,pcm_s24be,pcm_s16le,pcm_s16le_planar,pcm_s24le,pcm_s24le_planar,pcm_s32le,pcm_s32le_planar,pcm_s64be,pcm_s64le,pcm_s8,pcm_s8_planar,pcm_u8,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,tta,vorbis,wavpack,&#x27; --enable-decoder=&#x27;ass,ffv1,mjpeg,mjpegb,libaom_av1,libdav1d,libvpx_vp8,libvpx_vp9,rawvideo,theora,vp8,vp9,libopenh264&#x27; --enable-encoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-decoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-hwaccel=&#x27;vp8_vaapi,mjpeg_vaapi,&#x27; --enable-parser=&#x27;aac,ac3,flac,mjpeg,mpegaudio,mpeg4video,opus,vp3,vp8,vp9,vorbis,&#x27; --enable-muxer=&#x27;ac3,ass,flac,g722,gif,matroska,mp3,mpegvideo,rtp,ogg,opus,pcm_s16be,pcm_s16le,wav,webm,&#x27; --enable-demuxer=&#x27;aac,ac3,ass,flac,g722,gif,image_jpeg_pipe,image_png_pipe,image_webp_pipe,matroska,mjpeg,mov,mp3,mpegvideo,ogg,pcm_mulaw,pcm_alaw,pcm_s16be,pcm_s16le,rtp,wav,&#x27; --enable-filter=&#x27;crop,scale,overlay,amix,amerge,aresample,format,aformat,fps,transpose,pad,&#x27; --enable-indev=&#x27;v4l2,xcbgrab,&#x27; --enable-protocol=&#x27;crypto,file,pipe,rtp,srtp,rtsp,tcp,udp,unix,&#x27; --arch=x86_64 --enable-libopenh264&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;Input #0, matroska,webm, from &#x27;/home/exl/—1—ARCHIVE—1—/video/music videos/author --- a2 - name (text).webm&#x27;:&#xA;  Metadata:&#xA;    ENCODER         : Lavf59.16.100&#xA;  Duration: 00:03:24.98, start: -0.007000, bitrate: 915 kb/s&#xA;  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 1920x1036, SAR 1:1 DAR 480:259, 25 fps, 25 tbr, 1k tbn (default)&#xA;    Metadata:&#xA;      DURATION        : 00:03:24.960000000&#xA;  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, s16 (default)&#xA;    Metadata:&#xA;      DURATION        : 00:03:24.981000000&#xA;[NULL @ 0x55dd82de7d00] Unable to find a suitable output format for &#x27;/home/exl/—1—ARCHIVE—1—/—3—previews—3—/734a8a0bac3a83e0f6c69416a26ec5cd211a6d742f3df63bb72bdbe6431b57c30677bc11551ba4aaaecac15ed2c48de51340a09020b7e9d9479e1e81ff766191.webp&#x27;&#xA;/home/exl/—1—ARCHIVE—1—/—3—previews—3—/734a8a0bac3a83e0f6c69416a26ec5cd211a6d742f3df63bb72bdbe6431b57c30677bc11551ba4aaaecac15ed2c48de51340a09020b7e9d9479e1e81ff766191.webp: Invalid argument&#xA;&#xA;

    &#xA;

    As suggested here (FFMPEG command runs in terminal but not by subprocess) i tried using which determine path to correct version, but this command returns /usr/bin/ffmpeg both in python and in terminal.

    &#xA;

    which ffmpeg (both subprocess.run([&#x27;which&#x27;, &#x27;ffmpeg&#x27;], capture_output=True).stdout and terminal) : /usr/bin/ffmpeg

    &#xA;

    ffmpeg -version : 5.1.1-1ubuntu1

    &#xA;

    ffmpeg version 5.1.1-1ubuntu1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;built with gcc 12 (Ubuntu 12.2.0-1ubuntu1)&#xA;configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-shared&#xA;

    &#xA;

    subprocess.run([&#x27;ffmpeg&#x27;, &#x27;-version&#x27;], capture_output=True).stdout.decode() : 5.0.1

    &#xA;

    ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;built with gcc 12.1.0 (GCC)&#xA;configuration: --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-debug --disable-doc --disable-static --enable-optimizations --enable-shared --disable-everything --enable-ffplay --enable-ffprobe --enable-gnutls --enable-libaom --enable-libdav1d --enable-libfdk-aac --enable-libmp3lame --enable-libfontconfig --enable-libfreetype --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-openal --enable-opengl --enable-sdl2 --enable-vulkan --enable-zlib --enable-libv4l2 --enable-libxcb --enable-vdpau --enable-vaapi --enable-encoder=&#x27;ac3,alac,flac,libfdk_aac,g723_1,mp2,libmp3lame,libopus,libspeex,pcm_alaw,pcm_mulaw,pcm_f32le,pcm_s16be,pcm_s24be,pcm_s16le,pcm_s24le,pcm_s32le,pcm_u8,tta,libvorbis,wavpack,&#x27; --enable-encoder=&#x27;ass,ffv1,libaom_av1,libvpx_vp8,libvpx_vp9,mjpeg_vaapi,rawvideo,theora,vp8_vaapi,libopenh264&#x27; --enable-decoder=&#x27;adpcm_g722,alac,flac,g723_1,g729,libfdk_aac,libopus,libspeex,mp2,mp3,m4a,pcm_alaw,pcm_mulaw,pcm_f16le,pcm_f24le,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_s16be,pcm_s16be_planar,pcm_s24be,pcm_s16le,pcm_s16le_planar,pcm_s24le,pcm_s24le_planar,pcm_s32le,pcm_s32le_planar,pcm_s64be,pcm_s64le,pcm_s8,pcm_s8_planar,pcm_u8,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,tta,vorbis,wavpack,&#x27; --enable-decoder=&#x27;ass,ffv1,mjpeg,mjpegb,libaom_av1,libdav1d,libvpx_vp8,libvpx_vp9,rawvideo,theora,vp8,vp9,libopenh264&#x27; --enable-encoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-decoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-hwaccel=&#x27;vp8_vaapi,mjpeg_vaapi,&#x27; --enable-parser=&#x27;aac,ac3,flac,mjpeg,mpegaudio,mpeg4video,opus,vp3,vp8,vp9,vorbis,&#x27; --enable-muxer=&#x27;ac3,ass,flac,g722,gif,matroska,mp3,mpegvideo,rtp,ogg,opus,pcm_s16be,pcm_s16le,wav,webm,&#x27; --enable-demuxer=&#x27;aac,ac3,ass,flac,g722,gif,image_jpeg_pipe,image_png_pipe,image_webp_pipe,matroska,mjpeg,mov,mp3,mpegvideo,ogg,pcm_mulaw,pcm_alaw,pcm_s16be,pcm_s16le,rtp,wav,&#x27; --enable-filter=&#x27;crop,scale,overlay,amix,amerge,aresample,format,aformat,fps,transpose,pad,&#x27; --enable-indev=&#x27;v4l2,xcbgrab,&#x27; --enable-protocol=&#x27;crypto,file,pipe,rtp,srtp,rtsp,tcp,udp,unix,&#x27; --arch=x86_64 --enable-libopenh264&#xA;

    &#xA;

    Thank you in advance.

    &#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;