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

how to set video codec H265 for FFmpegFrameRecorder? #866

Closed
nobitaclash opened this issue Dec 29, 2017 · 10 comments
Closed

how to set video codec H265 for FFmpegFrameRecorder? #866

nobitaclash opened this issue Dec 29, 2017 · 10 comments
Labels

Comments

@nobitaclash
Copy link

I change the video codec to H265 for faster videostream. The following gives me org.bytedeco.javacv.FrameRecorder$Exception: avcodec_open2() error -1: Could not open video codec..

recorder.setSampleRate(sampleAudioRateInHz);
recorder.setVideoBitrate(videoBitrate);
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H265);
recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);

@saudet
Copy link
Member

saudet commented Dec 29, 2017

You'll need to provide a way to reproduce your issue. It works just fine for me on Linux:

    Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv), 402x402 [SAR 3:4 DAR 3:4], 1726 kb/s, 30.06 fps, 30 tbr, 15360 tbn, 30 tbc (default)

@nobitaclash
Copy link
Author

nobitaclash commented Jan 2, 2018

I used FFmpegFrameRecorder and javacv-platform-1.3.3-bin.zip in android

@saudet
Copy link
Member

saudet commented Jan 2, 2018

You're right, it looks like libx265 doesn't work on Android, which I think has already been reported in issues #41 and bytedeco/javacpp-presets#386. Could you check upstream what's up this? I wasn't able to find anything wrong with the build and the same works on Linux.

@saudet saudet closed this as completed Jan 2, 2018
@saudet saudet reopened this Jan 2, 2018
saudet added a commit to bytedeco/javacpp-presets that referenced this issue Feb 25, 2018
@saudet
Copy link
Member

saudet commented Feb 26, 2018

I figured out what the problem was. There was a bug in the patch I created for Android. I've fixed it in the commit above, so please try out new snapshot binaries: http://bytedeco.org/builds/ Thanks!

@pankajsoni19
Copy link

pankajsoni19 commented Feb 28, 2018

we used ffmpeg in conjuction with realm and webrtc. there has always been an issue with loading of libs with ffmpeg. I saw that you created android 64 bit releases. When will it be possible for you to do a release.

If it's possible to release by tuesday we can include it in our next app release. or this will get pushed for another month.

@nobitaclash
Copy link
Author

thanks you for support

@saudet
Copy link
Member

saudet commented Mar 6, 2018

@softwarejoint Binaries are available on the snapshot server: http://bytedeco.org/builds/

@saudet
Copy link
Member

saudet commented Mar 31, 2018

Fix included in JavaCV 1.4.1. Thanks for reporting and enjoy!

@saudet saudet closed this as completed Mar 31, 2018
@max-tian
Copy link

It's not been fixed in version 1.5.2 JavaCV. The settings as below.
recorder.setVideoCodec( avcodec.AV_CODEC_ID_H265 ); recorder.setPixelFormat( avutil.AV_PIX_FMT_YUV420P );

@saudet
Copy link
Member

saudet commented Jul 26, 2022

@max-tian I'm pretty sure that works, but please first update to JavaCV 1.5.7 just to be sure.

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

4 participants