[
https://issues.apache.org/jira/browse/GUACAMOLE-2298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095063#comment-18095063
]
Vicente Louvet III commented on GUACAMOLE-2298:
-----------------------------------------------
Thanks, [~necouchman],
I hadn't come across GUACAMOLE-1370 / #687; I read through it, and I think it's
complementary to this rather than a replacement.
#687 lets you name the output file (and stream to stdout), guessing the
container from the extension - useful on its own.
But it doesn't change codec selection: guacenc still hardcodes the video codec
to mpeg4.
Since libavformat's WebM muxer only accepts VP8/VP9/AV1, guacenc -o out.webm
would guess the WebM container and then fail writing the header:
{noformat}
[webm] Only VP8 or VP9 or AV1 video ... are supported for WebM.
Could not write header (incorrect codec parameters ?): Invalid argument
{noformat}
So producing a WebM/VP9 file needs the other half - selecting a codec the
container can actually hold. That's what this change adds: -c libvpx-vp9 picks
VP9 (royalty-free, browser-native) and writes WebM. It also derives a
compatible extension automatically, so it works on its own today, and it
composes cleanly with #687: -o decides where / which container, -c decides the
codec.
If #687 lands first, I'm glad to rebase on it.
The motivation, for context: a royalty-free, browser-playable format for
recordings - the piece that H.264 licensing has kept awkward. VP9-in-WebM
covers it with libraries guacenc already links.
> guacenc: add -c option to encode recordings as VP9/VP8 (WebM)
> -------------------------------------------------------------
>
> Key: GUACAMOLE-2298
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-2298
> Project: Guacamole
> Issue Type: Improvement
> Components: guacenc
> Reporter: Vicente Louvet III
> Priority: Minor
> Attachments: guacenc-vp9-webm.patch
>
>
> Currently guacenc only produces MPEG-4 video (FILE.m4v). It would be useful to
> also support a royalty-free, browser-native output format, so that recordings
> can be played back directly in a browser and shared without codec-licensing
> concerns. Encoding to VP9 (or VP8) in a WebM container covers this, and libvpx
> is already available wherever guacenc's libavcodec is.
> The attached patch adds an optional -c flag which selects the libavcodec
> encoder by name. For example:
> {color:#172b4d}guacenc -c libvpx-vp9 recording.guac -->
> recording.guac.webm{color}
> Details:
> - With no -c option, guacenc encodes mpeg4 to FILE.m4v exactly as before. The
> default behavior is unchanged.
> - The VP8 (libvpx) and VP9 (libvpx-vp9) encoders are written to a WebM
> (.webm)
> container. The output container is derived from the codec so the encoded
> stream always lands in a compatible container.
> - A codec name that isn't available in the local libavcodec build logs a
> warning and falls back to mpeg4, rather than aborting the run.
> guacenc already passes the codec name straight through to libavcodec, so no
> encoding logic changed beyond the container selection and the new option. The
> diff is small and self-contained – guacenc only, no libguac / protocol /
> client changes. A CUnit test suite under src/guacenc/tests covers the
> codec-to-container mapping, and the man page documents the option.
> I'm happy to open a pull request against guacamole-server if this looks
> reasonable.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)