I’m Using FFmpeg-kit’s React-Native Kit
And I want to encode H264 to HEVC.
But the Videotoolbox in ios not working
I use “ffmpeg-kit-react-native”: “^6.0.2”
And here is my Code
// hevc_videotoolbox
await FFmpegKit.execute(`-i ${videoUri} -c:v hevc_videotoolbox -c:a aac -tag:v hvc1 -movflags +faststart -y ${outputUri}`);
} else {
await FFmpegKit.execute(`-i ${videoUri} -c:v hevc_omx -c:a aac -tag:v hvc1 -movflags +faststart -y ${outputUri}`);
}
But I got the error follwed like this
LOG libavutil 58. 2.100 / 58. 2.100
LOG libavcodec 60. 3.100 / 60. 3.100
LOG libavformat 60. 3.100 / 60. 3.100
LOG libavdevice 60. 1.100 / 60. 1.100
LOG libavfilter 9. 3.100 / 9. 3.100
LOG libswscale 7. 1.100 / 7. 1.100
LOG libswresample 4. 10.100 / 4. 10.100
LOG Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
LOG Metadata:
LOG major_brand :
LOG mp42
LOG
LOG minor_version :
LOG 1
LOG
LOG compatible_brands:
LOG isommp41mp42
LOG
LOG creation_time :
LOG 2024-08-29T02:42:24.000000Z
LOG
LOG Duration:
LOG 00:00:23.10
LOG , start:
LOG 0.000000
LOG , bitrate:
LOG 1223 kb/s
LOG
LOG Stream #0:0
LOG [0x1]
LOG (und)
LOG : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 1220 kb/s
LOG ,
LOG 30 fps,
LOG 30 tbr,
LOG 600 tbn
LOG (default)
LOG
LOG Metadata:
LOG creation_time :
LOG 2024-08-29T02:42:24.000000Z
LOG
LOG handler_name :
LOG Core Media Video
LOG
LOG vendor_id :
LOG [0][0][0][0]
LOG
LOG Stream mapping:
LOG Stream #0:0 -> #0:0
LOG (h264 (native) -> hevc (hevc_videotoolbox))
LOG
LOG Press [q] to stop, [?] for help
LOG [hevc_videotoolbox @ 0x11af89120] Error encoding frame: -12905
LOG [hevc_videotoolbox @ 0x11af89120] popping: -542398533
LOG [vost#0:0/hevc_videotoolbox @ 0x11af88e50] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
LOG Conversion failed!
How can I fix this error?
I read the
stack overflow
- Error while opening encoder for output stream #0.0 – maybe incorrect parameters such as bit_rate, rate, width or height
2./questions/77734601/react-native-ffmpeg-producing-unplayable-hevc-videos-that-still-have-audio
But that links doesn’t work for me
I want to compress video’s compressing with react-native on ios and android for reducing server cost
I have a small problem I am trying to work with this same package but regarding the audio conversion issue, when I try to convert a file with m4a extension to mp3 it tells me that it is not possible to convert the file because the getLogLevel is null and I don’t know how to solve it.
I hope a prompt response if someone knows how to solve this problem.