elsampsa / valkka-core

Valkka - Create video surveillance, management and analysis programs with PyQt
GNU Lesser General Public License v3.0
181 stars 35 forks source link

Valkka server hangs after streaming few frames #8

Closed bobbych closed 4 years ago

bobbych commented 4 years ago

Issue:

We have been using Valkka for a while now. Everything worked great. Recently we added few new cameras from Axis communications, starting to see an issue where Valka server hangs after streaming few frames, no response or error message, it just hangs. We verified that it works with on opencv and openRTSP. We also played around with some setting in camera, like bit rate, etc still no avail.

Filter graph used

filtergraph:

    (LiveThread:livethread) --> {InfoFrameFilter:live_out_filter} -->> (AVThread:avthread) --> {SwsScaleFrameFilter:sws_scale_filter} --> {RGBShmemFrameFilter:shmem_filter}

source file

valkka_server.txt

Just need to modify RTSP URL in order to run and reproduce the issue.

Camera Specs

Sample output:

Created new TCP socket 3 for connection
[h264 @ 0x7fdbb4000ca0] no frame!
[h264 @ 0x7fdbb4000ca0] no frame!
[swscaler @ 0x7fdbb40b0840] deprecated pixel format used, make sure you did set range correctly
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652042432 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-62
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652042933 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=35
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652043433 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=19
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652043934 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=63
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652044434 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=23
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652044935 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=37
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652045379 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652045879 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=1
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652046380 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652046880 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-22
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652047381 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652047881 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-15
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652048381 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652048882 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-6
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652049382 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652049883 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-5
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652050383 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-33
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652050883 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-12
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652051384 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652051884 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=4
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652052385 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-34
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652052885 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-29
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652053385 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652053886 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-9
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652054386 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652054887 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-13
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652055387 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652055887 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=4
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652056388 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652056888 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-6
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652057388 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652057889 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=3
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652058389 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-27
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652058890 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=8
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652059390 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-41
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652059890 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-8
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652060391 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652060891 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-1
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652061392 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-34
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652061893 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-15
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652062394 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-29
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652062894 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-4
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652063394 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652063895 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-21
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652064395 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-34
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652064896 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652065396 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652065896 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-36
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652066397 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652066897 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=0
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652067398 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652067898 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-1
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652068398 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-28
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652068899 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-13
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652069399 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-33
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652069900 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-16
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652070400 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652070901 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-17
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652071401 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652071901 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-23
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652072402 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652072902 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-19
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652073403 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652073903 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-7
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652074403 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652074904 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-12
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652075405 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-38
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652075905 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-6
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652076406 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-26
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652076906 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=5
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652077406 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-28
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652077907 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-15
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652078407 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652078908 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=3
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652079408 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652079908 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-24
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652080409 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652080909 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-3
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652081410 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652081910 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-38
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652082411 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-27
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652082911 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-14
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652083411 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652083912 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-26
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652084412 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-29
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652084913 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-10
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652085413 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652085913 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-30
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652086414 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-28
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652086914 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=1
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652087415 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-29
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652087915 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=6
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652088416 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-28
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652088916 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-13
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652089416 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652089917 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-17
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652090417 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-40
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652090918 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-14
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652091418 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-29
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652091918 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652092419 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-31
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652092919 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-10
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652093420 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-32
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652093920 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-19
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652094420 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-50
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652094921 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-10
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652095421 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-27
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652095921 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-11
BriefInfoFrameFilter : shmem : <AVRGBFrame: timestamp=1565652096422 subsession_index=0 slot=1 / h=1080; w=1920; l=(5760,0,0); f=2> dT=-28
elsampsa commented 4 years ago
elsampsa commented 4 years ago

Ok.. said that, I found the bug.

There is one line in the code that was not executed, namely, this: https://github.com/elsampsa/valkka-core/blob/master/src/live.cpp#L518

Now it's getting executed and your bug should disappear.

Please update to 0.13.2 once the package system has churned through: https://launchpad.net/~sampsa-riikonen/+archive/ubuntu/valkka/+packages

And, still one comment about the "hanging" of the code: during those 600 seconds you're explicitly sleeping in your python code with time.sleep(600), you could be performing any other task you'd like (valkka runs in the background at cpp multithreads and without blocking your main code)

For example, meanwhile, you could be running your graphical user interface or do machine vision analysis using python.. that's the whole point of all of this..!

Please close this ticket once your Axis is working ok.

bobbych commented 4 years ago

Thank you for looking into this issue. I have tried new fix but still no luck. Interesting thing is that Valkka server stops streaming exactly after 60 seconds. Below is the output from the server using the script you provided, only change I did was increase sleep time (we only using this for testing). I also tested this on a docker container to make sure that I was using the latest version 0.13.2.

SwScaleFrameFilter: reserved 6220800 bytes for the bitmap
AVThread : constructor : N_MAX_DECODERS =4
Thread: startCall: waiting for avthread to start
AVThread: avthread : preRun
Thread: startCall: waiting for livethread to start
LiveThread: registerStream : rtsp stream registered at slot 1 with ptr 0x7fe044000b20
LiveThread: safeGetSlot : returning 1
LiveThread: playStream : playing.. 1
RTSPConnection : playStream : name liveMedia0
Created new TCP socket 3 for connection
ValkkaRTSPClient: Got a SDP description:
v=0
o=- 8541715433854160318 1 IN IP4 192.168.1.186
s=Session streamed with GStreamer
i=rtsp-server
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
a=control:rtsp://192.168.1.186:554/axis-media/media.amp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:50000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKawbGoBEA8eXwFuAgICgAAB9IAAdTB0MAAtxoAAHc1ld5caGAAW40AADuayu8uG+oA==,aO44MA==
a=ts-refclk:local
a=mediaclk:sender
a=control:rtsp://192.168.1.186:554/axis-media/media.amp/stream=0
a=framerate:30.000000
a=transform:0.000000,-1.000000,0.000000;0.750000,0.000000,0.000000;0.000000,0.000000,1.000000

ValkkaRTSPClient: handling subsession video
ValkkaRTSPClient: [URL:"rtsp://192.168.1.186:554/axis-media/media.amp/"]:  Initiated the "video/H264" subsession (client ports 32870-32871)
ValkkaRTSPClient: [URL:"rtsp://192.168.1.186:554/axis-media/media.amp/"]: Set up the "video/H264" subsession (client ports 32870-32871)
FrameSink: constructor: codec_name =H264, subsession_index =0
FrameSink: init H264 Frame
BriefInfoFrameFilter : live_out : <SetupFrame: timestamp=1565972811480 subsession_index=0 slot=1 / media_type=0 codec_id=28> dT=0
AVThread: avthread : run : registering decoder for subsession 0
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972811481 subsession_index=0 slot=1 / payload size=56 / H264: slice_type=7> dT=0
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972811481 subsession_index=0 slot=1 / payload size=8 / H264: slice_type=8> dT=0
FrameSink: constructor: internal_frame= <BasicFrame: timestamp=1565972811481 subsession_index=0 slot=1 / payload size=307204 / H264: slice_type=8>
ValkkaRTSPClient: [URL:"rtsp://192.168.1.186:554/axis-media/media.amp/"]: Created a data sink for the "video/H264" subsession
AVDecoder: registered decoder with av_codec_id 28
[h264 @ 0x7fe03c000ca0] no frame!
[h264 @ 0x7fe03c000ca0] no frame!
ValkkaRTSPClient: [URL:"rtsp://192.168.1.186:554/axis-media/media.amp/"]: Started playing session...
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812083 subsession_index=0 slot=1 / payload size=221752 / H264: slice_type=1> dT=-254
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812117 subsession_index=0 slot=1 / payload size=15064 / H264: slice_type=1> dT=-246
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812150 subsession_index=0 slot=1 / payload size=42362 / H264: slice_type=1> dT=-221
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812183 subsession_index=0 slot=1 / payload size=60434 / H264: slice_type=1> dT=-196
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812217 subsession_index=0 slot=1 / payload size=59443 / H264: slice_type=1> dT=-170
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812250 subsession_index=0 slot=1 / payload size=85383 / H264: slice_type=1> dT=-149
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812283 subsession_index=0 slot=1 / payload size=13062 / H264: slice_type=1> dT=-120
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812317 subsession_index=0 slot=1 / payload size=18362 / H264: slice_type=1> dT=-89
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812350 subsession_index=0 slot=1 / payload size=32297 / H264: slice_type=1> dT=-61
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812384 subsession_index=0 slot=1 / payload size=49833 / H264: slice_type=1> dT=-36
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812417 subsession_index=0 slot=1 / payload size=64203 / H264: slice_type=1> dT=-13
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812450 subsession_index=0 slot=1 / payload size=55685 / H264: slice_type=1> dT=10
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812484 subsession_index=0 slot=1 / payload size=55330 / H264: slice_type=1> dT=35
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812517 subsession_index=0 slot=1 / payload size=81676 / H264: slice_type=1> dT=56
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812550 subsession_index=0 slot=1 / payload size=71824 / H264: slice_type=1> dT=79
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812584 subsession_index=0 slot=1 / payload size=71365 / H264: slice_type=1> dT=102
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812617 subsession_index=0 slot=1 / payload size=105746 / H264: slice_type=1> dT=118
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812650 subsession_index=0 slot=1 / payload size=91587 / H264: slice_type=1> dT=137
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812684 subsession_index=0 slot=1 / payload size=89716 / H264: slice_type=1> dT=157
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812717 subsession_index=0 slot=1 / payload size=89382 / H264: slice_type=1> dT=177
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812750 subsession_index=0 slot=1 / payload size=89779 / H264: slice_type=1> dT=164
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812784 subsession_index=0 slot=1 / payload size=89095 / H264: slice_type=1> dT=171
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812817 subsession_index=0 slot=1 / payload size=90619 / H264: slice_type=1> dT=156
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812851 subsession_index=0 slot=1 / payload size=89256 / H264: slice_type=1> dT=116
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812884 subsession_index=0 slot=1 / payload size=89810 / H264: slice_type=1> dT=110
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972812917 subsession_index=0 slot=1 / payload size=90028 / H264: slice_type=1> dT=130
......................................
......................................

BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871153 subsession_index=0 slot=1 / payload size=103586 / H264: slice_type=1> dT=-259
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871186 subsession_index=0 slot=1 / payload size=61031 / H264: slice_type=1> dT=-234
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871220 subsession_index=0 slot=1 / payload size=69412 / H264: slice_type=1> dT=-210
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871253 subsession_index=0 slot=1 / payload size=105107 / H264: slice_type=1> dT=-193
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871286 subsession_index=0 slot=1 / payload size=60073 / H264: slice_type=1> dT=-168
BriefInfoFrameFilter : live_out : <BasicFrame: timestamp=1565972871320 subsession_index=0 slot=1 / payload size=69848 / H264: slice_type=1> dT=-165

Thread: closeThread: (1) livethread
Thread: closeThread: (2) joining : livethread
LiveThread: safeGetSlot : returning 1
LiveThread: deregisterStream : de-registering 1
ValkkaRTSPClient: shutdownStream :
ValkkaRTSPClient: shutdownStream : closing subsession
ValkkaRTSPClient: shutdownStream : closed subsession
ValkkaRTSPClient: shutdownStream : sending teardown
ValkkaRTSPClient: [URL:"rtsp://192.168.1.186:554/axis-media/media.amp/"]:  closing the stream.
RTSPConnection : stopStream: shut down
LiveThread: safeGetOutboundSlot : nothing at slot 0
LiveThread: safeGetOutboundSlot : nothing at slot 1
LiveThread: safeGetOutboundSlot : nothing at slot 2
LiveThread: safeGetOutboundSlot : nothing at slot 3
LiveThread: safeGetOutboundSlot : nothing at slot 4
LiveThread: safeGetOutboundSlot : nothing at slot 5
LiveThread: safeGetOutboundSlot : nothing at slot 6
LiveThread: safeGetOutboundSlot : nothing at slot 7
...................................................
...................................................

LiveThread: safeGetOutboundSlot : nothing at slot 251
LiveThread: safeGetOutboundSlot : nothing at slot 252
LiveThread: safeGetOutboundSlot : nothing at slot 253
LiveThread: safeGetOutboundSlot : nothing at slot 254
LiveThread: safeGetOutboundSlot : nothing at slot 255
livethread run : live555 loop exit
Thread: mainRun: (0) bye : livethread
Thread: closeThread: (3) joined : livethread
Thread: closeThread: (4) bye : livethread
Thread: closeThread: (1) avthread
Thread: closeThread: (2) joining : avthread
AVThread: avthread : postRun
Thread: mainRun: (0) bye : avthread
Thread: closeThread: (3) joined : avthread
Thread: closeThread: (4) bye : avthread
bye
Thread: closeThread: (1) avthread
Thread: closeThread: (1) avthread
Thread: closeThread: (1) livethread
Thread: closeThread: (1) livethread
randerse10 commented 4 years ago

A post from 2015 live555 seems related.

We use live555 to receive video and audio RTSP streams from cameras (and we show the video in our application). Our solution worked well for older Axis cameras, but it doesn't work for newer Axis cameras, which firmware is 5.6 or later.

The problem is that the stream stops after 1 minute. This is the typical timeout, so camera most probably doesn't get/accept the keep alive message. Note that I use the onvif RTSP stream (rtsp://[ip]/onvif-media/media.amp rtsp://[ip]/onvif-media/media.amp).

Some days ago I downloaded 2015.05.31 version of live555 library and I built testRTSPClient and did tests with this. It ran for 30 minutes for our old camera (then I stopped it), but it stopped after 1 minute with the new Axis camera (firmware 5.6).

I also tried VLC with the same stream, it worked well after 1 minute. I also tried to modify my code, and send OPTIONS command in every 10 seconds, and that also worked. Maybe VLS do similarly.

Do you have any idea what can be the problem? Is it an Axis firmware problem?

Probably. However this is not an “Axis” mailing list. Problems with “Axis” cameras need to be reported to Axis itself.

It appears that - with your newest “Axis” firmware - the RTSP server in your network camera does not recognize incoming RTCP “RR” packets (from the RTSP client) as indicating client ‘liveness’. (Apparently, in the older version of the firmware, your camera either recognized incoming RTCP packets as indicating client liveness, or (more likely) did not time-out RTSP clients at all.)

As you noted, you can overcome this problem by sending “OPTIONS” commands periodically. (Every 10s seems excessive, though.) A better solution, however, is to report this problem to “Axis”, and tell them to fix their firmware to use incoming RTCP “RR” packets to indicate client ‘liveness’.

http://lists.live555.com/pipermail/live-devel/2015-June/019425.html

elsampsa commented 4 years ago

Yes, this was in the back of my mind (we have encountered this before in other projects): Axis software is buggy, and one need to send the "OPTIONS" rtsp query each minute to the camera.

Expect a bugfix for this later this week.

elsampsa commented 4 years ago

Should be fixed at version 0.13.3. Please update & try.

bobbych commented 4 years ago

seems to be fixed now. Thanks again !

randerse10 commented 4 years ago

ffplay still complains when playing video dumped to file from AXIS rtsp stream as per lesson_1_c.py however file is now playable in latest ffplay and vlc after bugfix.

Was going to open ticket about this but problem seems related and was resolved.

ffplay console output sample:

[h264 @ 0x7fc0e0003980] non-existing PPS 0 referenced 0B f=0/0 Last message repeated 1 times [h264 @ 0x7fc0e0003980] decode_slice_header error [h264 @ 0x7fc0e0003980] no frame! [h264 @ 0x7fc0e0003980] non-existing PPS 0 referenced Last message repeated 1 times [NULL @ 0x7fc0e0003980] missing picture in access unit with size 24 [NULL @ 0x7fc0e0003980] missing picture in access unit with size 8 [h264 @ 0x7fc0e0734980] no frame! 0KB vq= 995KB sq= 0B f=0/0 [h264 @ 0x7fc0e0009180] no frame! 0KB vq= 1033KB sq= 0B f=0/0