Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware encoding and Latency minimization via FFMPEG #54

Closed
wants to merge 2 commits into from

Conversation

ShootingKing-AM
Copy link
Member

@ShootingKing-AM ShootingKing-AM commented Dec 22, 2020

Hardware Encoding Support and Network hand-wave latency reduction

Old/deprecated
- [x] Research low-latency Protocols: Done: RTP best for this application.
- [x] Research Available libraries
    - [x] PJ-SIP, FFMPEG
    - [x] PJ-SIP - Tests: Status: [Failed no pj-media Support](https://github.com/pjsip/pjproject/issues/2601).
    - [ ] Implement FFMPEG
        - [ ] Implement FFMPEG on Desktop
            - [x] Protocols Selection: RTP (ultra-low latency) + NVENC/NVDEC Encoder (h.264 Container format)
            - [ ] Code Implementation:
                - [x] Implement ffmpeg as ffmpeg-cli commandLineInterface integration
                    - [x] Stage0 - Research D3DSharedResourceHandle Streaming
                        - [x] Test1: using Inprocess pipes to get pipe render to ffmpeg for encoding. Status: Failed - WritePipe() Speed too low (~15 fps)
                        - [x] Test2: Piping D3DSharedResourceHandle to ffmpeg.exe process in background. Status Failed - Hard to maintain with FFMPEG-master updates, better to implement libav*
                            - [x] ~Bypass Mobile negotiation, for Development~
                            - [x] ~Modify FFMPEG fopen_inputs() to get D3DSharedResourceHandle~
                - [ ] Implement ffmpeg as libav* libraries, if Test1 & 2 Both fail.
                    - [ ] Stage1 - Static Content Streaming
                        - [ ] Stream Static testfile.mp4, with RTP to localhost, for Dev
                            - [x] Bypass Mobile negotiation, for Development
                            - [x] Code FFMPEG Init()
                            - [x] Code FFMPEG fopen_inputs()
                            - [x] Code FFMPEG fopen_outputs()
                            - [x] Code FFMPEG transcode()
                                - [x] Code FFMPEG transcode_init()
                                - [x] Code FFMPEG transcode_step() <--- Main Loop
                            - [ ] Code FFMPEG stop_stream(), Outputs and Inputs
                            - [x] Code FFMPEG deInit() <--- safe exit + Memory Release
                    - [ ] Stage2 - Dynamic Content Streaming
                        - [ ] Modify FFMPEG fopen_inputs() to get D3DSharedResourceHandle
                            - [x] Research methodology
                            - [x] Modify FFMPEG fopen_inputs() to take D3DSharedResourceHandle as Input instead of Static file
        - [ ] Implement FFMPEG on Mobile End
            - [ ] Add shared libraries (.so) to Android project.
            - [ ] Research into available FFMPEGAndroid ports/wrappers
                - [ ] Test3: Port Wrapper Implementation test on Android
            - [ ] If Test3 not successful, implement FFMPEG libav* code.
            

Fixes #44 and #52

PVRffmpeg New class for handling PVR <-> FFmpeg interaction.
@ShootingKing-AM ShootingKing-AM added this to In progress in beta-Development Dec 22, 2020
@ShootingKing-AM ShootingKing-AM added the enhancement feature improvement or request label Dec 22, 2020
@ShootingKing-AM ShootingKing-AM changed the title Hardware encoding and RTP Implementation via FFMPEG Hardware encoding and Latency minimization via FFMPEG Dec 22, 2020
@ShootingKing-AM ShootingKing-AM linked an issue Dec 22, 2020 that may be closed by this pull request
That code is not yet complete
@ShootingKing-AM
Copy link
Member Author

ShootingKing-AM commented Apr 11, 2023

@ShootingKing-AM
Copy link
Member Author

ShootingKing-AM commented Apr 15, 2023

  • Tested, ALVR client_core
    • Pros
      • Easy to install
      • Good friendly reliable discovery
      • GUI
      • Some parts of performance like HW Encoding(speed and quality) are better, latency minimization as expected from FFMPEG + ALVR networking is better
    • Cons
      • Todo but yes [Issue] very sensitive to gyro, jitter (fixable) - post beta 0.3 release
      • Also alvr-org has bad policies not modelled for sustainability, but for quick fixes
      • The client-server model is also not robust, only for quest (not even in different repos)
      • ALVR doesn't intend to go beyond quest hardware, frequent breaking changes, no stable client_core lib doc, no testing pipeline (e2e, even no compile time checks)
    • Wayforward
    • Better to Integrate with PhoneVR along with its own driver and dayDream SDK
      • Integrate Cardboard with Mobile - Integrate ALVR Server with PhoneVR #113
        • Separate vrActivity_Cardboard
        • Should be able to switch back and forth in APP, DayDream-PVR Driver or Cardboard-ALVR (default)
        • Disable settings when Cardboard-ALVR is selected
      • No need to Integrate Server - Communication, Streaming ports are already different
        • Readme - ALVR Server recommended for now #read
        • Update Readme Banner

This was referenced Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature improvement or request
Projects
No open projects
beta-Development
Work-In-progress
Development

Successfully merging this pull request may close these issues.

Phone VR working so slow [Issue] video on phone is too blurry Hardware encoding support Latency issues
1 participant