Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracted clips don't have audio #27

Closed
SKempin opened this issue May 23, 2020 · 4 comments
Closed

Extracted clips don't have audio #27

SKempin opened this issue May 23, 2020 · 4 comments

Comments

@SKempin
Copy link
Contributor

SKempin commented May 23, 2020

Can you confirm if the extracted clips should include audio? The clips are silent.

Thank you.

@Breakthrough
Copy link
Owner

Hi @SKempin;

That is correct. In the future I can consider adding a mode that uses an external tool (e.g. ffmpeg) to extract the audio as well.

Thanks!

@xiongyw
Copy link

xiongyw commented Jan 31, 2021

It will be great to have such a feature. Thanks!

@Breakthrough
Copy link
Owner

Breakthrough commented Feb 2, 2021

The long-term approach to fixing this would be to have DVR-Scan rely on PySceneDetect for much of the heavy lifting (since most is already done in that project), however that's a more long-term goal to converge both projects (i.e. to rewrite DVR-Scan to use the PySceneDetect API).

In the meantime, you can always use the timecodes that DVR-Scan outputs in scan-only mode (-so) with ffmpeg to accomplish this manually or with a bash script. For those who are more Python-savvy, this can be accomplished using scenedetect.video_splitter.split_video_ffmpeg(...) (link).

For reference, currently videos are processed and encoded on the fly using OpenCV VideoWriter. Using ffmpeg instead for this I think is the right approach, and I think most usage of DVR-Scan is currently offline rather than online, indicating that this should be the preferred/default method. Another benefit would be improved video quality of the output (since two-pass encoding, or even just copying the codec if frame accuracy isn't a requirement), so this is definitely one of the highest priorities of all open issues for DVR-Scan.

I'll plan this for the next v1.3, although cannot comment on a definitive timeline just yet.

@Breakthrough Breakthrough added this to the v1.2 milestone Feb 2, 2021
@Breakthrough Breakthrough modified the milestones: v1.2, v1.3 Feb 6, 2021
@Breakthrough Breakthrough modified the milestones: v1.5, v1.6 Feb 11, 2022
@Breakthrough Breakthrough modified the milestones: v1.6, v1.5 Jul 1, 2022
Breakthrough added a commit that referenced this issue Jul 1, 2022
Allow using ffmpeg to reencode or use codec-copying mode to
produce motion events. This includes audio and drastically
reduces filesizes while also improving quality.

Not all features are available in this mode (e.g. bounding boxes,
timecode overlays) although support may be added in the future.

Issues: #27, #42
@Breakthrough
Copy link
Owner

In v1.5, there will be an option to use ffmpeg for generating output files. This allows you to both do re-encoding (-m ffmpeg) as well as codec copying (-m copy), e.g.:

dvr-scan -i video.mp4 -m ffmpeg
dvr-scan -i video.mp4 -m copy

Note that certain features will not work in this mode yet (mainly, any overlays, and concatenating multiple input videos). Support for these features with these modes can be considered if required by filing a new feature request.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants