(solved) Gstreamer help (mpeg2 source file to mjpeg at v4l2 loopback device)

Solution up front: I found that the issue was an old ffmpeg library in the ubuntu repos. Build ffmpeg from source, as 4.3 and later allow you to stream mjpeg to v4l2

Hi,

Appologies if this has been asked before, I did not find a satisfactory answer in the similar topics or in online documentation.

I am trying to read a .ts file and stream it to a v4l2 loopback device as an mjpeg stream to simulate a webcam.

The purpose of this is to exactly simulate a webcam on a headless server through our normal camera intake code, so unfortunately the workaround of just reading the file straight into our pipeline is strongly disfavored. gstreamer seems like it would be appropriate for this, as would ffmpeg, but I have spent considerable time on both approaches without success. I can stream to the v4l2 device in the raw mpeg2 format, but converting the stream to mjpeg has been a non-starter.

#example of non working ffmpeg call:
ffmpeg -stream_loop -1 -re -i file.ts -f v4l2 -r 30 -c:v mjpeg -q:v 3 /dev/video(N)

We are trying to do this on both x86 and on the Xavier NX hardware so gstreamer is preferred. Any help would be greatly appreciated.

Glad to know issue resolved, thanks for the update.