No internet connection
  1. Home
  2. Technical Support

H.264 fail

By @sr800
    2023-01-18 12:15:33.775Z

    I'm getting this error when trying to switch to H.264. I've tried disabling and re-enabling it then rebooting, but same issue. "TinyPilot failed to stream video output from your target device using H.264 compression." How can I fix this?

    Logs link: https://logs.tinypilotkvm.com/pnGL1nX4

    Solved in post #8, click to view
    • 9 replies
    1. David @david2023-01-18 15:03:44.383Z

      Hi @sr800, sorry that you're running into this H.264 issue.

      Thanks for sharing your logs too! I took a look at the logs and I can't see any issues there.

      It could be an issue with the TinyPilot web interface. Could you share your browser's Javascript console output when you encounter the error on your TinyPilot? You may need to double-check that filtering is off for each of the message types (errors, warnings, info, etc.).

      1. S
        In reply tosr800:
        @sr800
          2023-01-18 15:24:12.702Z

          Thank you for the reply. Only MJPEG works. Same issue on multiple browsers and PCs. Console output below:

          janus.js:97 WebSocket connection to 'ws://tinypilot/janus/ws' failed:
          newWebSocket @ janus.js:97
          createSession @ janus.js:868
          Janus @ janus.js:543
          (anonymous) @ webrtc-video.js:44
          webrtc-video.js:53 Connection to Janus failed: Error connecting to the Janus WebSockets server: Is the server down?
          error @ webrtc-video.js:53
          error @ janus.js:886
          error (async)
          createSession @ janus.js:927
          Janus @ janus.js:543
          (anonymous) @ webrtc-video.js:44

          1. David @david2023-01-18 19:24:39.035Z

            Thanks for sharing those console logs! It looks like the Janus server that's used for H.264 may not be running.

            Were you using H.264 successfully before - before you updated to 2.5.2?

            And are you connecting to your TinyPilot on a local network or a remote connection?

            We can check whether the Janus server is up by running this curl command on your TinyPilot (SSH into your TinyPilot and then run):

            curl -v 127.0.0.1:8002
            

            If the Janus server is down, you'll get something like this:

            Failed to connect to 127.0.0.1 port 8002: Connection refused
            
          2. S
            In reply tosr800:
            @sr800
              2023-01-18 19:29:20.017Z

              I thought it was using H.264 before the 2.5.2 update since I'd followed the manual enable steps from this forum. I ran nmap on the tinypilot and 8002 is not open.

              1. David @david2023-01-19 12:19:40.327Z

                Ok, cool - thanks for clarifying.

                Just to confirm, is your TinyPilot and client machine on the same local network?

                Can you SSH into your TinyPilot and check the status of the Janus service?

                sudo service janus status
                

                If it's running, it should return Active: active (running), if not, Active: inactive (dead)

                If it's not running, could you restart the Janus service and see if that brings up the Janus server (and H.264 streaming)?

                sudo service janus restart
                
                1. S@sr800
                    2023-01-19 15:59:30.387Z2023-01-19 16:45:35.070Z

                    Local network. I ran the janus service status and it appears that that command started the service but then the ssh session froze. I tried restart and status, it's not active.

                    pilot@tinypilot:~ $ sudo janus status
                    Janus commit: not-a-git-repo
                    Compiled on:  Sat Apr 11 13:33:31 UTC 2020
                    
                    Logger plugins folder: /usr/lib/arm-linux-gnueabihf/janus/loggers
                    [WARN] Logger plugin 'libjanus_jsonlog.so' has been disabled, skipping...
                    ---------------------------------------------------
                      Starting Meetecho Janus (WebRTC Server) v0.9.2
                    ---------------------------------------------------
                    Checking command line arguments...
                    Debug/log level is 4
                    Debug/log timestamps are disabled
                    Debug/log colors are enabled
                    Using 192.168.1.56 as local IP...
                    [WARN] Token based authentication disabled
                    Initializing recorder code
                    Initializing ICE stuff (Full mode, ICE-TCP candidates disabled, half-trickle, IPv6 support disabled)
                    TURN REST API backend: (disabled)
                    [WARN] Janus is deployed on a private address (192.168.1.56) but you didn't specify any STUN server! Expect trouble if this is supposed to work over the internet and not just in a LAN...
                    Crypto: OpenSSL >= 1.1.0
                    [WARN] The libsrtp installation does not support AES-GCM profiles
                    [WARN] No cert/key specified, autogenerating some...
                    Fingerprint of our certificate: 41:36:4C:1A:EA:3B:99:87:2F:2A:92:D6:2B:6A:D8:32:E2:51:E9:03:AB:6B:D2:75:E6:D3:A5:0C:C8:EF:0C:06
                    [WARN] Event handlers support disabled
                    Plugins folder: /usr/lib/arm-linux-gnueabihf/janus/plugins
                    Joining Janus requests handler thread
                    Sessions watchdog started
                    [WARN] Plugin 'libjanus_sip.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_recordplay.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_textroom.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_voicemail.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_videocall.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_videoroom.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_audiobridge.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_duktape.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_streaming.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_lua.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_echotest.so' has been disabled, skipping...
                    [WARN] Plugin 'libjanus_nosip.so' has been disabled, skipping...
                    Loading plugin 'libjanus_ustreamer.so'...
                    == ustreamer -- Initializing plugin ...
                    == ustreamer -- Reading config file '/etc/janus/janus.plugin.ustreamer.jcfg' ...
                    [WARN] The 'janus.plugin.ustreamer' plugin doesn't implement any callback for RTP/RTCP/data... is this on purpose?
                    == ustreamer -- No active watchers, memsink disconnected
                    Transport plugins folder: /usr/lib/arm-linux-gnueabihf/janus/transports
                    Loading transport plugin 'libjanus_websockets.so'...
                    [WARN] libwebsockets has been built without IPv6 support, will bind to IPv4 only
                    libwebsockets logging: 0
                    WebSockets server started (port 8002)...
                    [WARN] Secure WebSockets server disabled
                    [WARN] Admin WebSockets server disabled
                    [WARN] Secure Admin WebSockets server disabled
                    JANUS WebSockets transport plugin initialized!
                    [WARN] Transport plugin 'libjanus_http.so' has been disabled, skipping...
                    [WARN] Transport plugin 'libjanus_nanomsg.so' has been disabled, skipping...
                    [WARN] Transport plugin 'libjanus_pfunix.so' has been disabled, skipping...
                    [WARN] Transport plugin 'libjanus_rabbitmq.so' has been disabled, skipping...
                    WebSockets thread started
                    [WARN] libnice version outdated: 0.1.14 installed, at least 0.1.15 recommended
                    
                    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                    pilot@tinypilot:~ $ sudo service janus restart
                    pilot@tinypilot:~ $ sudo service janus status
                    ● janus.service - Janus Gateway
                       Loaded: loaded (/etc/systemd/system/janus.service; enabled; vendor preset: enabled)
                       Active: failed (Result: exit-code) since Thu 2023-01-19 15:55:08 UTC; 15s ago
                      Process: 352 ExecStart=/opt/janus/bin/janus --cwd-path=/opt/janus --configs-folder=/opt/janus/etc/janus --log-file=/var/log/janus/janus.log (code=exite
                     Main PID: 352 (code=exited, status=203/EXEC)
                    
                    Jan 19 15:55:08 tinypilot systemd[1]: Started Janus Gateway.
                    Jan 19 15:55:08 tinypilot systemd[352]: janus.service: Failed to execute command: No such file or directory
                    Jan 19 15:55:08 tinypilot systemd[352]: janus.service: Failed at step EXEC spawning /opt/janus/bin/janus: No such file or directory
                    Jan 19 15:55:08 tinypilot systemd[1]: janus.service: Main process exited, code=exited, status=203/EXEC
                    Jan 19 15:55:08 tinypilot systemd[1]: janus.service: Failed with result 'exit-code'.
                    
                    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                    
                    pilot@tinypilot:~ $ sudo service janus status
                    ● janus.service - Janus Gateway
                       Loaded: loaded (/etc/systemd/system/janus.service; enabled; vendor preset: enabled)
                       Active: failed (Result: exit-code) since Thu 2023-01-19 15:55:08 UTC; 1min 6s ago
                      Process: 352 ExecStart=/opt/janus/bin/janus --cwd-path=/opt/janus --configs-folder=/opt/janus/etc/janus --log-file=/var/log/janus/janus.log (code=exite
                     Main PID: 352 (code=exited, status=203/EXEC)
                    
                    Jan 19 15:55:08 tinypilot systemd[1]: Started Janus Gateway.
                    Jan 19 15:55:08 tinypilot systemd[352]: janus.service: Failed to execute command: No such file or directory
                    Jan 19 15:55:08 tinypilot systemd[352]: janus.service: Failed at step EXEC spawning /opt/janus/bin/janus: No such file or directory
                    Jan 19 15:55:08 tinypilot systemd[1]: janus.service: Main process exited, code=exited, status=203/EXEC
                    Jan 19 15:55:08 tinypilot systemd[1]: janus.service: Failed with result 'exit-code'.
                    
                    1. David @david2023-01-20 17:26:21.717Z

                      Thanks for sharing that. It looks like Janus is broken. The output you shared has references to files in the wrong locations which is odd. I haven't been able to reproduce the issue either, so I don't know how it happened.

                      The easiest fix here is to re-flash your SD card for a clean install of 2.5.2 - although it's a bit drastic if you have settings and other data you'd like to preserve.

                      If you don't want to re-flash, another option is to SSH into your TinyPilot and try running the following commands. It might fix the issue, but depending on how extensive the problem is, there's a chance it won't work.

                      sudo apt remove -y janus && \
                        sudo rm /etc/systemd/system/janus.service && \
                        cd /opt/tinypilot-updater/ && \
                        sudo ./install && \
                        sudo reboot
                      

                      Let me know how it goes!

                      ReplySolution
                      1. S@sr800
                          2023-01-22 14:38:34.458Z

                          Running those commands worked. Thanks.

                          1. David @david2023-01-23 12:04:05.983Z

                            Perfect! No problem at all! Thanks for the update @sr800.

                            Feel free to reach out again in future if you run into any other issues or if you have other questions.