encode YUV420 frame to VP9
up vote
1
down vote
favorite
As title,
I'm pulling frames from a IP camera. I converted the input raw data to YUV420 format, and would like to encode YUV420 to VP9, and save frames as .webm format. Would I be able to do that? Or should I input a BGR444 format for encoding?
BTW, to set up the parameters for encoding vp9. Is the av_dict_set()
the right function for setting parameters?
Ex: (http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)
av_dict_set(&opt, "crf" , "23", 0);
av_dict_set(&opt, "speed" , "4" , 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "pass" , "1" , 0);
av_dict_set(&opt, "b:v", "1400k", 0);
Edit: The wiki uses 2 pass for setting parameters, would I be able to do in with 1 pass?
Edit2: Blow code seems to be working, wonder how can I bring the size of the videos (vp9) down? Currently, I have similar size as using h264 encoder.
av_dict_set(&opt, "crf" , "45", 0);
av_dict_set(&opt, "speed" , "8" , 0);
av_dict_set(&opt, "quality", "realtime", 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "tile-columns", "3", 0);
av_dict_set(&opt, "frame-parallel", "1", 0);
av_dict_set(&opt, "row-mt", "1", 0);
Update1:
YUV420P can be encoded as VP9!
video encoding ffmpeg webm vp9
add a comment |
up vote
1
down vote
favorite
As title,
I'm pulling frames from a IP camera. I converted the input raw data to YUV420 format, and would like to encode YUV420 to VP9, and save frames as .webm format. Would I be able to do that? Or should I input a BGR444 format for encoding?
BTW, to set up the parameters for encoding vp9. Is the av_dict_set()
the right function for setting parameters?
Ex: (http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)
av_dict_set(&opt, "crf" , "23", 0);
av_dict_set(&opt, "speed" , "4" , 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "pass" , "1" , 0);
av_dict_set(&opt, "b:v", "1400k", 0);
Edit: The wiki uses 2 pass for setting parameters, would I be able to do in with 1 pass?
Edit2: Blow code seems to be working, wonder how can I bring the size of the videos (vp9) down? Currently, I have similar size as using h264 encoder.
av_dict_set(&opt, "crf" , "45", 0);
av_dict_set(&opt, "speed" , "8" , 0);
av_dict_set(&opt, "quality", "realtime", 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "tile-columns", "3", 0);
av_dict_set(&opt, "frame-parallel", "1", 0);
av_dict_set(&opt, "row-mt", "1", 0);
Update1:
YUV420P can be encoded as VP9!
video encoding ffmpeg webm vp9
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
As title,
I'm pulling frames from a IP camera. I converted the input raw data to YUV420 format, and would like to encode YUV420 to VP9, and save frames as .webm format. Would I be able to do that? Or should I input a BGR444 format for encoding?
BTW, to set up the parameters for encoding vp9. Is the av_dict_set()
the right function for setting parameters?
Ex: (http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)
av_dict_set(&opt, "crf" , "23", 0);
av_dict_set(&opt, "speed" , "4" , 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "pass" , "1" , 0);
av_dict_set(&opt, "b:v", "1400k", 0);
Edit: The wiki uses 2 pass for setting parameters, would I be able to do in with 1 pass?
Edit2: Blow code seems to be working, wonder how can I bring the size of the videos (vp9) down? Currently, I have similar size as using h264 encoder.
av_dict_set(&opt, "crf" , "45", 0);
av_dict_set(&opt, "speed" , "8" , 0);
av_dict_set(&opt, "quality", "realtime", 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "tile-columns", "3", 0);
av_dict_set(&opt, "frame-parallel", "1", 0);
av_dict_set(&opt, "row-mt", "1", 0);
Update1:
YUV420P can be encoded as VP9!
video encoding ffmpeg webm vp9
As title,
I'm pulling frames from a IP camera. I converted the input raw data to YUV420 format, and would like to encode YUV420 to VP9, and save frames as .webm format. Would I be able to do that? Or should I input a BGR444 format for encoding?
BTW, to set up the parameters for encoding vp9. Is the av_dict_set()
the right function for setting parameters?
Ex: (http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)
av_dict_set(&opt, "crf" , "23", 0);
av_dict_set(&opt, "speed" , "4" , 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "pass" , "1" , 0);
av_dict_set(&opt, "b:v", "1400k", 0);
Edit: The wiki uses 2 pass for setting parameters, would I be able to do in with 1 pass?
Edit2: Blow code seems to be working, wonder how can I bring the size of the videos (vp9) down? Currently, I have similar size as using h264 encoder.
av_dict_set(&opt, "crf" , "45", 0);
av_dict_set(&opt, "speed" , "8" , 0);
av_dict_set(&opt, "quality", "realtime", 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "tile-columns", "3", 0);
av_dict_set(&opt, "frame-parallel", "1", 0);
av_dict_set(&opt, "row-mt", "1", 0);
Update1:
YUV420P can be encoded as VP9!
video encoding ffmpeg webm vp9
video encoding ffmpeg webm vp9
edited Nov 20 at 23:09
asked Nov 19 at 20:07
User800222
295
295
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I'm pulling frames from a IP camera. I converted the input raw data to
YUV420 format, and would like to encode YUV420 to VP9, and save frames
as .webm format. Would I be able to do that?
Yes. Here is ffmpeg's official examples: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
Or should I input a BGR444 format for encoding?
Always use yuv formats like yuv420p. Do not use RGB, even if it is supported will be inefficient.
The wiki uses 2 pass for setting parameters, would I be able to do in
with 1 pass
Yes, 2 pass gives advantages but not necessary.
Blow code seems to be working, wonder how can I bring the size of the
videos (vp9) down? Currently, I have similar size as using h264
encoder.
What you need is sws_scale
functionality of ffmpeg. This does two things, scaling and format conversion, both can be performed same time. Check scaling_video.c
example.
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I'm pulling frames from a IP camera. I converted the input raw data to
YUV420 format, and would like to encode YUV420 to VP9, and save frames
as .webm format. Would I be able to do that?
Yes. Here is ffmpeg's official examples: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
Or should I input a BGR444 format for encoding?
Always use yuv formats like yuv420p. Do not use RGB, even if it is supported will be inefficient.
The wiki uses 2 pass for setting parameters, would I be able to do in
with 1 pass
Yes, 2 pass gives advantages but not necessary.
Blow code seems to be working, wonder how can I bring the size of the
videos (vp9) down? Currently, I have similar size as using h264
encoder.
What you need is sws_scale
functionality of ffmpeg. This does two things, scaling and format conversion, both can be performed same time. Check scaling_video.c
example.
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
add a comment |
up vote
0
down vote
I'm pulling frames from a IP camera. I converted the input raw data to
YUV420 format, and would like to encode YUV420 to VP9, and save frames
as .webm format. Would I be able to do that?
Yes. Here is ffmpeg's official examples: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
Or should I input a BGR444 format for encoding?
Always use yuv formats like yuv420p. Do not use RGB, even if it is supported will be inefficient.
The wiki uses 2 pass for setting parameters, would I be able to do in
with 1 pass
Yes, 2 pass gives advantages but not necessary.
Blow code seems to be working, wonder how can I bring the size of the
videos (vp9) down? Currently, I have similar size as using h264
encoder.
What you need is sws_scale
functionality of ffmpeg. This does two things, scaling and format conversion, both can be performed same time. Check scaling_video.c
example.
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
add a comment |
up vote
0
down vote
up vote
0
down vote
I'm pulling frames from a IP camera. I converted the input raw data to
YUV420 format, and would like to encode YUV420 to VP9, and save frames
as .webm format. Would I be able to do that?
Yes. Here is ffmpeg's official examples: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
Or should I input a BGR444 format for encoding?
Always use yuv formats like yuv420p. Do not use RGB, even if it is supported will be inefficient.
The wiki uses 2 pass for setting parameters, would I be able to do in
with 1 pass
Yes, 2 pass gives advantages but not necessary.
Blow code seems to be working, wonder how can I bring the size of the
videos (vp9) down? Currently, I have similar size as using h264
encoder.
What you need is sws_scale
functionality of ffmpeg. This does two things, scaling and format conversion, both can be performed same time. Check scaling_video.c
example.
I'm pulling frames from a IP camera. I converted the input raw data to
YUV420 format, and would like to encode YUV420 to VP9, and save frames
as .webm format. Would I be able to do that?
Yes. Here is ffmpeg's official examples: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
Or should I input a BGR444 format for encoding?
Always use yuv formats like yuv420p. Do not use RGB, even if it is supported will be inefficient.
The wiki uses 2 pass for setting parameters, would I be able to do in
with 1 pass
Yes, 2 pass gives advantages but not necessary.
Blow code seems to be working, wonder how can I bring the size of the
videos (vp9) down? Currently, I have similar size as using h264
encoder.
What you need is sws_scale
functionality of ffmpeg. This does two things, scaling and format conversion, both can be performed same time. Check scaling_video.c
example.
answered Nov 21 at 7:27
the kamilz
7021411
7021411
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
add a comment |
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
I have a downscaled frame already for both h264 and vp9 to encode and would like to get the advantage of VP9's which having a smaller size but maintain similar quality as h264. The video is fairly short, I manage to change the parameter of keyframe intervals to get the vp9's file size down.
– User800222
Nov 21 at 8:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53381888%2fencode-yuv420-frame-to-vp9%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown