Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 尝试使用ffplay播放h264流时出错_Java_Video_Ffmpeg_H.264 - Fatal编程技术网

Java 尝试使用ffplay播放h264流时出错

Java 尝试使用ffplay播放h264流时出错,java,video,ffmpeg,h.264,Java,Video,Ffmpeg,H.264,我有一个包含部分原始h264流的文件,我想在Android应用程序中播放它 首先我试着在电脑上玩。。。所以我试着用ffplay来做这个。。 我使用了以下命令: ffplay.exe stream.out 然后它打开了一个窗口,开始播放,但我看到的是屏幕上的绿色很多 输出有很多错误的红线: [h264 @ 00000000031238c0] Reducing left cropping to 0 chroma samples to preserve alignment. [h264 @ 00000

我有一个包含部分原始h264流的文件,我想在Android应用程序中播放它

首先我试着在电脑上玩。。。所以我试着用ffplay来做这个。。 我使用了以下命令:
ffplay.exe stream.out

然后它打开了一个窗口,开始播放,但我看到的是屏幕上的绿色很多

输出有很多错误的红线:

[h264 @ 00000000031238c0] Reducing left cropping to 0 chroma samples to preserve alignment.
[h264 @ 00000000031238c0] illegal aspect ratio
[h264 @ 0000000003110ec0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'out4':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1200k tbn, 59.94 tbc
[h264 @ 0000000005791960] error while decoding MB 50 37, bytestream -11
[h264 @ 0000000005791960] top block unavailable for requested intra4x4 mode -1 at 4 42
[h264 @ 0000000005791960] error while decoding MB 4 42, bytestream 4057
[h264 @ 0000000005791960] concealing 3519 DC, 3519 AC, 3519 MV errors in P frame
[h264 @ 0000000005782840] error while decoding MB 0 3, bytestream -23
[h264 @ 0000000005782fc0] error while decoding MB 1 36, bytestream -16
[h264 @ 0000000005782fc0] concealing 3462 DC, 3462 AC, 3462 MV errors in P frame
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 0000000005490380] error while decoding MB 0 12, bytestream 917
[h264 @ 0000000005782840] error while decoding MB 0 12, bytestream 4415
[h264 @ 0000000005782840] top block unavailable for requested intra mode at 22 18
[h264 @ 0000000005782840] error while decoding MB 22 18, bytestream 1477
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 8 30
[h264 @ 0000000005782840] error while decoding MB 8 30, bytestream 4272
[h264 @ 0000000005782840] error while decoding MB 67 37, bytestream -10
[h264 @ 0000000005782840] top block unavailable for requested intra mode at 51 42
[h264 @ 0000000005782840] error while decoding MB 51 42, bytestream 3845
[h264 @ 0000000005782840] concealing 3309 DC, 3309 AC, 3309 MV errors in P frame
[h264 @ 0000000005490380] concealing 3296 DC, 3296 AC, 3296 MV errors in P frame
[h264 @ 00000000057914c0] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 00000000057914c0] error while decoding MB 0 12, bytestream 4371
[h264 @ 00000000057914c0] top block unavailable for requested intra4x4 mode -1 at 5 18
[h264 @ 00000000057914c0] error while decoding MB 5 18, bytestream 5007
[h264 @ 00000000057914c0] error while decoding MB 46 26, bytestream -6
[h264 @ 00000000057914c0] top block unavailable for requested intra mode at 37 36
[h264 @ 00000000057914c0] error while decoding MB 37 36, bytestream 1271
[h264 @ 00000000057914c0] concealing 2953 DC, 2953 AC, 2953 MV errors in P frame
[h264 @ 0000000005791960] concealing 3391 DC, 3391 AC, 3391 MV errors in P frame
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 5 0
[h264 @ 0000000005782840] error while decoding MB 5 0, bytestream 1025
[h264 @ 0000000005782fc0] top block unavailable for requested intra4x4 mode -1 at 47 30
[h264 @ 0000000005782fc0] error while decoding MB 47 30, bytestream 584
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 8 6
[h264 @ 0000000005782840] error while decoding MB 8 6, bytestream 4699
[h264 @ 0000000005782fc0] concealing 3600 DC, 3600 AC, 3600 MV errors in P frame
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 0000000005782840] error while decoding MB 0 12, bytestream 4586
[h264 @ 0000000005782840] error while decoding MB 58 19, bytestream -6
[h264 @ 0000000005782840] top block unavailable for requested intra mode at 44 30
[h264 @ 0000000005782840] error while decoding MB 44 30, bytestream 3906
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 37 0
[h264 @ 0000000005490380] error while decoding MB 37 0, bytestream 805
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 18 6
[h264 @ 0000000005490380] error while decoding MB 18 6, bytestream 4681
[h264 @ 0000000005782840] concealing 3271 DC, 3271 AC, 3271 MV errors in P frame
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 53 18
[h264 @ 0000000005490380] error while decoding MB 53 18, bytestream 4391
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 2 24
[h264 @ 0000000005490380] error while decoding MB 2 24, bytestream 1268
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 0 30
[h264 @ 0000000005490380] error while decoding MB 0 30, bytestream 4550
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 0 36
[h264 @ 0000000005490380] error while decoding MB 0 36, bytestream 4722
[h264 @ 0000000005490380] top block unavailable for requested intra4x4 mode -1 at 0 42
[h264 @ 0000000005490380] error while decoding MB 0 42, bytestream 792
[h264 @ 0000000005490380] concealing 3596 DC, 3596 AC, 3596 MV errors in P frame
[h264 @ 00000000057914c0] concealing 3598 DC, 3598 AC, 3598 MV errors in P frame
[h264 @ 0000000005791960] top block unavailable for requested intra mode at 25 0
[h264 @ 0000000005791960] error while decoding MB 25 0, bytestream 964
[h264 @ 0000000005791960] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 0000000005791960] error while decoding MB 0 12, bytestream 4593
[h264 @ 0000000005791960] top block unavailable for requested intra4x4 mode -1 at 29 24
[h264 @ 0000000005791960] error while decoding MB 29 24, bytestream 954
[h264 @ 0000000005791960] top block unavailable for requested intra mode at 3 30
[h264 @ 0000000005791960] error while decoding MB 3 30, bytestream 799
[h264 @ 0000000005791960] concealing 3118 DC, 3118 AC, 3118 MV errors in P frame
[h264 @ 0000000005782fc0] top block unavailable for requested intra4x4 mode -1 at 0 30
[h264 @ 0000000005782fc0] error while decoding MB 0 30, bytestream 778
[h264 @ 0000000005782840] error while decoding MB 31 4, bytestream -8
[h264 @ 0000000005782fc0] concealing 3600 DC, 3600 AC, 3600 MV errors in P frame
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 4 6
[h264 @ 0000000005782840] error while decoding MB 4 6, bytestream 4729
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 0 12
[h264 @ 0000000005782840] error while decoding MB 0 12, bytestream 4431
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 38 18
[h264 @ 0000000005782840] error while decoding MB 38 18, bytestream 4798
[h264 @ 0000000005782840] top block unavailable for requested intra mode at 31 24
[h264 @ 0000000005782840] error while decoding MB 31 24, bytestream 752
[h264 @ 0000000005782840] top block unavailable for requested intra mode at 5 30
[h264 @ 0000000005782840] error while decoding MB 5 30, bytestream 3844
[h264 @ 0000000005782840] top block unavailable for requested intra4x4 mode -1 at 38 42
[h264 @ 0000000005782840] error while decoding MB 38 42, bytestream 3739
[h264 @ 0000000005782840] concealing 3291 DC, 3291 AC, 3291 MV errors in P frame
[h264 @ 0000000005490380] Delayed frames seen. Reenabling low delay requires a codec flush.
[h264 @ 0000000005490380] Reinit context to 1280x720, pix_fmt: yuvj420p
[h264 @ 00000000057914c0] error while decoding MB 10 17, bytestream -6
[h264 @ 0000000005490380] left block unavailable for requested intra4x4 mode -1 at 0 16
[h264 @ 0000000005490380] error while decoding MB 0 16, bytestream 3934
[h264 @ 00000000057914c0] concealing 3239 DC, 3239 AC, 3239 MV errors in P frame
[h264 @ 0000000005490380] left block unavailable for requested intra mode at 0 18
[h264 @ 0000000005490380] error while decoding MB 0 18, bytestream 3068
[h264 @ 0000000005490380] left block unavailable for requested intra4x4 mode -1 at 0 33
[h264 @ 0000000005490380] error while decoding MB 0 33, bytestream 745
[h264 @ 0000000005490380] left block unavailable for requested intra4x4 mode -1 at 0 38
[h264 @ 0000000005490380] error while decoding MB 0 38, bytestream 4460
[h264 @ 0000000005490380] concealing 2769 DC, 2769 AC, 2769 MV errors in I frame
[h264 @ 0000000005782840] error while decoding MB 79 24, bytestream -7
[h264 @ 0000000005782840] concealing 3570 DC, 3570 AC, 3570 MV errors in P frame
我的消息来源有问题吗? 我能做什么


谢谢:)

这可能是因为您正在尝试播放部分 原始的.264流


要播放原始.264文件,该文件应以SPS、PPS和IDR帧(与以前的帧没有依赖关系)开始。如果在流的某个随机部分开始播放,那么这将不起作用,并且您看到的伪影可能是基于缺少参考帧的预测错误

你确定情况就是这样吗?因为我使用了一些无人机的sdk来提供流,sdk中的小部件应该能够成功播放视频:/n不,我不确定,只有你可以验证是否是这样。如果您有原始的.264文件,例如,您可以在十六进制编辑器中打开它,并检查文件以哪种类型的NAL单元开头。如果您在中流接收到H.264文件,通常仅在第一个SPS/PPS/IDR NAL单元开始解码视频。在此之前,SDK小部件可能会跳过其他帧。这完全取决于文件的内容。如果你把你的“部分”文件上传到网上,我会看一看。这是原始缓冲区,这是相机sdk解密的iframe。。谢谢):你的原始缓冲区开始在一个NEL单元的中间,后面跟着各种类型的NAR单元:“非IDR图片的编码切片”、Access单元分隔符等。如果这是你要回放的文件,那么它就失败了,因为你只能从流中的下一个IDR开始一个“干净”的解码。这将解释您看到的工件。我无法下载其他文件。如何找到下一个IDR?您能否定义“原始h264流的一部分”的含义?是你自己剪的吗?不是我自己剪的。。我只是不确定这条流是否从一开始就记录了下来。有办法检查吗?