5

I'm trying to film with my PI B+ with motion. I'm using the RPi camera board (so no USB), and got that working (which is nice).

The thing is, is that the recorded video is not real time. What I mean is that you see all the images behind each other instead of an fluid film.

How can I achieve something that is as closed as possible to normal filming?

Here's an link to the motion.conf file

The most important settings:

###########################################################
# Capture device options
############################################################

# Videodevice to be used for capturing  (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0

# v4l2_palette allows to choose preferable palette to be use by motion
# to capture from those supported by your videodevice. (default: 8)
# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
# Setting v4l2_palette to 1 forces motion to use V4L2_PIX_FMT_SBGGR8
# instead.
#
# Values :
# V4L2_PIX_FMT_SN9C10X : 0  'S910'
# V4L2_PIX_FMT_SBGGR8  : 1  'BA81'
# V4L2_PIX_FMT_MJPEG   : 2  'MJPEG'
# V4L2_PIX_FMT_JPEG    : 3  'JPEG'
# V4L2_PIX_FMT_RGB24   : 4  'RGB3'
# V4L2_PIX_FMT_UYVY    : 5  'UYVY'
# V4L2_PIX_FMT_YUYV    : 6  'YUYV'
# V4L2_PIX_FMT_YUV422P : 7  '422P'
# V4L2_PIX_FMT_YUV420  : 8  'YU12'
v4l2_palette 8

# Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
# This is ONLY used for FreeBSD. Leave it commented out for Linux
; tunerdevice /dev/tuner0

# The video input to be used (default: 8)
# Should normally be set to 0 or 1 for video/TV cards, and 8 for USB cameras
input 8

# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0

# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
frequency 0

# Rotate image this number of degrees. The rotation affects all saved images as
# well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
rotate 0

# Image width (pixels). Valid range: Camera dependent, default: 352 // 640
width 1280

# Image height (pixels). Valid range: Camera dependent, default: 288 // 480
height 720

# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 100

# Minimum time in seconds between capturing picture frames from the camera.
# Default: 0 = disabled - the capture rate is given by the camera framerate.
# This option is used when you want to capture images at a rate lower than 2 per second.
minimum_frame_time 0

As you can see, I've setup the frame rate all the way up to 100 (maximum), So I don't know what I could do more...

Update

Here's an screenshot of top when motion is on 100fps: Top: 100fps

Here's an screenshot of top when motion is on 60fps: Top: 60fps

  • Maybe try a lower frame rate like 60fps instead of 100fps, 60fps is the furthest I would personally push the frame rate of the raspberry pi camera. what is the CPU usage like when you record or playback the video? – Darth Vader Apr 12 '15 at 13:21
  • @DarthVader I've updated my question with screenshot's of top with 100 and 60fps. This is when it's actually recording. With 60fps, you can visually see bigger steps taken between the images (frames?) then on 100 (which doesn't sound strange i guess?). Any suggestion would be appreciated, because I'm very new to this... – Mathlight Apr 12 '15 at 14:18
  • The Pi Camera can handle 120FPS at 720p only from what I understand. Anything above 720p only 60FPS. This is only true for raw x264/YUYV video stream and not taking sequenced stills. – Piotr Kula Apr 12 '15 at 15:03
  • check out this page: raspberrypi.org/new-camera-mode-released it gives instructions on how to record video at 90 FPS and includes instructions and a demo video. it might not be entirely what you are looking for but it will allow smooth recording of video at 90 FPS. – Darth Vader Apr 12 '15 at 19:33
  • @DarthVader Will definitely check that URL out and fiddle with the settings. And maybe motion isn't the way to go but do I have to use some kind of Python script? – Mathlight Apr 13 '15 at 4:23
2

Not sure why you are having such a problem trying to capture smooth video, I'm no expert on the software you were trying to use. But the CPU usage I would consider to be really high, considering you were using a B+, so that might be part of the problem.

My recommendation is to check out this link:https://www.raspberrypi.org/new-camera-mode-released/

which gives details about how to record video at 90FPS using code typed into the LXTerminal.

You can also use the picamera module in python, check out this page:http://picamera.readthedocs.org/en/release-1.10/index.html

it gives lots of example python code and I have found it really useful.

  • Thank you. Will read through the links and hack something together. Thank you again for helping me on this fun project ^_^ – Mathlight Apr 13 '15 at 17:14
5

Check out this thread: https://www.raspberrypi.org/forums/viewtopic.php?t=75240

With the updated binary you can get 15FPS on the live stream. If you set output_pictures ON, you can collect up to 15 jpgs per second. Then just use ffmpeg to convert to AVI. Viola!

  • Interesting idea, gluing all these images into a "movie" – Mathlight Dec 12 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.