FFmpeg流在几秒钟后停止

时间:2019-06-28 18:15:42

标签: windows http ffmpeg video-streaming

我有一个mkv文件的http流,我正在尝试通过ffmpeg将其转码为mp4。这是我输入的启动流ffmpeg -i "input.mkv" -f mpeg1video -vf "scale=640:480" -r 20 "http://localhost:port"的命令。流开始正常。这是流最初给我的:Metadata: title : Chapter 17 Stream #0:0(eng): Video: mpeg1video, yuv420p, 640x480 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 24 fps, 24 tbn, 24 tbc Metadata: BPS-eng : 31632108 DURATION-eng : 02:03:42.289875000 NUMBER_OF_FRAMES-eng: 177957 NUMBER_OF_BYTES-eng: 29347831113 SOURCE_ID-eng : 001011 _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 win(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-06-18 22:53:22 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID encoder : Lavc58.31.102 mpeg1video Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 frame= 111 fps=0.0 q=6.2 size= 212kB time=00:00:04.54 bitrate= 382.2kbits/s speed=8.82x 但是在显示出来之后它挂了一段时间,然后它给了我这个:

av_interleaved_write_frame(): Unknown errorime=00:00:05.24 bitrate= 788.3kbits/s speed=10.5x
Error writing trailer of http://192.168.1.19:4012: Error number -10054 occurred
frame=  128 fps=1.1 q=12.1 Lsize=     646kB time=00:00:05.84 bitrate= 905.0kbits/s speed=0.0487x
video:343kB audio:274kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.639489%
[http @ 000001cb1fdac780] URL read error:  -10054
Conversion failed!

这是我在node.js中的http服务器:

const express = require('express')
const port = port
var ffmpeg = require('ffmpeg');
var http = require('http')

var server = http.createServer(function(req, res) {
    res.writeHead(200, {'Content-Type': 'video/mp4'});
})

server.listen(port, 'ipAddress')
console.log(`Example app on port ${port}!`);

0 个答案:

没有答案