ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

Invalid data found when processing input error when generating mp4 video from video frames

Open SejalHarsoda opened this issue 3 years ago • 5 comments

Discussed in https://github.com/tanersener/ffmpeg-kit/discussions/208

Originally posted by SejalHarsoda October 27, 2021 I have built FFmpeg-kit by modifying the configuration as I only want mp4 muxer functionality. Configure option I have added in ffmpeg.sh is : ./configure
--cross-prefix="${HOST}-"
--sysroot="${ANDROID_SYSROOT}"
--prefix="${FFMPEG_LIBRARY_PATH}"
--arch="${TARGET_ARCH}"
--cc="${CC}"
--cxx="${CXX}"
--target-os=android
${BUILD_LIBRARY_OPTIONS}
--enable-cross-compile --disable-debug --disable-programs
--disable-doc --enable-pic --disable-everything
${ASM_OPTIONS}
--enable-protocol=file
--enable-muxer=mp4
1>>"${BASEDIR}"/build.log 2>&1

It gives no error and .aar built. Now when I added it in the project and try to execute the command "-i inputVideoFile -c:v copy -f mp4 -y outputFile"

Video file not generated and it returns return code 1 and display invalid data found when processing input

Note: Video file generated properly when building the library without change in the configuration in ffmpeg.sh file

Which configuration option i have to enable to resolve invalid data error

SejalHarsoda avatar Oct 28 '21 11:10 SejalHarsoda

@tanersener Even try configuration provided at https://github.com/tanersener/ffmpeg-kit/wiki/How-to-Decrease-Binary-Size which generates mp4 from jpeg but when I try to create an mp4 file it throws the same error invalid data found when processing input.

Please check which are other configurations I have to enable in order to make it work

SejalHarsoda avatar Nov 09 '21 04:11 SejalHarsoda

I updated the example in the How to Decrease Binary Size page. It had been tested before, but somehow it wasn't creating a valid library with the latest versions. So, I added a few things there.

tanersener avatar Nov 09 '21 13:11 tanersener

Your example is working now. Which flags do I require if I want to create an mp4 file from the file which contains video frames with h264, h265, or mjpeg video codecs?

I have tried --disable-everything
--enable-protocol=file
--enable-muxer=mp4 \

Also tried by enabling mpeg4 demuxer, encoder, and parser

Can you check what I am missing in the configuration?

I already had frames that are in h264 format then also did I require to enable encoder?

SejalHarsoda avatar Nov 10 '21 08:11 SejalHarsoda

I don't know. You need to try and see it yourself.

You're ignoring the decoders, encoders and demuxers in your configure script. If you are not familiar with them ask google and try to understand what they do. Then compare your configure script with the configure in the example and put something for each of these components.

tanersener avatar Nov 10 '21 09:11 tanersener

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 10 '22 01:01 github-actions[bot]