-
Notifications
You must be signed in to change notification settings - Fork 11
encode train clips using h264 #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Certainly a good idea, GIF is a terrible format for this and h264 is much better. However, I am not happy about the choice of gstreamer. We already depend on the ffmpeg (cli) anyways, and the overhead when using ffmpeg in a separate process is prob. negligible as this is only happening asynchronously for a few frames, not all the time. |
OK. Doesn't feel great since gstreamer was a a bunch of work. But understandable. BTW, is there a way to provide per frame timings to ffmpeg? This is relevant because we sometimes have frames dropped within a frame (because it is too dark/contrast too low) and it would be nice to not have the train clip jump. Also ofc there's webcams with variable frame rate. Would be awesome if the videos were good enough to be reprocessed afterwards. I also imagine would could save the video on stitching failures, to generate test cases. |
Yes, videos could indeed be quite useful to generate more testdata and aid in debugging. Supposedly, you can provide a per frame duration to the demuxer: |
no per-frame PTS yet
Let me know when ready for review. I am also fine with completely removing the GIF recording functionality, but ofc. the database has to stay backwards compatible and to know if for a certain recording there is a gif or a h264 clip. I can also fix the frontend if that change is implemented. But please be aware that I am currently under a bit of time pressure, so it might take a bit. |
Hello!
Driven by the fact that my 1.5 years worth of trains are now approaching 1TB of space usage, and most of that is just the (poorly looking) gifs, i have hacked together this h264/mp4 train clip encoding feature using gstreamer. Gstreamer has been a pain, but i finally got it working. I went for gstreamer and not ffmpeg in the hopes that we could save some context switches and copying frames around.
example train renderings
train_00010101_000004.186_Z.mp4
This clip plays for me locally in mp4, just one more detail i have not figured out …
But it is much better looking than the gif, while being smaller than the stitched jpg.
There is still a bunch of stuff to do, but i wanted your feedback on the general idea.
Cheers,
Feiko