-
Notifications
You must be signed in to change notification settings - Fork 55
implement viddump #2270
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: master
Are you sure you want to change the base?
implement viddump #2270
Conversation
|
Great that you got audio working, congratulations! |
|
|
||
| #include "SDL_pixels.h" | ||
|
|
||
| #define VIDEO_CODEC_ID AV_CODEC_ID_H264 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these settings should become config options. For example, I'd prefer opus codec over mp2. And some distributions might be unable to ship patent encumbered mpeg video codecs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we should try to dlopen() the libraries, so we don't have to carry them along ourselves. We could tell users to download ffmpeg binary releases from elsewhere and simply drop the libraries into the Woof executable directory. I think there are portable helper functions in DSL for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these settings should become config options. For example, I'd prefer opus codec over mp2. And some distributions might be unable to ship patent encumbered mpeg video codecs.
The MP2 supports the AV_SAMPLE_FMT_S16 format; the others require the AV_SAMPLE_FMT_FLTP format (planar float). Since OpenAL doesn't support planar formats, we need resampling. I didn't bother with that yet.
Yes, we need a lot of options. Perhaps we should create profiles: "lossless" (FFV1 codec), "fast," and "slow."
Also, we should try to dlopen() the libraries, so we don't have to carry them along ourselves.
For Linux, I have a 19 MB AppImage, which isn't bad: https://github.com/fabiangreffrath/woof/actions/runs/15091989526/artifacts/3145857687
Windows failed. I'll look into it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MP2 supports the
AV_SAMPLE_FMT_S16format; the others require theAV_SAMPLE_FMT_FLTPformat (planar float). Since OpenAL doesn't support planar formats, we need resampling. I didn't bother with that yet.
I see, didn't think about that before.
Yes, we need a lot of options. Perhaps we should create profiles: "lossless" (FFV1 codec), "fast," and "slow."
Yes, profiles sound like a very good idea. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MP2 supports the
AV_SAMPLE_FMT_S16format; the others require theAV_SAMPLE_FMT_FLTPformat (planar float). Since OpenAL doesn't support planar formats, we need resampling. I didn't bother with that yet.I see, didn't think about that before.
Apparently, opus can also encode from 16-bit samples. MP2 may be appropriate for a "fast" profile, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any experiences with AV1, VP8 or VP9 for video encoding? Just a thought...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any experiences with AV1, VP8 or VP9 for video encoding? Just a thought...
I use Nvidia encoders with my GPU (no VP8/VP9 support), so H.264 and H.265 are the fastest options for me. I've never tried AV1.
The current plan is to use FFV1 with paletted graphics support for the "lossless" profile and a variant of H.264 (first search for "h264_nvenc," then fall back to "x264") for the "fast" and "slow" profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds reasonable. I'd still vote for an entirely (patent) free alternative for users of very restricted ffmpeg distributions, something like "xiph" (theora + vorbis) or "webm" (vp8 + vorbis or vp9 + opus).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, Dosbox uses the lossless ZMBV codec for its video recordings, which might thus be a bit better supported than ffmpeg's very own ffv1 codec. Gnome Shell's screen recording feature tries (variants of) h264 and falls back to vp8 in a webm container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, Dosbox uses the lossless ZMBV codec for its video recordings, which might thus be a bit better supported than ffmpeg's very own ffv1 codec.
FFmpeg supports ZMBV, but FFV1 is much more sophisticated. Anyway, I will try it.
|
Random thought: can we replace spng with ffmpeg libs while at it? |
I doubt it. We use some advanced features to access the BTW, ffmpeg API changes quite often, so the |
|
|
If recording in widescreen mode, the video is completely distorted. Is it possible that video and sound are desync because of the wipe screen? I mean, it isn't recorded on the video track, but maybe the audio track waits for it? |
I haven't put much effort into syncing it yet. I think viddump should only work in demo playback mode and shouldn't skip any frames. PrBoom+ has separate logic in the main loop for this. Maybe we should rename viddump to converttovideo: |
Yes, it shound't. But right now the wipe screen frames are skipped.
But people are already used to the PrBoom+ CLI syntax. |
|
Also, |
The video and sound are working, but they are not in sync at the moment. I just want to check how it will compile in CI and what the size of the static binaries will be.
Command line:
woof -devparm -viddump -timedemo demo1"output.mp4" file will be created.