Avidemux Forum

Avidemux => Windows => Topic started by: hfrmobile on August 20, 2016, 04:04:21 PM

Title: Apply a filter to specific section of video
Post by: hfrmobile on August 20, 2016, 04:04:21 PM
Tried this tutorial: http://www.howtogeek.com/108584/how-to-quickly-edit-combine-transcode-apply-filters-to-videos-with-avidemux/

I  want to apply a filter to only a specific section of the video but under Windows there is no "Partial" button.

Adding filters to the whole video works, but I just need a short section to add a crop filter ....

Of course, workaround works: Cut video into parts and apply the filter to a specific parts and combine the parts .... But this is a lot of effort I'd like to avoid.

Thanks in advance!
Title: Re: Apply a filter to specific section of video
Post by: Jan Gruuthuse on August 20, 2016, 04:15:55 PM
There is no "Partial" button. see using Partial Filter (https://www.youtube.com/watch?v=CKyK1KZAAXU)(YouTube)
Forum: Partial applying filter (http://avidemux.org/smif/index.php/topic,16921.0.html)

Title: Re: Apply a filter to specific section of video
Post by: mean on August 20, 2016, 04:16:43 PM
It is back in 2.6.13 but not with all filters
Only with filters that :
* Dont change framerate
* Dont change size
* Dont need several frames (e.g. deinterlacer)
Title: Re: Apply a filter to specific section of video
Post by: hfrmobile on August 21, 2016, 09:15:25 AM
Thank you for your responses!

Quote from: mean on August 20, 2016, 04:16:43 PM
It is back in 2.6.13 but not with all filters
Only with filters that :
* Dont change framerate
* Dont change size
* Dont need several frames (e.g. deinterlacer)

Well, I never had the "Partial" button and also not in 2.6.13! Seems to be that it is not available for the Windows edition.


Quote from: Jan Gruuthuse on August 20, 2016, 04:15:55 PM
There is no "Partial" button. see using Partial Filter (https://www.youtube.com/watch?v=CKyK1KZAAXU)(YouTube)
Forum: Partial applying filter (http://avidemux.org/smif/index.php/topic,16921.0.html)

Thank you, found now the "Make Partial" context menu. But even when I just add a black border at the bottom (to hide news flash in a TV show I recorded) I always get:
This filter cannot be made partial.

Even I don't change size etc. as suggested by "mean".

What is the best way to "hide"  a news flash at the bottom of a video?

e.g.
(https://j26mtq.dm2301.livefilestore.com/y3pO7IxPN6mLw9-8XGjIZVhcO3F1kV2w2N9ReYsgIzrTYGid5RogVy1SZlYBPjxFrVoag6ZfY5Eosj9nLZfK6s6_Prwz15X9HgsrLoBFNw2fobU5wbxEcTD2l0LS50QLX50l0SgMPQ6bMz8wFIcF1ROHMVyA0F57UrSPBeG7ehgZ6E/Avidemux-Apply-Filter-To-Specifix-Section-Of-Video.png?psid=1)
Title: Re: Apply a filter to specific section of video
Post by: Jan Gruuthuse on August 21, 2016, 11:32:48 AM
Blacken border is only for full length video.
My best guess for now:
- Filters: Sharpness: Mplayer delogo2

or create a black png, matching the rectangular part of video you want to mask
- Filters: Add logo: select your BlackRectangular.png

The mark [A ] & [ B] are not filter related, these are cut or saving points.
take note of time in A: [00:05:13.440] and B: [00:07:29.440]
and use these times in Partial Filter: (fill in yourself)
Start time (ms) from A: [00:05:13.440]
End Time (ms) from B: [00:07:29.440]
(https://avidemux.org/smif/index.php?action=dlattach;topic=16921.0;attach=2202;image)
Title: Re: Apply a filter to specific section of video
Post by: Jan Gruuthuse on August 21, 2016, 11:54:25 AM
black .png used as logo:

black 256 pixels high for 720p:
black 256 pixels high for 1080i/pp:
Title: Re: Apply a filter to specific section of video
Post by: Jan Gruuthuse on August 21, 2016, 01:09:18 PM
see a small howto demo @YouTube: How to mask out news ticker in video (https://www.youtube.com/watch?v=bpMkeRaQXPw&index=10&list=PLLGMi2RSm8sbiUG2tfv8mcCzJoEsK3JVN)

our YouTube playlists: Howto and Developers Corner (https://www.youtube.com/channel/UC7ycUgCIuOlChtpiTFfLTmw/playlists?view=1&shelf_id=0&sort=dd)
Title: Re: Apply a filter to specific section of video
Post by: hfrmobile on August 21, 2016, 06:10:03 PM
Well, blackborder.png approach is exactly what I am looking for, but AviDemux crashes when selecting the png file:

(https://j26mtq.dm2301.livefilestore.com/y3pn2si6zXhGk0sNvkAeUdrQKSl8hv7EyBd56Uy3NkreALS2LYabOpHlHRIfSXmfmbh_1nKC8ikPTWNnHrFPlqulnseE6swdiHR9RswnjBQawPNCEaa4IgVLRPfCOj3o_Mt1yD7qRMGoDuN62kH6GHh0UA4XVgv6AQjldrC9eNHEuk/Crash-01-AddFilterPNG.png?psid=1)

(https://j26mtq.dm2301.livefilestore.com/y3pCv8_jkwClVGSb1Vk9vcpyYYUz0jEEJiyZZm3oH0mACbi7gT1EKU5e4xj1fQq3NxcSAAfHVzteVaXiFiTIKhSY4-mgvj4WHzfEYD1_jn2q22g0MzuAzLmB4xDutNbn9nPIgwerOwAV8Tfq07-i9vJCXJLHWcbdqXO3Zt6QwXi_u0/Crash-02-AddFilterPNG.png?psid=1)

QuoteADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
ADM_backTrack  [libADM_core6.dll]
decoderFF::frameType()  [libADM_coreVideoCodec6.dll]
ADM_coreCodecGetDecoder(unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int)  [libADM_coreVideoCodec6.dll]
createImageFromFile(char const*)  [libADM_coreImageLoader6.dll]
Ui_logoWindow::tryToLoadimage(char const*)  [libADM_vf_logoQT5.dll]
Ui_logoWindow::imageSelect()  [libADM_vf_logoQT5.dll]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QButtonGroup::checkedId() const  [Qt5Widgets.dll]
QAbstractButton::mousePressEvent(QMouseEvent*)  [Qt5Widgets.dll]
QWidget::event(QEvent*)  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal(QObject*, QEvent*)  [Qt5Core.dll]
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)  [Qt5Widgets.dll]
non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const  [Qt5Widgets.dll]
non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal(QObject*, QEvent*)  [Qt5Core.dll]
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)  [Qt5Gui.dll]
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)  [Qt5Gui.dll]
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Gui.dll]
QEventDispatcherWin32Private::sendTimerEvent(int)  [Qt5Core.dll]
DispatchMessageW  [USER32.dll]
DispatchMessageW  [USER32.dll]
QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
unknown function  [qwindows.dll]
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
QDialog::exec()  [Qt5Widgets.dll]
DIA_getLogo(logo*, ADM_coreVideoFilter*)  [libADM_vf_logoQT5.dll]
ADM_vf_addFilterFromTag(IEditor*, unsigned int, CONFcouple*, bool)  [libADM_coreVideoFilter6.dll]
filtermainWindow::allDoubleClick(QListWidgetItem*)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QListWidgetItem::setFlags(QFlags<Qt::ItemFlag>)  [Qt5Widgets.dll]
QListWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QAbstractItemView::mouseDoubleClickEvent(QMouseEvent*)  [Qt5Widgets.dll]
QWidget::event(QEvent*)  [Qt5Widgets.dll]
QFrame::event(QEvent*)  [Qt5Widgets.dll]
QAbstractItemView::viewportEvent(QEvent*)  [Qt5Widgets.dll]
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)  [Qt5Core.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal(QObject*, QEvent*)  [Qt5Core.dll]
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)  [Qt5Widgets.dll]
non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const  [Qt5Widgets.dll]
non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal(QObject*, QEvent*)  [Qt5Core.dll]
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)  [Qt5Gui.dll]
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)  [Qt5Gui.dll]
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Gui.dll]
QEventDispatcherWin32Private::sendTimerEvent(int)  [Qt5Core.dll]
DispatchMessageW  [USER32.dll]
DispatchMessageW  [USER32.dll]
QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
unknown function  [qwindows.dll]
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
QDialog::exec()  [Qt5Widgets.dll]
GUI_handleVFilter()  [avidemux.exe]
HandleAction(Action)  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
MainWindow::actionSignal(Action)  [avidemux.exe]
MainWindow::buttonPressed()  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]

(https://j26mtq.dm2301.livefilestore.com/y3pVEMLIc9LzTGB2sO0IvK_RXJfkvmjFxlEDIxIiKdexPFVIFpZGK-zXKdRSpEFu7AF9LJZdmNvS3PaBFMgnoboTtnjzXDgtWdF98kEzOq1qtbHoIRU-9wFEzRAzp8Q7wKcX6FlnPdWtHLuYZdWStkxcwqKIjMSpGBiv6D95s8Tgeg/Crash-04-AddFilterPNG.png?psid=1)

(https://j26mtq.dm2301.livefilestore.com/y3pJ24U5diwj5719sF7uAIZ2YXIYtTu2vzJNuQqbn9e-tS3VXRCmvdJcW7dnYFr2XBmc8TRZ36PQ7XqL04lULF9VxRRdGyhg9E2HzLPrYEIvJ9phPr9BZTNsAgnZf7TPzjEZHk5yN8731HVER22fVr5UXgYhPyrqlEPpj7nyvc1B7A/Crash-05-AddFilterPNG.png?psid=1)

Didn't expect that is that much effort to simply "hide a news banner"  ;D
Title: Re: Apply a filter to specific section of video
Post by: hfrmobile on August 21, 2016, 06:12:05 PM
Tried .jpg and it looked better but then Avidemux crashes when selecting "Make partial".

Avidemux also crashes for "Sharpness: Mplayer delogo2" when selecting "Make partial".

No detailed crash information, just getting the "has stopped working" message box ...
Title: Re: Apply a filter to specific section of video
Post by: Jan Gruuthuse on August 21, 2016, 06:40:39 PM
eeks. What windows are you running? and is it 32 or 64-bit operating?
If 64-bit try Aug 21 2016. http://www.avidemux.org/nightly/
Don't use .avi container.
If still issues or 32-bit windows: remux 1st original (.avi) to (.mkv) using mkvtoolnix gui (https://mkvtoolnix.download/downloads.html)
Title: Re: Apply a filter to specific section of video
Post by: hfrmobile on August 22, 2016, 05:50:08 AM
Thank you all for your support!

Windows 10 Version 1511 (OS Build 10586.545), 64 bit
64-bit Edition of Avidemux.

I ended up doing it "manually":
1. Splitting video
2. grop the part with the banner
3. resized the cropped part
4. concatenated the three parts

  20.08.2016  08:45       515.477.892 29 (1967) Der Mönch mit der Peitsche.avi
  21.08.2016  20:55        51.362.382 29 (1967) Der Mönch mit der Peitsche_1.avi
  21.08.2016  21:00        40.184.982 29 (1967) Der Mönch mit der Peitsche_2.avi
  21.08.2016  21:06        28.206.284 29 (1967) Der Mönch mit der Peitsche_2cropped+resized.avi
  21.08.2016  21:03        24.007.190 29 (1967) Der Mönch mit der Peitsche_2cropped.avi
  21.08.2016  21:02       477.003.278 29 (1967) Der Mönch mit der Peitsche_3.avi
  21.08.2016  21:08       555.983.448 29 (1967) Der Mönch mit der Peitsche_RESULT.avi


Took me 13 minutes to get the desired result  ;)

But for further movies it would be nice to know how to it easier (partial filters) (e.g. when a movie contains more than one banners).
Title: Re: Apply a filter to specific section of video
Post by: eumagga0x2a on August 22, 2016, 10:33:20 AM
Quote from: hfrmobile on August 22, 2016, 05:50:08 AM
  20.08.2016  08:45       515.477.892 29 (1967) Der Mönch mit der Peitsche.avi
  21.08.2016  20:55        51.362.382 29 (1967) Der Mönch mit der Peitsche_1.avi
  21.08.2016  21:00        40.184.982 29 (1967) Der Mönch mit der Peitsche_2.avi
  21.08.2016  21:06        28.206.284 29 (1967) Der Mönch mit der Peitsche_2cropped+resized.avi
  21.08.2016  21:03        24.007.190 29 (1967) Der Mönch mit der Peitsche_2cropped.avi
  21.08.2016  21:02       477.003.278 29 (1967) Der Mönch mit der Peitsche_3.avi
  21.08.2016  21:08       555.983.448 29 (1967) Der Mönch mit der Peitsche_RESULT.avi


Please never ever use the AVI container for pretty much anything today.

The crash must be Windows specific, WFM on Linux.
Title: Re: Apply a filter to specific section of video
Post by: Cormy1 on July 09, 2022, 04:41:31 AM
Are the restrictions to partial filter applications listed here still current?

I would like to Change FPS different amounts to different sections of a video.
If this is impossible, could I cut the video into multiple projects, Change FPS on the various projects, and then remux them together? Or is variable framerate not supported at all?
If it is not supported, I suppose I would have to go a step further and resample to match framerates.
The purpose is for a music edit sync
Title: Re: Apply a filter to specific section of video
Post by: eumagga0x2a on July 09, 2022, 07:44:05 PM
Quote from: Cormy1 on July 09, 2022, 04:41:31 AMAre the restrictions to partial filter applications listed here still current?

Yes, they are.

Quote from: Cormy1 on July 09, 2022, 04:41:31 AMI would like to Change FPS different amounts to different sections of a video.

You would need to export each section to a different video, you should also add "resample fps" to keep the frame rate. If storage is not a limiting factor, I'd recommend using a lossless codec (e.g. Ut Video) for intermediate steps. This all assumes that you don't need A/V to be in sync. If you do, this enormously complicates the task.

Quote from: Cormy1 on July 09, 2022, 04:41:31 AMOr is variable framerate not supported at all?

You should be able to append and process videos with matching dimensions but differing frame rates and export them to formats like MP4 or MKV (that's it). I would just avoid doing that for many reasons starting with the encoder always assuming a constant frame rate when calculating bitrate.

Quote from: Cormy1 on July 09, 2022, 04:41:31 AMThe purpose is for a music edit sync

I must admit that it doesn't tell me much about what you actually try to accomplish.
Title: Re: Apply a filter to specific section of video
Post by: Cormy1 on July 13, 2022, 12:06:38 AM
Is CRF 0 not lossless on x264?
The audio track is being replaced with music, I will edit the video to sync it with the music.
Is that a scenario that gets complicated?
Title: Re: Apply a filter to specific section of video
Post by: eumagga0x2a on July 13, 2022, 09:23:32 AM
Quote from: Cormy1 on July 13, 2022, 12:06:38 AMIs CRF 0 not lossless on x264?

Yes, but the performance is an order of magnitude worse than with Ut. In any case, disable B-frames for all intermediate steps.

Quote from: Cormy1 on July 13, 2022, 12:06:38 AMThe audio track is being replaced with music, I will edit the video to sync it with the music.
Is that a scenario that gets complicated?

IMHO yes, this is quite a challenge.
Title: Re: Apply a filter to specific section of video
Post by: Gew on November 29, 2023, 10:02:25 AM
Thread necromancy, check! ✅

Anyways, any plans on adding a filter-only-on-part-of-project button/function/feature? It could come in much handy, like me right now for instance, trying to put crop on only a small part of the video, running latest Avidemux under Windows 10. Of course there are work-arounds, running stream-copy-and-save on parts of the project and then outputting using same (e.g. x264) parameters and then pulling a an append/merge on parts, but not having to do all these steps would be awesome.
Title: Re: Apply a filter to specific section of video
Post by: Geo_log on November 29, 2023, 12:42:53 PM
Quote from: Gew on November 29, 2023, 10:02:25 AMtrying to put crop on only a small part of the video
Crop filter cannot be partitionized because it changes the dimensions of the video.
Use Zoom instead.
Title: Re: Apply a filter to specific section of video
Post by: sark on November 29, 2023, 01:12:20 PM
Quote from: Gew on November 29, 2023, 10:02:25 AMAnyways, any plans on adding a filter-only-on-part-of-project button/function/feature?

This function/feature already exists, just not for all filters.
The Zoom filter Geo_log suggests is basically a Crop and Rescale filter combined, with the option to partialize.