avenc_mjpeg not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

avenc_mjpeg not working

macarons
Hello! I'm streaming MJPEG using the GStreamer RTSP server and I'm using the jpegenc encoder, but I would like to be able to change the bitrate, so I'm trying to use avenc_mjpeg instead, but I can't seem to get it to work. Am I missing something?

This works:
string server_configs = "v4l2src device=/dev/video2 ! jpegenc ! rtpjpegpay name=pay0 pt=96";
gst_rtsp_media_factory_set_launch(factory, server_configs.c_str());

This doesn't work:
string server_configs = "v4l2src device=/dev/video2 ! avenc_mjpeg ! rtpjpegpay name=pay0 pt=96";
gst_rtsp_media_factory_set_launch(factory, server_configs.c_str());

I have also tried changing the input format of the encoder like this:
string server_configs = "v4l2src device=/dev/video2 !  video/x-raw, format=I420 ! avenc_mjpeg ! rtpjpegpay name=pay0 pt=96";
gst_rtsp_media_factory_set_launch(factory, server_configs.c_str());

The only error GST_DEBUG=3 gives me is:
0:00:01.117815741 12592 0x7fe5f0003520 ERROR             rtspclient rtsp-client.c:1077:find_media: client 0x7fe61c2245e0: can't prepare media

Any help would be appreciated, thank you!