# Convert the h264 format to the mp4 format.Ĭommand = "MP4Box -add " + file_h264 + " " + file_mp4 # Initiate the camera module with pre-defined settings. Note: If you want, you can use the same method to convert existing videos without recording. Set filenames and call the convert function. Record a 15 seconds video with the given filename (h264).Ĭonvert the h264 format to the mp4 format by activating the terminal with the MP4Box command. Initiate the camera module with pre-defined settings. The easiest way to obtain an MP4 file from the raspivid command is using MP4Box (1). Many media players will refuse to play it, or play it at an incorrect speed, unless it is "wrapped" in a suitable container format like MP4. The Pi captures video as a raw H264 video stream. To convert video formats, I used MP4Box: you can download it to your Raspberry Pi, as shown here: And thus, in this tutorial, I will show you how to convert a recently recorded video in the h264 format to the mp4 format automatically in Python. Raspberry Pi records videos in the h264 format by default, but unfortunately, the h264 format is not supported by most of the applications which you can use in collaboration with your Raspberry Pi, for instance, WhatsApp.
0 Comments
Leave a Reply. |