1、视频文件转码 h264
ffmpeg -i 6.mp4 -vcodec h264 output.mp4
2、用文件从命令合并
copy /b d:\录像\uuid001\20201008\30\vcr00001.mp4+d:\录像\uuid001\20201008\30\vcr00002.mp4+d:\录像\uuid001\20201008\30\vcr00003.mp4+d:\录像\uuid001\20201008\30\vcr00004.mp4+d:\录像\uuid001\20201008\30\vcr00005.mp4+d:\录像\uuid001\20201008\30\vcr00006.mp4+d:\录像\uuid001\20201008\30\vcr00007.mp4+d:\录像\uuid001\20201008\30\vcr00008.mp4 d:\录像\uuid001\20201008\30.mp4
3、用FFMPEG和文件列表合并
ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4
filelist.txt如下
file 'd:\录像\uuid001\20201008\30\vcr00001.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00002.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00003.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00004.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00005.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00006.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00007.mp4'
file 'd:\录像\uuid001\20201008\30\vcr00008.mp4'
4、用ffmpeg单命令合并
格式:
ffmpeg -i "concat:文件1|文件2|文件3|" -c copy output2.mp4
ffmpeg -i concat:"文件1|文件2|文件3|" -c copy output2.mp4
ffmpeg -i concat:"d:\录像\uuid001\20201008\30\vcr00001.mp4|d:\录像\uuid001\20201008\30\vcr00002.mp4|d:\录像\uuid001\20201008\30\vcr00003.mp4|d:\录像\uuid001\20201008\30\vcr00004.mp4|d:\录像\uuid001\20201008\30\vcr00005.mp4|d:\录像\uuid001\20201008\30\vcr00006.mp4|d:\录像\uuid001\20201008\30\vcr00007.mp4|d:\录像\uuid001\20201008\30\vcr00008.mp4|" -c copy output2.mp4
5、用m3u8文件顺序播放
vcr.m3u8文件内容如下
vcr00001.mp4
vcr00002.mp4
vcr00003.mp4
vcr00004.mp4
6、用ffmpeg进行rtsp转码推流
ffmpeg.exe -i "rtsp://admin:admin12345@192.168.0.201:80/cam/realmonitor?channel=1&subtype=0" -c copy -f hls -hls_time 2 -hls_list_size 50 -hls_wrap 30 d:\live\test.m3u8
将live目录在iis中加入虚拟目录,加入m4u8的mime类型,就可以用ckplay播放器直接打开大华摄像头的推流视频了。
7、用ffmpeg进行录像
ffmpeg.exe -y -i "rtsp://admin:admin123@192.168.0.201:80/cam/realmonitor?channel=1&subtype=0" -vcodec copy -acodec copy -f mp4 "d:\ffmpeg\bin\a.mp4"