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

Same Command is not working on React-Native-ffmpeg #1035

Open
aza1200 opened this issue Sep 4, 2024 · 2 comments
Open

Same Command is not working on React-Native-ffmpeg #1035

aza1200 opened this issue Sep 4, 2024 · 2 comments
Labels
ios Affect iOS platform needs-more-details We need more details to understand what the problem is

Comments

@aza1200
Copy link

aza1200 commented Sep 4, 2024

Hello,

I am using react-native-ffmpeg-kit to encode a video with the following FFmpeg command:

ffmpeg -i input.mp4 -c:v hevc_videotoolbox -c:a aac -tag:v hvc1 -vf scale=1920:1080 -b:v 3000k -r 30 -movflags +faststart -y output.mp4

It works on local mac - ffmpeg(not-native-ffmpeg-kit)
However, when I run this command on react-native ios simulator, I receive the following error message:

 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 'file:///Users/aza1200/Library/Developer/CoreSimulator/Devices/B2FFF7CD-CEC4-405C-A53F-6353CD9648F3/data/Containers/Data/Application/3E0D2C8A-34F7-43CA-975D-6864C7FB4B5D/Library/Caches/ImagePicker/3C4E4D03-3128-4BCE-841D-D77BCC0EDA30.mp4':
 LOG    Metadata:
 LOG      major_brand     :
 LOG  isom
 LOG  
 LOG      minor_version   :
 LOG  512
 LOG  
 LOG      compatible_brands:
 LOG  isomiso2mp41
 LOG  
 LOG      encoder         :
 LOG  Lavf61.5.101
 LOG  
 LOG    Duration:
 LOG  00:02:54.71
 LOG  , start:
 LOG  0.000000
 LOG  , bitrate:
 LOG  26825 kb/s
 LOG  
 LOG    Stream #0:0
 LOG  [0x1]
 LOG  (und)
 LOG  : Video: hevc (hvc1 / 0x31637668), yuv420p(tv, bt709, progressive), 3840x2160, 26702 kb/s
 LOG  ,
 LOG  59.94 fps,
 LOG  59.94 tbr,
 LOG  60k tbn
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        handler_name    :
 LOG  ISO Media file produced by Google Inc. Created on: 09/03/2024.
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG        encoder         :
 LOG  Lavc61.11.100 hevc_videotoolbox
 LOG  
 LOG    Stream #0:1
 LOG  [0x2]
 LOG  (eng)
 LOG  : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 124 kb/s
 LOG   (default)
 LOG  
 LOG      Metadata:
 LOG        handler_name    :
 LOG  ISO Media file produced by Google Inc.
 LOG  
 LOG        vendor_id       :
 LOG  [0][0][0][0]
 LOG  
 LOG  Stream mapping:
 LOG    Stream #0:0 -> #0:0
 LOG   (hevc (native) -> hevc (hevc_videotoolbox))
 LOG  
 LOG    Stream #0:1 -> #0:1
 LOG   (aac (native) -> aac (native))
 LOG  
 LOG  Press [q] to stop, [?] for help
 LOG  [hevc_videotoolbox @ 0x115de72e0] Error encoding frame: -12905
 LOG  [hevc_videotoolbox @ 0x115de72e0] popping: -542398533
 LOG  [vost#0:0/hevc_videotoolbox @ 0x115de7010] 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  [aac @ 0x115de8550] Qavg: 29522.865
 LOG  [aac @ 0x115de8550] 2 frames left in the queue on closing
 LOG  Conversion failed!

Environment:
FFmpeg version: 60.3.100 (via react-native-ffmpeg-kit)
H.264 codec, 30 fps, 1220 kbps
Command options:
Video codec: hevc_videotoolbox
Resize: 1920x1080
Video bitrate: 3000k
Frame rate: 30 fps
Audio codec: aac
Other: -movflags +faststart
Issue:
It seems there’s an issue with the encoder (hevc_videotoolbox) while initializing the output stream. The error message suggests that the problem might be related to incorrect parameters, but I’m not sure which parameters are causing the issue (bitrate, resolution, frame rate, or something else).

Has anyone experienced this issue before? Any help or insights on how to resolve this would be greatly appreciated!

Thank you in advance!

Copy link

github-actions bot commented Nov 4, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@tanersener tanersener added the needs-more-details We need more details to understand what the problem is label Nov 7, 2024
@tanersener
Copy link
Collaborator

If there is a difference in behaviour, then outputs from local ffmpeg and react-native-ffmpeg-kit must be compared to understand the issue.

@tanersener tanersener added the ios Affect iOS platform label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios Affect iOS platform needs-more-details We need more details to understand what the problem is
Projects
None yet
Development

No branches or pull requests

2 participants