My idea was:
- From rtspsrc source (IP camera) take only one frame per second using
videorate
. - Scale frame down to save space using
videoscale
.
3.Then, that one-per-second frame rate increase into 30fps (for example) again
4 Re-encode it into .mp4 file.
End result would be 30fps video where every frame is actually 1 second apart from original recording point of view, i.e. fast “timelapse” video.
But what I get is just 30 frames copied of that single frame per second, i.e. just bigger file, without “timelapse” speedup…
My current pipeline that just takes one frame per second and re-encodes it is:
timeout -s SIGINT 10s gst-launch-1.0 -e rtspsrc location="rtsp://x:y@host:554/Streaming/Channels/101" ! rtph264depay ! h264parse ! queue ! avdec_h264 ! queue ! videorate ! video/x-raw,framerate=1/1 ! videoscale ! video/x-raw,width=426,height=240 ! queue ! videoconvert ! video/x-raw,format=NV12 ! vah264enc ! queue ! h264parse ! qtmux ! filesink location=output.mp4
Adding videorate ! video/x-raw,framerate=30/1
does not help, as it just copies that single frame 30 times, but it does not change it’s PTS (or whatever?).
Is it possible to make that one frame playback faster, as if it’s interval was not 1 second but 1/30 seconds?
Thanks!