
Recherche avancée
Autres articles (18)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (3808)
-
How to debug ffmpeg reliability for long running rtsp streams
13 septembre 2022, par MarkI have a long running ffmpeg background process that "watches" an rtsp stream and takes snapshots every 7 minutes.


It's being run like this


C:\Windows\System32\cmd.exe /c C:\ffmpeg\bin\ffmpeg.exe -nostdin -rtsp_transport tcp -y -timeout 5000000 -i rtsp://someurl -q:v 1 -an -vf fps=0.002381,scale="1280:720" -strftime 1 -f image2 C:\somelocalfolder\%Y-%m-%d_%H-%M-%S.jpg > c:\ffmpeglog.txt 2>&1



This process runs for days but intermittently, for hours at a time, seems to miss taking snapshots, until eventually it starts to take them again - then fail again, etc. The logs at info level are not helpful. I checked the stream during times when it was not taking snapshots and the stream was up. What's happening here ? How can I debug this ?


Below is an image of succesfull snapshots per hour. There should always be between 8 and 9.



Logs look like this


ffmpeg version 2022-03-31-git-e301a24fa1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 57. 24.101 / 57. 24.101
 libavcodec 59. 25.100 / 59. 25.100
 libavformat 59. 20.101 / 59. 20.101
 libavdevice 59. 6.100 / 59. 6.100
 libavfilter 8. 29.100 / 8. 29.100
 libswscale 6. 6.100 / 6. 6.100
 libswresample 4. 6.100 / 4. 6.100
 libpostproc 56. 5.100 / 56. 5.100
Input #0, rtsp, from 'rtsp://somerul':
 Metadata:
 title : HIK Media Server V4.21.005
 comment : HIK Media Server Session Description : standard
 Duration: N/A, start: 0.033000, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 704x576, 30 tbr, 90k tbn
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
[swscaler @ 000002a1c2c20680] [swscaler @ 000002a1c2c2e0c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000002a1c2c20680] [swscaler @ 000002a1c2c67c40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000002a1c2c20680] [swscaler @ 000002a1c2cc6700] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'C:\somelocalfolder\Temp\stream_2\StreamedImages\%Y-%m-%d_%H-%M-%S.jpg':
 Metadata:
 title : HIK Media Server V4.21.005
 comment : HIK Media Server Session Description : standard
 encoder : Lavf59.20.101
 Stream #0:0: Video: mjpeg, yuvj420p(pc, progressive), 1280x720, q=2-31, 200 kb/s, 0.0024 fps, 0.0024 tbn
 Metadata:
 encoder : Lavc59.25.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 



Update
I got some trace logs. The ffmpeg seems to fail silently at some point and stop taking snapshots.


After about 3 million log lines (which is really only a couple of hours in my case) I get the following


rtsp://192.168.15.195:554/streaming/channels/904: Unknown error



But ffmpeg silently continues. Here is a bit more of the log


[Parsed_fps_0 @ 00000248e7d50e40] Read frame with in pts 1074443040, out pts 28
[Parsed_fps_0 @ 00000248e7d50e40] Dropping frame with pts 28
frame= 28 fps=0.0 q=1.0 size=N/A time=03:08:59.77 bitrate=N/A speed=0.95x 
[rtsp @ 00000248e765cf00] tcp_read_packet:
[h264 @ 00000248e7d59880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3
[rtsp @ 00000248e765cf00] ret=-138 c=24 [$]
rtsp://192.168.15.195:554/streaming/channels/904: Unknown error
[Parsed_fps_0 @ 00000248e7d50e40] Read frame with in pts 1074446100, out pts 28
[Parsed_fps_0 @ 00000248e7d50e40] Dropping frame with pts 28
frame= 28 fps=0.0 q=1.0 size=N/A time=03:08:59.77 bitrate=N/A speed=0.95x 
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=696
[rtsp @ 00000248e765cf00] Sending:
GET_PARAMETER rtsp://192.168.15.195:554/streaming/channels/904 RTSP/1.0

CSeq: 402

User-Agent: Lavf59.20.101

Session: 931848797

Authorization: Digest username="******", realm="709382dda4ccb674edf093d3", nonce="13fca62fc", uri="rtsp://192.168.15.195:554/streaming/channels/904", response="74341df9611f0ac3dc247b402424735b", algorithm="MD5"



--
[NULL @ 00000248e7662640] nal_unit_type: 7(SPS), nal_ref_idc: 3
[NULL @ 00000248e7662640] nal_unit_type: 8(PPS), nal_ref_idc: 3
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=756
[Parsed_fps_0 @ 00000248e7d50e40] Read frame with in pts 1074449070, out pts 28
[Parsed_fps_0 @ 00000248e7d50e40] Dropping frame with pts 28
[Parsed_fps_0 @ 00000248e7d50e40] Read frame with in pts 1074449070, out pts 28
[Parsed_fps_0 @ 00000248e7d50e40] Dropping frame with pts 28
frame= 28 fps=0.0 q=1.0 size=N/A time=03:08:59.77 bitrate=N/A speed=0.949x 
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
frame= 28 fps=0.0 q=1.0 size=N/A time=03:08:59.77 bitrate=N/A speed=0.949x 
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1228
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
[NULL @ 00000248e7662640] reference count 1 overflow
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=804
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=1352
[NULL @ 00000248e7662640] illegal memory management control operation 11
[rtsp @ 00000248e765cf00] tcp_read_packet:
[rtsp @ 00000248e765cf00] ret=1 c=24 [$]
[rtsp @ 00000248e765cf00] id=0 len=836



Basically it appears an issue of ffmpeg silently failing. If it crashed, my software could detect it and I could rerun it, but if it fails silently like this, I need another solution.


-
what is wrong with this ffmpeg command ? i am trying to trim a video & apply audio filter(audio disable) to it
18 septembre 2022, par Khaled Mortajai am working on a a command that trim a video, after trim it applies audio filter to some seconds of the trimmed video.


-ss 0:00:02.000000 -i "/data/user/0/com.example.cameraapp/cache/REC4972494270640553218.mp4" -t 0:00:14.000000 -avoid_negative_ts make_zero -af volume=enable='between(t,5,10)':volume=0 "/data/user/0/com.example.cameraapp/app_flutter/Trimmer/REC4972494270640553218_trimmed:Sep18,2022-22:24:01.mp4"



the af is the audio filter
anyone have idea what is wrong here ?


-
How to send ffmpeg AVPacket through WebRTC (using libdatachannel)
14 novembre 2022, par mikeI'm encoding a video frame with the
ffmpeg
libraries, generating anAVPacket
with compressed data.

Thanks to some recent advice here on S/O, I am trying to send that frame over a network using the
WebRTC
librarylibdatachannel
, specifically by adapting the example here :

https://github.com/paullouisageneau/libdatachannel/tree/master/examples/streamer


I am seeing problems inside
h264rtppacketizer.cpp
(part of the library, not the example) which are almost certainly to do with how I'm providing the sample data.
(I don't think that this is anything to do with libdatachannel specifically, it will be an issue with what I'm sending)

The example code reads each encoded frame from a file, and populates a
sample
by setting the content of the file to the contents of the file :

sample = *reinterpret_cast *>(&fileContents);


sample
is just astd::vector<byte>;</byte>


I have naively copied the contents of an
AVPacket->data
pointer into thesample
vector :

sample.resize(pkt->size);
memcpy(sample.data(), pkt->data, pkt->size * sizeof(std::byte)); 



but the packetizer is falling over when trying to get length values out of that data.
Specifically, in the following code, the first iteration gets a length of 1, but the second, looking up index 5, gives 1119887324. This is way too big for my data, which is only 3526 bytes (the whole frame is a single colour so likely to be small once encoded) :


while (index < message->size()) {
assert(index + 4 < message->size());
auto lengthPtr = (uint32_t *)(message->data() + index);
uint32_t length = ntohl(*lengthPtr);
auto naluStartIndex = index + 4;
auto naluEndIndex = naluStartIndex + length;
assert(naluEndIndex <= message->size()); 
 
auto begin = message->begin() + naluStartIndex;
auto end = message->begin() + naluEndIndex;
nalus->push_back(std::make_shared<nalunit>(begin, end));
index = naluEndIndex;
}
</nalunit>


Here is a dump of


uint32_t length = ntohl(*lengthPtr);



for the first few elements of the message (
*lengthPtr
in parentheses) :

[2022-03-29 15:12:01.182] [info] index 0: 1 (16777216)
[2022-03-29 15:12:01.183] [info] index 1: 359 (1728118784)
[2022-03-29 15:12:01.184] [info] index 2: 91970 (1114046720)
[2022-03-29 15:12:01.186] [info] index 3: 23544512 (3225577217)
[2022-03-29 15:12:01.186] [info] index 4: 1732427807 (532693607)
[2022-03-29 15:12:01.187] [info] index 5: 1119887324 (3693068354)
[2022-03-29 15:12:01.188] [info] index 6: 3223313413 (98312128)
[2022-03-29 15:12:01.188] [info] index 7: 534512896 (384031)
[2022-03-29 15:12:01.188] [info] index 8: 3691315291 (1526728156)
[2022-03-29 15:12:01.189] [info] index 9: 83909537 (2707095557)
[2022-03-29 15:12:01.189] [info] index 10: 6004992 (10574592)
[2022-03-29 15:12:01.190] [info] index 11: 1537277952 (41307)
[2022-03-29 15:12:01.190] [info] index 12: 2701131779 (50331809)
[2022-03-29 15:12:01.192] [info] index 13: 768 (196608)



(I know I should post a complete sample, I am working on it)


- 

-
I am fairly sure I am just missing something basic. E.g. am I supposed to do something with the
AVPacket
side_data
, does AVPacket have or miss some header info ?

-
If I just
fwrite
thepkt->data
for a single frame to disk, I can read the codec information withffprobe
:







Input #0, h264, from 'encodedOut.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1280x720, 30 tbr, 1200k tbn



Update : This issue is solved by changing the
H264RtpPacketizer
separator setting fromH264RtpPacketizer::Separator::Length
toH264RtpPacketizer::Separator::LongStartSequence
, many thanks to author of libdatachannel paullouisageneau (see answer below)

I have issues related to settings for the
libx264
encoder, but can happily encode withh264_nvenc
andh264_mf


-