首页 > 解决方案 > 通过一些过滤器对我的 mpeg4 视频进行解码和编码的管道

问题描述

我使用以下管道在屏幕上播放我的视频

gst-launch-1.0 filesrc location=01_189_libxvid_1920x1080_6M.mp4 ! 
qtdemux ! mpeg4videoparse ! omxmpeg4videodec ! videobalance brightness=100 ! 
video/x-raw,format=BGRA ! waylandsink --gst-debug=*:2

但现在我不想直接播放,而是想对其进行编码并将其保存在某个文件夹中。请建议

标签: gstreamer

解决方案


应该是这样的(以 h264 编解码器为例):

gst-launch-1.0 -e --gst-debug=3 \
filesrc location="/path/input/sample_in.mp4" \
! qtdemux \
! mpeg4videoparse \
! omxmpeg4videodec \
! queue \
! x264enc \
! qtmux \
! filesink location="/path/output/sample_out.mp4"

推荐阅读