Linux Camera Streaming by using live555, x264, V4L2 and ffmpeg
2013-03-03 17:32
141 查看
Get source from: live555-for-win32 on
Google code. http://code.google.com/p/live555-for-win32/
svn checkout http://live555-for-win32.googlecode.com/svn/trunk/ live555-for-win32-read-only
There is a blog on CSDN:
/article/7969680.html
The code change I did to make it work on my box is changing the video source from video1 to video0
mp_capture = capture_open("/dev/video0", VIDEO_WIDTH, VIDEO_HEIGHT, PIX_FMT_YUV420P);
Set port = 1234
RTSPServer *rtspServer = RTSPServer::createNew(*_env, port);
I also changed the Makefile to let it include the ffmpeg and x264 as I didn't install them in /usr/local/lib. My folder layout looks like these:
LIVE555= ../live
FFMPEG=../ffmpeg
X264 = ../x264
INCLUDES= ... -I$(FFMPEG) -I$(X264)
EXLIB = -L$(FFMPEG)/libavcodec -L$(FFMPEG)/libswscale -L$(FFMPEG)/libavutil -L$(X264)
$(CXX) -o $@ $^ -fPIC -L/usr/local/lib $(EXLIB) -lavcodec -lswscale -lavutil
-lx264 -g3 -O0 -lpthread
$(CXX)
-o $@ $^ -fPIC -L/usr/local/lib $(EXLIB) -lavcodec -lswscale -lavutil -lx264 -lpthread
To play it, mplayer2 is used on linux on the same machine:
mplayer rtsp://192.168.1.5:1234/webcam
It can continue play without problem.
While when play it on Windows XP on another machine using VLC, it only played the first several frames then stopped
there.
To install x264:
First to get the source:
git clone git://git.videolan.org/x264.git
As this version need yasm-1.2.0, so I have to get it from:
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar -xvzf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
sudo make install #Install to system folder
Then go to x264 folder:
cd ../x264/
./configure --enable-shared
make # I leave the x264 in its folder, not install to system folder
To install ffmpeg:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure
make
To install live555:
Go to live555 web side to download the tar file from http://www.live555.com/liveMedia/
I downloaded this file: live.2013.02.11.tar.gz
tar -xvzf live.2013.02.11.tar.gz
cd live
./genMakefiles linux
make
Google code. http://code.google.com/p/live555-for-win32/
svn checkout http://live555-for-win32.googlecode.com/svn/trunk/ live555-for-win32-read-only
There is a blog on CSDN:
/article/7969680.html
The code change I did to make it work on my box is changing the video source from video1 to video0
mp_capture = capture_open("/dev/video0", VIDEO_WIDTH, VIDEO_HEIGHT, PIX_FMT_YUV420P);
Set port = 1234
RTSPServer *rtspServer = RTSPServer::createNew(*_env, port);
I also changed the Makefile to let it include the ffmpeg and x264 as I didn't install them in /usr/local/lib. My folder layout looks like these:
LIVE555= ../live
FFMPEG=../ffmpeg
X264 = ../x264
INCLUDES= ... -I$(FFMPEG) -I$(X264)
EXLIB = -L$(FFMPEG)/libavcodec -L$(FFMPEG)/libswscale -L$(FFMPEG)/libavutil -L$(X264)
$(CXX) -o $@ $^ -fPIC -L/usr/local/lib $(EXLIB) -lavcodec -lswscale -lavutil
-lx264 -g3 -O0 -lpthread
$(CXX)
-o $@ $^ -fPIC -L/usr/local/lib $(EXLIB) -lavcodec -lswscale -lavutil -lx264 -lpthread
To play it, mplayer2 is used on linux on the same machine:
mplayer rtsp://192.168.1.5:1234/webcam
It can continue play without problem.
While when play it on Windows XP on another machine using VLC, it only played the first several frames then stopped
there.
To install x264:
First to get the source:
git clone git://git.videolan.org/x264.git
As this version need yasm-1.2.0, so I have to get it from:
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar -xvzf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
sudo make install #Install to system folder
Then go to x264 folder:
cd ../x264/
./configure --enable-shared
make # I leave the x264 in its folder, not install to system folder
To install ffmpeg:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure
make
To install live555:
Go to live555 web side to download the tar file from http://www.live555.com/liveMedia/
I downloaded this file: live.2013.02.11.tar.gz
tar -xvzf live.2013.02.11.tar.gz
cd live
./genMakefiles linux
make
相关文章推荐
- 基于v4l2 ffmpeg x264的视频远程监控
- arm mini2440 基于v4l2 ffmpeg x264的视频远程监控
- 2440 基于v4l2 ffmpeg x264的视频远程监控
- arm mini2440 基于v4l2 ffmpeg x264的视频远程监控 ----fwqlzz love is for ever
- Realtime h264 encoding and decoding with x264 and ffmpeg-1
- 基于v4l2 ffmpeg x264的视频远程监控(附上编译好的库文件)
- mini2440 基于v4l2 ffmpeg x264的视频远程监控
- mini2440 基于v4l2 ffmpeg x264的视频远程监控
- 基于v4l2 ffmpeg x264的视频远程监控(附上编译好的库文件)
- arm mini2440 基于v4l2 ffmpeg x264的视频远程监控
- arm mini2440 基于v4l2 ffmpeg x264的视频远程监控
- FFmpeg and x264 Encoding
- arm mini2440 基于v4l2 ffmpeg x264的视频远程监控 .
- 基于v4l2 ffmpeg x264的视频远程监控(附上编译好的库文件)
- FFmpeg and x264 Encoding Guide(英文)
- s3c2440交叉编译 x264 sdl-1.2 ffmpeg ffplay
- V4L2视频采集 X264编码项目总结(下)
- ios一步一步编译ffmpeg,x264实现h264编码
- Correct Smartphone Video Orientation and How To Rotate iOS and Android Videos with ffmpeg
- arm移植x264 ffmpeg配置