News:

--

Main Menu

adding jpg or jpeg file

Started by quinto, March 16, 2020, 10:57:08 AM

Previous topic - Next topic

quinto

Can please someboy help a dummy like me? I want to paste a jpg image at the beginning and at the end of a mp4 file. They should stay 2 sec. max before the beginning and after the end. Thanks for help and suggestions, I could not find info on that subject

eumagga0x2a

First of all, prepare that brief 2 seconds long still video you are going to use as opening and closing sequence. The first step here is to ensure the JPEG matches the resolution of the video. This can be accomplished in Avidemux in one go with following steps, but using a dedicated image editor (e.g. The GIMP) may be preferable e.g. if downscaling with quality enhancements is desired.

Assuming the resolution of the image is correct, you need to load it in Avidemux and duplicate it for duration of 2 seconds by applying the "Still Image" filter. You need to select a codec first (filters are unavailable in copy mode). To avoid quality loss at this phase, choose "(FF)HuffYUV".

If the frame rate of the mp4 file is not equal 25.000 (exactly 25 fps), you should add the "Resample FPS" filter to match the frame rate, but only in case you can use one of the predefined modes (no "custom" fps values!), otherwise fps harmonizing will be accoumplished during the final re-encoding.

Now save the sequence as MKV.

The next step depends on whether you are going to use an external audio track for the entire final video or the source mp4 file should keep the audio track. If it is the latter, you will need to add an audio track to the intro sequence exactly matching the number of channels, the channel layout and the codec settings of the audio track of the mp4 file.

If it is acceptable to re-encode the audio track in the final step, you don't need to match codec settings, but you should still match the number of channels and channel layout when adding an external audio track to the 2s long intro sequence.

When the intro sequence video is ready, load the mkv in Avidemux, press Ctrl+C to copy it to clipboard, append the mp4 (Ctrl+A), navigate to the end of the video (with alternative keyboard shortcuts in Avidemux enabled, press "E") and paste the intro sequence (Ctrl+V). If necessary, add "Resample FPS" filter to unify the frame rate for the entire video and re-encode it using the codec you need (with the target container being MP4, the codec should be either HEVC for quality if backward compatibility doesn't matter and the computer is very powerful, else H.264).

When dealing with mp4 both as source and target, I strongly recommend using the latest Avidemux nightly.