VLC录制网络摄像头和流chrome linux [英] VLC record webcam and stream to chrome linux

查看:271
本文介绍了VLC录制网络摄像头和流chrome linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在寻找如何完成我所说的事情是可能的。



有人告诉我们,我们可以使用vlc在linux中传输一个网络摄像头,以便进行下列操作:


  • 将流录制到本地计算机供以后上传。

  • 使用Chrome的HTML5视频功能录制流。 b $ b
  • 发送vlc录音的网络启动和停止命令。



  • 我一直在研究这个有些时候,还没有找到一个可行的解决方案。



    我可以使用VLC录制视频,具体如下:

      vlc v4l2://:v4l2-dev = / dev / video0:v4l2-width = 640:v4l2-height = 480 --sout#transcode {vcodec = mpeg4,acodec = mpga,vb = 800,ab = 128}:标准{access = file,dst = capture_4.avi}

    这真的有可能吗?

    解决方案

    若要回答您的问题,这是棘手的。我无法回答所有观点,只有在VLC中进行流式处理并以HTML5格式显示的部分



    您需要一个特定的环境设置才能运行(Segmenter并在服务器上更正MIME类型)。我假设你都在linux上;我不是(Mac OS / unix),但其背后的原则在使其工作的工作流程中保持不变。我会尽力解释 - 希望这有助于以任何方式。



    我已经成功的设置工作如下:



    (1)STREAMING&录制

    本地vlc流式传输实例流音频和视频 - >制作mpegts流。尝试将您的命令更改为类似于

      vlc v4l2://:v4l2-dev = / dev / video0:v4l2-width = 640:v4l2-height = 480 --sout#transcode {vcodec = mpeg4,acodec = mpga,vb = 800,ab = 128}:标准{access = udp,mux = ts,sap,name = live-video,dst = $ 224.0.0.1,port = 1234}

      vlc v4l2://:v4l2-dev = / dev / video0:v4l2-width = 640:v4l2-height = 480 --sout#transcode {vcodec = mpeg4 ,acodec = mpga,vb = 800,ab = 128}:udp {dst = 224.0.0.1,port = 1234,mux = ts}

    我只是给你在Mac上运行的移植命令。我不知道他们是否在linux上工作。现在,您应该可以通过访问SAP公告或直接使用VLC播放实时流。

      vlc -vvv udp:/ /@224.0.0.1:1234 

    然后,您可以使用另一个vlc实例来记录流

      vlc udp://@224.0.0.1:1234 --sout#transcode {vcodec = mpeg4,acodec = mpga,vb = 800 ,ab = 128}:standard {access = file,dst = capture_4.avi}

    VLC中的重复命令,我一直在玩,但没有成功。这样你就可以用一个实例进行流式处理和记录。 (2)SEGMENTING



    mediastreamsegmenter将您的mpegts数据流细分为可交付部分。我正在使用Apple服务器软件。 Apple为您提供了一个mediastreamsemmnter,可以将实时的mpegts流转换为添加到播放列表中的片段。我不知道在Linux中的实时分段器。也许有人会这样做。



    (3)DELIVERY



    链接到包含细分受众群的视频播放列表。 mediastreamsegmenter将产生一个播放列表playlist.m3u8,然后可以用HTML 5访问它。

     < video width =640高度= 480 > 
    < source src =YOUR_PATH / playlist.m3u8/>
    < / video>






    有关这个主题的一些有用的教程是: p>

    信息在设置和基本命令



    VLC的例子,以流我知道这不是一个完整的解决方案,你的问题,但这可能会给你一些很好的起点调查。

    I am currently looking for how to accomplish what I have been told is possible.

    I was told that we would be able use vlc to stream a webcam in linux which would allow for the following:

    • Recording the stream to the local machine for a later upload.
    • Play the stream as it's recording using Chrome's HTML5 video capabilities.
    • Send a start and stop command from the web for the vlc recording.

    I have been researching this for quite some time and haven't been able to find a viable solution.

    I am able to record video using VLC already with the following

    vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:standard{access=file,dst=capture_4.avi}"
    

    Is this really even possible?

    解决方案

    To answer your question if this is possible... YES it is BUT it's tricky. I can't answer all your points, only the part with streaming in VLC and displaying it in HTML5

    You'll need a certain environment setup for this to work (Segmenter and correct MIME Type on server). I assume you are all on linux; which I am not (Mac OS / unix) but the principles behind it stay the same concerning the workflow of getting this to work. I'll try to explain - hope this helps in any way.

    The setup I've had success with works the following way:

    (1) STREAMING & RECORDING

    local vlc streaming instance streaming audio and video -> producing a mpegts stream. Try changing your command to something like

    vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:standard{access=udp, mux=ts, sap, name=live-video, dst=224.0.0.1, port=1234}"
    

    or

    vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:udp{dst=224.0.0.1,port=1234,mux=ts}"
    

    I'm just giving you ported commands here which work on Mac. I don't know if they work on linux. Now you should be able to play the live stream with VLC by accessing the SAP announcement or directly with

    vlc -vvv udp://@224.0.0.1:1234
    

    You could then use another vlc instance to record the stream

    vlc udp://@224.0.0.1:1234 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:standard{access=file,dst=capture_4.avi}"
    

    There is a duplicate command in VLC which I have been playing around with but without success. This way you could stream and record with one instance. Maybe this works on linux.

    (2) SEGMENTING

    mediastreamsegmenter to segment your mpegts stream into deliverable segments. I'm using Apple Server Software. Apple provides you with a mediastreamsegemnter which can take a live mpegts stream and convert it into segments which are added to a playlist. I don't know of a live segmenter in linux. Maybe someone else does.

    (3) DELIVERY

    html 5 page linking to the video playlist containing the segments. The mediastreamsegmenter will produce a playlist playlist.m3u8, which then can be accessed with HTML 5

    <video width="640" height="480">
    <source src="YOUR_PATH/playlist.m3u8" />
    </video>
    


    Some helpful tutorials concerning this topic are:

    Info on the setup and basic commands

    VLC examples in order to stream

    I know this is not a complete solution to your problem, but this will maybe give you some nice starting points to look into.

    这篇关于VLC录制网络摄像头和流chrome linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆