No internet connection
  1. Home
  2. Technical Support

2.4.1 H264

By NightLink42 @NightLonk42
    2022-05-13 04:33:49.843Z

    Hello there :)

    I see that experimental support was added for H264 streaming, but I don't see any way to enable it in the GUI. I'm guessing it's done over SSH and if so, how?

    Thanks!

    Solved in post #2, click to view
    • 12 replies
    1. Michael Lynch @michael2022-05-13 12:07:09.695Z2022-05-16 15:48:50.106Z

      We're in the process of simplifying these instructions for a blog post Monday, but here's the current process once you've updated to 2.4.1:

      Requirements

      • Debian 10 (Buster)

      We don't yet have builds working for Ubuntu or later versions of Debian.

      Enable H264

      echo 'ustreamer_h264_sink: tinypilot::ustreamer::h264
      ustreamer_h264_sink_mode: 777
      ustreamer_h264_sink_rm: yes
      ustreamer_compile_janus_plugin: yes
      tinypilot_install_janus: yes' | sudo tee --append /home/tinypilot/settings.yml && \
        sudo /opt/tinypilot/quick-install && \
        sudo apt-get autoremove --yes && \
        sudo reboot
      

      Note that the installation process builds the WebRTC server from source on the device, so it takes about 30 minutes for the initial installation. We're working on a pre-made binary to avoid this slow process.

      Disable H264

      TINYPILOT_SETTINGS='/home/tinypilot/settings.yml'
      sudo sed --in-place '/^ustreamer_h264_sink:/d' "${TINYPILOT_SETTINGS}" && \
        sudo sed --in-place '/^ustreamer_h264_sink_mode:/d' "${TINYPILOT_SETTINGS}" && \
        sudo sed --in-place '/^ustreamer_h264_sink_rm:/d' "${TINYPILOT_SETTINGS}" && \
        sudo sed --in-place '/^ustreamer_compile_janus_plugin:/d' "${TINYPILOT_SETTINGS}" && \
        sudo sed --in-place '/^tinypilot_install_janus:/d' "${TINYPILOT_SETTINGS}" && \
        sudo systemctl disable janus && \
        sudo service janus stop && \
        sudo /opt/tinypilot/quick-install && \
        sudo reboot
      
      ReplySolution
      1. NNightLink42 @NightLonk42
          2022-05-14 19:06:28.658Z

          Awesome ty!

          I did get an error trying to disable H64 though

          TASK [tinypilot.tinypilot-pro : patch Janus plugin.h file to successfully include refcount.h file] ***
          skipping: [localhost]
          
          TASK [ansible-role-ustreamer : check that the H264 variables are in a consistent state] ***
          fatal: [localhost]: FAILED! => {"changed": false, "msg": "The H264 variables are in an inconsistent state. You must set the ustreamer_h264_sink variable in order to set other H264 variables."}
          
          1. Sorry about that! I had an error in the disabling instructions. I've updated the snippet above. If you re-run the instructions, it should disable H264 successfully.

          2. In reply tomichael:
            DDan Medhurst @d4nm3d
              2022-05-14 22:28:24.458Z

              Hi, i've just tried to enable after updating and i receive the following error :

              TASK [ansible-role-janus-gateway : Install required platform dependencies] *************************************************************************************************************************************
              fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'gstreamer1.0-doc' is available"}

              1. Thanks for reporting this! What OS is running on the target system?

                1. DDan Medhurst @d4nm3d
                    2022-05-16 15:43:37.371Z

                    HI, it's running :

                    Distributor ID: Raspbian
                    Description: Raspbian GNU/Linux 11 (bullseye)
                    Release: 11
                    Codename: bullseye

                    1. Ah, it needs to be Debian Buster. I've updated the instructions above.

                      A huge part of the Pi's H264 encoding stack changed between Buster and Bullseye, and the Bullseye APIs are unfortunately not backwards compatible, so it's going to take some more work to get everything working on Bullseye.

                      1. S@sr800
                          2022-05-18 12:50:56.365Z

                          I've enabled H264 and it works well. Are the GUI video settings no longer relevant with H264?

                          1. Frame rate still has an effect, but JPEG quality doesn't. We're working on integrating H264 support into the web UI so that the settings match the video mode you're using.

                2. L
                  In reply toNightLonk42:
                  Michael @Lateralus11235
                    2022-05-18 14:43:21.324Z

                    I was able to successfully install this update. Here are some observations:

                    • Will not work in Safari (latest releases) in either iOS or MacOS. The site comes up but the video will not display. If I refresh in iOS is briefly shows up and then disappears. This is with or without the visual keyboard on.
                    • Works fine using the Edge browser in MacOS, but not on iOS.
                    • I have Tailscale installed on my tiny pilot. I cannot access it on either iOS (same issue above re: browsers likely the issue) but also can’t from a MacBook Pro running Edge.
                    • On a very positive note, it’s very smooth rendering when using the Edge browser - a definite improvement.
                    1. Thanks for reporting this! I've filed a Github issue to track the issue on Safari:

                      https://github.com/tiny-pilot/tinypilot/issues/979

                      Did video streaming work on Edge under iOS before H264?

                      1. LMichael @Lateralus11235
                          2022-05-18 23:41:06.546Z

                          Yes, stream worked (works) fine in both Safari and Edge. Not sure if this helps but if I refresh the page repeatedly in edge or Safari on iOS I see the server screen (and it is live), but it immediately drops.