省略nginx + rtmpmodule的过程,可以参考:https://www.cnblogs.com/jys509/p/5649066.html
####################################################################################################
# -i url (input)
# input file url
#
# -f fmt (input/output)
# Force input or output file format. The format is normally auto detected for input files
# and guessed from the file extension for output files, so this option is not needed in
# most cases.
#
# -c[:stream_specifier] codec (input/output,per-stream)
# -codec[:stream_specifier] codec (input/output,per-stream)
# Select an encoder (when used before an output file) or a decoder (when used before an
# input file) for one or more streams. codec is the name of a decoder/encoder or a
# special value copy (output only) to indicate that the stream is not to be re-encoded.
#
# -re (input)
# Read input at native frame rate. Mainly used to simulate a grab device, or live
# input stream (e.g. when reading from a file). Should not be used with actual grab
# devices or live input streams (where it can cause packet loss). By default ffmpeg attempts
# to read the input(s) as fast as possible. This option will slow down the reading of the
# input(s) to the native frame rate of the input(s). It is useful for real-time
# output (e.g. live streaming).
#
# -strict 2
# Native FFmpeg AAC encoder
# The native FFmpeg AAC encoder. This is currently the second highest-quality AAC encoder
# available in FFmpeg and does not require an external library like the other AAC encoders
# described here. This is the default AAC encoder.
# Note: -strict experimental (or -strict -2) was previously required for this encoder, but
# it is no longer experimental and these options are unnecessary since 5 December 2015.
#
# add the below to nginx.conf(nginx + rtmp module)
# rtmp {
# server 1935;
# application rtmplive {
# live on;
# record off;
# }
# }
#
# ffplay rtmp://localhost/rtmplive/room
##########################################################################################
ffmpeg -re -i a.mp4 -vcodec copy -acodec copy -f flv rtmp://192.168.1.11:1935/rtmplive/room
#ffmpeg -re -i a.mp4 -vcodec libx264 -acodec aac -f flv rtmp://192.168.1.11:1935/rtmplive/room
本文详细介绍了使用FFmpeg工具进行实时音视频编码,并将其推流至Nginx RTMP模块搭建的直播服务器的具体过程。涵盖FFmpeg参数详解,如-iurl、-ffmt、-c、-re等,以及Nginx配置示例,适用于直播场景。
550

被折叠的 条评论
为什么被折叠?



