UV4L H.264 Stream not working, MJPEG works



  • I'm just getting started with Shinobi. I like the API and the software seems to be pretty popular on the openHAB forums. I apologize if this has been asked and answered. The search function doesn't work for me and I didn't find an answer in the top 100 or so postings.

    I have a Raspberry Pi in my garage with a camera module attached running some home automation stuff as well as UV4L to stream the camera feed. I've configured UV4L to stream H.264 and I can successfully bring up the H.264 feed in Chrome. Apparently it also serves the MJPEG stream as well, even though I've not configured that, and I can bring up that stream in Chrome too. In both cases I'm bringing up the actual stream, not some web page with the stream embedded: http://ip-of-rpi:8080/stream/video.h264 and http://ip-of-rpi:8080/stream/video.mjpeg.

    UV4L will allow up to three simultaneous connections and I can monitor how many connections there are so I've eliminated exceeding that as a problem.

    When I configure a monitor using the MJPEG stream (recommended settings from the docs) everything works great. I can see the stream, recordings are saved. Everything works great. But I've read on the docs that if one can stream H.264 it is better to as it's less resource intensive I guess. However, when I try to configure a monitor on the h.264 stream using the recommended settings from the docs I can't get it to work. The thumbnail remains blank and I get errors in the log. In both cases I have the frame rate and resolution match what UV4L is producing.

    AmioC31gF8 : qDZyyxHjF3
    Process Unexpected Exit a few seconds ago
    msg : Process Crashed for Monitor
    cmd : -loglevel warning -r 15 -progress pipe:5 -analyzeduration 1000000 -probesize 1000000 -fflags +igndts -i "http://XXX.XXX.XXX.xxx:8080/stream/video.h264" -an -vcodec libx264 -r 15 -s 1280x720 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 "/opt/shinobi/videos/AmioC31gF8/qDZyyxHjF3/%Y-%m-%dT%H-%M-%S.mp4" -preset ultrafast -an -c:v copy -f hls -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/AmioC31gF8/qDZyyxHjF3/s.m3u8"
    AmioC31gF8 : qDZyyxHjF3
    FFMPEG STDERR a few seconds ago
    [mpjpeg @ 0x427f640] Unexpected Content-Type : video/h264 [mpjpeg @ 0x427f640] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Output file #0 does not contain any stream
    
    AmioC31gF8 : qDZyyxHjF3
    Process Started a few seconds ago
    cmd : -loglevel warning -r 15 -progress pipe:5 -analyzeduration 1000000 -probesize 1000000 -fflags +igndts -i "http://XXX.XXX.XXX.XXX:8080/stream/video.h264" -an -vcodec libx264 -r 15 -s 1280x720 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 "/opt/shinobi/videos/AmioC31gF8/qDZyyxHjF3/%Y-%m-%dT%H-%M-%S.mp4" -preset ultrafast -an -c:v copy -f hls -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/AmioC31gF8/qDZyyxHjF3/s.m3u8"
    AmioC31gF8 : qDZyyxHjF3
    
    Process Unexpected Exit a few seconds ago
    msg : Process Crashed for Monitor
    cmd : -loglevel warning -r 15 -progress pipe:5 -analyzeduration 1000000 -probesize 1000000 -fflags +igndts -i "http://10.10.1.123:8080/stream/video.h264" -an -vcodec libx264 -r 15 -s 1280x720 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 "/opt/shinobi/videos/AmioC31gF8/qDZyyxHjF3/%Y-%m-%dT%H-%M-%S.mp4" -preset ultrafast -an -c:v copy -f hls -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/AmioC31gF8/qDZyyxHjF3/s.m3u8"
    AmioC31gF8 : qDZyyxHjF3
    FFMPEG STDERR a few seconds ago
    Output file #0 does not contain any stream
    
    AmioC31gF8 : qDZyyxHjF3
    FFMPEG STDERR a few seconds ago
    [mpjpeg @ 0x4a8a640] Unexpected Content-Type : video/h264 [mpjpeg @ 0x4a8a640] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options
    
    AmioC31gF8 : qDZyyxHjF3
    Process Started a few seconds ago
    cmd : -loglevel warning -r 15 -progress pipe:5 -analyzeduration 1000000 -probesize 1000000 -fflags +igndts -i "http://10.10.1.123:8080/stream/video.h264" -an -vcodec libx264 -r 15 -s 1280x720 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 "/opt/shinobi/videos/AmioC31gF8/qDZyyxHjF3/%Y-%m-%dT%H-%M-%S.mp4" -preset ultrafast -an -c:v copy -f hls -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/AmioC31gF8/qDZyyxHjF3/s.m3u8"
    

    I can live with the MJPEG stream if I need to but I'd like to use the H.264 stream if that is possible. No sense using more resources than I have to.

    I'm pretty new to this stuff but the Unexpected Content-Type : video/h264 [mpjpeg @ 0x4a8a640] makes me think that even though I'm pulling up what is supposed to be the H.264 stream it is identifying itself as MJPEG? But I could be misinterpreting this line, hence my posting here.

    These details probably are not relevant, but I'm running the Docker image on an Ubuntu 18.02 server VM. I've no hardware acceleration set up. I've only these two monitor set up right now and probably will not have more than two more when all is said and done. I've pretty light weight requirements.

    Many thanks for any advice.


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.