File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -688,8 +688,8 @@ def test_pipe():
688
688
width = 32
689
689
height = 32
690
690
frame_size = width * height * 3 # 3 bytes for rgb24
691
- frame_count = 10
692
- start_frame = 2
691
+ frame_count = 15
692
+ start_frame = 3
693
693
694
694
out = (
695
695
ffmpeg .input (
@@ -716,7 +716,7 @@ def test_pipe():
716
716
'-i' ,
717
717
'pipe:0' ,
718
718
'-filter_complex' ,
719
- '[0]trim=start_frame=2 [s0]' ,
719
+ '[0]trim=start_frame={} [s0]' . format ( start_frame ) ,
720
720
'-map' ,
721
721
'[s0]' ,
722
722
'-f' ,
@@ -739,8 +739,19 @@ def test_pipe():
739
739
p .stdin .close ()
740
740
741
741
out_data = p .stdout .read ()
742
- assert len (out_data ) == frame_size * (frame_count - start_frame )
743
- assert out_data == in_data [start_frame * frame_size :]
742
+
743
+ if start_frame > 0 and len (out_data ) < len (in_data ):
744
+ # ffmpeg 4.x removes trimmed frames
745
+ assert len (out_data ) == frame_size * (frame_count - start_frame )
746
+ assert out_data == in_data [start_frame * frame_size :]
747
+ else :
748
+ # ffmpeg 5.x duplicates trimmed frames
749
+ assert len (out_data ) == len (in_data ):
750
+
751
+ for fn in range (0 , start_frame ):
752
+ assert out_data [fn * frame_size ] == in_data [start_frame * frame_size ]
753
+
754
+ assert out_data [start_frame * frame_size :] == in_data [start_frame * frame_size :]
744
755
745
756
746
757
def test__probe ():
You can’t perform that action at this time.
0 commit comments