avafinger / ffmpeg-3.3.4_cedrus264

ffmpeg 3.3.4 with cedrus264 HW encoder
19 stars 11 forks source link

Ubuntu 18.04 and baresip #4

Open alexlansovich opened 1 year ago

alexlansovich commented 1 year ago

Hello.

FFmpeg 3.3.4 compiled and working with sudo ffmpeg -f v4l2 -channel 0 -video_size 640x480 -i /dev/video0 -pix_fmt nv12 -t 15 -r 30 -c:v cedrus264 test4_640x480.mp4 But when compile Baresip - a get error. I think this is because old version of ffmpeg. Log eror is here https://gist.github.com/alexlansovich/e02b15a377b622a31bf81df4fec5f1cd Can you make FFmpeg for the 4 or 5 or 6 version?

avafinger commented 1 year ago

I don't know much about baresip. Do you get an error with ffmpeg version 4.x standalone or while running baresip?

alexlansovich commented 1 year ago

I am getting error when compile baresip. Baresip is using ffmpeg libraries.

wget -O re.v3.2.0.tar.gz https://github.com/baresip/re/archive/refs/tags/v3.2.0.zip unzip re.v3.2.0.tar.gz cd re-3.2.0 cmake -B build cmake --build build -j4 sudo cmake --install build sudo ldconfig

wget -O baresip.v3.2.0.tar.gz https://github.com/baresip/baresip/archive/refs/tags/v3.2.0.zip unzip baresip.v3.2.0.tar.gz cd baresip-3.2.0

cmake -B build cmake --build build -j4 <- at this stage sudo cmake --install build

avafinger commented 1 year ago

I am getting error when compile baresip

With my 3.3.4, ok.

I would like to know if you run THAT v4 (that compiles with baresip) works standalone. Does it?

alexlansovich commented 1 year ago

Yes. v4 working standalone and with baresip. But with baresip v4 have segfault after second sip video call.

avafinger commented 1 year ago

segfault after second sip video call.

Looks like the problem is in the baresip. Maybe baresip is not closing properly in the first instance. I would suggest you insert some debugging into v4 (ffmpeg) close, like cedrus264_close and also in the memory release, and compare the standalone with baresip info.

If i have enough time i may try this but i can't promise (i also need to set up a similar environment).

avafinger commented 1 year ago

In v4 should be ve_close() and cedrus264_close as well

alexlansovich commented 11 months ago

Hello. We have add some code and now baresip dont coredump after 3 call. But we have another problem - when sip clients connect to PBX - only one can see video. First client call to second - first get this error. If Second clal to first - Second getting this eror. Other codec dont get erorr - but no 30 fps( Can be this problem in cedrus coder?

Erorr: 07:51:55.-632514560|avcodec: decode: avcodec_send_packet error, packet=12732 bytes, ret=-1094995529 (Invalid data found when processing input) 07:51:55.-1093701140|video: H264 decode error (seq=26815, 1220 bytes): Bad message [74] 07:51:56.-632514560|avcodec: decode: avcodec_send_packet error, packet=12573 bytes, ret=-1094995529 (Invalid data found when processing input) 07:51:56.-1093701140|video: H264 decode error (seq=26826, 1061 bytes): Bad message [74] 07:51:56.-632514560|avcodec: decode: avcodec_send_packet error, packet=12315 bytes, ret=-1094995529 (Invalid data found when processing input) 07:51:56.-1093701140|video: H264 decode error (seq=26837, 803 bytes): Bad message [74]

avafinger commented 11 months ago

Can be this problem in cedrus coder?

Sorry, i haven't gone this far with cedrus, so i really don't know. I don't have any experience with baresip to suggest something really useful to try, but perhaps the code is multithreaded (or calling a second instance) and this can break the encoder or decoder?

Try saving the stream to a file at each endpoint so you can analyze the content.