Dynamically Record Video

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Dynamically Record Video

跳至解决方案
2,028 次查看
itaigolan
Contributor II

Hi, I’m displaying a video from v4l2src in a waylandsink and while I’m doing that I want to dynamically record the video to an mp4. I want to allow a user provided input to determine when to start recording to an mp4 and when to stop the recording. The recording pipeline I’m currently using is:
gst-launch-1.0 v4l2src ! vpuenc_h264 ! h264parse ! mp4mux ! filesink location=sample.mp4 -e

I tried connecting the recording pipeline to a tee and then deleting it when I’m done recording and I was able to get video to record but that approach causes problems after starting and stopping recording multiple times. Does anyone know a way I can approach this, preferably by just pausing the recording section of the pipeline?

 
标签 (1)
0 项奖励
回复
1 解答
1,965 次查看
malik_cisse
Senior Contributor I

Hi @itaigolan,
I would implement a gstreamer Tee that sinks in an Appsink. After that, every time a new recording event occurs, I will start a recording pipeline using Appsrc. This would be my best bet.

You might alternatively look at Ridgerun Interpipe that can do similar stuff:
https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_GstInterpipe_Overview 

Using pause or start/stop does not work well with MP4 because MP4 needs a proper file header that contains all key frame positions of the stream. A more robust file format for this is Mpeg-TS. H.264 elementary stream embeds very well in *.ts files and TS muxer are available in stock Gstreamer.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,966 次查看
malik_cisse
Senior Contributor I

Hi @itaigolan,
I would implement a gstreamer Tee that sinks in an Appsink. After that, every time a new recording event occurs, I will start a recording pipeline using Appsrc. This would be my best bet.

You might alternatively look at Ridgerun Interpipe that can do similar stuff:
https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_GstInterpipe_Overview 

Using pause or start/stop does not work well with MP4 because MP4 needs a proper file header that contains all key frame positions of the stream. A more robust file format for this is Mpeg-TS. H.264 elementary stream embeds very well in *.ts files and TS muxer are available in stock Gstreamer.

0 项奖励
回复
1,874 次查看
itaigolan
Contributor II

Thanks for the response, I got good results using the appsink approach.

2,013 次查看
joanxie
NXP TechSupport
NXP TechSupport

what processor and bsp version do you use? and what kind of problem do you have? 

0 项奖励
回复
1,989 次查看
itaigolan
Contributor II

The processor is imx8mp and we are running Mickledore. My question is how do I set up a system where I can dynamically start and stop video recording while constantly displaying the video on a waylandsink.

0 项奖励
回复