-
-
Notifications
You must be signed in to change notification settings - Fork 877
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
Animated plots, hook_ffmpeg_html and video format #712
Comments
Thanks for the feedback. The animation support in HTML was not carefully designed, and there is a lot of room for improvement. I do not really want to hard-code the video format. Perhaps I can clean up the mess in knitr 1.7. |
Admittedly, I'm not a video expert, but I would think that the more control given to the user the better (given sane default settings for those who don't want to bother with details, and just want an out-of-the-box result). So, in advance, thanks for taking care of the code about videos! |
I added an internal function so you can define your own video format, e.g. if you want mp4:
Note the default video format has been changed to WebM in the latest version of knitr. |
Thanks Yihui, that looks great! Looks like I have everything I was hoping for there (not tested yet). |
FYI, I just added a chunk option |
Hey Yihui, This looks great! Did the new option make it to v1.11? I couldn't have it work, with e.g. In addition, does the option allow to change other settings, or is it necessary to go through Thanks for your work! |
@basille It is in the development version: https://github.com/yihui/knitr/blob/master/NEWS.md (1.12 is not released yet) This option does not allow you to change any other settings. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Since knitr 1.3, animated plots using
hook_ffmpeg_html
uses OGG video flies instead of MP4. I think it is a sensible default (although WebM would be equally good, according to browser support. However, would it be possible to have the file type as an option, so that people could, if needed, switch to MP4?It might be already possible, in which case I apologize: I couldn't find a way to do it. As far as I understand it, the file type is hard-coded in
hook_ffmpeg_html
:After a couple of trials, I couldn't find a way to do it manually. For instance, modifying directly
hook_ffmpeg_html
using:does nothing: output is still a OGG file. Or setting up a new
hook_ffmpeg_html_mp4
, which would be called byopts_knit$get(animation.fun = hook_ffmpeg_html_mp4)
, results in an error. In the end, I'm not too sure what to modify or what option to change to make this choice possible.By the way, I'm using knitr 1.5.
Mathieu.
The text was updated successfully, but these errors were encountered: