Errors running video encode in Docker container

I am attempting to get an application running in a Docker container on a Jetson TX2 running jetpack 3.3. I am doing some video processing using a camera as input and am getting errors creating an encoder. I tried running the video_encode sample and get the same errors.

video_encode video.h264 640 480 H264 temp.vid
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
[ERROR] (NvV4l2Element.cpp:63) <enc0> Could not open device '/dev/nvhost-msenc': Inappropriate ioctl for device
[ERROR] (NvV4l2ElementPlane.cpp:496) <enc0> Output Plane:Error in VIDIOC_REQBUFS at output plane: Bad file descriptor
[ERROR] (NvV4l2ElementPlane.cpp:496) <enc0> Capture Plane:Error in VIDIOC_REQBUFS at output plane: Bad file descriptor
Could not create encoder
Segmentation fault (core dumped)

I am mapping the /dev/nvhost-msenc device into the container, so I am not quite sure the problem is. This runs fine on my host device, just not in the container.

hello peterqissel,

had you already confirm camera functionality?
could you please refer to Camera Software Development Solution, please have a try to access camera sensor via v4l2-ctl or gst-launch.
thanks

Turns out I didn’t have the usb device mapped properly.
I previously only had ‘–device=/dev/bus/usb --device=/dev/bus/usb/001/002’ and I added ‘–device=/dev/bus/usb/001/001 --device=/dev/bus/usb/002/001’ which got it working. I don’t quite understand why this would affect the encoder, but it works now.