gstreamer视频h264,h265转码,摄像头录像,网络视频流的一些常用命令

时间:10个月前   阅读:1645

gst-launch-1.0 filesrc location=201-01-183548-183548-00p000.h264 ! h264parse ! avdec_h264 ! videoconvert  ! autovideosink
#播放 h264编码视频
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux name=demux demux.video_0 ! queue ! video/x-h264  ! h264parse ! avdec_h264 
! video/x-raw,framerate=25/1  !  videorate !  video/x-raw,framerate=30/1  !  videoconvert ! x264enc  
!  'video/x-h264, stream-format=(string)byte-stream, framerate=30/1, complexity=high, bitrate=10000000' 
! queue ! h264parse ! avmux_ipod ! filesink location=265.mp4
#将qtmux h264 mp4文件从25帧改为30帧, 打包方式改为avmux
gst-launch-1.0 -v filesrc location=1.mp4 ! decodebin ! videoconvert ! x265enc 
!   'video/x-h265, stream-format=(string)byte-stream'  ! h265parse ! qtmux  ! filesink location=out.mp4
#用decodebin将mp4改为h265编码qtmux打包
gst-launch-1.0 -v filesrc location=1.mp4 ! decodebin ! videoconvert ! x264enc ! mp4mux ! filesink location=out.mp4
#用decodebin将mp4改为h264编码mp4mux打包
gst-launch-1.0 filesrc location=1.h264  ! h264parse   ! avimux ! filesink location=output.avi
#h264文件用avimux打包为avi格式
gst-launch-1.0 -v filesrc location=1.mp4 ! decodebin ! videoconvert ! x264enc ! qtmux ! filesink location=out.mp4
#mp4文件h264编码qtmux打包
gst-launch-1.0 -v filesrc location=1.mp4 ! decodebin ! videoconvert ! x264enc  ! h264parse ! qtmux  ! filesink location=out.mp4
#mp4文件h264编码qtmux打包
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! h264parse ! flvmux ! rtmpsink location="rtmp://127.0.0.1:1949/live/main_stream"
#h264 mp4文件flvmux打包后推流rtmp://127.0.0.1:1949/live/main_stream
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux  ! h264parse   ! video/x-h264,stream-format = byte-stream  ! filesink location=1.h264
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux  ! h264parse    ! filesink location=1.h264
#qtmux打包的h264编码mp4文件变为h264文件
gst-launch-1.0 filesrc location=1.mp4 !  decodebin ! videoconvert ! x265enc    ! filesink location=1.h265
#mp4文件变为h265视频流文件
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux   ! h264parse  ! video/x-h264,stream-format = byte-stream  
! avdec_h264 !   videoconvert ! x264enc  ! h264parse ! qtmux ! filesink location=264.mp4
#重新解码编码打包h264 mp4文件
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux   ! h264parse  ! video/x-h264,stream-format = byte-stream  
! avdec_h264 !   videoconvert ! x265enc  ! h265parse ! qtmux ! filesink location=265.mp4
#重新解码编码打包h265 mp4文件
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux  ! h264parse   ! video/x-h264,stream-format = byte-stream  
! avdec_h264 !   videoconvert ! identity sync=true  ! x264enc  ! h264parse ! qtmux ! filesink location=264.mp4
#重新解码编码打包h264 mp4文件
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! h264parse ! flvmux ! rtmpsink location="rtmp://127.0.0.1:1949/hls/movie"
#h264 mp4文件flvmux打包后推流rtmp
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux  ! h264parse ! avdec_h264 ! video/x-raw,width=640,height=360,framerate=25/1  
! videoscale  ! video/x-raw,width=720,height=180,framerate=25/1 ! videoconvert ! autovideosink
#改变视频分辨率
gst-launch-1.0 filesrc  location=1.mp4 ! decodebin ! videoscale ! video/x-raw,width=320,height=200 ! videoconvert ! autovideosink
#改变视频分辨率
gst-launch-1.0 rtmpsrc location=rtmp://127.0.0.1:1949/live/main_stream ! flvdemux ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
#播放网络视频流
gst-launch-1.0 rtmpsrc location=rtmp://127.0.0.1:1949/live/main_stream ! decodebin ! videoconvert ! autovideosink
#播放网络视频流
gst-launch-1.0 v4l2src device=/dev/video18 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! kmssink
#播放摄像头视频流
gst-launch-1.0 v4l2src device=/dev/video18 num-buffers=100 ! videoconvert !video/x-raw,format=NV12,width=1920,height=1080 
! queue ! mpph264enc ! queue ! h264parse ! qtmux ! filesink location=/tmp/uvc_h264.mp4
#摄像头视频流录像为h264文件
gst-launch-1.0 videotestsrc  num-buffers=100 ! videoconvert ! x265enc ! h265parse ! filesink location=output.h265
#录像h265文件
gst-launch-1.0 v4l2src device=/dev/video18 num-buffers=10 !  video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 
!  videoconvert ! x265enc !  h265parse ! mp4mux !   filesink location=/tmp/h265.mp4
#摄像头录像为h265文件
gst-launch-1.0 filesrc location=15_05.h265  ! h265parse  ! video/x-h265,stream-format = byte-stream  ! avdec_h265 
!  videoconvert ! x265enc  ! h265parse ! qtmux ! filesink location=265.mp4
#h265文件转为h265mp4文件



微信扫码关注

更新实时通知

上一篇:ffmpeg mp4 mkv avi 视频ts切片生成m3u8

下一篇:rockchip的usb otg和debug如何实现按键切换的

网友评论

请先 登录 再评论,若不是会员请先 注册