@@ -666,6 +666,8 @@ type ffmpegClient struct {
666
666
// The backend service process.
667
667
process * backendService
668
668
669
+ // FFmpeg cmd name
670
+ ffmpegCmdName string
669
671
// FFmpeg cli args, without ffmpeg binary.
670
672
args []string
671
673
// Let the process quit, do not cancel the case.
@@ -678,6 +680,7 @@ func NewFFmpeg(opts ...func(v *ffmpegClient)) FFmpegClient {
678
680
v := & ffmpegClient {
679
681
process : newBackendService (),
680
682
cancelCaseWhenQuit : true ,
683
+ ffmpegCmdName : * srsFFmpeg ,
681
684
}
682
685
683
686
// Do cleanup.
@@ -702,7 +705,7 @@ func (v *ffmpegClient) ReadyCtx() context.Context {
702
705
func (v * ffmpegClient ) Run (ctx context.Context , cancel context.CancelFunc ) error {
703
706
logger .Tf (ctx , "Starting FFmpeg by %v" , strings .Join (v .args , " " ))
704
707
705
- v .process .name = * srsFFmpeg
708
+ v .process .name = v . ffmpegCmdName
706
709
v .process .args = v .args
707
710
v .process .env = os .Environ ()
708
711
v .process .duration = v .ffmpegDuration
@@ -746,6 +749,10 @@ type ffprobeClient struct {
746
749
// The timeout to wait for task to done.
747
750
timeout time.Duration
748
751
752
+ // the FFprobe cmd name
753
+ ffprobeCmdName string
754
+ // the ffmpeg cmd name
755
+ ffmpegCmdName string
749
756
// Whether do DVR by FFmpeg, if using SRS DVR, please set to false.
750
757
dvrByFFmpeg bool
751
758
// The stream to DVR for probing. Ignore if not DVR by ffmpeg
@@ -764,8 +771,10 @@ type ffprobeClient struct {
764
771
765
772
func NewFFprobe (opts ... func (v * ffprobeClient )) FFprobeClient {
766
773
v := & ffprobeClient {
767
- metadata : & ffprobeObject {},
768
- dvrByFFmpeg : true ,
774
+ metadata : & ffprobeObject {},
775
+ dvrByFFmpeg : true ,
776
+ ffprobeCmdName : * srsFFprobe ,
777
+ ffmpegCmdName : * srsFFmpeg ,
769
778
}
770
779
v .doneCtx , v .doneCancel = context .WithCancel (context .Background ())
771
780
@@ -842,7 +851,7 @@ func (v *ffprobeClient) doDVR(ctx context.Context) error {
842
851
}
843
852
844
853
process := newBackendService ()
845
- process .name = * srsFFmpeg
854
+ process .name = v . ffmpegCmdName
846
855
process .args = []string {
847
856
"-t" , fmt .Sprintf ("%v" , int64 (v .duration / time .Second )),
848
857
"-i" , v .streamURL , "-c" , "copy" , "-y" , v .dvrFile ,
@@ -869,7 +878,7 @@ func (v *ffprobeClient) doDVR(ctx context.Context) error {
869
878
870
879
func (v * ffprobeClient ) doProbe (ctx context.Context , cancel context.CancelFunc ) error {
871
880
process := newBackendService ()
872
- process .name = * srsFFprobe
881
+ process .name = v . ffprobeCmdName
873
882
process .args = []string {
874
883
"-show_error" , "-show_private_data" , "-v" , "quiet" , "-find_stream_info" ,
875
884
"-analyzeduration" , fmt .Sprintf ("%v" , int64 (v .duration / time .Microsecond )),
0 commit comments