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

Catorcio63

  • Newbie
  • *
  • Posts: 9
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: 3188
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: 9
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: 3188
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: 9
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: 3188
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: 9
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: 3188
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.