-
Notifications
You must be signed in to change notification settings - Fork 301
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
Black Frame detection using ffprobe #212
base: main
Are you sure you want to change the base?
Conversation
…fmpeg Added Codec, PixelFormat and ContainerFormat classes
Fixed color pallette (issue rosenbjerg#58)
This reverts commit d95f687.
completely in-memory is now possible
ratio=source.PrimaryVideoStream.Height / 0
Add OutputStreamArgument
Enhance ffprobe duration parsing
…DefaultForceFormat Add mirror and default ForceFormat for OutputPipeArgument
Hey @leta-lpb What inputs would a method wrapping this functionality take? |
Sorry for the extremely late reply. The only input for the method would be the file location to be processed. The 0 in the out0 is just specifying the first stream in the output that's being scanned for black. It's part of the filtergraph processing and it's pretty much required. It's highly unlikely someone would ever be scanning a video with multiple streams in it. The default=nw=1 is how you get the nice output. Take that out and you get incoherent nonsense, not the output listed above. The benefit of this data is you could do some fun things where you automatically slice up video based on the numbers received. If you create video with planned black in it and run this, you could get slice times that you could then feed into another method and automatically slice up videos. |
ffprobe code to detect black frames:
ffprobe -f lavfi -i movie="input.mp4,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1
Output displays line by line as each black frame is found.
TAG:lavfi.black_start=35.7691
TAG:lavfi.black_start=35.7691
TAG:lavfi.black_end=37.0704
TAG:lavfi.black_end=37.0704
TAG:lavfi.black_start=53.9205
TAG:lavfi.black_start=53.9205
TAG:lavfi.black_end=54.1207
TAG:lavfi.black_end=54.1207
TAG:lavfi.black_start=68.9689
TAG:lavfi.black_start=68.9689
TAG:lavfi.black_end=69.4694
TAG:lavfi.black_end=69.4694
TAG:lavfi.black_start=75.7423
TAG:lavfi.black_start=75.7423
TAG:lavfi.black_end=76.2095
TAG:lavfi.black_end=76.2095
TAG:lavfi.black_start=1617.95
TAG:lavfi.black_start=1617.95
TAG:lavfi.black_end=1618.25
TAG:lavfi.black_end=1618.25
TAG:lavfi.black_start=1635.1
TAG:lavfi.black_start=1635.1
TAG:lavfi.black_end=1635.33
TAG:lavfi.black_end=1635.33
TAG:lavfi.black_start=1650.18
TAG:lavfi.black_start=1650.18
TAG:lavfi.black_end=1650.68
TAG:lavfi.black_end=1650.68
TAG:lavfi.black_start=1656.96
TAG:lavfi.black_start=1656.96
TAG:lavfi.black_end=1657.76
TAG:lavfi.black_end=1657.76
TAG:lavfi.black_start=1660.03
TAG:lavfi.black_start=1660.03
[Parsed_movie_0 @ 0000020c41f67b00] EOF timestamp not reliable
[blackdetect @ 0000020c41f470c0] black_start:1660.03 black_end:1980.48 black_duration:320.453
errors in the file can appear such as the "EOF timestamp not reliable" error seen above. The processing time would almost necessitate using await as the file in its entirety is scanned and can take multiple minutes to complete.