How to save a RTSP video stream to MP4 file via gstreamer?

后端 未结 3 1424
旧时难觅i
旧时难觅i 2021-01-11 12:24

I need to get a video stream from my camera via RTSP and save it to a file. All of this needs to be done via gstreamer.

After some google searching, I tried the foll

3条回答
  •  臣服心动
    2021-01-11 12:56

    The second command looks correct. Raw h264 video data is a bit tricky because it has two characteristics--"alignment" and "stream-format", which can vary. h264parse can transform h264 data into the form needed for different h264-related GStreamer elements.

    avdec_h264 is a decoder element. You don't want to decode the data since you're apparently not displaying it. You're putting encoded h264 data from an RTSP stream into an mp4 container file.

    If the file doesn't play, you should check that the stream is good, or try other media players and see if they work (mplayer, Media Player, Quicktime, whatever).

    You could also try muxing into a matroska container file using the "matroskamux" element.

提交回复
热议问题