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

May I set profile and level ? #226

Open
windwolf1001 opened this issue Mar 16, 2023 · 1 comment
Open

May I set profile and level ? #226

windwolf1001 opened this issue Mar 16, 2023 · 1 comment

Comments

@windwolf1001
Copy link

I want to convert video file to h264 (Main) rather than h264(High). Is there any parameters i can set ?
I find something like "profile High, level 3.0," in my console. But i don't know any method to change them.

My code as below:
VideoAttributes video = new VideoAttributes();
video.setCodec("h264");
File target = new File(targetFilePath);
AudioAttributes audio = new AudioAttributes();
audio.setCodec("aac");
EncodingAttributes attrs = new EncodingAttributes();
attrs.setOutputFormat("mp4");
attrs.setAudioAttributes(audio);
attrs.setVideoAttributes(video);
Encoder encoder = new Encoder();
encoder.encode(multimediaObject, target, attrs);

my console as below:
original File:hevc (Main) (hev1 / 0x31766568)
11:13:38.860 logback [http-nio-8102-exec-10] INFO w.s.jave.ConversionOutputAnalyzer - Unhandled message in step: 2 Line: 22 message: <[libx264 @ 000000000037ce00] using SAR=1/1>
11:13:38.861 logback [http-nio-8102-exec-10] INFO w.s.jave.ConversionOutputAnalyzer - Unhandled message in step: 2 Line: 23 message: <[libx264 @ 000000000037ce00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2>
11:13:38.861 logback [http-nio-8102-exec-10] INFO w.s.jave.ConversionOutputAnalyzer - Unhandled message in step: 2 Line: 24 message: <[libx264 @ 000000000037ce00] profile High, level 3.0, 4:2:0, 8-bit>
11:13:38.861 logback [http-nio-8102-exec-10] INFO w.s.jave.ConversionOutputAnalyzer - Unhandled message in step: 2 Line: 25 message: <[libx264 @ 000000000037ce00] 264 - core 164 r3075 66a5bc1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=11 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00>
result File : h264 (High) (avc1 / 0x31637661)

@windwolf1001
Copy link
Author

I have solved this problem.

VideoAttributes video = new VideoAttributes();
video.setCodec("h264");
video.setX264Profile(X264_PROFILE.MAIN);

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

No branches or pull requests

1 participant