小咖秀代码 用ffplay播放报错‘Error splitting the input into NAL units.’
来源:5-21 作业:ffmpeg实现小咖秀

blazer_2015
2019-09-05
需要把 if (ifmt_ctx1->nb_streams == 1) 和ifmt_ctx2->nb_streams == 1 改成 if (ifmt_ctx1->nb_streams >= 1) 和ifmt_ctx2->nb_streams >= 1 ,才能合成成功,
但是用ffplay 播放,好像只能看到第一帧,而且没有声音
这是什么原因,
ffplay 播放提示的错误是
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘/Users/luowailin/Downloads/avmerge.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:00.21, start: 0.000000, bitrate: 3504 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1000x418 [SAR 1672:1675 DAR 160:67], 1729 kb/s, 14.40 fps, 12 tbr, 90k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1000x418 [SAR 1672:1675 DAR 160:67], 1729 kb/s, 14.40 fps, 12 tbr, 90k tbn, 48 tbc
Metadata:
handler_name : VideoHandler
**[h264 @ 0x7fbcb0838000] Invalid NAL unit size (554779904 > 135).
**
[h264 @ 0x7fbcb0838000] Error splitting the input into NAL units.**
**
如果改用flv格式的话,在avformat_write_header 的时候报"at most one video stream is supported in flv 在网上查资料,只知道是原因报错,但是没有更改
补充:
在调试过程发现报:
Application provided invalid, non monotonically increasing dts to muxer in stream 0: 15000 >= -7500
说是dts没有增加导致 av_interleaved_write_frame 写入失败。
这里的pts要怎么处理
1回答
-
李超
2019-09-05
为啥大于一才能成功呢?在合并之前,两个文件必须只能有一路音视频,即一个媒体文件只有音频,另一个只有视频。你的原始视频现在显然不符合要求
022019-09-07
相似问题