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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Raspberry Pi with OpenCV
  • 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
  • State Not Answered
  • Replies 10 replies
  • Subscribers 665 subscribers
  • Views 942 views
  • Users 0 members are here
Related

Raspberry Pi with OpenCV

gtrplyer16
gtrplyer16 over 10 years ago

All,

 

          In my electronics club in college we are using the Raspberry Pi Camera with OpenCV trying to use the video to store to a location and view the video that was recorded on a laptop that is connected via Ethernet cable. When we go to compile and run the program that does this we are getting and error that it won't open the output video. It should be an AVI video and going through PuTTy it should be able to play that video but it's not. We tried using V4L2 driver for the camera which is 264 video format. Is there anyway we can convert it that it will play through PuTTy or is there other drivers out there that would actually record in AVI format?

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 10 years ago

    Hi Tyler,

     

    I didn't completely understand the issue, but PuTTY only provides a text interface, and trying to launch any graphics or video programs remotely using PuTTY won't work.

    The solution is to transfer the video file (using SFTP for example) to your laptop, and then double-click it to play it. The latter is guesswork if it will play, I don't have an

    RPI camera nor tried this, but definitely PuTTY won't allow you to play video and the usual way would be to transfer the file across.

    I hope this helps!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gtrplyer16
    0 gtrplyer16 over 10 years ago in reply to shabaz

    I just checked it looks like we are trying to open it with pscp. It works with still pictures however not video.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to gtrplyer16

    I see, PSCP is the file transfer method, so that should transfer any file across (picture or video or anything else). So, presuming you have transferred the file,  it sounds like the file itself is the issue or is not recognised by the laptop. Or it could be a file naming issue.

    What happens if you double-click, what exactly is the error message you see?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gtrplyer16
    0 gtrplyer16 over 10 years ago in reply to shabaz

    Nothing is saving to click on. On PuTTy while remote accessing the Pi we run the program and on the Pi terminal we it set to reply "Can't open the output video" if something went wrong so nothing is being transferred to the laptop. At least nothing that we can see. So it's like it is recording the video then can't save or transfer it and then gets deleted or lost.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to gtrplyer16

    Can you copy and paste the text you type into PuTTY and the response you see?

    It could be that the program you're running is not intended to record, or has some command line switch to disable trying to bring up (say) an X-window. You can't bring up a window because PuTTY can't do that - the underlying protocol cannot do this. So you need to execute the program with the switches to only dump to file. It sounds like the program is not doing this.

    In general it is far easier to debug if we can see the specific text that was typed and the response.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gtrplyer16
    0 gtrplyer16 over 10 years ago in reply to shabaz

    I am not currently able to show you the text that is coming up, but the other club member will be in around 2:30 PM (it is currently 11:00 AM here) and will communicate with you. Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 10 years ago

    As Shabaz as stated the Putty interface is  a text interface how ever it does allow for port forwarding in particular X forwarding.

    You can configure X-Forwarding and use the Xserver on Windows such as that supplied free with Cygwin  this will allow you to run a program on the RPI and display on the PC.

     

    Better still would to use SAMBA to export a directory with the video contents in and  mount this on the Windows PC. You can then just click on the file in Windows explorer and use what ever player you like ....VLC is a good one!

    John A

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 10 years ago in reply to Problemchild

    You can also consider running a streaming server such as ICEcast  to stream your generated media!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gtrplyer16
    0 gtrplyer16 over 10 years ago in reply to Problemchild

    This is Zach, the other club member.  We are writing C++ code to try to take the input from the camera and output it to a video stream.  We are using the VideoWriter class for the output and it fails the isOpened check.  The input video reports errors trying to get the FOURCC property and the FRAME RATE.  The FOURCC property is set to -1, do you know what the appropriate value is to output avi?  Do we need to install a codec for open cv to ouput avi?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to gtrplyer16

    This is a different issue to the one originally described. So this is code you've written and are trying to debug.

    Did you really mean a stream (over the network), or did you mean a file? The vagueness in this thread is making things hard to understand.

     

    A google search reveals the raspberrypi.org site had someone ask a similar question here: http://www.raspberrypi.org/forums/viewtopic.php?f=67&t=85326 and no-one answered.

    Not being familiar with OpenCV, do you have to use it for writing the images to a video, or can you use a different library for that portion? In which case something like avconv if you've got screenshots captured to files or something? Is this to post-process, or to be live network stream? Like using RTSP?

    If not live, surely some code already exists to capture video to a file?

    Sorry for the equally vague questions/answers, but this now sounds like a question that needs camera and OpenCV knowledge - and I have neither.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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