mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-08-09 23:50:40 +02:00
Open source input before frame pipe
This commit is contained in:
@@ -158,6 +158,10 @@ tail when diagnostics are unusually large. Aborts release it even when ffmpeg
|
||||
has already exited. A real subprocess regression writes diagnostics beyond pipe
|
||||
capacity while streaming frames, checks bounded failure reporting, and the Linux
|
||||
full-clip CI job guards the complete path.
|
||||
The finite source file is opened before the frame pipe, so ffmpeg can initialize
|
||||
the copied audio stream before producer backpressure is possible. Stream and
|
||||
metadata mappings are source-indexed accordingly; regressions assert the input
|
||||
order and both map targets.
|
||||
`probe_video_encode_profile` reads the first source video stream with ffprobe
|
||||
and preserves the supported properties that survive the 8-bit BGR boundary:
|
||||
`yuv420p`/`yuv422p`/`yuv444p` chroma sampling, recognized color tags, encoder
|
||||
|
||||
@@ -358,21 +358,21 @@ def raw_video_command(
|
||||
"-loglevel",
|
||||
"error",
|
||||
*(["-copyts"] if copy_input_timestamps else []),
|
||||
*frame_input,
|
||||
"-i",
|
||||
str(source),
|
||||
*frame_input,
|
||||
"-map",
|
||||
"0:v:0",
|
||||
"1:v:0",
|
||||
"-map",
|
||||
"1:a?",
|
||||
"0:a?",
|
||||
*_video_codec_args(output.suffix.lower(), crf=crf, profile=profile),
|
||||
*_profile_args(profile),
|
||||
"-c:a",
|
||||
"copy",
|
||||
"-map_metadata",
|
||||
"-1" if strip_metadata else "1",
|
||||
"-1" if strip_metadata else "0",
|
||||
"-map_chapters",
|
||||
"-1" if strip_metadata else "1",
|
||||
"-1" if strip_metadata else "0",
|
||||
]
|
||||
if timestamped_input:
|
||||
command.extend(["-fps_mode", "passthrough"])
|
||||
|
||||
@@ -128,6 +128,10 @@ def test_encoder_command_discards_metadata_and_copies_audio(
|
||||
"colorprim=bt709:transfer=bt709:colormatrix=bt709:range=limited"
|
||||
)
|
||||
assert "pipe:0" in command
|
||||
assert command.index(str(source)) < command.index("pipe:0")
|
||||
assert command[command.index("-map") + 1] == "1:v:0"
|
||||
second_map = command.index("-map", command.index("-map") + 1)
|
||||
assert command[second_map + 1] == "0:a?"
|
||||
assert "-shortest" not in command
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user