robo_builder
Posts: 2
Joined: Fri Feb 21, 2014 9:21 pm

camera video play back?

Fri Feb 21, 2014 9:27 pm

I recorded a video using my noir camera. I took the sd card out and plug into my laptop. I notice a lock next to it but it still let me copy to my computer. When viewing it, it's like playing 4x fast and I'm not able to pick where I want to watch at. Anyone have any idea what going on or how to fix it?

I saved it as a mp4 file.

raspivid -w 640 -h 480 -o /home/pi/video1.mp4 -ex night -fps 60 -t 18000000

That will record for 5 hours. Anything I may be doing wrong?

I notice the file size says 238.9 mb but size on disk is 1.9gb. So I'm assuming it's almost 2gb. I tried plugging a flash drive up to the raspi and copy it but that still gave me the smaller file.

User avatar
jbeale
Posts: 3491
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: camera video play back?

Fri Feb 21, 2014 10:07 pm

Unless raspivid has changed recently, it outputs in only one format which is a raw H264 stream and not mp4, so I'm guessing that's what the file you recorded is. You can call it any file name and extension you like, .avi or .gif or .xyzzy but the actual data is always H264 format without the MP4 "container" wrapper around it. That might explain why you can't seek forward or back in your player. You can make this into a real mp4 file right on the Pi, using a utility like MP4Box, for example http://www.raspberrypi.org/phpBB3/viewt ... 23#p459223

Also the recorded h264 stream does not contain timing information, so if if the camera used the slow shutter around 8 fps due to low light, the playback of that file defaulting to 30 fps would appear 4x too fast.

robo_builder
Posts: 2
Joined: Fri Feb 21, 2014 9:21 pm

Re: camera video play back?

Sat Feb 22, 2014 6:40 am

So should I change my line to:

raspivid -w 640 -h 480 -o /home/pi/video1.h264 -ex night -fps 8 -t 18000000

This should get it to play at a normal speed or should i leave the fps blank? Then I would just have to convert it to an mp4 after?

Then after its done recording I just type:

MP4Box -fps 30 -add video1.h264 video1.mp4

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: camera video play back?

Sat Feb 22, 2014 10:07 am

Not quite. For playback at normal speed, the fps settings in the raspivid and MP4Box commands should be the same. Also I understand that, as yet, raspivid records at max 30 fps. so the command in your original post would not give you the output you expect. 60 fps is being worked on though.

--
Regards, Kári.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: camera video play back?

Sat Feb 22, 2014 4:45 pm

For raw .h264 your player has to assume some default fps, because raw h264 doesn’t have intrinsic fps. If you record at 8 fps then the player assumes, e.g., 25 fps and will play too fast.

Return to “Camera board”