ffmpeg filter command
来源:互联网 发布:plc编程实例 编辑:程序博客网 时间:2024/05/16 08:22
http://corpus.hubwiz.com/2/node.js/19154807.html
Merging two video streams and saving as one file
I'm writing chat application with video call using webRTC. I have two MediaStream
s, remote and local and want to merge and save them as one file. So when opening a file, i shall see large video frame (remote stream) and little video frame at top right (local stream). Now I can record these two streams separately using RecordRTC. How can i merge them with nodejs? (no code because I don't know how it's done)
- node.js
- video-streaming
- webrtc
You can use FFmpeg with -filter_complex
, here is a working and tested example using FFmpeg version N-62162-gec8789a:
ffmpeg -i main_video.mp4 -i in_picture.mp4 -filter_complex "[00]scale=640x480[main_video]; [10]scale=240x180[in_picture];[main_video][in_picture]overlay=390:10" output.mp4
So, this command tells FFmpeg to read from two input files, main_video.mp4
and in_picture.mp4
, then it send some information to the-filter_complex
flag...
The -filter_complex
flag takes the [00]
(first input, first video track) and scale this video to be 640x480px and it identifies the video as [main_video]
, then, takes the [10]
(second input, video track 0) and resize the video to 240x180px naming the video[in_picture]
, then it merges both videos making an overlay of the second one at x=390 y=10.
Then it saves the output to output.mp4
It is that what you want?
UPDATE: I forgot to add, all you need in node is a module to run FFmpeg, there are plenty of those: https://nodejsmodules.org/tags/ffmpeg
------------------------------------------------------------------------------------
ffmpeg cut video with time
ffmpeg -ss 00:00:00 -t 00:00:20 -i vod.flv -vcodec copy -acodec copy vod20s.flv
1/4 every video, use first audio
ffmpeg -i vod1.flv -i vod2.flv -i vod3.flv -i vod4.flv -filter_complex "[0:v]pad=iw*2:ih*2[a];[a][1:v]overlay=w[b];[b][2:v]overlay=0:h[c];[c][3:v]overlay=w:h" out0080.flv
ok:mux multi font
ffmpeg -i src.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/droid/DroidSansMono.ttf : fontcolor=white : text='Suker-10-10' : x=10: y=10, drawtext=fontfile=/usr/share/fonts/truetype/droid/DroidSansMono.ttf : fontcolor=white : text='Suker10-100' : x=10: y=100, drawtext=fontfile=/usr/share/fonts/truetype/droid/DroidSansMono.ttf : fontcolor=white : text='Suker10-200' : x=10: y=200" -an -y outfont.mp4
ffplay -f rawvideo -video_size 1920x1080 input.yuv
mux two video
ffmpeg -i 01.mp4 -i mvp.mp4 -filter_complex "[0:v]format=rgb24,setsar=sar=1/1[mv];[1:v]format=rgb24,setsar=sar=1/1[in];[in][mv]blend=all_mode='addition':all_opacity=1,format=rgb24" -strict -2 output.mp4
- ffmpeg filter command
- ffmpeg filter command
- ffmpeg audio filter command line examples
- ffmpeg video filter command line examples
- ffmpeg filter
- Linux / Unix Command: filter
- ffmpeg中available filter
- FFmpeg filter HOWTO
- FFmpeg filter HOWTO
- ffmpeg filter参数设置格式
- FFMPEG filter讲解
- FFMPEG Filter介绍
- ffmpeg fancy filter example
- ffmpeg的filter分析
- FFmpeg filter简介
- ffmpeg filter开发
- FFmpeg filter[待完善]
- FFMPEG Filter相关API
- U盘安装CentOS7遇到:init... timeout
- [Java]ThreadPoolExecutor源码分析
- Spring-mybatis的整合
- ColorDescriptor software v4.0 一个提取颜色特征描述子的软件包
- hdoj2053
- ffmpeg filter command
- Opendaylight 学习文档 ---转载
- C语言中动态二维数组的创建
- 逻辑思维题 微信18954274246 答案
- HDU 5694 BD String
- HDU 5694 BD String
- hdoj 2035人见人爱A^B 解题报告
- android error opening trace file no such file or directory
- leetcode.52. N-Queens II
ffmpeg -i vod1.flv -i vod2.flv -filter_complex "[00]scale=720x480[main_video]; [10]scale=700x450[in_picture];[main_video][in_picture]overlay=10:10" out05231943.flv
vod2 over vod1 with postion 10,10
------------------------------------------------------------------------------------