@ -33,10 +33,10 @@ using namespace std;
# define SRS_RTMP_ENCODER_COPY "copy"
# define SRS_RTMP_ENCODER_COPY "copy"
# define SRS_RTMP_ENCODER_NO_VIDEO "vn"
# define SRS_RTMP_ENCODER_NO_VIDEO "vn"
# define SRS_RTMP_ENCODER_NO_AUDIO "an"
# define SRS_RTMP_ENCODER_NO_AUDIO "an"
// only support libx264, libx265 and h264_qsv encoder .
// only support encoder: h264, h265 and other variants like libx264 etc .
# define SRS_RTMP_ENCODER_VCODEC_ LIBX264 "libx 264"
# define SRS_RTMP_ENCODER_VCODEC_ H264 " 264"
# define SRS_RTMP_ENCODER_VCODEC_ LIBX265 "libx 265"
# define SRS_RTMP_ENCODER_VCODEC_ H265 " 265"
# define SRS_RTMP_ENCODER_VCODEC_H 264QSV "h264_qsv "
# define SRS_RTMP_ENCODER_VCODEC_H EVC "hevc "
# define SRS_RTMP_ENCODER_VCODEC_PNG "png"
# define SRS_RTMP_ENCODER_VCODEC_PNG "png"
// any aac encoder is ok which contains the aac,
// any aac encoder is ok which contains the aac,
// for example, libaacplus, aac, fdkaac
// for example, libaacplus, aac, fdkaac
@ -125,10 +125,8 @@ srs_error_t SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
}
}
if ( vcodec ! = SRS_RTMP_ENCODER_COPY & & vcodec ! = SRS_RTMP_ENCODER_NO_VIDEO & & vcodec ! = SRS_RTMP_ENCODER_VCODEC_PNG ) {
if ( vcodec ! = SRS_RTMP_ENCODER_COPY & & vcodec ! = SRS_RTMP_ENCODER_NO_VIDEO & & vcodec ! = SRS_RTMP_ENCODER_VCODEC_PNG ) {
if ( vcodec ! = SRS_RTMP_ENCODER_VCODEC_LIBX264 & & vcodec ! = SRS_RTMP_ENCODER_VCODEC_LIBX265 & & vcodec ! = SRS_RTMP_ENCODER_VCODEC_H264QSV ) {
if ( vcodec . find ( SRS_RTMP_ENCODER_VCODEC_H264 ) ! = string : : npos & & vcodec . find ( SRS_RTMP_ENCODER_VCODEC_H265 ) ! = string : : npos & & vcodec . find ( SRS_RTMP_ENCODER_VCODEC_HEVC ) ! = string : : npos ) {
return srs_error_new (
return srs_error_new ( ERROR_ENCODER_VCODEC , " invalid vcodec, must be h264, h265 or one of their variants, actual %s " , vcodec . c_str ( ) ) ;
ERROR_ENCODER_VCODEC , " invalid vcodec, must be %s, %s or %s, actual %s " ,
SRS_RTMP_ENCODER_VCODEC_LIBX264 , SRS_RTMP_ENCODER_VCODEC_LIBX265 , SRS_RTMP_ENCODER_VCODEC_H264QSV , vcodec . c_str ( ) ) ;
}
}
if ( vbitrate < 0 ) {
if ( vbitrate < 0 ) {
return srs_error_new ( ERROR_ENCODER_VBITRATE , " invalid vbitrate: %d " , vbitrate ) ;
return srs_error_new ( ERROR_ENCODER_VBITRATE , " invalid vbitrate: %d " , vbitrate ) ;