문제

I have a question on streaming output of libx264. My scenario is that Iam capturing video from webcam, encoding with x264 and then streaming data to flash, muxed as FLV. For muxing, Im using output/flv_bitstream.h, included in libx264 budle. The only modification of muxer, that I made, is that instead of fwrite() im usig send() to transfer data via socket... Encoding library is working fine. If I save output (even muxed), vlc player is able to play it. But, when it goes to data transfer via socket, vlc and flash are not cooperating. The weird thig is, that if Im sending data to vlc player thru socket, it waits till transmission end and then plays video from buffer. But what I need is to play live stream.

I also tryed to read flv file and send it to vlc of flash tag by tag and it is working fine.

Any suggestions?

도움이 되었습니까?

해결책

Implement a simple http server and respond to incoming requests with:
"HTTP/1.0 200 OK\r\n"
"Pragma: no-cache\r\n"
"Content-Type: video/x-flv\r\n"
"\r\n"
Each of these should be followed by the raw FLV bit-stream.
This should enable live consumption of the content using eg. VLC, flowplayer, ...

Also, consider using 'url_open_dyn_buf'/'url_close_dyn_buf' rather than 'fwrite', see ffserver for reference.

Nadav at Sophin

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top