Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (37)

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5364)

  • Permission deneied android 14 FFmpeg [closed]

    26 décembre 2023, par Aarav Raj

    I have inserted log

    


    ffmpeg -hwaccel auto -y -i "/storage/emulated/0/DCIM/Camera/20231217_205048.mp4" -c:v libaom-av1 -q:v 5 -c:a libmp3lame -ab 128k -ar 44100 "/storage/emulated/0/DCIM/Camera/20231217_205048.avi"

    


    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers

    


    built with gcc 4.9.x (GCC) 20150123 (prerelease)

    


    configuration : —enable-version3 —enable-gpl —enable-nonfree —disable-indev=v4l2 —enable-libmp3lame —enable-libx264 —enable-libx265 —enable-libvpx —enable-libvorbis —enable-libtheora —enable-libopus —enable-libfdk-aac —enable-libfreetype —enable-libass —enable-libfribidi —enable-fontconfig —enable-pthreads —enable-libxvid —enable-filters —enable-openssl —enable-librtmp —disable-protocol='udp,udplite' —enable-libopencore-amrwb —enable-libopencore-amrnb —enable-libvo-amrwbenc —enable-libspeex —enable-libsoxr —enable-libwebp —enable-libxml2 —enable-libopenh264 —enable-jni —prefix=/home/silentlexx/AndroidstudioProjects/ffmpeg/ffmpeg/build/arm64-api21-r13b —sysroot=/home/silentlexx/Android/android-ndk-r13b/platforms/android-21/arch-arm64 —arch=arm64 —disable-shared —enable-static —enable-pic —enable-ffmpeg —disable-ffplay —disable-ffprobe —disable-ffnvcodec —disable-avdevice —disable-debug —disable-doc —disable-htmlpages —disable-manpages —disable-podpages —disable-txtpages —disable-symver —cross-prefix=/home/silentlexx/Android/android-ndk-r13b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- —target-os=android —enable-cross-compile —pkg-config-flags=—static —extra-libs='-lgnustl_static -lm -lpng -l:libz.so -lpthread' —enable-asm —enable-neon —enable-libxavs2 —enable-libdav1d —enable-libaom —enable-small

    


    libavutil 58. 2.100 / 58. 2.100

    


    libavcodec 60. 3.100 / 60. 3.100

    


    libavformat 60. 3.100 / 60. 3.100

    


    libavfilter 9. 3.100 / 9. 3.100

    


    libswscale 7. 1.100 / 7. 1.100

    


    libswresample 4. 10.100 / 4. 10.100

    


    libpostproc 57. 1.100 / 57. 1.100

    


    /storage/emulated/0/DCIM/Camera/20231217_205048.mp4 : Permission deni
ed

    


    When i tried to convert a mp4 to av1 it showed me this error.

    


  • Why does my script return 0 when it fails ? Bash, Whisper, ffmpeg

    30 avril 2024, par d-b

    I have a bash script that executes whisper on all sound files in a directory. Whisper uses ffmpeg to decode sound files to a format it can handle. One of the files in the directory was corrupt and caused ffmpeg to fail. The first time I executed my script it returned 1 when it hit that file but when I try to reproduce the error it always returns 0.

    


    Here is the log from the first run when 1 was returned :

    


    Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 48, in load_audio&#xA;    .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)&#xA;     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/ffmpeg/_run.py", line 325, in run&#xA;    raise Error(&#x27;ffmpeg&#x27;, out, err)&#xA;ffmpeg._run.Error: ffmpeg error (see stderr output for detail)&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/bin/whisper", line 8, in <module>&#xA;    sys.exit(cli())&#xA;             ^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 437, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 121, in transcribe&#xA;    mel = log_mel_spectrogram(audio, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 130, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 51, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;/soundfile1.opus: Invalid data found when processing input&#xA;&#xA;&#xA;exit: 1 //this is my own output&#xA;</module>

    &#xA;

    and here is an example of when it returns 0 despite the input file is corrupt :

    &#xA;

    % whisper soundfile1.opus&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 58, in load_audio&#xA;    out = run(cmd, capture_output=True, check=True).stdout&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run&#xA;    raise CalledProcessError(retcode, process.args,&#xA;subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-nostdin&#x27;, &#x27;-threads&#x27;, &#x27;0&#x27;, &#x27;-i&#x27;, &#x27;soundfile1.opus&#x27;, &#x27;-f&#x27;, &#x27;s16le&#x27;, &#x27;-ac&#x27;, &#x27;1&#x27;, &#x27;-acodec&#x27;, &#x27;pcm_s16le&#x27;, &#x27;-ar&#x27;, &#x27;16000&#x27;, &#x27;-&#x27;]&#x27; returned non-zero exit status 1.&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 597, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 133, in transcribe&#xA;    mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 140, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 60, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;Skipping soundfile1.opus due to RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;% echo $?&#xA;0&#xA;

    &#xA;

    When I try to reproduce the behaviour I have both tried to execute the script as well as just running the actual line of code from the command prompt. The actual script looks like this :

    &#xA;

    if whisper "$file" >> "${directory}/../${transdir}/${name}.txt"; then&#xA;    whispersuccess=$?&#xA;    echo "exit code $whispersuccess"&#xA;else&#xA;    whispersuccess=$?&#xA;    echo "exit code: $whispersuccess"&#xA;

    &#xA;

    I want it to return ¬0 when something like this happens. How do I achieve this ?

    &#xA;

  • ffmpeg rtsp record problems [closed]

    3 mai 2023, par user429643

    I have 3 ip cameras from which I take rtsp stream and record mp4 files via ffmpeg. Previously, everything worked well, but some time ago, the recording from second camera ends after a some period of time (before it should be ended).&#xA;Program code :

    &#xA;

    if [ "$1" = "1" ]; then&#xA;    ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags &#x2B;genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM1IP:$RTSPport/Streaming/Channels/101 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/1.mp4 -report null >/dev/null 2>$FULLpath/cam01.log &amp;&#xA;    ffmpeg -i rtsp://$CAMLogin@$CAM1IP:$RTSPport/Streaming/Channels/101 -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/1.jpg null >/dev/null 2>$FULLpath/cam_jpg01.log &amp;&#xA;fi&#xA;&#xA;if [ "$2" = "1" ]; then&#xA;    ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags &#x2B;genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM2IP:$RTSPport/cam/realmonitor?channel=1&amp;subtype=0 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/2.mp4 -report null >/dev/null 2>$FULLpath/cam02.log &amp;&#xA;    ffmpeg -i $CENTRAL -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/2.jpg null >/dev/null 2>$FULLpath/cam_jpg02.log &amp;&#xA;fi&#xA;&#xA;if [ "$3" = "1" ]; then&#xA; ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags &#x2B;genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM3IP:$RTSPport/Streaming/Channels/101 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/3.mp4 -report null >/dev/null 2>$FULLpath/cam03.log &amp;&#xA; ffmpeg -i rtsp://$CAMLogin@$CAM3IP:$RTSPport/Streaming/Channels/101 -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/3.jpg null >/dev/null 2>$FULLpath/cam_jpg03.log &amp;&#xA;

    &#xA;

    If I set a certain recording time, then the problem occurs only from the second camera.

    &#xA;

    FFMPEG log for first camera :

    &#xA;

    ffmpeg started on 2023-05-03 at 12:04:01&#xA;Report written to "ffmpeg-20230503-120401.log"&#xA;ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers&#xA;  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g&#x2B;&#x2B; --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv&#xA;  libavutil      54. 31.100 / 54. 31.100&#xA;  libavcodec     56. 60.100 / 56. 60.100&#xA;  libavformat    56. 40.101 / 56. 40.101&#xA;  libavdevice    56.  4.100 / 56.  4.100&#xA;  libavfilter     5. 40.101 /  5. 40.101&#xA;  libavresample   2.  1.  0 /  2.  1.  0&#xA;  libswscale      3.  1.101 /  3.  1.101&#xA;  libswresample   1.  2.101 /  1.  2.101&#xA;  libpostproc    53.  3.100 / 53.  3.100&#xA;Input #0, rtsp, from &#x27;rtsp://username:password@192.168.8.98:554/Streaming/Channels/101&#x27;:&#xA;  Metadata:&#xA;    title           : Media Presentation&#xA;  Duration: N/A, start: 1683104641.578533, bitrate: N/A&#xA;    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc&#xA;[mp4 @ 0x23f8d80] Codec for stream 0 does not use global headers but container format requires global headers&#xA;Output #0, mp4, to &#x27;/var/www/view/dist/videos/archive/2023-05-03/c24706a011ae90262875803ad73b8a2b/1.mp4&#x27;:&#xA;  Metadata:&#xA;    title           : Media Presentation&#xA;    encoder         : Lavf56.40.101&#xA;    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 20 fps, 20 tbr, 10240 tbn, 20 tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Press [q] to stop, [?] for help&#xA;[mp4 @ 0x23f8d80] Non-monotonous DTS in output stream 0:0; previous: 6516, current: 6516; changing to 6517. This may result in incorrect timestamps in the output file.&#xA;[mp4 @ 0x23f8d80] Non-monotonous DTS in output stream 0:0; previous: 6523, current: 6523; changing to 6524. This may result in incorrect timestamps in the output file.&#xA;frame=   34 fps=0.0 q=-1.0 size=    1922kB time=00:00:01.52 bitrate=10321.7kbits/s    &#xA;frame=   45 fps= 41 q=-1.0 size=    2019kB time=00:00:02.07 bitrate=7978.7kbits/s&#xA;....&#xA;....&#xA;....&#xA;....&#xA;....&#xA;frame=144051 fps= 20 q=-1.0 size= 3530396kB time=02:00:01.84 bitrate=4015.8kbits/s    &#xA;frame=144055 fps= 20 q=-1.0 Lsize= 3532194kB time=02:00:02.04 bitrate=4017.7kbits/s    &#xA;video:3530424kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.050154%   &#xA;

    &#xA;

    FFMPEG log for second camera :

    &#xA;

    ffmpeg started on 2023-05-03 at 12:04:01&#xA;Report written to "ffmpeg-20230503-120401.log"&#xA;ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers&#xA;  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g&#x2B;&#x2B; --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv&#xA;  libavutil      54. 31.100 / 54. 31.100&#xA;  libavcodec     56. 60.100 / 56. 60.100&#xA;  libavformat    56. 40.101 / 56. 40.101&#xA;  libavdevice    56.  4.100 / 56.  4.100&#xA;  libavfilter     5. 40.101 /  5. 40.101&#xA;  libavresample   2.  1.  0 /  2.  1.  0&#xA;  libswscale      3.  1.101 /  3.  1.101&#xA;  libswresample   1.  2.101 /  1.  2.101&#xA;  libpostproc    53.  3.100 / 53.  3.100&#xA;[rtsp @ 0x134adc0] DTS discontinuity in stream 1: packet 3 with DTS 80789022795410, packet 4 with DTS 80789022798792&#xA;[rtsp @ 0x134adc0] DTS discontinuity in stream 1: packet 7 with DTS 80789022798811, packet 8 with DTS 80789022809865&#xA;Guessed Channel Layout for  Input Stream #0.1 : mono&#xA;Input #0, rtsp, from &#x27;rtsp://username:password@192.168.8.22:554/cam/realmonitor?channel=1&amp;subtype=0&#x27;:&#xA;  Metadata:&#xA;    title           : Media Server&#xA;  Duration: N/A, start: 1683104641.570750, bitrate: N/A&#xA;    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709), 4096x1800, 90k tbr, 90k tbn, 180k tbc&#xA;    Stream #0:1: Audio: pcm_alaw, 48000 Hz, 1 channels, s16, 384 kb/s&#xA;[mp4 @ 0x1538e00] Codec for stream 0 does not use global headers but container format requires global headers&#xA;Output #0, mp4, to &#x27;/var/www/view/dist/videos/archive/2023-05-03/c24706a011ae90262875803ad73b8a2b/2.mp4&#x27;:&#xA;  Metadata:&#xA;    title           : Media Server&#xA;    encoder         : Lavf56.40.101&#xA;    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 4096x1800, q=2-31, 90k tbr, 10240 tbn, 20 tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Press [q] to stop, [?] for help&#xA;frame=   31 fps=0.0 q=-1.0 size=    1170kB time=00:00:01.46 bitrate=6543.0kbits/s    &#xA;frame=   40 fps= 39 q=-1.0 size=    1435kB time=00:00:01.92 bitrate=6120.5kbits/s    &#xA;Invalid UE golomb code&#xA;frame=   52 fps= 34 q=-1.0 size=    2099kB time=00:00:02.50 bitrate=6864.2kbits/s    &#xA;frame=   63 fps= 31 q=-1.0 size=    2399kB time=00:00:03.06 bitrate=6411.5kbits/s    &#xA;frame=   72 fps= 28 q=-1.0 size=    2670kB time=00:00:03.52 bitrate=6210.5kbits/s    &#xA;Invalid UE golomb code&#xA;...&#xA;...&#xA;...&#xA;...&#xA;Invalid UE golomb code&#xA;frame=27243 fps= 20 q=-1.0 size= 1046397kB time=00:22:42.09 bitrate=6293.3kbits/s    &#xA;frame=27254 fps= 20 q=-1.0 size= 1046712kB time=00:22:42.64 bitrate=6292.7kbits/s    &#xA;frame=27264 fps= 20 q=-1.0 size= 1046990kB time=00:22:43.12 bitrate=6292.1kbits/s    &#xA;frame=27275 fps= 20 q=-1.0 size= 1047290kB time=00:22:43.67 bitrate=6291.4kbits/s    &#xA;Invalid UE golomb code&#xA;frame=27285 fps= 20 q=-1.0 size= 1048022kB time=00:22:44.20 bitrate=6293.3kbits/s    &#xA;frame=27292 fps= 20 q=-1.0 Lsize= 1048561kB time=00:22:44.52 bitrate=6295.1kbits/s    &#xA;video:1048224kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032150%&#xA;

    &#xA;

    Initially, I thought that the error was in timestamps, so I added arguments to ffmpeg :

    &#xA;

    -use_wallclock_as_timestamps 1&#xA;-fflags +genpts&#xA;-fflags -discardcorrupt&#xA;-vsync vfr

    &#xA;

    But this doesnt help.

    &#xA;