Closed jeb218 closed 4 years ago
x264
, x265
and xvidcore
are only available in GPL licensed packages, like min-gpl
and full-gpl
.
I suspect you are using the default package. Can you check your gradle
dependency tree and tell me which mobile-ffmpeg
dependency you have in your classpath?
cat tmp.txt | grep ffmpeg +--- project :react-native-ffmpeg +--- project :react-native-ffmpeg | +--- com.arthenica:mobile-ffmpeg-video:4.3.1 +--- com.arthenica:mobile-ffmpeg-video:{strictly 4.3.1} -> 4.3.1 (c) +--- project :react-native-ffmpeg --- project :react-native-ffmpeg +--- com.arthenica:mobile-ffmpeg-video:4.3.1 +--- project :react-native-ffmpeg --- project :react-native-ffmpeg +--- com.arthenica:mobile-ffmpeg-video:4.3.1 --- project react-native-ffmpeg (n) +--- project :react-native-ffmpeg --- project :react-native-ffmpeg +--- com.arthenica:mobile-ffmpeg-video:4.3.1 +--- project :react-native-ffmpeg --- project :react-native-ffmpeg +--- com.arthenica:mobile-ffmpeg-video:4.3.1
`
That appears to be the same output from the react-native-ffmpeg-test repo
Does that help pinpoint the problem? Thanks in advance!
This shows that you are using the video
package. But this package does not have x264
inside. Can you show the dependencies when you have one of the GPL licensed packages enabled?
i had switched to full-gpl as well as min-gpl as mentioned in my first post, but it still couldn't find the libx264, libx265, etc codecs.
After your last reply I tried setting it to full-gpl again, but suddenly i was getting libcpufeatures.so not found. I found 3 other issue reports about that, with suggestions to clear the gradle cache and delete the .gradle home directory. I did that, and it didn't solve the issue.
So I created a brand new project, added the react-native-ffmpeg dependency, changed the ext to full-gpl and built it. I am now able to use the libx264 codec, so I imagine the issue was something to do with caching all along. Not sure why clearing the cache didn't fix the issues I was having, but a new build with ext as full-gpl to begin with has me up and running.
I appreciate your help.
Let me know if I should create a separate issue report for this....
On full-gpl if I am using mpeg4 everything works great, meaning the video is processed and ffmpeg completes, no problems. I think mpeg4 lacks in quality, and takes longer to process, but that is beside the point.
Also on full-gpl, using libx264, the processing always crashes after about 55 frames - the app closes, and no errors are output to the log so I can't see what is causing it. If possible, I'd like to get libx264 to work because the processing fps is about 3-4 times faster than mpeg4.
Do you have any luck using libx264, or have any ideas on what might be causing the process to fail?
Thanks again!
Can you please create another issue for this? Also, can you please add platform, version information and logs too? I have test applications which use libx264 with no issues. I don't know the reason of your crashes, it has to be analysed. Can you try using different files?
I have tried a few packages in android/buld.gradle:
ext { reactNativeFFmpegPackage = "video" }
ext { reactNativeFFmpegPackage = "full-gpl" }
ext { reactNativeFFmpegPackage = "min-gpl" }
Along with a few options for -vcodec:
libx264, libx265, and xvidcore
I don't see that "video" includes "x264", but the react-native-ffmpeg-test repo has "video" as the package, and uses -vcodec libx264 in a lot of the test commands.
In all of those combinations the error log says "Unknown encoder libx264" (or whichever codec i was trying to use at the time).
Do you have any tips on how to use another encoder?