Controling H.264 encoder via UVC 1.5

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

Controling H.264 encoder via UVC 1.5

Postby peter_gerten » 10 Jan 2017, 08:07

Hi,
since the November 2016 firmware update for the Theta S, there is UVC 1.5 support to allow H.264 video over USB. Does anyone know if the UVC 1.5 controls to change bandwidth settings are implemented?

Peter
peter_gerten
 
Posts: 4
Joined: 10 Jan 2017, 08:06

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 10 Jan 2017, 16:50

peter_gerten wrote:Hi,
since the November 2016 firmware update for the Theta S, there is UVC 1.5 support to allow H.264 video over USB. Does anyone know if the UVC 1.5 controls to change bandwidth settings are implemented?
Peter


Peter, thank you for asking this question. I hadn't realized that UVC stood for USB Video Class. I downloaded the USB Dev Class FAQ and looked through the contents briefly.

It seems that the USB Bandwidth Management Support is between the host and the camera, right?
I don't think the specification deals with bandwidth between the host and the Internet.

In either case, I don't think that the parameters of the UVC FullHD (or HD) Blender driver can be set. Have you managed to change any of the settings with the driver?

You've probably seen all information on the RICOH R Development Kit for live streaming applications. This appears to allow for control of the video stream via USB.

  • Can be controlled with video settings via USB
  • The source code for the video control tool will be publicly released

Can you provide more information on what your application is doing?
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby peter_gerten » 11 Jan 2017, 06:41

I just noticed that "bandwidth" was probably the wrong word. What I meant is, if it is possible to influence any parameters of the H.264 encoder over UVC in general and more specific rate control (desired bitrate for CBR (Constant Bit Rate)) or Quanitzation Parameters.

I actually don't have a Ricoh S Camera yet. I am researching if it is a suitable solution for my project. I did indeed read the announcements on the Ricoh R Dev Kit incl. "Can be controlled with video settings via USB". Unfortunately this is all very vague and does not give us developers technical details.

I want to use the Theta S iwith gstreamer and need to adjust bitrate / quantize parameters on the fly while streaming over USB. The UVC 1.5 spec allows this (see https://github.com/matthiasbock/gstreamer-phone/wiki/GStreamer-support-for-the-UVC-for-H.264-encoding-cameras for an example) but apparently not all manufactures implement it. So I am not sure what the Theta S is capable of.
peter_gerten
 
Posts: 4
Joined: 10 Jan 2017, 08:06

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 13 Jan 2017, 00:56

peter_gerten wrote:I want to use the Theta S iwith gstreamer and need to adjust bitrate / quantize parameters on the fly while streaming over USB. The UVC 1.5 spec allows this (see https://github.com/matthiasbock/gstreamer-phone/wiki/GStreamer-support-for-the-UVC-for-H.264-encoding-cameras for an example) but apparently not all manufactures implement it. So I am not sure what the Theta S is capable of.


I do not think that people are controlling the bitrate and other parameters of the live stream using a USB cable right now. If it's possible, I haven't heard of anyone doing it. I'm going to forward your question to a contact I have at RICOH. It's possible that he won't know the answer either.

As far as I know, there isn't any public API or specification for controlling the live stream parameters. Due to the announcement of the RICOH R and community hacks to the THETA S, we can assume that it's possible. Unless you're in a rush, I would suggest waiting for the specs and most importantly, the open source video stream controller of the RICOH R. Once we get the source code of the video stream controller, we should be able to quickly understand how the streaming controller app communicates with the camera and then be able to send other commands to test it out.

Right now, it does not seem that the current THETA S will meet the requirements of your project due to lack of documentation on how to control the video stream with the USB cable. It's possible that once the controller for RICOH R Dev Kit comes out, we'll be able to use the same code with the THETA S. But, it's a gamble and I doubt that you'll be able to use the THETA S for your application out of the box.

The current USB driver for the THETA doesn't accept any parameters (as far as I can tell). If it can, it's not documented.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 19 Jan 2017, 01:28

Peter, I spoke to a contact I have at RICOH. He doesn't know if the THETA S supports the full UVC 1.5 specification or only part of it. If you are researching specifications for a large product development project, you may be able to convince an OEM sales manager at RICOH to get the list of supported UVC 1.5 specifications for you.

If this is for a smaller research project, I think the best course of action is to wait for the RICOH R Development Kit and ideally the source code for the USB controller for the video stream.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby dakami » 26 Jan 2017, 14:44

Right now, the UVC 1.50 support is pretty raw. Forget controlling capture parameters, it only *barely* gets any sort of stream out at all.

There's some twisty path wherein they sort of have in working in Windows, it seems, but it's not like it just shows up as another codec and resolution pair. I'm diving into the driver trying to fix it (I managed to get the PS3 camera working much nicer). I randomly found out recently that Wireshark has super nice USB sniffing now on Windows, so if I can get it up there (and thus far, I haven't really) I can force whatever parameters are needed.

Ah, it's never easy. At least 720p15 works without too much drama.
dakami
 
Posts: 2
Joined: 26 Jan 2017, 14:40

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 27 Jan 2017, 22:11

dakami wrote:Right now, the UVC 1.50 support is pretty raw. Forget controlling capture parameters, it only *barely* gets any sort of stream out at all.


Dakami, this is fantastic information. Thanks for sharing it. Do you have the source code for the driver, or are you building your own driver from scratch?

BTW, have you tried to use the THETA UVC Blender or FullHD Blender with Unity? If not, that's fine, but there's several people here in the US that would like to use UVC Blender stream in unity to try and get better stitching than is possible by blending the two spheres.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby dakami » 29 Jan 2017, 12:09

Just a hacker looking at what's coming in. Do we think that UVC Blender is actually getting different input? There's no shortage of code out there to convert the sphere to equirectangular format, so I've just been focusing on what needs to be done to get 1080p inbound.
dakami
 
Posts: 2
Joined: 26 Jan 2017, 14:40

Re: Controling H.264 encoder via UVC 1.5

Postby peter_gerten » 02 Feb 2017, 06:53

Hi guys,
thanks for all the information.
It is a bit disappointing though. I got a Theta S now to play around and UVC 720@15 mjpeg indeed works without problems. As I target a linux based system it is not only a problem of incomplete UVC1.5 support on Theta side but also on Linux side. I was not aware that UVC1.5 kernel patches that appeared 3 years ago never made it into the kernel (not even in the recent 4.9).

Other H.264 UVC cameras use UVC1.1 which works good on Linux. I don't know why Ricoh decided to be 1.5 only. I hope UVC support will improve via firmware update or at least with the new developer model.

Peter
peter_gerten
 
Posts: 4
Joined: 10 Jan 2017, 08:06

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 03 Feb 2017, 20:02

wow, thanks for this information. Are there community patches that you can apply to the Linux kernel and then recompile it for UVC 1.5 support? Or, is this not supported at all?

I only found this for device detection, but I haven't seen anything more substantial.

https://patchwork.kernel.org/patch/7585711/

This post seems to indicate that patches were available at one time.

Back in August 2013, there was a discussion on adding support for UVC
1.5, among other things:
https://www.mail-archive.com/linux-media@xxxxxxxxxxxxxxx/msg66203.html

If I'm not mistaken, this set of patches provided above haven't been
integrated into the kernel.
Is there a lot of work to do to "backport" the code into the current kernel?
2 years after the original was written, has there been changes in the
API that requires to "revisit" the patches?

Damiano Albani
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby caop42432 » 09 Feb 2017, 02:19

Do anyone know the difference between H264 and vp9? Recently i used a video converter named video enhancement software. After i transferred my video into vp9, i did not find any evident differences in graphics except that the size got 50% smaller compared with the original one.
caop42432
 
Posts: 4
Joined: 03 Jan 2017, 09:57

Re: Controling H.264 encoder via UVC 1.5

Postby peter_gerten » 24 Feb 2017, 05:40

Did anyone got the Theta S working with h.264 and UVC 1.5 under linux yet?
peter_gerten
 
Posts: 4
Joined: 10 Jan 2017, 08:06

Re: Controling H.264 encoder via UVC 1.5

Postby AbigailSheen » 26 Jul 2017, 23:42

Bump.

I'm also having trouble getting 1080p 30fps dual-fisheye live video stream from Theta S over USB, either on Windows or Linux.

The "THETA S" camera comes up as 720p 15fps (MJPEG). As far as I've read, with update to firmware 1.82 (which I have done), it should be possible to get the spherical/fisheye at 1080p 30fps (H.264), right?

Anyone managed to do this?
AbigailSheen
 
Posts: 2
Joined: 26 Jul 2017, 21:06

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 27 Jul 2017, 01:09

It won't work on Linux as the kernel does not support H.264 encoding with UVC 1.5. It should work with Windows 10 64 bit. It won't work with Windows 7.

How can I see the framerate and resolution of the stream? What software are you using to test it?

One thing I noticed is that on the Mac, there is a driver called THETA S HD. On Windows 10, I don't see this option, at least on my system.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 15 Aug 2017, 15:27

This project lists UVC 1.5 support for Android (which uses the Linux kernel) on the feature list. I notice it's planned, but maybe he's got it working?

https://github.com/jwoolston/Android-Webcam

Has anyone tried it? the last commit was on Jan 19, 2015. Maybe it was unfeasible?
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 05 Jan 2018, 07:18

Hi,

I am parsing the raw USB descriltor of my Theta S, and I see no traces of H264 (just MPEG @30fps).

Did anyone ever managed to get H264 via UVC?
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 12 Jan 2018, 22:05

Can you post the USB descriptor? I was under the impression that the THETA S live streaming was only H.264 or MotionJPEG. Is it possible for the transport stream to be MPEG, but the actual encoding to be H.264? I'm not too familiar with these standards.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 15 Jan 2018, 22:45

Here (parts) of the descriptor. I don`t understand why bcdUVC=110 (should be 150)...

    +++++++++++++++++ Device Information ++++++++++++++++++
    Device Description : USB Composite Device
    Device Path : \\.\usb#vid_05ca&pid_2711#00104656#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID : USB\VID_05CA&PID_2711\00104656
    Hardware IDs : USB\VID_05CA&PID_2711&REV_0000 USB\VID_05CA&PID_2711
    Legacy BusType : PNPBus
    Class : USB
    Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
    Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Service : usbccgp
    Enumerator : USB
    Location Info : Port_#0003.Hub_#0003
    Location IDs : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(4)#USB(1)#USB(3)
    Container ID : {fc0777e7-ce50-5e7e-9ce5-b01218697d3b}
    Manufacturer Info : RICOH COMPANY, LTD.
    Capabilities : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
    Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code : 0
    Address : 3
    Power State : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
    Child Device 1 : USB Video Device
    Device ID : USB\VID_05CA&PID_2711&MI_00\8&28728310&0&0000
    Class : Image
    Child Device 2 : USB Audio Device
    Device ID : USB\VID_05CA&PID_2711&MI_02\8&28728310&0&0002
    Class : MEDIA

    ---------------- Connection Information ---------------
    Connection Index : 0x03 (3)
    Connection Status : 0x01 (DeviceConnected)
    Current Config Value : 0x01
    Device Address : 0x0F (15)
    Is Hub : 0x00 (no)
    Number Of Open Pipes : 0x01 (1)
    Device Bus Speed : 0x02 (High-Speed)
    Pipe0ScheduleOffset : 0x00 (0)

    -------------------- Device Descriptor --------------------
    bLength : 0x12 (18 bytes)
    bDescriptorType : 0x01 (Device Descriptor)
    bcdUSB : 0x200 (USB Version 2.00)
    bDeviceClass : 0xEF (Miscellaneous)
    bDeviceSubClass : 0x02
    bDeviceProtocol : 0x01 (IAD)
    bMaxPacketSize0 : 0x40 (64 bytes)
    idVendor : 0x05CA (Ricoh Company Ltd.)
    idProduct : 0x2711
    bcdDevice : 0x0000
    iManufacturer : 0x01 (String Descriptor 1)
    Language 0x0409 : "Ricoh Company, Ltd."
    iProduct : 0x02 (String Descriptor 2)
    Language 0x0409 : "RICOH THETA S"
    iSerialNumber : 0x03 (String Descriptor 3)
    Language 0x0409 : "00104656"
    bNumConfigurations : 0x02

    ------------------ Configuration Descriptor -------------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x02 (Configuration Descriptor)
    wTotalLength : 0x0114 (276 bytes)
    bNumInterfaces : 0x04
    bConfigurationValue : 0x01
    iConfiguration : 0x00 (No String Descriptor)
    bmAttributes : 0x80
    D7: Reserved, set 1 : 0x01
    D6: Self Powered : 0x00 (no)
    D5: Remote Wakeup : 0x00 (no)
    D4..0: Reserved, set 0 : 0x00
    MaxPower : 0xFA (500 mA)

    ---------------- Interface Descriptor -----------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x04 (Interface Descriptor)
    bInterfaceNumber : 0x00
    bAlternateSetting : 0x00
    bNumEndpoints : 0x01 (1 Endpoint)
    bInterfaceClass : 0x0E (Video)
    bInterfaceSubClass : 0x01 (Video Control)
    bInterfaceProtocol : 0x00
    iInterface : 0x02 (String Descriptor 2)
    Language 0x0409 : "RICOH THETA S"

    ------- Video Control Interface Header Descriptor -----
    bLength : 0x0D (13 bytes)
    bDescriptorType : 0x24 (Video Control Interface)
    bDescriptorSubtype : 0x01 (Video Control Header)
    bcdUVC : 0x0110 (UVC Version 1.10)
    wTotalLength : 0x0035 (53 bytes)
    dwClockFreq : 0x000003E8 (1000 Hz)
    bInCollection : 0x01 (1 VideoStreaming interface)
    baInterfaceNr[1] : 0x01

    -------- Video Control Input Terminal Descriptor ------
    bLength : 0x12 (18 bytes)
    bDescriptorType : 0x24 (Video Control Interface)
    bDescriptorSubtype : 0x02 (Input Terminal)
    bTerminalID : 0x01
    wTerminalType : 0x0201 (ITT_CAMERA)
    bAssocTerminal : 0x00 (Not associated with an Output Terminal)
    iTerminal : 0x00
    Camera Input Terminal Data:
    wObjectiveFocalLengthMin : 0x0000
    wObjectiveFocalLengthMax : 0x0000
    wOcularFocalLength : 0x0000
    bControlSize : 0x03
    bmControls : 0x0E, 0x00, 0x04

    -------- Video Control Processing Unit Descriptor -----
    bLength : 0x0D (13 bytes)
    bDescriptorType : 0x24 (Video Control Interface)
    bDescriptorSubtype : 0x05 (Processing Unit)
    bUnitID : 0x02
    bSourceID : 0x01
    wMaxMultiplier : 0x0000
    bControlSize : 0x03
    bmControls : 0x40, 0x11, 0x01
    iProcessing : 0x00
    bmVideoStandards : 0x3F

    ------- Video Control Output Terminal Descriptor ------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x24 (Video Control Interface)
    bDescriptorSubtype : 0x03 (Output Terminal)
    bTerminalID : 0x03
    wTerminalType : 0x0101 (TT_STREAMING)
    bAssocTerminal : 0x00 (Not associated with an Input Terminal)
    bSourceID : 0x02
    iTerminal : 0x00

    ----------------- Endpoint Descriptor -----------------
    bLength : 0x07 (7 bytes)
    bDescriptorType : 0x05 (Endpoint Descriptor)
    bEndpointAddress : 0x82 (Direction=IN EndpointID=2)
    bmAttributes : 0x03 (TransferType=Interrupt)
    wMaxPacketSize : 0x0040
    Bits 15..13 : 0x00 (reserved, must be zero)
    Bits 12..11 : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
    Bits 10..0 : 0x40 (64 bytes per packet)
    bInterval : 0x08 (8 ms)

    --- Class-specific VC Interrupt Endpoint Descriptor ---
    bLength : 0x05 (5 bytes)
    bDescriptorType : 0x25 (Video Control Endpoint)
    bDescriptorSubtype : 0x03 (Interrupt)
    wMaxTransferSize : 0x0040 (64 bytes)

    ---------------- Interface Descriptor -----------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x04 (Interface Descriptor)
    bInterfaceNumber : 0x01
    bAlternateSetting : 0x00
    bNumEndpoints : 0x00 (Default Control Pipe only)
    bInterfaceClass : 0x0E (Video)
    bInterfaceSubClass : 0x02 (Video Streaming)
    bInterfaceProtocol : 0x00
    iInterface : 0x00 (No String Descriptor)

    ---- VC-Specific VS Video Input Header Descriptor -----
    bLength : 0x0E (14 bytes)
    bDescriptorType : 0x24 (Video Streaming Interface)
    bDescriptorSubtype : 0x01 (Input Header)
    bNumFormats : 0x01
    wTotalLength : 0x003D (61 bytes)
    bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
    bmInfo : 0x00 (Dynamic Format Change not supported)
    bTerminalLink : 0x03
    bStillCaptureMethod : 0x00 (No Still Capture)
    nbTriggerSupport : 0x00 (Hardware Triggering not supported)
    bTriggerUsage : 0x00 (Host will initiate still image capture)
    nbControlSize : 0x01
    Video Payload Format 1 : 0x00

    ----- Video Streaming MJPEG Format Type Descriptor ----
    bLength : 0x0B (11 bytes)
    bDescriptorType : 0x24 (Video Streaming Interface)
    bDescriptorSubtype : 0x06 (Format MJPEG)
    bFormatIndex : 0x01
    bNumFrameDescriptors : 0x01
    bNumFrameDescriptors : 0x01
    bmFlags : 0x00 (Sample size is not fixed)
    bDefaultFrameIndex : 0x01
    bAspectRatioX : 0x00
    bAspectRatioY : 0x00
    bmInterlaceFlags : 0x00
    D0 IL stream or variable: 0 (no)
    D1 Fields per frame : 0 (2 fields)
    D2 Field 1 first : 0 (no)
    D3 Reserved : 0
    D4..5 Field pattern : 0 (Field 1 only)
    D6..7 Display Mode : 0 (Bob only)
    bCopyProtect : 0x00 (No restrictions)

    ----- Video Streaming MJPEG Frame Type Descriptor -----
    ---> This is the Default (optimum) Frame index
    bLength : 0x1E (30 bytes)
    bDescriptorType : 0x24 (Video Streaming Interface)
    bDescriptorSubtype : 0x07 (MJPEG Frame Type)
    bFrameIndex : 0x01
    bmCapabilities : 0x00
    wWidth : 0x0500 (1280)
    wHeight : 0x02D0 (720)
    dwMinBitRate : 0x0D2F0000 (27.6 MB/s)
    dwMaxBitRate : 0x0D2F0000 (27.6 MB/s)
    dwMaxVideoFrameBufferSize: 0x003F4800
    dwDefaultFrameInterval : 0x000A2EC6 (66 ms -> 14.98 fps)
    bFrameIntervalType : 0x01
    adwFrameInterval[1] : 0x000A2EC6 (66 ms -> 14.98 fps)

    ------- VS Color Matching Descriptor Descriptor -------
    bLength : 0x06 (6 bytes)
    bDescriptorType : 0x24 (Video Streaming Interface)
    bDescriptorSubtype : 0x0D (Color Matching)
    bColorPrimaries : 0x01 (BT.709, sRGB)
    bTransferCharacteristics : 0x01 (BT.709)
    bMatrixCoefficients : 0x04 (SMPTE 170M)
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 17 Jan 2018, 23:07

bcdUVC : 0x0110 (UVC Version 1.10)
----- Video Streaming MJPEG Format Type Descriptor ----
bLength : 0x0B (11 bytes)
bDescriptorType : 0x24 (Video Streaming Interface)
bDescriptorSubtype : 0x06 (Format MJPEG)
wWidth : 0x0500 (1280)
wHeight : 0x02D0 (720)
dwDefaultFrameInterval : 0x000A2EC6 (66 ms -> 14.98 fps)
bFrameIntervalType : 0x01
adwFrameInterval[1] : 0x000A2EC6 (66 ms -> 14.98 fps)


As you mentioned, it's using UVC 1.1 and Motion-JPEG at 1280x720 15fps, not UVC 1.5, H.264 at 1920x1080 at 30fps.

Are you using Linux or Windows 7? To get UVC 1.5 (with H.264/1920x1080/30fps), you'll need to use Windows 10 or Mac. There's a limitation of the Linux kernel that it can detect UVC 1.5, but not support features like H.264. When I use live streaming with Linux, I can only get it to work with UVC 1.1, MotionJPEG 1280x720, 15fps. You'll have this same limitation with Android and Raspian (Raspberry Pi) as they use the Linux kernel.

What OS are you running the streaming on?
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 18 Jan 2018, 01:10

So are you saying that the camera can detect whether or not it connected to Linux, and then decide to push 1.1 or 1.5 descriptors?

I am wondering why a such behaviour and what are the Linux limitations, since I am writing my own 1.5 UVC drivers and it should only be software related (not hardware)...

thx anyway
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 18 Jan 2018, 18:45

From wikipedia
Linux
USB video class support for Linux is provided by the Linux UVC driver, although as of July 2017 support for still-image capture is not yet implemented.[2] The UVC driver has been included in the Linux kernel source code since kernel version 2.6.26. Detection of UVC 1.5 devices was introduced in Linux kernel version 4.5,[3] but support in the driver for UVC 1.5 specific features or specific UVC 1.5 devices was not added and MPEG-2 TS, H.264 and VP8 payloads are not supported yet. The result is that some UVC 1.5 devices that also support UVC 1.1 work correctly.


There is some additional information here
http://www.ideasonboard.org/uvc/

I think that since your application needs to talk to the Linux kernel, you won't be able to access the video stream.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 18 Jan 2018, 22:11

It is not clear at what layer level the limitation is...

Assuming a two layers world, where the Linux UVC driver speaks to the USB driver: I can believe that the `generic` Linux UVC driver is not yet supporting the 1.5 UVC specification.

But in my case, I am bypassing the UVC driver and I am speaking directly to the USB driver (which actually knows nothing about the UVC specification).

cheers
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 19 Jan 2018, 16:08

Thank you for this information. I can help test it on Linux if you tell him how you're pulling that information on the video stream. What program are you using that provides this good info?

If you can access a UVC 1.5 cam, it would help the Linux community in general.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 20 Jan 2018, 00:37

Ok, just for your information, I missed the fact that the Camera offers a second USB configuration :oops: and that one describes UVC 1.5... even on Linux (Android)!

Thanks for your help and patience!
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 24 Jan 2018, 23:37

This Japanese developer has Android working with a THETA V using H.264 high profile. How did he do it?

http://lists.theta360.guide/t/theta-v-4k-live-mobile-streaming-free-app/2256

Image

Image

I would love to get more information on this.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 27 Jan 2018, 22:04

I also got a Theta S working with H264 in our Android App.

My assumption in my previous post was right. Linux "default" UVC driver (e.g. V4L2) might not support 1.5 (actually, Android does not even have a UVC driver), but nothing prevents you from creating your own driver.

So I have implemented my own 1.5 UVC driver for Android, following the specs (http://www.usb.org/developers/docs/devclass_docs). From there, is is only standard USB i/o.

What confused me at the beginning is that the Theta has two USB configurations:
The first configuration (which is the default one) defines the UVC 1.1 interfaces. The second one defines UVC 1.5. It is quite unusual, so I missed the second one.

I have not tried yet to see if you can control the H.264 encoder though...
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 29 Jan 2018, 18:13

This is great news. Once you finish your app, send us the information, my colleague Jesse Casman and I can help you to promote it.

Would your driver work on a Raspberry Pi?
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 29 Jan 2018, 22:16

I dont have a Raspberry Pi, but I dont see any reasons why not, so it should work.

cheers,
Nick
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Re: Controling H.264 encoder via UVC 1.5

Postby codetricity » 30 Jan 2018, 00:03

bernz wrote:I dont have a Raspberry Pi, but I dont see any reasons why not, so it should work.

cheers,
Nick

Nick, is there any chance you can share your driver code with full attribution to you? Maybe put it on GitHub as a repo or a gist? or zip it and put it on dropbox? We've been looking for something like this for a while. Also, understandable if you want to keep it closed for your commercial app.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: Controling H.264 encoder via UVC 1.5

Postby bernz » 30 Jan 2018, 01:14

Sorry that I cannot share the code because it is indeed a commercial app.

However, I have tried that open source UVC driver in the pass and it should work, or at least be a good start: https://github.com/saki4510t/UVCCamera

I am also open to answer to your questions,

Cheers
bernz
 
Posts: 10
Joined: 27 Dec 2017, 18:18

Next

Return to Development



All times are UTC