How to fix fork in encode H.264 stream

When using Jensen_multymedia_api with V4L2 to encode raw data into H.264 stream, everything works fine when executing the demo, but after adding fork, the child process responsible for encoding and the parent process sleeps. The program down at NvBufferTransform.

Hi there @1749618135, welcome to the NVIDIA developer forums.

I hope you don’t mind if I re-interpret your post to better understand how we can help you.

You are using the “Jetson multimedia API” for stream encoding and now want to use it in multiple threads, that’s why you are forking. Do I understand that right?

Before I ask the Jetson forums to jump in and help, did you read the Jetson V4L2 docs closely? They might help already.

Another thing to try out is possibly use NvBufferTransformAsync instead of NvBufferTransform to allow non-blocking calls.

After that if there are still issues I would suggest checking our Jetson forums directly.

Thanks!