Browse Source

Always set ffmpeg flag +genpts when video stream is being copied

Lynxy 6 năm trước cách đây
mục cha
commit
9b39404b9a
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 3 - 6
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -1904,7 +1904,7 @@ namespace MediaBrowser.Controller.MediaEncoding
             {
                 flags.Add("+ignidx");
             }
-            if (state.GenPtsInput)
+            if (state.GenPtsInput || string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
             {
                 flags.Add("+genpts");
             }
@@ -2436,6 +2436,8 @@ namespace MediaBrowser.Controller.MediaEncoding
 
             if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase))
             {
+                args += " -flags -global_header -fflags +genpts";
+
                 if (state.VideoStream != null && IsH264(state.VideoStream) &&
                     string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase) &&
                     !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
@@ -2447,11 +2449,6 @@ namespace MediaBrowser.Controller.MediaEncoding
                 {
                     args += " -copyts -avoid_negative_ts disabled -start_at_zero";
                 }
-
-                if (!state.RunTimeTicks.HasValue)
-                {
-                    args += " -flags -global_header -fflags +genpts";
-                }
             }
             else
             {