Rafael M.
Rafael M.

Reputation: 3

Unknown format from Picamera recording

I have been using my RaspberryPi 3 model B with the Picamera to record videos. I saw in the RaspberryPi website that the default video format that you get from capturing video is h264, however when I use the camera, the file created appears as file type unknown.

To capture I tried both the basic command line

raspivid -o video -t 10 #for a 10s video

or a small program using the PiCamera.start_recording (which I believe lets you choose the format of the output file) but I still get these not known format files.

If it helps (doubtful) I tried to read the recorded files with omxplayer and the footage is displayed at roughly twice the speed it should.

Upvotes: 0

Views: 393

Answers (1)

dbmitch
dbmitch

Reputation: 5386

You're not specifiying the h264 extension - without that omxplayer doesn't know what type of video format it is - unless you can suggest what to try via command line

Try:

raspivid -o video.h264 -t 10 #for a 10s video

There's plenty of online help and examples for raspivid

Also - you may have to wrap your h264 file in mp4 "box" to play it

Here's one suggestion on how to do this wrapping using MP4Box

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

Once installed use the following command to wrap your H264 video in an MP4 container file. This allows most media players to play the video.

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

This will give you a nice video at 30 frames per second that should play in most modern media players.

Upvotes: 1

Related Questions