LoginSignup
2
0

More than 5 years have passed since last update.

ffmpeg コマンドメモ

Posted at

RTPで映像と音声が送られてくる場合のffmpegトランスコード

※パラメータ未チューニング

RTP -> RTMP

ffmpeg -analyzeduration 30M -probesize 30M -protocol_whitelist file,crypto,udp,rtp -re -vcodec h264 -acodec opus -i ~/local.sdp -pix_fmt yuv420p -preset veryfast -r 15 -c:v libx264 -an -acodec copy -b:v 500k -b:a 64k -ar 48000 -bufsize 1024k -maxrate 500k -g 50 -threads 1 -f flv rtmp://127.0.0.1:1935/live/stream

RTP -> HLS

ffmpeg -analyzeduration 30M -probesize 30M -protocol_whitelist file,crypto,udp,rtp -re -vcodec h264 -acodec opus -i ~/local.sdp -pix_fmt yuv420p -preset veryfast -r 15 -c:v libx264 -an -acodec copy -b:v 500k -b 500k -b:a 64k -ar 48000 -bufsize 1024k -maxrate 500k -g 20 -threads 0 -flags -global_header -hls_time 2 -hls_list_size 2 -hls_wrap 10 -hls_flags delete_segments -hls_allow_cache 0 -f hls ./hls.m3u8

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0