element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Viewing MJPEG raspberry pi motion stream
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 18 replies
  • Subscribers 674 subscribers
  • Views 3697 views
  • Users 0 members are here
Related

Viewing MJPEG raspberry pi motion stream

Former Member
Former Member over 12 years ago

I have created a IP webcam using raspberry pi. I used Sakis3g n Motion webcam software to do this. The stream obtained is in MJPEG format.

 

So, whenever I open that link, I can only see the 1st image on my browser (on my windows 7 PC). it does'nt automotaically update the stream every few seconds.

 

How do I view the stream on any browser ??? Are there any plugins ???

 

Does any browser support on PC (windows 7)this MJPEG stream?? If so, which one and which version of the browser ???

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 12 years ago

    There is a difference between the stream that is created as a file on the Pi when motion is detected and the actual stream via a browser.  The browser is showing you streamed jpegs.  I have this working in Firefox but in IE it only justs tries to download the jpeg files.

     

    You may also take a look at this.  http://sirlagz.net/2013/01/07/how-to-stream-a-webcam-from-the-raspberry-pi-part-3/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    For me in my firefox browser, it just shows the 1st image, it doesnt refresh stream every few seconds.

     

    Which version of firefox did you use to get the live stream working properly ???

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Firefox version is 21.0.

     

    Are you on the latest version if wheezy with all updates?

     

    Post your motion.conf file and I will compare it to mine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    yes i"m on the latest version, just updates it 5 weeks back

     

     

     

    The values of the parameters in motion.conf

    daemon off -> daemon on

    process_id_file -> /home/raspbian/motion/motion.pid

    width 320 -> 640  //Width of the camera feed

    height 240 -> 480  //Height of the camera feed

    framerate 15

    max_mpeg_time 12000 //Larger the value, smaller the video file

    ffmpeg_cap_new off  //Set to OFF as video is not recorded

    webcam_quality 75

    webcam_motion off -> on //Changed  to 'on' so only 1 frame per second is broadcast to the web cam server until actual motion is detected)

    webcam_localhost on -> off (change this to 'off' so you can view the webcam stream remotely)

    webcam_maxrate 1 (the maximum number of frames per second the web cam server will show in your browser, try 10 for starters)

    webcam_localhost on -> off  //Changed to 'off' so that webcam stream can be viewed remotely

    webcam_maxrate 10   // The maximum number of frames per second the web cam server will show in your browser

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Which webcam_maxrate setting are you using?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    the one under live webcam server.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    the one under live webcam server.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    In the config you pasted above you have 2 of the same setting.  One set at 1 and one set at 10.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    yes , I have used both of same setting.

     

    Is this causing problems ??

     

    What is your settings for these ???

     

    So, is your browser refershing the stream automatically every few seconds ???

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    You can download my motion.conf file here https://www.dropbox.com/s/n6p97e419tnbn46/motion.conf.

     

    It refreshes the stream automatically in firefox.

     

    I also downloaded an app for ipad/iphone called CameraView ($.99) This works great to view the stream video.

     

    I did some more research and found that IE basically has no compatibility for MJPEG.  Other browsers do suport it but have issues with it.  Maybe you should look into turning the Pi into a web server and then using the webserver and either HTML or Java script to render the video as discussed in the links below.

     

    http://stackoverflow.com/questions/5269376/cross-browser-solution-for-displaying-mjpeg-stream

     

    http://forums.asp.net/t/1853365.aspx/1

     

    Final thought.  Make sure you are using motion version 3.2.9 as previous versions had issues with streaming in FireFox (http://www.lavrsen.dk/foswiki/bin/view/Motion/FrequentlyAskedQuestions#Firefox_shows_a_still_image_44_that_never_stops_loading_44_if_I_press_F5_it_starts_refreshing.)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Thank you very much!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    I think you have used this netcam url.

     

    How to create this netcam url ????

     

    What was the address (netcam complete url) to view the stream on the browser ???

     

     

    I just used the format, 192.168.1.2:8081 to stream.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    The motion.conf file will work as default to show the stream on port 8081.

     

    On your internal network you would use http://<IP address of Pi>:8081.

     

    From the external nework (Internet) you need to have a url.  You can use your external IP address provided by your Internet provider but if this is a residential service that more than likely changes everytime your modem is rebooted which is not good.

     

    The easiest way to combat this is to use a dynamic DNS service.  The Pi can run this as shown in the link below.  The Pi will sit behind your modem and tell the service what it sees as the external IP address so you will always have a url  that never changes.  You can take this a step farther if you own your own domain and create a CNAME record in your Domain's DNS to point at the dynamic DNS url.

    http://www.administeria.com/raspberry-pi-dynamic-dns-on-raspbian/

     

    Once all of this is setup you will just need to open the 8081 port on your firewall/router to allow the traffic into the Pi.  This procedure varies from router to router but if you need assistance configuring it let me know the make and model and I can help you with it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    I think I cant do this, as I'm using a wireless 3G USB modem.

     

    I think I'll have to neglect the netcam URL part of your conf and follow the rest of the settings,as it is not possible to assign a static address to 3G usb dongle.

     

    What do you think???

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    This is exactly what Dynamic DNS is for and should still work even with the 3G USB dongle.  The Dynamic DNS service will update the url on the fly based on the public IP of the modem.  The service is free so it maybe worth it to give it a shot.  The only question I do not know the answer to is, is that modem going to allow the inbound calls to 8081?  What model USB dongle is it?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Huawei

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Can you set up the Dynamic DNS and test the connestion to the Pi?  From what I can find the modem should not be port agnostic and should work if you can get to it. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube