Capture video from vlc command line with a stop time

爱⌒轻易说出口 提交于 2019-12-21 23:06:03

问题


I'm trying to capture a video from an RPT stream to my pc (Ubuntu 12-04 LTS). I'm using vlc from command line as below:

cvlc -vvv rtp://address:port --start-time=00 --stop-time=300 --sout file/ts:test.ts

but vlc ignores the command --stop-time and it continues to download video even more than 300 seconds as specified.

Does anyone know the reason for this? and a possible solution?

Thanks


回答1:


If you know the start-time and the end-time you can compute the record time. You can afterward use the --run-time option to get what you want, like this: cvlc --run-time 60 --start-time 1260 /Path/to/your/file.ts vlc://quit




回答2:


Yes, this is a limitation of the stop-time option. It only works with streams with a known length. As captured video doesn't have this information as it is live (or more precisely, the capture access module don't even try to add said information), the option won't work.

Patches are certainly welcome and sorry for the limitation.




回答3:


I tried vlc to record a webcam for a specific period. I ended up using the timeout command:

timeout <seconds>s vlc v4l2:///dev/video1

In Ubuntu it's available without any installation



来源:https://stackoverflow.com/questions/18013503/capture-video-from-vlc-command-line-with-a-stop-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!