胡斌

add -shortest option when call ffmpeg to let it write the end of mp4 when pipe closed

... ... @@ -6,8 +6,7 @@ npm install
运行命令示例:
;record duration 30s framerate 20fps width 640 height 320 videobitrate 800k
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.flv
ffmpeg -i test.flv -acodec copy -vcodec copy test.mp4
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.mp4
局限:
1. electron需要在桌面环境下运行
... ...
... ... @@ -126,6 +126,7 @@ function startFFmpeg(videosize) {
args.push('-acodec');
args.push('aac');
args.push('-shortest');
args.push(argv._[0]);
console.log(args.join` `);
... ...
;record duration 30s framerate 20fps width 640 height 320 videobitrate 800k
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.flv
ffmpeg -i test.flv -vcodec copy -acodec copy test.mp4
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.mp4
... ...