fengda2870 2020-09-14 15:27 采纳率: 0%
浏览 634
已结题

TS文件无法转换成MP4格式

我从直播流的m3u8中下载下来的TS文件片段,在直播结束之后,使用ffmpeg合成整个文件时

ffmpeg  -f concat -safe 0 -i 1.txt -c copy 1.mp4

无法进行合成。提示如下错误:

[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[concat @ 00000298256d97c0] decoding for stream 0 failed
[concat @ 00000298256d97c0] Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, concat, from '2020-08-26-07-22.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc ([36][0][0][0] / 0x0024), none, 14.99 fps, 14.99 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 134 kb/s
[mp4 @ 0000029825f16700] dimensions not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

后来我使用格式工厂,查看TS文件的属性,发现现在的TS文件中Video属性是这样的

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L3.1@Main
Codec ID                                 : 36
Duration                                 : 8 min 47 s
Width                                    : 720 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 0.563
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits

而上述异常的TS文件中Video属性却少很多,没有Color space,Width,Height 等属性值。

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 3 s 938 ms

有没有办法把这些属性直播添加到TS文件中呢?

链接:https://pan.baidu.com/s/1dXQy3TLx8HQd9ZxROV5M0A
提取码:1111

百度网盘中共享出来1个有问题的TS文件,请指教。

  • 写回答

2条回答 默认 最新

  • threenewbee 2020-09-14 15:45
    关注

    Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024), none): unspecified size
    数据格式的问题
    解决参考:
    https://blog.csdn.net/weixin_34187822/article/details/85926723

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型