raspberrypipress / official-raspberry-pi-beginners-guide-5e

Code and resources for The Official Raspberry Pi Beginner's Guide, 5th Edition from Raspberry Pi Press
35 stars 6 forks source link

[Errata]: Video format h264 and save-pts not supported on Pi 5 #10

Closed Rueful-Pi closed 1 month ago

Rueful-Pi commented 2 months ago

Contact Details

No response

What format of the book has this error? You may select more than one option.

Print

What language of the book has this error?

English (EN)

Page Number or Section

Chapter 8 page 209

Detailed description

I am using Pi 5 with the HQ Camera (I have tried this on 2 different Pi 5s with 2 different microsd cards running 64 bit Bookworm). Every terminal command, for video recording, given in chaper 8 that suggests file format .h264 doesn't produce a working video file. You end up with a file that shows one second of video. Inorder to get a 10 second video from libcamera-vid -t 1000 -o test.h264 you must change .h264 to nearly any other format (.3g2, .3gp, .avi, .f4v, .flv, .m4v, .mkv, .mov, .mp4, or .mpeg) then it will work.

On page 210 libcamera-vid -t 10000 --save-pts timestamps.txt -o test-time.h264 produces again a 1 second video file. But, also produces a file "timestamps.txt" who's contents are only the text "# timecode format v2" and nothing else. The next command mkvmerge --timecodes 0:timestamps.txt test-time.h264 -o test-time.mkv on page 211, returns a terminal error mkvmerge v74.0.0 ('You Oughta Know') 64-bit 'test-time.h264': Using the demultiplexer for the format 'AVC/H.264'. Error: The timestamp file 'timestamps.txt' does not contain any valid entry. I made a forum post on this issue at https://forums.raspberrypi.com/viewtopic.php?p=2206818. Later I did some forum searching and I found some posts on Raspberry Pi's forum that included some replys from naushir "Raspberry Pi Engineer & Forum Moderator". Who said "Saving the pts file through the libav encoder (the only available encoder on Pi 5) is not possible" https://forums.raspberrypi.com/viewtopic.php?p=2169261 & "On Pi 5 we currently don't support timestamp output with the --timestamp argument, as this is automatically handled by the libav codec framework" https://forums.raspberrypi.com/viewtopic.php?p=2152504

Perhaps this could be addressed in future versions of the pdf. Bumping into this issue as a beginner I found it to be very discouraging. I have not continued to the end of this chapter. I have no desire complete this chapter for fear of finding other commands not supported on Pi 5 hardware or software. Frustrating, given that I paid for the paperback and the cover states "Fully updated for Raspberry Pi 5". This issue had me thinking my HQ camera was faulty. I know know for sure now that the camera is fine. As, I have bought both a new Pi 5 (and got the same errors) and a new Pi 4, and had no issues. I have tested these terminal commands on pi 4 running 64bit Bullseye, with the same HQ camera, and the commands are all working fine there. I have not tried on Pi 4 with Bookworm.

With all due respect, I must ask. Were these terminal commands tested by the author on a physical Pi 5? If so, please let me know how he got it to produce working .h264 video files.

bjepson commented 2 months ago

Thanks so much for reporting this, @Rueful-Pi. We did encounter issues related to this during the development of the book, and due to an oversight on my part, we did not include a warning in the text similar to the warnings we included around the Scratch and Sense HAT issues that were also going on during that time. My apologies.

We will correct this issue in a future edition of the book, and we have already coordinated with the documentation team to very clearly address this issue in the docs. The correction was pushed to the documentation site yesterday, and you can find it at https://www.raspberrypi.com/documentation/computers/camera_software.html#rpicam-vid

I really appreciate your bringing this to our attention, and I am sorry that you had to encounter frustration in doing so. You've helped us improve both our documentation and the next revision of this book, and we're grateful.

Rueful-Pi commented 2 months ago

Thank you for the reply @bjepson

Yes indeed, there was a much appreciated warning concerning issues with SenseHat and scratch in the book. Apologies are not needed. Aside from the camera chapter, the book is really good and I enjoyed it immensely. At first I just bought the book, a Pi 5, and a power supply. The book was what encouraged me to go on and the SenseHat, the HQ camera, along with another book, "The Official Raspberry Pi Camra Guide" (which turned out to be outdated, I would buy an updated copy if one was released) a Pico and Pico W, along with various bits for physical computing and all of what is needed to work through the book available in the bookshelf "Get started with MicroPython on Raspberry Pi Pico". I am, aswell, enjoying this book. This is to say the book was my gateway into a new hobby that I am now committed to.

Thank you to the author and all who were/are involved. I hope my posting here hasn't been a bother, I guess I took what was printed on page v, too seriously, "If you've found what you believe to be a mistake or error in the book, please let us know by using our errata submission form". Which is how I found this GitHub. I am glad to hear that corrections are being made. This will be a benefit for future readers of ths book and the documentation.

I will be keeping my fingers crossed for an updated version of "The Official Raspberry Pi Camra Guide".

bjepson commented 1 month ago

You're welcome and thanks @Rueful-Pi! We are working on a new edition of the Camera Guide, and hope to have it in print by late summer.

Your posting has definitely not been a bother—it is extremely helpful! Please keep any feedback coming, because we take all of it seriously.

Best,

Brian