zoukankan      html  css  js  c++  java
  • Webcam Streaming Desktop Recording on Linux for ubuntu or its destros

    How to record your desktop and webcam, or stream them?

    Here's the solution:

    Go visit:

    https://help.ubuntu.com/community/Webcam#VLC

    Here's some key references:

    VLC is neat

    It's better to use the VLC GUI interface to operate.

    3.2. VLC

    3.2.1. Using the GUI

    In VLC, choose 'Open capture device' from the file menu and enter the video and audio device files (see above) in video device name and audio device name, respectively. If you just want a 'mirror' (to see what the webcam is showing), click 'OK' and you're done. If you wish to record, tick off 'Stream/save' in the 'Advanced options' section. Click the settings button right next to it. Tick 'File' off under 'Outputs' and enter a filename. Encapsulation method can be left at the default (MPEG TS). Under 'Transcoding options', tick 'Audio codec' and 'Video codec'. These can also safely be left the defaults (obviously greater compression results in lower file sizes, so experiment). Click 'OK' in the Settings screen and once again in the main webcam screen (Video4linux). If you want to have more control, you can access several settings, including resolution, by clicking the Advanced options button. 

    3.2.2. Using the Command Line

    A simple test of just the video from your webcam can be done as follows. This assumes the webcam is installed as '/dev/video0'.

    $ vlc v4l2:///dev/video0

    If you wish to be able to quickly start a video session with your webcam, the resulting vlc command is printed in the Customize line at the bottom. You simply need to prepend 'vlc', e.g. 

    vlc v4l2:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100

    The recording instructions will similarly need to be appended. Copy the contents of the 'Stream Output MRL' box under 'Settings' and change ":sout=" to "--sout " and append it to your vlc command:, e.g.

    vlc v4l2:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout "#transcode{vcodec=mp1v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=mpeg1,dst=/tmp/test.mpg}}"

    To simple take a few snapshots, open the webcam without recording and choose 'Snapshot' under the 'Video' menu.

    Those are also good.

    Mplayer

    ffmpeg (for main linux destros)

    avconv for ubuntu 12.04+

  • 相关阅读:
    【C++】链表回环检测
    【C++】满二叉树问题
    【C++】约瑟夫环(数组+链表)
    【C++】子序列匹配问题
    【OJ】抓牛问题
    【C++】基于邻接矩阵的图的深度优先遍历(DFS)和广度优先遍历(BFS)
    【C++】二叉树的构建、前序遍历、中序遍历
    范进中Nature——儒林外史新义
    VMware Workstation下ubuntu虚拟机无法上网连不上网络解决
    儒林外史人物——娄三、娄四公子
  • 原文地址:https://www.cnblogs.com/spaceship9/p/3016547.html
Copyright © 2011-2022 走看看