Page 2 of 2
Re: DVCPRO adds 1 frame to the file metadata
Posted: Mon Sep 23, 2024 5:21 pm
by FranceBB
I can reproduce
Code: Select all
ColorBars(848, 480, pixel_type="YV12")
trim(0, 100)
This will give you a 101 frames clip.
Code: Select all
ColorBars(848, 480, pixel_type="YV12")
trim(0, 100)
FadeIn(1)
This will give you a 103 frames clip (2 frames are added).
Code: Select all
ColorBars(848, 480, pixel_type="YV12")
trim(0, 100)
FadeOut(1)
This will give you a 102 frames clip (1 frame is added).
So it really looks like FadeIn() adds 2 frames, but FadeOut() adds 1, which is... weird.
I don't really have an answer, though, on whether that's unexpected or not, so I redirected the question to Ferenc and Stephen.
But yeah, as emcodem said, not bad for a bug report, movalex xD
Re: DVCPRO adds 1 frame to the file metadata
Posted: Mon Sep 23, 2024 7:01 pm
by movalex
With the updated workflow by @emcodem, the duration of the result file is correct, but the fade is not, as it does not fade to complete black, which is also a prerequisite. So I dived a bit into AviSynth and realized there's some options I can use for my rare case.
Basically I trimmed the source video, then used the
FadeIO2, which adds the fade to color with two frames at both ends simultaneously, and then trimmed one excessive frame at the end. Hence I get the video with correct length, with 6 fading frames and complete black frame at both ends.
http://avisynth.nl/index.php/Fade
Code: Select all
audio = m_clip
video = m_clip
# Trim one frame from both ends
video = Trim(video, 1, video.FrameCount-2)
# Fade video with adding 2 frames at both ends
video = FadeIO2(video, 6)
# Trim one extra frame from both ends
video = Trim(video, 1, video.FrameCount-2)
# Dub audio back to the video
m_clip = AudioDub(video, audio)
return m_clip
I cannot express how grateful I am for all the help and and tips you share here. A huge thanks to all of you for this amazing adventure of frame picking!
Re: DVCPRO adds 1 frame to the file metadata
Posted: Mon Sep 23, 2024 8:50 pm
by emcodem
Well done, glad you liked it
! It appears FadeIO2 is not "misbehaving" like FadeIn and adds exactly the frames that it should add.
Let's hope the behaviour is consistent but as it behaves as documented i guess you are on the safe side
I really don't like that the topic about apad filter adding odd number of milliseconds to the audio stays open... maybe i find the time to reproduce it and pinpoint the issue later. Of course there are chances that its not even an ffmpeg problem but currently it appears like it because avisynth never reported such odd audio durations using "return Info(m_clip)"
And someone (@FranceBB) might want to take care about the wrongly generated avisynth lines the fade filter generates when checking/unchecking the different checkboxes?
Re: DVCPRO adds 1 frame to the file metadata
Posted: Tue Sep 24, 2024 7:36 am
by FranceBB
emcodem wrote: ↑Mon Sep 23, 2024 8:50 pm
And someone (@FranceBB) might want to take care about the wrongly generated avisynth lines the fade filter generates when checking/unchecking the different checkboxes?
Sure. As for the 2 frames in FadeIn(), I hope it's gonna be fixed in the AviSynth+ 3.7.4 release due by the end of the year.