I can use following command to read an rtsp stream that is H264 encoded and save it to a file:
gst-launch-1.0 -ev rtspsrc location=rtsp://127.0.0.1:8554/test ! application/x-rtp, media=video, encoding-name=H264 ! queue ! rtph264depay ! h264parse ! matroskamux ! filesink location=received_h264.mkv
Can anyone help me modify the command to downscale the video to a predefined resolution before saving the file? I’ve tried using videoscale element but couldn’t make it work.
Hi,
You would need to decode, downscale the resolution, and re-encode the content. Below is a sample command for downscale to 640x480.
gst-launch-1.0 -ev rtspsrc location=rtsp://127.0.0.1:8554/test ! application/x-rtp, media=video, encoding-name=H264 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=480' ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=received_h264.mkv
1 Like
DaneLLL:
gst-launch-1.0 -ev rtspsrc location=rtsp://127.0.0.1:8554/test ! application/x-rtp, media=video, encoding-name=H264 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! 'video/x-raw(memory:NVMM),format=640,height=480' ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=received_h264.mkv
Thanks for the reply.
I tried the command (removed one extra ! ) but I get the following error:
WARNING: erroneous pipeline: could not link nvvconv0 to nvv4l2h264enc0, neither element can handle caps video/x-raw(memory:NVMM), format=(int)640, height=(int)480
The following command worked for me:
gst-launch-1.0 -ev rtspsrc location=rtsp://127.0.0.1:8554/test ! application/x-rtp, media=video, encoding-name=H264 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=640,height=480’ ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=received_h264.mkv
Any idea how I could execute the same command from a python app?
system
Closed
May 25, 2022, 3:02am
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.