Open UPuXA opened 1 year ago
Hello,
i searched a little bit myself and found this stack overflow answer.
The ffmpeg command allows not only absolute stream specifiers like "stream 0", but also "audio stream 0".
In the command it would be written like so: "0:0"
vs "0:a:0"
.
The current version uses the absolute specification https://github.com/tfaehse/DashcamCleaner/blob/6a9160b85aa294f35f540665f53420267863e2b1/dashcamcleaner/src/blurrer.py#L113-L131
This could be the fixed version
subprocess.run(
[
ffmpeg_exe,
"-y",
"-i",
temp_output,
"-i",
input_path,
"-c",
"copy",
"-map",
"0:v:0",
"-map",
"1:a:0",
"-shortest",
output_path,
],
stdout=subprocess.DEVNULL,
)
(ps.: great work und sorry, i have no idea how to make a pull request)
@UPuXA you can edit files in browser and propose changes like that, I have done so just yet in the above-mentioned commit.
Please test the change if it works correctly, @UPuXA (or @tfaehse).
Hello again, i tested it and it works, i have now audio, the file size is significantly smaller and i want to share some additional findings.
It seems like the original/current behavior copies the complete original video stream into the output file if the video stream is at index 1 in the original file.
With the current version i was able to delete stream 0 (the processed one) to see the source file (without the blurring).
I verified this by disabling this whole segment by changing the if audio_present
statement to if False
:
https://github.com/tfaehse/DashcamCleaner/blob/6a9160b85aa294f35f540665f53420267863e2b1/dashcamcleaner/src/blurrer.py#L112-L140
The file was smaller and the original stream gone.
Like i wrote the file size is now significantly smaller too (18,3MiB vs 248,0Mib) because of the missing source stream. It seems like there is some heavy compression going on in the inside and no parameter to change this "behavior" (i dont really care and maybe my original action cam video files are garbage).
However Big thanks for your help @joshinils
Correction:
It seems like there is some heavy compression going on in the inside and no parameter to change this "behavior"
--quality [1.0, 10.0]
Quality of the resulting video. higher = better. Conversion to crf: ⌊(1-q/10)*51⌋.
When i process a mp4 video with the audio stream at index 1 the audio is not in the final file.
I use the feature/package-installation branch and cli.py with the following parameters:
Tests
Test method:
ffprobe -show_streams -v quiet -show_format -print_format json PATH
Results
Summary
Format: index codec_type codec_name
Ok audio:
Missing audio:
Detailed results
Excerpts of ffprobe
Ok audio:
after process
Missing audio:
after process