Author Topic: Add a still picture to a video  (Read 1484 times)

Catorcio63

  • Newbie
  • *
  • Posts: 12
Add a still picture to a video
« on: September 05, 2019, 11:48:56 AM »
In the context of the same task described in my previous post "Audio timing problems", I would like to add a still picture (a map) as the first image of the video.
To that aim, I created a .jpg the same size (in pixels) as the video.

I tried in many ways to integrate the still picture with the video, but I encountered some issues.
For the time being I describe two ways that I tried.

--- 1st way
First, I opened the picture in Avidemux and then I appended the original video. It works, except that the audio of the video is not available in the audio tracks.
I tried to encode and the resulting video is ok (when the video is opened in a video player, I can see the picture, then clicking "play" shows the video correctly). The problem now is to add the audio, bearing in mind the synch problems that I described in my previous post. So, if you suggest me a way to properly integrate the audio, the task is complete.

--- 2nd way
First, I loaded the original video in Avidemux, then I used the AddLogo video filter to add the picture (at 0,0, alpha 255).
When I encode, playing the resulting video shows just the picture. I tried to use the fad in/out value, but it seems to be associated only to when the picture fades in (i.e. if I set 5s for the fad in/out value, after 5s of playing the video, the picture fades in but then the picture is played for the rest of the video).

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #1 on: September 05, 2019, 02:57:58 PM »
There are different ways to accomplish your task depending on what you really want.

Do you want the map to be shown during the duration of the video? In this case the 2nd way was correct, you just need to right-click the logo filter in the list of active filters and select "make partial".

Do you want to prepend the map to the video? (I assume that you would want it to be shown longer than just for a tiny fraction of a second.)

In this case load just the JPG into Avidemux, add "Still Image" video filter for the desired duration and if necessary the "resample FPS" filter to match the FPS of the main video (use pre-defined values whenever possible). Now re-encode using e.g. x264 with very good quality.

Prepare an external audio track matching exactly the properties (codec, codec settings, bitrate, number of channels and channel layout) of the audio in the video, load the still image video from the first step into Avidemux and add that external audio track, save the output in copy mode.

In the last step, load the output from the second phase into Avidemux and append the main video, apply if necessary the "Fade in/out" filters at the boundary and re-encode the video.

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #2 on: September 10, 2019, 11:04:23 AM »
Finally, I managed to achieve what I wanted. :)

The 2nd way is correct, I just did not know how to show the picture (inserted using addLogo) in the video for a limited time. As you suggested, eumagga0x2a, it is just a matter of right-clicking the AddLogo filter in the list of active filters and select "make partial".

I exploit the opportunity to give some feedback on the last version (2.7.5). When I open it (in Windows 7, up to date), the bottom of the main window (which contains essential GUI elements) falls below the visible screen and it is not possible to resize the window so to show the bottom (however maximising the window fixes the problem). In any case, I managed to complete my task using version 2.7.3, which does not present this problem.

Cheers  :)


eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #3 on: September 10, 2019, 11:57:33 AM »
I exploit the opportunity to give some feedback on the last version (2.7.5). When I open it (in Windows 7, up to date), the bottom of the main window (which contains essential GUI elements) falls below the visible screen and it is not possible to resize the window so to show the bottom

What resolution does your monitor have? What is the resolution of the video? Do you know that you can downscale the video pressing 2, 3 or 4 up to 1/4 of the original size?

Quote
(however maximising the window fixes the problem).

This will autoscale the video to fit the available space, yes.

Quote
In any case, I managed to complete my task using version 2.7.3, which does not present this problem.

...but many other issues.

The only relevant change was https://github.com/mean00/avidemux2/commit/e31c5643f19dc37f3b71fc2a87c3ce9930360c33 necessary to avoid exactly this sort of annoyance (not really a problem as keys "2", "3" and "4" are always in reach) on wide screens.

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #4 on: September 12, 2019, 11:40:46 AM »
The screen resolution is 1920x1080.
However the problems shows just after launching Avidemux (2.7.5), before loading any video. The Avidemux window does not resize (the mouse cursor changes to the resize icon, but dragging the window border has no effect).

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #5 on: September 12, 2019, 08:18:50 PM »
I have the same display resolution, can't reproduce the problem you describe with Avidemux 2.7.5 VC++ on my freshly resurrected Windows 7 installation.

Do you have multiple monitors? Could you please just start Avidemux, then close it and attach admlog.txt from %localappdata%\avidemux\ to your reply (compress it as zip or 7z if necessary)?

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #6 on: September 17, 2019, 11:30:06 AM »
I just noticed that I can partially resize the window horizontally, but not vertically.
Cheers.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #7 on: September 17, 2019, 01:36:48 PM »
Code: [Select]
The screen seems to be 960 x 540 px
Looks like Qt is sure it needs to apply HiDPI scaling. Try to add an env variable QT_AUTO_SCREEN_SCALE_FACTOR set to 0.

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #8 on: September 18, 2019, 11:01:10 AM »
Correct eumagga0x2a, after setting that env variable, Avidemux (2.7.5) starts in a smaller window which fits well in the screen and resizes properly.
For your info, myscreen resolution is set to 1920x1080, however I use bigger fonts (Control Panel\All Control Panel Items\Display fonts 150% bigger, you know, the age  :) ), which maybe the culprit.
Thanks a lot!

Another issue, please. I would like to have a portable version of Avidemux (in order to bring along custom settings, of course). What do you suggest? Do you suggest the PortableApp version of Avidemux? Thanks.

Cheers.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #9 on: September 18, 2019, 12:27:54 PM »
I would like to have a portable version of Avidemux (in order to bring along custom settings, of course).

What do you mean by "bring along" exactly? A flash drive to run Avidemux on someone's else Windows computer? On your own system, you can always put a .py script with your alternative configuration (similar to the "defaultSettings.py" file) into the "custom" subdirectory of %appdata%\avidemux\ folder to be able to load these settings when needed from the "Custom" menu.

Otherwise just copy the content of the Avidemux program directory to a flash drive, remove the uninstaller ("Uninstall Avidemux VC++ 64bits" .dat, .exe and .ini) and rename "avidemux.exe" to "avidemux_portable.exe". That's all.

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #10 on: September 19, 2019, 11:31:37 AM »
eumagga0x2a, you are an inexhaustible source of information.  :)

Recently, while passing from 2.6 to 2.7, I tried to migrate a some custom x264 configuration files. And I did not manage. It took a while to realise that that feature does not work anymore in 2.7, despite the UI to save and load x264 configurations is still there (which is confusing). After googling for information, I realised that substantially that feature has been replaced by py scripts (which are even better -when you are aware of it- at least for someone familiar with programming, because py scripts have a much wider scope in controlling Avidemux functionalities. However I am not sure that users unfamiliar with programming will be happy).

In any case, by "bring along custom settings", I meant that I appreciate to be able to easily copy free software that I use, including (at least some) configuration, from one PC to another or to run the software from a USB.
For your info, I did exactly what you suggested (there is no need to rename the executable). I had an annoying although uninfluential pop up message about a missing directory, an issue which has been fixed by the last system update (likely it will be reintroduced by the next update  :) ).

Thanks for Avidemux!
Cheers.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3484
Re: Add a still picture to a video
« Reply #11 on: September 19, 2019, 11:44:05 AM »
there is no need to rename the executable

Renaming the executable to "avidemux_portable.exe" tells the Windows version of Avidemux to save its configuration in the program directory instead of in %appdata%\avidemux. That is what "portable" means.

Catorcio63

  • Newbie
  • *
  • Posts: 12
Re: Add a still picture to a video
« Reply #12 on: September 20, 2019, 11:36:41 AM »
I confirm, you are an inexhaustible source of information.  :)

Cheers.