Transcoding process hangs
Posted: 19 Jan 2022 19:11
I am hosting a webcam, converting its rtsp stream to http. Here is the VLC (3.0.16) command line that I use on my Windows 10 PC:
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I http -R rtsp://192.168.0.116:554/11 --intf=dummy --sout "#transcode{vcodec=mjpg,venc=ffmpeg{strict=1},vb=1536,fps=1,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" --extraintf=http:logger --verbose=2 --file-logging --logfile=vlc-log.txt
Those vb and fps rates correspond to the bit rate and fps of the H264 stream on the camera. (The camera supports H264 baseline, H264 mainprofile, H264 highprofile, and H265 mainprofile. I have no idea what effect changing that might have. Currently I have H264 highprofile selected, at 50Hz)
To view the stream, I connect to http://localhost:8888/videostream.cgi from a web browser on the same PC or http://<my-public-ip>:8888/videostream.cgi from the Internet. This works OK but sometimes the stream just stops and cannot be restarted by refreshing the browser page. VLC does not crash or exit and there is no error message in the logfile at that point; it just stops streaming to http. (While it is working, there are regular "late buffer for mux input" messages in the logfile. I wish I knew how to timestamp those.)
This hang-up normally happens after several hours of operation. Until now I had put it down to "one of those things", and just set up my PC to kill the VLC process and restart it a couple of times per day.
However, I have recently found that I can provoke the problem by going outside to the camera (which normally points at the view from my balcony) and putting my hand up in front of the lens. When I do this, the streaming stops and the last image that it captures (for example, as shown on my phone which has the http stream open) is a picture of my fingers.
One possible explanation is that the picture is somehow "too different" from the previous one and something is getting overwhelmed, although the VLC process normally only takes up 2-3% of my CPU. But I don't know where to start with debugging this. Any tips would be appreciated!
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I http -R rtsp://192.168.0.116:554/11 --intf=dummy --sout "#transcode{vcodec=mjpg,venc=ffmpeg{strict=1},vb=1536,fps=1,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" --extraintf=http:logger --verbose=2 --file-logging --logfile=vlc-log.txt
Those vb and fps rates correspond to the bit rate and fps of the H264 stream on the camera. (The camera supports H264 baseline, H264 mainprofile, H264 highprofile, and H265 mainprofile. I have no idea what effect changing that might have. Currently I have H264 highprofile selected, at 50Hz)
To view the stream, I connect to http://localhost:8888/videostream.cgi from a web browser on the same PC or http://<my-public-ip>:8888/videostream.cgi from the Internet. This works OK but sometimes the stream just stops and cannot be restarted by refreshing the browser page. VLC does not crash or exit and there is no error message in the logfile at that point; it just stops streaming to http. (While it is working, there are regular "late buffer for mux input" messages in the logfile. I wish I knew how to timestamp those.)
This hang-up normally happens after several hours of operation. Until now I had put it down to "one of those things", and just set up my PC to kill the VLC process and restart it a couple of times per day.
However, I have recently found that I can provoke the problem by going outside to the camera (which normally points at the view from my balcony) and putting my hand up in front of the lens. When I do this, the streaming stops and the last image that it captures (for example, as shown on my phone which has the http stream open) is a picture of my fingers.
One possible explanation is that the picture is somehow "too different" from the previous one and something is getting overwhelmed, although the VLC process normally only takes up 2-3% of my CPU. But I don't know where to start with debugging this. Any tips would be appreciated!