【发布时间】:2020-06-29 13:06:30
【问题描述】:
我想创建一个带有可以播放 H264 mpeg-ts 实时流的视频播放器的网页。我找不到任何可以做到这一点的网络播放器。
我了解到 JWPlayer 能够做到这一点,但仅限于付费版本。
流可以在 VLC 和任何其他播放器中播放。
我能做什么?我尝试使用 ffmpeg 将流转换为更有用的东西,但没有成功。
ffmpeg -i "http://localhost:9002/tv.ts" -vcodec libx264 -r 20 -s 320x240 -threads 2 -vprofile baseline -vpre zoom -strict experimental -acodec aac -ab 96000 -ar 48000 -ac 1 -f rtsp rtsp://192.168.0.28:1935/live/_definst_/c3
这是我得到的:
Last message repeated 1 times
[h264 @ 0xbb9500] decode_slice_header error
[h264 @ 0xbb9500] no frame!
[mpegts @ 0xbaa6e0] decoding for stream 1 failed
[mpegts @ 0xbaa6e0] Could not find codec parameters for stream 1 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'http://192.168.0.28:9002/tv.ts':
Duration: N/A, start: 30764.854700, bitrate: N/A
Program 1
Stream #0:0[0x44](???): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:1[0x45]: Video: h264 ([27][0][0][0] / 0x001B), none, 25 fps, 25 tbr, 90k tbn, 180k tbc
File for preset 'zoom' not found
【问题讨论】:
标签: ffmpeg