IXL
Posts: 19
Joined: Tue Jun 04, 2013 11:25 am
Location: UK

Camear record on boot & file type

Mon Nov 25, 2013 12:32 pm

Hello all,

I would appreciate some advise / help if possible.

I have setup and got my camera running fine, from the thread below which was very useful.

http://www.raspberrypi.org/camera

However, I would like to know two things.

1, Is there a way to start the camera process, from boot? Or even from a webmin sh script? ( I installed webmin on my pi )
2, The file type, I seem to have a problem with. It creates the video, which I tend to ftp to a windows pc after its finished recording. I dont seem to be able to view this video, I find the notes on the above thread a little confusing. Is there anotehr way to do this, so it saves to a native *mov or *mpeg file name? Simply renaming to an mpeg works, but it runs too fast.

I am completely new to the PI and linux, however thats why I got one to learn, so appologies if this seems a bit daft.

Thanks in advance.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27101
Joined: Sat Jul 30, 2011 7:41 pm

Re: Camear record on boot & file type

Mon Nov 25, 2013 12:43 pm

The video is recorded to a raw H264 stream, this doesn't have any frame rate information, so if you need it, you need to apply a 'container' around the stream, using ffmpeg/avconv. You specify the frame rate used in the recording at that point. Once 'contained' the video will run on most players.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: Camear record on boot & file type

Mon Nov 25, 2013 3:04 pm

Here is some useful info about converting to mp4:
http://www.raspberrypi-spy.co.uk/2013/0 ... ra-module/

Code: Select all

sudo apt-get update
sudo apt-get install -y gpac

Once installed you can then use the following command to wrap your H264 video data in an MP4 container file. This will allow most media players to play the video.

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

IXL
Posts: 19
Joined: Tue Jun 04, 2013 11:25 am
Location: UK

Re: Camear record on boot & file type

Mon Nov 25, 2013 4:42 pm

Thanks for that info jbeale, I'll give that all a go and get back to you. :)

IXL
Posts: 19
Joined: Tue Jun 04, 2013 11:25 am
Location: UK

Re: Camear record on boot & file type

Thu Nov 28, 2013 10:08 pm

Well, just to report, this all works perfectly as described.

Ideally, it would be great to have the file contained as its writing the video in the first place, but at least this works. I guess the problem is that it writes two files, therefore taking but twice the space of any video you do.

The things I want to work on next are creating a start script for it, so it starts recording on boot ( with a off feature ). I also need to read up more, as I cant yet seem to find anyway of creating the camera to record in say 30 min loops, with each new recording becoming a new file name, such as video1, video2, video3.

Still, it keeps me plodding on. Cheers :)

tgwaste
Posts: 51
Joined: Thu Jan 31, 2013 7:15 pm

Re: Camear record on boot & file type

Wed Apr 23, 2014 10:28 pm

for i in (1..48); do raspivid -w 640 -h 480 -fps 30 -t 1800000 -o /root/video.$i.h264; done;

will record 30 minute videos for 1 day

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Camear record on boot & file type

Wed Apr 23, 2014 10:38 pm

jamesh wrote:The video is recorded to a raw H264 stream, this doesn't have any frame rate information, so if you need it, you need to apply a 'container' around the stream, using ffmpeg/avconv. You specify the frame rate used in the recording at that point. Once 'contained' the video will run on most players.
Is there any reason why raspivid couldn't simply do the container file stuff instead of relying on 3rd party tools??

Sure you could fire up ffmpeg and "fix" the problem but that's just wasting disk space with the original h.264 and the container file with h264 data at the same time.

Richard S.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27101
Joined: Sat Jul 30, 2011 7:41 pm

Re: Camear record on boot & file type

Thu Apr 24, 2014 8:20 am

redhawk wrote:
jamesh wrote:The video is recorded to a raw H264 stream, this doesn't have any frame rate information, so if you need it, you need to apply a 'container' around the stream, using ffmpeg/avconv. You specify the frame rate used in the recording at that point. Once 'contained' the video will run on most players.
Is there any reason why raspivid couldn't simply do the container file stuff instead of relying on 3rd party tools??

Sure you could fire up ffmpeg and "fix" the problem but that's just wasting disk space with the original h.264 and the container file with h264 data at the same time.

Richard S.
I did look in to it, we do have container code but apparently it doesn't work on the current Raspberry firmware tree (which lags behind the development tree by quite a long way - this is for stability reasons). That may change eventually, but not right now.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “Camera board”