Closed darwindu closed 1 year ago
You'll need to call recorder.setVideoSideData(grabber.getVideoSideData())
, but that property doesn't exist, yet, but contributions are welcome!
Duplicate of https://github.com/bytedeco/javacv/issues/1976
Duplicate of #1976
Thank u.
recorder.setVideoSideData(grabber.getVideoSideData())
Is there a release plan for adding this attribute?
When can I call it?
Like I said, contributions are welcome. Anyone, include yourself, can create it!
Like I said, contributions are welcome. Anyone, include yourself, can create it!
ok, thank u
Like I said, contributions are welcome. Anyone, include yourself, can create it!
Supplementary explanation:
Property settings take effect recorder.setVideoMetadata("rotate", "90");
Tested versions 1.5.4 to 1.5.8
Version 1.5.4~1.5.6 is normal and will not rotate -90
Version 1.5.7~1.5.8 is abnormal and will rotate -90
Please note( the environment of the issues):
Windows rotates 90 degrees counterclockwise=-90
Linux rotates 90 degrees clockwise=90
Yes, the behavior of FFmpeg changed so that's not unexpected.
I've added setVideoSideData() and setDisplayRotation() in commit https://github.com/bytedeco/javacv/commit/b1c95f1fa838a9e3b11084095e11cb237682fbee. Please give it a try with the snapshots: http://bytedeco.org/builds/
I've added setVideoSideData() and setDisplayRotation() in commit b1c95f1. Please give it a try with the snapshots: http://bytedeco.org/builds/
Sorry for the late reply,
Environment: win10 Version: javacv master feature
Three methods were tested to adjust the video direction:
setVideoSideData log:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\test\video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2023-05-11T13:58:37.000000Z
location : +22.5332+113.9491/
location-eng : +22.5332+113.9491/
com.android.version: 12
Duration: 00:00:05.47, start: 0.000000, bitrate: 20608 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 19621 kb/s, 30.03 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
[libopenh264 @ 0000000022420ac0] Slice count will be set automatically
[libopenh264 @ 0000000022420ac0] [OpenH264] this = 0x0000000003e35c00, Warning:layerId(0) doesn't support profile(578), change to UNSPECIFIC profile
[libopenh264 @ 0000000022420ac0] [OpenH264] this = 0x0000000003e35c00, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
Output #0, mp4, to 'D:\test\video_compress_javacv.mp4':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, q=2-31, 2000 kb/s, 30 fps, 15360 tbn
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s
[aac @ 00000000233ac1c0] Qavg: 8073.756
[aac @ 00000000233ac1c0] 1 frames left in the queue on closing
Process finished with exit code 0
setDisplayRotation log:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\test\video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2023-05-11T13:58:37.000000Z
location : +22.5332+113.9491/
location-eng : +22.5332+113.9491/
com.android.version: 12
Duration: 00:00:05.47, start: 0.000000, bitrate: 20608 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 19621 kb/s, 30.03 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
[libopenh264 @ 0000000023490940] Slice count will be set automatically
[libopenh264 @ 0000000023490940] [OpenH264] this = 0x00000000237e0a30, Warning:layerId(0) doesn't support profile(578), change to UNSPECIFIC profile
[libopenh264 @ 0000000023490940] [OpenH264] this = 0x00000000237e0a30, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
Output #0, mp4, to 'D:\test\video_compress_javacv.mp4':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, q=2-31, 2000 kb/s, 30 fps, 15360 tbn
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s
[aac @ 0000000022e9df80] Qavg: 8073.756
[aac @ 0000000022e9df80] 1 frames left in the queue on closing
Process finished with exit code 0
setVideoMetadata log:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\test\video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2023-05-11T13:58:37.000000Z
location : +22.5332+113.9491/
location-eng : +22.5332+113.9491/
com.android.version: 12
Duration: 00:00:05.47, start: 0.000000, bitrate: 20608 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 19621 kb/s, 30.03 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
creation_time : 2023-05-11T13:58:37.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
[libopenh264 @ 000000002210e280] Slice count will be set automatically
[libopenh264 @ 000000002210e280] [OpenH264] this = 0x00000000229be2b0, Warning:layerId(0) doesn't support profile(578), change to UNSPECIFIC profile
[libopenh264 @ 000000002210e280] [OpenH264] this = 0x00000000229be2b0, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
Output #0, mp4, to 'D:\test\video_compress_javacv.mp4':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, q=2-31, 2000 kb/s, 30 fps, 15360 tbn
Metadata:
rotate : 90
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s
[aac @ 000000002210ee00] Qavg: 8073.756
[aac @ 000000002210ee00] 1 frames left in the queue on closing
Process finished with exit code 0
inputFile:
Causing video selection -90 degrees.
Can video transcoding compression not rotate -90 degrees by setting properties?
inputFile:
outputFile:
log: