gpt4 book ai didi

ffmpeg - android 将 rtsp 转换为 MP4 ffmpeg

转载 作者:行者123 更新时间:2023-12-04 23:18:41 25 4
gpt4 key购买 nike

1.Gradle

dependencies { api 'nl.bravobit:android-ffmpeg:1.1.5' }
2.代码
String[] ffmpegCommand = new String[]{"-rtsp_transport","tcp", "-i", rtspUrl,"-g","100", "-f", "mp4", "-r", "20", "-s", "640x480", filePath};
return ffmpeg.execute(ffmpegCommand, new FFcommandExecuteResponseHandler() {
@Override
public void onSuccess(String s) {
LogUtil.d(Rtsp2FilePresenter.class.getName(), "startRecord onSuccess :" + s);
}

@Override
public void onProgress(String s) {
LogUtil.d(Rtsp2FilePresenter.class.getName(), "startRecord onProgress :" + s);
}

@Override
public void onFailure(String s) {
LogUtil.d(Rtsp2FilePresenter.class.getName(), "startRecord onFailure :" + s);
}

@Override
public void onStart() {
LogUtil.d(Rtsp2FilePresenter.class.getName(), "startRecord onStart :");
}

@Override
public void onFinish() {
LogUtil.d(Rtsp2FilePresenter.class.getName(), "startRecord onFinish :");
}
});
3.Logcat:

built with gcc 4.9.x (GCC) 20150123 (prerelease)configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-ffprobe --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-libvpx --enable-libass --enable-yasm --enable-pthreads --disable-debug --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --enable-nonfree --pkg-config=pkg-config --pkg-config-flags=--static --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags=libavutil 56. 14.100 / 56. 14.100libavcodec 58. 18.100 / 58. 18.100libavformat 58. 12.100 / 58. 12.100libavdevice 58. 3.100 / 58. 3.100libavfilter 7. 16.100 / 7. 16.100libavresample 4. 0. 0 / 4. 0. 0libswscale 5. 1.100 / 5. 1.100libswresample 3. 1.100 / 3. 1.100libpostproc 55. 1.100 / 55. 1.100[h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame![h264 @ 0xee6c9380] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0xee6c9380] decode_slice_header error[h264 @ 0xee6c9380] no frame!


问题:如何修复命令?但是该命令可以在windows上运行而不会出错......

最佳答案

String[] ffmpegCommand = new String[]{"-rtsp_transport","udp", "-i",rtspUrl,"-g","100", "-f", "mp4", "-r", "20", "-s", "640x480",filePath};

关于ffmpeg - android 将 rtsp 转换为 MP4 ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71417789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com