gpt4 book ai didi

video - 从 IIS Smooth Streaming 解码 mp4 片段中​​的 h264

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

因此,我决定尝试为 IIS 的平滑流制作自己的客户端作为学习练习,我正在努力解码 mp4 片段。

我有以下片段:
http://www.mediafire.com/download/n32660d920g291c/part+1.mp4

当我尝试使用 ffmpeg 解码时:

C:\>ffplay.exe -f h264 -vcodec h264 -g 52 "part 1.mp4"
ffplay version N-58502-g738ebb4 Copyright (c) 2003-2013 the FFmpeg developers built on Nov 27 2013 22:09:34 with gcc 4.8.2 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 55.100 / 52. 55.100
libavcodec 55. 44.100 / 55. 44.100
libavformat 55. 21.102 / 55. 21.102
libavdevice 55. 5.102 / 55. 5.102
libavfilter 3. 91.100 / 3. 91.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 0000000001e58260] non-existing PPS referenced 0B f=0/0
[h264 @ 0000000001e58260] non-existing PPS 25 referenced
[h264 @ 0000000001e58260] decode_slice_header error
[h264 @ 0000000001e58260] Invalid mix of idr and non-idr slices
[h264 @ 0000000001e58260] sps_id out of range
Last message repeated 4 times
[h264 @ 0000000001e58260] non-existing PPS referenced
[h264 @ 0000000001e58260] sps_id out of range
Last message repeated 4 times
[h264 @ 0000000001e58260] slice type too large (24) at 0 0
[h264 @ 0000000001e58260] decode_slice_header error
[h264 @ 0000000001e58260] no frame!
[h264 @ 0000000001e4fa00] decoding for stream 0 failed
[h264 @ 0000000001e4fa00] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
part 1.mp4: could not find codec parameters

阅读后我发现 PPS/SPS 来自 IIS 给我的 list 中的 CodecPrivateData,我有:
000000016764001eacd940a03da10005161501312d000f162d960000000168ebe3cb22c0

二进制: http://www.mediafire.com/download/hm3av6h3i1g7ojf/CodecPrivateData

我认为是附件 b 00000001[SPS]00000001[PPS] 但我不知道如何处理它,我尝试将它放在文件的开头但得到相同的错误,我也尝试只获取数据在 mdat 中并将其发送到 ffmpeg 但我得到了
[h264 @ 0000000001da8a80] sps_id out of range 0KB sq=    0B f=0/0
[h264 @ 0000000001da8a80] non-existing PPS referenced
[h264 @ 0000000001da8a80] sps_id out of range
[h264 @ 0000000001da8a80] slice type too large (24) at 0 0
[h264 @ 0000000001da8a80] decode_slice_header error
[h264 @ 0000000001da8a80] no frame!
[h264 @ 0000000001d9fa00] decoding for stream 0 failed
[h264 @ 0000000001d9fa00] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
part 1 - Copy.mp4: could not find codec parameters

所以我然后尝试将 CodecPrivateData 放在 mdat 部分之前,然后我得到了这个
[h264 @ 0000000001d38a80] sps_id out of range 0KB sq=    0B f=0/0
Last message repeated 1 times
[h264 @ 0000000001d38a80] slice type too large (24) at 0 0
[h264 @ 0000000001d38a80] decode_slice_header error
[h264 @ 0000000001d38a80] no frame!
[h264 @ 0000000001d2fa00] decoding for stream 0 failed
[h264 @ 0000000001d2fa00] Could not find codec parameters for stream 0 (Video: h264 (High)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
part 1 - Copy.mp4: could not find codec parameters

我似乎遗漏了一些东西来解码,我只是不确定是什么,所以我希望了解 h264 的人可以帮助我!最终我想让它在 DirectShow 中工作,但即使让它在 ffmpeg 中工作也会有很大的帮助!

最佳答案

mp4 片段无法自行解码。如果您希望将其转换为 mp4,则需要重新创建整个 moov atom。这包括制作一个包含 avcc 格式的额外数据 (sps/pps) 的 avc1 atom。

关于video - 从 IIS Smooth Streaming 解码 mp4 片段中​​的 h264,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20293341/

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