2014-11-07 1 views
0

나는 lubuntu 컴퓨터에서 인터넷을 통해 웹캠 데이터를 스트리밍하려고합니다. 이를 위해 ffmpeg와 ffserver를 설치했습니다. 그러나, 나는 이것을 작동시킬 수 없다. webm 형식을 사용하여 HTML5 비디오로 통합하고 싶습니다. 나는 이것에 대한 몇 가지 예를 인터넷에서 발견 했으므로 그것이 내 설정을 기반으로한다.ffserver는 webm 데이터를 스트리밍하지만 아무 것도 표시되지 않습니다.

HTTPPort 8090      # Port to bind the server to 
HTTPBindAddress 0.0.0.0 
MaxHTTPConnections 2000 
MaxClients 1000 
MaxBandwidth 10000    # Maximum bandwidth per client 
           # set this high enough to exceed stream bitrate 
CustomLog - 
#NoDaemon      # Remove this if you want FFserver to daemonize after start 

<Feed feed1.ffm>    # This is the input feed where FFmpeg will send 
    File ./feed1.ffm   # video stream. 
    FileMaxSize 5M    # Maximum file size for buffering video 
    ACL allow 127.0.0.1   # Allowed IPs 
</Feed> 

<Stream camera1.webm>    # Output stream URL definition 
    Feed feed1.ffm    # Feed from which to receive video 
    Format webm 

    # Audio settings 
    #AudioCodec vorbis 
    #AudioBitRate 64    # Audio bitrate 
    NoAudio 

    # Video settings 
    VideoCodec libvpx 
    VideoSize 640x480   # Video resolution 
    VideoFrameRate 2   # Video FPS 
    AVOptionVideo flags +global_header # Parameters passed to encoder 
             # (same as ffmpeg command-line parameters) 
    #AVOptionVideo cpu-used 0 
    AVOptionVideo qmin 1 
    AVOptionVideo qmax 42 
    #AVOptionVideo quality good 
    AVOptionAudio flags +global_header 
    #PreRoll 1 
    #StartSendOnKey 
    VideoBitRate 400   # Video bitrate 
</Stream> 

<Stream status.html>   # Server status URL 
    Format status 
    # Only allow local people to get the status 
    ACL allow localhost 
    ACL allow 192.168.0.0 192.168.255.255 
</Stream> 

<Redirect index.html> # Just an URL redirect for index 
    # Redirect index.html to the appropriate site 
    URL http://www.ffmpeg.org/ 
</Redirect> 

내가 2 초에서 거의 최대를 FPS를 넣어 내가 달성 할 수 사용하고 컴퓨터가 4 몇 가지 이유 : 이것은 내가 지금 가지고있는 ffserver의 설정입니다. 나는 다음 명령으로는 FFmpeg를 시작

ffmpeg -f video4linux2 -s 640x480 -r 2 -i /dev/video0 -c:v libvpx http://localhost:8090/feed1.ffm. 

입력이 제대로 wprks (치즈 테스트) 표준 UVC 웹캠이다,는 FFmpeg은 ffserver하고 링크 (OUPUT가 제대로 작동으로 설정 파일) 작동하는 것 같다 작동하는 것처럼 보이지만, 두 프로그램은 서로를 조정합니다. 응용 프로그램이 ffserver 스트림을 요청하면 데이터를 수신합니다. 예를 들어 wget은 주어진 비트 전송률로 예상되는 크기의 파일을 생성합니다. 그러나 웹 페이지에서 스트림을 여는 것은 효과가 없습니다. 두 가지 방법으로 시도해 보았습니다. 간단히 webm 링크를 탐색했습니다. firefox는 일부 데이터를 수신하고 있지만 아무것도 표시되지 않음을 나타냅니다. 또한 ffserver는 정상 양의 데이터가 전송되었음을 나타냅니다. 두 번째로 시도한 것은 비디오 스트림 용 비디오 태그가있는 웹 페이지입니다.

<video with="640" height="480" autoplay> 
    <source src="http://localhost:8090/camera1.webm" type="video/webm"> 
</video> 

이 작업은 모두 수행되지 않습니다. 어디서 잘못 됐는지 누가 알겠습니까?

답변

0

이 목적으로 <embed> 태그를 사용해보십시오. 이런 식으로 뭔가 : 문제가 해결되지 않으면, 당신은 127.0.0.1 대신 localhost

의 시도 할 수

<embed type="video/webm" src="http://localhost:8090/camera1.webm" width="640" height="480"> 

관련 문제