How to fade last (extended) frame [Avidemux 2.8.1 release version on Windows]

Started by velw, January 27, 2024, 09:06:21 AM

Previous topic - Next topic

velw

Hi there,

I'm trying to make a short (1m22s) clip from a longer video, with a short fade in from black at the start and out again to black at the end. I'm having problems with the fade out at the end.

I want it to fade out, but I also want the viewer to be able to see the last frame I've selected for the clip (let's call it frame Z). The next frame after is very different, so I can't just start the fade after frame Z. To work around this, I'm using the "Still image" filter to extend frame Z for the duration of the fade.

  • Frame Z is at 14:33.080
  • The "Still image" filter starts at 14:33.080 and lasts for 5 seconds (I've tried making this shorter, to match the length of the fade for example, but that doesn't seem to help)
  • The "Fade to black" filter starts at 14:33.080 and ends at 14:33.240
  • When I view the list of filters, the "Fade to black" in from black at the beginning is first, then the "Still image" filter, then the "Fade to black" filter for the fade out at the end

If I set the B marker to 14:33.080, the clip saved does end showing frame Z, but there's no fade.

If I set the B marker to 14:33.240, or even to 14:33.200, some kind of fade does seem to be happening but the "Still image" filter doesn't seem to be applied — what I see is the fade applied over the frames that follow frame Z.

If I shorten the "Still image" filter so that it shouldn't extend beyond the B marker (setting the duration to 159 milliseconds, for example, and then setting the B marker to 14:33.240), it still doesn't seem to be applied.


The source video is H264 encoded MPEG with AAC audio. I am saving the clip as H264 encoded MPEG with AAC audio using the mp4 muxer (not using "Copy" for video or audio). I'm using Avidemux 2.8.1 release version on Windows (I just upgraded in the hope it may help with this problem).

What settings should I use to have frame Z extended for the duration of the fade, and to end the clip at the end of the fade?


V


sark

Example for 10 sec input clip that you want to end at 8 secs, and  display 8th sec frame for 4 secs while fading to black.

Set B marker to 8th sec frame.

Still Image filter: Start at 8 sec, Duration 4 sec.

Fade to black filter: Start at 8 sec, End at 12 sec (8 + 4).

Remember. Still image has a Duration. Fade to black an End time.

velw

Quote from: sark on January 27, 2024, 02:21:07 PMExample for 10 sec input clip that you want to end at 8 secs, and  display 8th sec frame for 4 secs while fading to black.

Set B marker to 8th sec frame.

Still Image filter: Start at 8 sec, Duration 4 sec.

Fade to black filter: Start at 8 sec, End at 12 sec (8 + 4).

Remember. Still image has a Duration. Fade to black an End time.

You know, I was just about to write back and say I'd tried that (I thought I had, right at the start) and that it hadn't worked. Then I tried it one more time, just to be sure — and now it works  :o

Thank you!

I was really sure I had tried it, maybe only in the older version, though (2.7.1). Maybe something was fixed, or maybe I just always had something slightly off.

I have a follow-up question, though (sorry!)... if you wanted to do the same at the start of the clip — freezing the initial frame for the duration of the fade in from black — what settings would you use? I just tried doing the same thing that now works for the end of the clip (setting the "Fade to black" and "Still image" filters to the same length and both starting from the A frame) and only the fade seems to be applied.

In fact, even if I disable the fade, the "Still image" filter on its own doesn't seem to be applied. I feel like I must be misunderstanding something important about how this filter is supposed to work.

V

velw

I just tried starting over with a completely different input file (albeit the same encoding), selecting an 18 second clip with a "Still image" filter applied within the clip (not at the start or the end).

The source file is just under 52 minutes long.

A marker: 00:00:24.000
B marker: 00:00:42.000

One filter — the "Still image" filter set to start from 00:00:27.160 for 10 seconds.

Now, when the filtered output is previewed within Avidemux, it plays the source video for the first three seconds of the clip, then the frame with the "Still image" applied for 10 seconds, then the source video continues.

When I save the clip, the first three seconds are the frame with the "Still image" applied, then the video continues. The saved clip is shown in the file explorer and VLC as 22 seconds long.

Something doesn't seem right with this filter. In the project with the "Fade to black" filters it just stopped working altogether, even when I removed everything else. In this fresh test project it seems to be applied in the output differently to when it's previewed within Avidemux.

V

eumagga0x2a

Please test with the latest available 2.8.2 nightly first. I'll check when able ASAP.

sark

Example as previous, but with 4 sec fade in.

Still image: Start 0 secs. Duration 4 secs.

Fade to black: Type = In. Start 0 secs. End  4 secs.

**** Set B marker to 8 secs ****

Still image: Start 12 secs. Duration 4 secs.

Fade to black: Type = Out. Start 12 secs. End 16 secs.

Only the B marker need be set, after fade in filters have been applied. Although technically, when you actually set it with these these particular filters is not critical. More important, Fade out times must be appended to take into account 4 sec fade in.

Note: Tested on 2.8.2 nightly.




eumagga0x2a


Philo

Until you have access to a fixed version here is something you could try.

Navigate to the frame you want to use as the end frame (for the fade out) and go to File | Save as Image and save the frame as a .png file.

Define the area where you want the held image to appear using the A and B markers, and go to Filters and the Add Logo filter.  Select the image you just saved as the "logo" and make sure the X and Y values are set to 0 and 0, the Scaling is 1.00 and the Alpha is 255.  The Fade in/out should be set to 0 (by the way I have long wished that the fade in and fade out could be specified independently in this filter, but I don't use it all that often so have never requested it).  Make the filter partial, using the times in your A and B markers as the start and end.  The reason you don't use Fade In/Out here is because you can't specify the in and out times independently, and because the "fade" is not to black but rather a transition to full transparency (which makes sense if you are really using the filter for a logo as intended).

Now when you preview it, it should hold the image at the end for the amount of time you want.  This assumes that your video has enough padding at the end that the extra time exists.  Now, without changing your A and B markers, you can use the Transition | Fade to Black filter to fade out the image.  The last step is to delete everything after your B marker so the video ends at the end of the fade.

This is a roundabout way to do it but I suspect it will work.  Once the video has fully encoded you can delete the temporary .png file you created.

eumagga0x2a

Builds that include the fix (those from Jan 29 and later, NOT the vsWin64 build from Jan 28) are already available. The bug hit when marker A was not at zero.

sark

Quote from: sark on January 28, 2024, 03:27:24 PMOnly the B marker need be set,

@velw: Appologies, I didn't fully read your last post. I never tested at an alternative start time to the first frame. It now appears this was causing the issue.

Latest  Windows nightlies available below:

https://www.avidemux.org/nightly/win64/


velw

Quote from: Philo on January 29, 2024, 02:37:06 PMUntil you have access to a fixed version here is something you could try.

Hi there! Sorry for the delayed response — and thank you for this suggestion. It looks like on some builds the fade in and out are working, but it's great to have this alternative option. Thank you for taking the time to post it and for describing it step by step as well 🧡

velw

Quote from: eumagga0x2a on January 29, 2024, 01:37:27 AMShould be fixed now, please try a future nightly build. Thank you very much for your report.

Hello! Thank you very much for looking at this and applying a fix — I'm really sorry this reply is so late, I thought I'd registered for e-mail notifications from this board but it looks like I was only registered for "alerts", and I'm not sure where they go  ???

I've tested the "Still image"/"Fade in/out to black" combo at the start and also (separately) at the end of the clip using the Jan. 29 build.

The fade in with still image now seems to work reliably. Here are the settings I used at the start of the test clip. (The clip is shortened and the fade and still image filters lengthened for testing purposes.) This is wonderful — thank you! 💕

Unfortunately, there seems to be a problem with combining the fade out and still image in this build. Here are the settings I used for the fade out/still image combo at the end of the test clip.

What it seems to be doing at the end is freezing the frame three frames before the one selected for the still image filter, and then not applying the fade out to black (the very end of the output video is black, but there's no fade). I tried switching the order of the filters but that doesn't make any difference.

Is there something I should adjust in the settings for the end filters?

V


eumagga0x2a

The end of selection doesn't belong to selection, therefore the B marker must be at 00:14:33.120 (at the next picture after start of "still image"), not at 00:14:33.080.

velw

Quote from: eumagga0x2a on February 08, 2024, 07:20:49 PMThe end of selection doesn't belong to selection, therefore the B marker must be at 00:14:33.120 (at the next picture after start of "still image"), not at 00:14:33.080.

Aha! Thank you, that makes sense — I remember the selections working like that in the past, and then at some point they seemed to change and start including the frame at the B marker but I'm not sure when. Perhaps I was just confused.

If I set the B marker to 00:14:33.120, the correct frame is chosen for the "Still image" filter, which seems to work correctly for the rest of the duration of the output file. The "Fade to black" also seems to work correctly with the settings I posted previously right up to the last frame, but then it vanishes. The final frame of the output video becomes a single frame of the "Still image" filter, not faded at all (as though the fade finishes one frame earlier than the extended still frame).

Does the end of the "Fade to black" filter work the same way as the B marker, with the "end" marker of the fade not belonging to the fade? If I set it to end at 00:14:33.120 as well the final output frame is black, so I can work with whatever it's doing, but it'd be good to know what it is doing.

Also, if setting B to 00:14:33.080 ends the output before both filters are set to begin, why did the earlier frame get used for a "Still image" filter type effect when I had B set to that? Shouldn't the output video have ended before either of the filters kicked in?

V

eumagga0x2a

Quote from: velw on February 09, 2024, 02:44:35 PMDoes the end of the "Fade to black" filter work the same way as the B marker, with the "end" marker of the fade not belonging to the fade?

It should, else it is a bug. The mathematical concept of a selection is universal.

Quote from: velw on February 09, 2024, 02:44:35 PMif setting B to 00:14:33.080 ends the output before both filters are set to begin, why did the earlier frame get used for a "Still image" filter type effect when I had B set to that? Shouldn't the output video have ended before either of the filters kicked in?

This might be an effect of caching between the filter chain and video encoder (the default cache size is 3 pictures, if I am not mistaken). I'll check both findings later, thank you.