【问题标题】:Live TV recording .ts to mp4 with ffmpeg使用 ffmpeg 将 .ts 直播电视录制到 mp4
【发布时间】:2017-02-24 07:21:09
【问题描述】:

我正在使用 HDHomrun Prime 录制直播电视,结果文件是 .ts 文件。我想将此文件转换为 .mp4。我尝试了 VLC 播放器来转换需要一段时间。我的研究表明 ffmpeg 可以做到这一点,但我遇到了一个错误,谷歌搜索这个没有帮助。我在终端中运行了这段代码。 (操作系统 ubuntu 16.04)

ffmpeg -i gsgame.ts -c copy -bsf:a aac_adtstoasc ford_ffmpeg.mp4

我明白了。

[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] SPS unavailable in decode_picture_timing
[h264 @ 0x561db2eba2e0] non-existing PPS 0 referenced
[h264 @ 0x561db2eba2e0] decode_slice_header error
[h264 @ 0x561db2eba2e0] no frame!
[h264 @ 0x561db2eba2e0] Increasing reorder buffer to 2
[mpegts @ 0x561db2eb57c0] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x561db2eb57c0] PES packet size mismatch
    Last message repeated 1 times
[mpegts @ 0x561db2eb57c0] Could not find codec parameters for stream 4 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x561db2eb57c0] Could not find codec parameters for stream 5 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x561db2eb57c0] Could not find codec parameters for stream 6 (Unknown: none ([192][0][0][0] / 0x00C0)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'gsgame.ts':
  Duration: 02:38:20.56, start: 14821.384111, bitrate: 3998 kb/s
  Program 3 
    Stream #0:0[0x1167]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1168](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x1169](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x116a]: Data: scte_35
    Stream #0:4[0x116b]: Unknown: none (ETV1 / 0x31565445)
    Stream #0:5[0x116c]: Unknown: none (ETV1 / 0x31565445)
    Stream #0:6[0x116d]: Unknown: none ([192][0][0][0] / 0x00C0)
[AVBSFContext @ 0x561db2ebade0] Codec 'ac3' (86019) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018) 
Error initializing bitstream filter: aac_adtstoasc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

感谢您的帮助。

【问题讨论】:

  • 尝试“ffmpeg -f mpeg2video -i inputfile outputfile.mp4”或使用“-f mpegts”。 -f 开关强制编解码器。如果输入是另一种格式,则使用该格式。 ffprobe 将为您提供使用的编解码器。
  • [AVBSFContext @ 0x561db2ebade0] Codec 'ac3' (86019) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018) Error initializing bitstream filter: aac_adtstoasc 这就是这里的问题。您不能将此比特流过滤器与 ac3 音频一起使用
  • 我尝试搜索那个比特流问题,但我在上面找到了任何东西。 @AndreyTurkin 你能给点建议吗?
  • @WLGfx : -f switch 强制指定的解复用器。到 OP,删除-bsf:a aac_adtstoasc

标签: video ffmpeg mp4


【解决方案1】:

据我所知,您的流有 ac3 音频,这意味着 aac_adtstoasc 比特流过滤器将不起作用。

转换视频应该很简单(尽管可能需要一段时间,具体取决于您的视频):

ffmpeg -i gsgame.ts -c:v copy -c:a aac ford_ffmpeg.mp4

【讨论】:

  • 无需重新编码音频。 FFmpeg 支持将 AC-3 复用到 MP4 中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-09-18
  • 1970-01-01
  • 2021-10-05
  • 2022-09-23
  • 1970-01-01
  • 2015-08-07
  • 1970-01-01
相关资源
最近更新 更多