[FFmpeg-user] Record N RTSP frames and average into 1 jpg? In a loop?

Steven Kan steven at kan.org
Sat Jul 8 23:12:45 EEST 2023


I am attempting to capture a time-lapse of corn seeds germinating under an LED grow-light, using a Wyze Cam v3 with the beta RTSP firmware.

The problem is that the LEDs are coincidentally synced with the camera, resulting in this egregious banding:

 https://www.kan.org/pictures/CornSeedlingstmix500.jpg

It has a period of ~32 seconds at 20 fps.

 https://www.youtube.com/watch?v=3weqY5wTntY

I can fix this by tmix-ing N frames:

ffmpeg -i CornCam.mp4 -vf tmix=frames=500:weights="1" -vcodec h264_videotoolbox out.mp4

and this is a screencap of one frame from out.mp4:

 https://www.kan.org/pictures/CornSeedlingsBanding.jpg

but I want to optimize for N, because if I average in more than the optimal number of frames, I’ll be un-doing some of the blending effect.

So I’d like to put this in a bash loop to:

1) Record N frames from RTSP 
2) tmix N frames into exactly 1 jpg output
3) Save as N.jpg
4) Increment N from ~400 to ~500 

Then I can scan through all my results and see what value of N looks best, and then set up my time lapse for the next 10 days.

Thanks!

-- 
Steven "Rocket Man" Kan                          #```````
mailto:steven at kan.org                            #  ```````
http://www.kan.org                               #    ```````
aim://stevenkan@me.com                           #      ```````
                                                 #        ```````
                                    ~       ~      . \_ at _/  ```````
                            ^_@         o            . V      ```````
                          `-'  -         \_ at _   ~      .       ######
                                           V \       ~   .     ######
                                    ~                      .   #H2O##
                                ~                            . #POLO#
Blood, sweat, and chlorine                          ~    ~     ######




More information about the ffmpeg-user mailing list