Skip to content
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

Implement rav1eenc.c for libavcodec #472

Closed
Kagami opened this issue Aug 16, 2018 · 17 comments
Closed

Implement rav1eenc.c for libavcodec #472

Kagami opened this issue Aug 16, 2018 · 17 comments
Labels

Comments

@Kagami
Copy link
Contributor

Kagami commented Aug 16, 2018

This issue rather belongs to ffmpeg's bugtracker but I suppose it would be useful to have tracking issue here as well.

Right now ffmpeg supports encoding to AV1 only via libaom. Would be nice to add encoding support via rav1e as well.

@lu-zero
Copy link
Collaborator

lu-zero commented Aug 17, 2018

A C API is in the work, it depends on #410 and wouldn't be limited to libavcodec. :)

@tdaede
Copy link
Collaborator

tdaede commented Aug 17, 2018

This is especially useful because ivf to mp4 muxing in ffmpeg doesn't currently work due to the lack of an av1 parser.

@kodawah kodawah self-assigned this Feb 14, 2019
@kodawah
Copy link
Collaborator

kodawah commented Feb 14, 2019

this is on my todo plate for march

@farindk
Copy link

farindk commented Feb 14, 2019

+1 from me.
I started an AV1 plugin for libheif in order to support AVIF images (https://github.com/strukturag/libheif).
Since libaom is way too slow, I would like to use rav1e instead, but I depend on a C API for that.

@lu-zero
Copy link
Collaborator

lu-zero commented Feb 14, 2019

The C API exists, you are welcome to use it and provide feedback :)

@farindk
Copy link

farindk commented Feb 14, 2019

Thanks for the link. I will have a look.

Offtopic question: is there support for encoding with still_picture and reduced_still_picture_header set in the sequence header?

@tdaede
Copy link
Collaborator

tdaede commented Feb 14, 2019

We're missing an API call to set it. When that's added, still_picture should work. There's also some support for reduced_still_picture_header but it's never been tested so we may need to fix a few bugs.

@farindk
Copy link

farindk commented Feb 14, 2019

Sounds good. As soon as I find some time, I'll try to integrate rav1e to libheif.

@dwbuiten
Copy link
Collaborator

dwbuiten commented Apr 5, 2019

WIP: https://github.com/dwbuiten/FFmpeg/tree/rav1e

@kodawah kodawah removed their assignment Apr 5, 2019
@xuguangxin
Copy link
Contributor

@dwbuiten , any update on this? I want to use ffmpeg+rav1e to do some RD curve comparison. Is your patch ready for target bitrate setting?
thanks

@lu-zero
Copy link
Collaborator

lu-zero commented Apr 28, 2019

@xuguangxin what do you have in mind?

@dwbuiten
Copy link
Collaborator

@xuguangxin It's a few extra lines of code to update the patch to properly map bitrate options from FFmpeg to rav1e.

However, rav1e's bitrate mode is a WIP. I am, in fact, working on updating some of the empiracally derived values in the bitrate RC code to work properly with AV1 (one of tons of low hanging fruit for rav1e).

If you really want to test it within FFmpeg, you can apply the patch as-is and build; it will work fine, but you have to specify stuff like bitrate via -rav1e-params quantizer=<maxqaunt>:bitrate=<bps>.

@xuguangxin
Copy link
Contributor

xuguangxin commented Apr 29, 2019

@lu-zero , just want to draw some RD curve for all AV1 encoders and compare it with x264 and x265. But current rav1e's ivf muxer did not write bitrate information to headers.

@dwbuiten. I had use some workaround to get the bitrate. I used ffmpeg remux the ivf to mp4. ffmpeg will calc the bitrate for me.
I got the basic RD curve now. As you said, seems rav1e's bitrate control still WIP.

Also, I want to double confirm you with params. To make sure I did not make a mistake.
Here is command for one pass abr:

encoder params
x264 ffmpeg -i $INPUT -c:v libx264 -tune psnr -b:v $RATE -bufsize 2*$RATE -vframes 600 $OUTPUT
x264 ffmpeg -i $INPUT -c:v libx265 -tune psnr -b:v $RATE -bufsize 2*$RATE -vframes 600 $OUTPUT
libaom ffmpeg -i $INPUT -c:v libaom-av1 -b:v $RATE -bufsize 2*$RATE -vframes 600 $OUTPUT
rav1e rav1e --tune Psnr -b $RATE $INPUT -o $OUTPUT

thanks for help

@Kagami
Copy link
Contributor Author

Kagami commented Apr 29, 2019

Offtopic, but can't you get bitrate just by diving file size to the number of seconds in resulting video which should be known in your case?

@xuguangxin
Copy link
Contributor

xuguangxin commented Apr 29, 2019

Sorry for off topic :). In this case, I need query fps and frame count from ivf. Then to the calc by my self. But ffmpeg can help me do this :).
Just need one line, "ffmpeg -i out.ivf -c:v copy out.mp4 && ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1 out.mp4"

@dwbuiten
Copy link
Collaborator

This is done an upstreamed.

@peters
Copy link

peters commented Nov 12, 2019

FFmpeg/FFmpeg@d8bf244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants