Arduino project

Raspberry project

Post Page Advertisement [Top]

Following tutorial will show how to install FFmpeg into Raspberry Pi, then stream video to Local web which can be access through Computer/Phone/Tablet

Hardware needed:
1. Rasbperry Pi
2. USB camera

1. Install library
cd /usr/src
git clone git://
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
sudo make install

2. Install ffmpeg
cd /usr/src
git clone git://
cd ffmpeg/
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
Note: Model B+ (4-Cores) can do “make -j4” instead of  “make”
         This "make" command will take 4 hours long -> take a sleep instead wait for it!
sudo make install

3. Config something:
gedit /etc/ffserver.conf

Input following settings:
Port 8090
# bind to all IPs aliased or not
# max number of simultaneous clients
MaxClients 10
# max bandwidth per-client (kb/s)
MaxBandwidth 1000
# Suppress that if you want to launch ffserver as a daemon.

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 10M

<Stream test.mjpg>
Feed feed1.ffm
Format mpjpeg
VideoFrameRate 4
VideoSize 600x480
VideoBitRate 80
# VideoQMin 1
# VideoQMax 100
Strict -1

Make execute file for easy command
gedit /usr/sbin/
Input following settings:
ffserver -f /etc/ffserver.conf & ffmpeg -v verbose -r 5 -s 600x480 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm

Change mode for file so it can execute, then run it
chmod +x /usr/sbin/

After above command, streamming will be started to Local web

Go to web browser, type address <your-ip-address:8090>/test.mjpg

Result will come:

Note: to stop camera, press Ctrl+C at terminal, then type command
pkill ffserver

As test, video can see clock needle rotate every single second!

4. Autmatic run
In order to run ffmpeg service without type command /usr/sbin/
Go to /etc/rc.local -> then add command line /usr/sbin/ before "exit 0"
Everytime Raspberry start up, ffmpeg will automatically run without typing code

You might also like:
1. Raspberry pi - remote control car camera
This project will make remote car control which can view camera attached on car.
It will need:
Hardware side:
1. Car toy
2. Two gear motor
3. Raspberry B+
4. Wifi dongle
5. Power bank (10A) (for Raspberry board)
6. Battery (for gear motor)
7. H-bridge circuit (L298N)


  1. Thanks for the step-by-step information. I am curious, what is the lagging in this video. I tried different projects for video streaming and they always have about 3 sec lagging. thanks,

    1. Hi, i have just updated video recording clock and local web. I admit that there is still some lagging, anyway, this is the best i have now.
      Thanks for visiting.

  2. Thanks. Maybe helps to someone: if is used a Raspberry Camera attached to the GPU, before the ffmpeg commnand you need to enable the camera in raspi-config and then load the driver with modprobe bcm2835-v4l2 , so /dev/video0 will appear.

  3. Hello :) I try to do this tutorial. I following instructions and when i try to run this i get this :
    Someone can help me ?

    1. and one more question. This file ffserver.conf we could make or this file should be already created ?

    2. Hi. We (manually) made the file ffserver.conf
      Make sure USB camera is plug to Raspberry (check if /dev/video0 is exist or not).
      Try it again with every single steps as in instruction.

    3. I think , propably my camera doesnt support a raspberry PI (camera is a some kind of chineese no name )

    4. i Have raspbeery pi 3 with raspian 10 jessie

    5. I did this with 2 webcam, one is no name, one is Logitech. Both are also from China, but they're working well. Mine is Rasp2 Raspian

    6. what version of raspian wheeze or jessie ?

    7. I have just made it in RASPBIAN JESSIE latest version. Everything still works fine.

  4. Is it possible to record a vĂ­deo and save it into a usb memory styck ?

  5. should U be concerned about about deprecated warning during the make portion of install the ffmpeg?

  6. Is this a tailored ffmpeg just for web video streaming for a fully functioning install of ffmpeg?

    I have several Raspberry Pi Zero W's with camera modules running as time lapse cameras collecting images around my home. Currently I run ffmpeg on my Mac Mini to convert the jpeg images to a video clip for the day. This works fine. But I would like to automate the process and use a Raspberry Pi 3 to run ffmpeg via crontab to create the videos rather than manually running ffmpeg on my Mac.

    Will your build of ffmpeg allow me to do this?


  7. is it possible to stream the video at an IP address without the '/test.mjpg'? Just the IP addr and Port number.
    With this I have no problem to stream it, but i need to further use it in a python code and I am using server socket to read it and it is only allowing me to enter an IP addr and port number. I cant find a way to add '/test.mjpg' to the addr it listens to. Any suggestions?

    1. unfortunately i have no experience about this. Please try to search more

    2. HI, today i find another way stream video no need "/test.mjpg", just using IP address and port number only
      Please visit here

  8. This comment has been removed by the author.

  9. Nicely Explained!
    I got -> "Unable to find a suitable output format for 'http://localhost:8090/feed1.ffm' http://localhost:8090/feed1.ffm: Invalid argument"
    ERROR! Can you help?

    Command -> $ ffserver -f /etc/ffserver.conf & ffmpeg -s 600x480 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm

    Output->ffmpeg version N-90077-g56f77b0 Copyright (c) 2000-2018 the FFmpeg developers
    built with gcc 4.9.2 (Raspbian 4.9.2-10)
    configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libtheora --enable-libvorbis
    libavutil 56. 7.101 / 56. 7.101
    libavcodec 58. 11.101 / 58. 11.101
    libavformat 58. 9.100 / 58. 9.100
    libavdevice 58. 1.100 / 58. 1.100
    libavfilter 7. 12.100 / 7. 12.100
    libswscale 5. 0.101 / 5. 0.101
    libswresample 3. 0.101 / 3. 0.101
    libpostproc 55. 0.100 / 55. 0.100
    ffserver version N-87073-g1c56bec Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.9.2 (Raspbian 4.9.2-10)
    libavutil 55. 74.100 / 55. 74.100
    libavcodec 57.103.101 / 57.103.101
    libavformat 57. 78.100 / 57. 78.100
    libavdevice 57. 7.101 / 57. 7.101
    libavfilter 6.100.100 / 6.100.100
    libswscale 4. 7.103 / 4. 7.103
    libswresample 2. 8.100 / 2. 8.100
    /etc/ffserver.conf:1: Port option is deprecated. Use HTTPPort instead.
    /etc/ffserver.conf:3: BindAddress option is deprecated. Use HTTPBindAddress instead.
    /etc/ffserver.conf:9: NoDaemon option has no effect. You should remove it.
    /etc/ffserver.conf:27: Setting default value for video bit rate tolerance = 20000. Use NoDefaults to disable it.
    /etc/ffserver.conf:27: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
    /etc/ffserver.conf:27: Setting default value for video max rate = 30906320. Use NoDefaults to disable it.
    /etc/ffserver.conf:27: Setting default value for video buffer size = 160000. Use NoDefaults to disable it.
    [video4linux2,v4l2 @ 0x1fe71f0] The V4L2 driver changed the video from 600x480 to 640x480
    Input #0, video4linux2,v4l2, from '/dev/video0':
    Duration: N/A, start: 16778.275190, bitrate: 147456 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    [NULL @ 0x1fe8e60] Unable to find a suitable output format for 'http://localhost:8090/feed1.ffm'
    http://localhost:8090/feed1.ffm: Invalid argument
    [4]- Exit 1 ffserver -f /etc/ffserver.conf

    1. Hi, please try to update/ uprade Raspberry and then do all above steps again.

    2. I have also this problem.
      ->Unable to find a suitable output format for 'http://localhost:8090/feed1.ffm'
      http://localhost:8090/feed1.ffm: Invalid argument
      Have you already solved it?

    3. Same problem here too after updating and upgrading

  10. Thanks for the great tutorial! I have a Raspberry pi model 3, and cannot seem to get this to work. When I go to install ffmpeg, it installs without a problem, but when I try to execute the file, it says that the ffserver is not a recognized command. I have tried to configure ffmpeg with "--arch=armhf", but that did not seem to work. Do you have any suggestions?

    1. Can i see the error code? Maybe you need to open port forwarding 8090?

    2. Thanks for the fast reply. After working with the system for a few hours, I decided to use your tutorial for the moving camera and use motion to broadcast the camera signal. I used this with your same car webpage, and it works great. One note on the camera.php file - every user needs to change the file to their specific IP address, or it will listen for the camera output on the right port, but the wrong IP address, or at least this was the case for me. Thank you for the tutorials, as they were very helpful and informative!

  11. Hello, thank you very much for your tutorial! It worked perfectly, but I have one question. Do you know or have an idea on how to implement the stream on a website? I am running an Apache Server on the raspberry and i would like to implement the stream onto it.

    1. Hi, i didn't stream to (internet) website by ffmpeg.
      I just did it by another application, and use "Port Forwarding" to put it into internet.
      Please see here

  12. every time I try to do the make command in the second step it starts running for a couple of minutes and then exits the command and doesn't finish it. it gives me this at the bottom:

    Makefile:108: recipe for target 'ffmpeg_g' failed
    make: *** [ffmpeg_g] Error 1

    how can I get passed this?

    1. please try to update your Raspberry Pi and do it again. Thanks

  13. I have also this problem.
    ->Unable to find a suitable output format for 'http://localhost:8090/feed1.ffm'
    http://localhost:8090/feed1.ffm: Invalid argument
    Have you already solved it?

    1. Hi, please try to update your Raspberry Pi and do it again. Now i'm busy to make this project again to see if what's problem. Thanks for your visit

  14. This is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. Official Web site

  15. Hi there, i was just wondering if anyone could give me any help. when i got to "sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree", I get the error ERROR: libx264 not found

    If you think configure made a mistake, make sure you are using the latest
    version from Git. If the latest version fails, report the problem to the mailing list or IRC #ffmpeg on
    Include the log file "ffbuild/config.log" produced by configure as this will help
    solve the problem."

  16. It's very useful blog post with inforamtive and insightful content and i had good experience with this information. We, at the CRS info solutions ,help candidates in acquiring certificates, master interview questions, and prepare brilliant resumes.Find top Salesforce admin interview questions in 2020.
    These Salesforce developer interview questions are highly helpful in 2020. You can read these Salesforce lightning interview questions and Salesforce integration interview questions which are prepared by industry experts.

  17. Never too late to start learning at Salesforce Training in Australia even though you don't have any programming knowledge you can excell in Salesforce Training in London United Kingdom (UK) because it is all about your customers, so this time find the best Salesforce Training in Europe. This way we will learn Salesforce CRM.

  18. There is a lively forum available for people to join together and share their experiences via this friendly online platform. Link Manga Stream Alternatives

  19. An accomplished author and sales consultant, Riddleberger is also highly in demand as a business development and motivational speaker for organizations seeking to drive their sales force to greater levels of performance Salesforce training in Chennai


Bottom Ad [Post Page]