Coder Social home page Coder Social logo

voc-poc's Introduction

¯\_(ツ)_/¯

voc-poc is a proof of concept for video put from the DJI FPV Goggles over USB.

tl;dr;

Install nodejs and the Javascript dependencies

npm install

Connect your DJI FPV goggles to your PC, power on your quad, make sure the stream is connected and run:

node index.js -f outfile.bin

If all goes well voc-poc will find your DJI Goggles, obtain the USB interface and write the raw video stream to outfile.bin.

If you want to preview the stream live install ffplay (part of the ffmpeg package) and use the -o option.

node index.js -o | ffplay -i - -analyzeduration 1 -probesize 32 -sync ext

If you want to produce a nice outfile.mp4, pipe the output through ffmpeg:

node index.js -o | ffmpeg -vcodec copy outfile.mp4 -i -

If needed -o and -f may be combined.

See node index.js --help for more options.

Troubleshooting

If you get USB errors on Windows make sure the Goggles Bulk Transfer Endpoint is using WinUSB drivers using Zadiq.

How does this work

It sends the magic 0x524d5654 packet to the USB Bulk Transfer Out Endpoint on the Goggles and starts dumping data from the USB Bulk Transfer Out Endpoint to file or stdout.

The Protocol

The Goggles have a Bulk Transfer Endpoint. To initiate the video stream one has to simply send 0x524d5654 to the Out Bulk Endpoint and then Listen on the In Bulk Endpoint for data.

The data format is currently largely unknown:

  • 0x00010910 seems to indicate the beginning of some sort of h264 frame according to this.
  • Followed by a 6 byte (frame?) counter
  • Which is always followed by 0xc867ff?

In any case, ffmpeg and other an make sense of it.

Todo

Essential

  • Get data out over USB
  • Figure out the packet structure
    • It sort of just works
  • Mux together an mp4 stream for output
    • ffmpeg is good enough for the time being

Nice to have

  • Set the output file path via cli
  • More error handling
  • Wait for Goggles to appear if not connected
  • Reconnect (and re send magic packet) when connection lost
  • Support multiple Goggles
  • Rewrite to C

Why Nodejs?

Why not?

Support the effort

If you'd like, you can send some ETH to 0xbAB1fec80922328F27De6E2F1CDBC2F322397637 or BTC to 3L7dE5EHtyd2b1tXBwdnWC2MADkV2VTbrq or buy me a coffe.

Credits

Shout out to Jack from D3VL for the debugging help, the og-s for dji-firmware-tools and everyone else doing great work in the scene.

voc-poc's People

Contributors

d3vl-jack avatar mavericm1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.