jAlbum / Settings / Videos

Video Settings

Videos Settings give you control of the conversion process, which uses FFmpeg, from virtually all video formats to the MP4 HTML5 standard.

Basic Settings

settingsVideoTop.png

Tip: if you just want to see how videos look with a skin then, under the custom section, you could set -t to 1, to reduce all videos to 1 second length for the first time you make your album.


Quality

Sets the compression level and is a compromise between video quality and file size. Start with the default setting and if the quality is not good enough raise the setting and try making the album again.

resolution.png

Resolution

A drop down menu lets you choose from a range of standard video resolutions such as Full HD, HD, 480p, 360p, 240p, or the image bounds as set in Settings/Images. If you want a size other than these standard choices, you can enter values in place of $videoWidth and $videoHeight (each in two places) in ‘Use custom settings.’

'Original video' will process the video, but keep the video's dimensions rather than scaling them.

Use custom settings

If you check the 'Use custom settings' box then you can configure the video conversion process, to mp4, as you want.

SettingsVideoBottom.png


Advanced Settings

Variables

There are variables that you can use to aid conversion:

Video variables
Name Explanation
clipLength The length of the selected portion of the video or the full length if not clipped
clipStart The starting position of the clipped video or the beginning if not clipped
fileName The filename of the video being processed
inputDirectory The directory within which the video being processed is
inputPath The path to the video being processed
label The name, without the extension, of the video being processed
normalizeOrientation Rotate the video if required, e.g. if the video is taken in portrait mode
outputDirectory The directory in which the processed video will be created
outputPath The path to the video generated in the output directory
projectPath The path to the project's root image directory
videoHeight Height, either from the resolution setting or, if selected, the image bounds, of the video being generated
videoWidth Width, either from the resolution setting or, if selected, the image bounds, of the video being generated
videoQuality Quality as set using the video quality slider


FFMPEG Switches

Lets now look at the default switches used with ffmpeg

ffmpeg settings
Name Explanation
-y If the output file already exists then overwrite it, removing this switch will prevent overwriting the generated video.
-i Used to indicate an input file follows
-vf Create the filtergraph specified by filtergraph and use it to filter the stream. hqdn3d is a high quality de-noise filter, scale ensures the generated video is scaled to the correct aspect ratio whilst keeping within the lowest image bounds value, unsharp sharpens (can also be set to blur) the output video,
-ss Ensures the output starts at the point set by the video scrubber’s (video edit mode) start position
-t Sets how long the video plays from the start point above.
threads 0 allows the ffmpeg process to use as many threads are available, to speed up video creation as much as possible.
-b:a Sets audio input sampling rate to 96K bits per second
-ac Sets the audio channels to 2 (stereo)
-ar Sets the audio output sampling frequency to 44100Hz
-vcodec Selects the video codec to be used, libx264
-crf allows the quantization parameter to change depending on the amount of motion between frames
-metadata:s:v:0 ffmpeg autorotates movies based on metadata, this will set the rotate value to zero for the output video.
-movflags Movies the index (moov atom metadata) to the beginning of the file.
-pix_fmt Sets the pixel format of the video, yuv420p for example sets chroma subsampling and converts any interleaved inputs to progressively scanned outputs. YUV420p is used to ensure compatibility with most MP4 players.
$outputPath Sets the location for the generated video

Custom Settings

Apple Silicon (M series)

FFMPEG are currently not providing binaries fro Apple Silicon (M series) ARM chips. You can get FFMPEG compiled for M series chips from http://osxexperts.net which will let you use hardware acceleration by changing the video codec from, typically, libx264 to h264_videotoolbox

To check hardware acceleration is enabled in your ffmpeg open a terminal window and execute

/Users/username/Library/JAlbum/bin/ffmpeg -version and look for 'arch=arm64' in the resultant text.

Adding a watermark

To add or delete lines right click on the line and select ‘Insert row’ or ‘Delete row’. When adding lines you need to enter the ‘Name’ and, for many options a ‘Value’.


The watermark will be centred on the video and requires an image, called logo.png, in the project's root folder. To prevent the logo appearing in the album you need to 'exclude' it. For best results the image should be a transparent png file with a low transparency value, say 40%. Note that the example below uses a Mac OS file separator ‘/‘ Windows users will need to use ‘\’


The required settings are shown below:

Tip, you can copy and paste the contents of these tables (ignoring Name & Value header cells of course) directly into the advanced settings, no need to manually type them in :)


Video settings
Name Value
-y
-i $inputPath
-i $projectPath/logo.png
-ss $clipStart
-t $clipLength
-threads 0
-b:a 96K
-ac 2
-ar 44100
-vcodec libx264
-crf $videoQuality
-metadata:s:v:0 rotate=0
-movflags faststart
-pix_fmt yuv420p
-filter_complex overlay=(W-w)/2:(H-h)/2, unsharp=3:3:1.0:3:3:0.0,scale='min(iw,trunc(iw*min($videoWidth/iw,$videoHeight/ih)*0.5)*2):min(ih,trunc(ih*min($videoWidth/iw,$videoHeight/ih)*0.5)*2)'
$outputPath

To change the location of the watermark you can use different values for the 'overlay' element of the 'filter_complex' entry.
Top left use overlay=10:10
Top right overlay=main_w-overlay_w-10:10
Bottom left overlay=10:H-h-10
Bottom right overlay=W-w-10:H-h-10


Changing the volume

Another example is how to change the volume of the audio track of a video. Given changes to volumes are likely to be unique to each video this example might be be used as an interim step - that is process the original video and use the output from this as the input to your actual project.


The required settings are shown below:

Video settings
Name Value
-y
-i $inputPath
-vcodec copy
-af volume=2
$outputPath

Volume can be decreased by using negative numbers, you can also use 'dB' instead, e.g. volume=-6dB


Remove audio from video

If you want to entirely remove the audio from video(s) use the settings below:

The required settings are shown below:

Video settings
Name Value
-y
-i $inputPath
-vf hqdn3d=1.5:1.5:6:6,

scale=min(iw\,trunc(iw*min($videoWidth/iw\,$videoHeight/ih)*0.5)*2): min(ih\,trunc(ih*min($videoWidth/iw\,$videoHeight/ih)*0.5)*2), unsharp=3:3:1.0:3:3:0.0,$normalizeOrientation

-ss $clipStart
-t $clipLength
-threads 0
-an
-vcodec libx264
-crf $videoQuality
-metadata:s:v:0 rotate=0
-movflags faststart
-pix_fmt yuv420p
$outputPath

Most of the settings are the default, only the audio settings have been changed - so you don't need to enter the values for, example, -vf etc. The switch '-an' is the control for 'no audio'.

Other jAlbum and FFMPEG uses

Make a video from images in a jalbum project

This jAlbum external tool forum post shows how to install and run the ‘images to video’ tool to create videos of images within each folder of a project and/or a project-wide video. The tool allows you to include an audio track for each video. All the information need to get, install and run the tool is in the forum post.

Extract GPS metadata from videos

The metadata library used by jAlbum (v23.01 and newer) supports Mp4.Latitude and Mp4.Longitude data in mp4 videos. It does not support Quicktime metadata.ISO 6709 latitude and longitude, but you can extract that information using this jalbum external tool.

The tool is run on the video selected in jAlbum’s explore view, so it needs to be run one for each video. The GPS data is extracted and added to your clipboard, so all you need to do is paste the URL from the clipboard into the description field for that video. Users can then click on the link and it will open a Google Maps page of that videos location.

FFmpeg documentation

The documentation on the options available for configuring FFmpeg is available from ffmpeg.org. There is a link, FFmpeg documentation, to that page at the bottom of the custom settings.

jAlbum uses a static version of ffmpeg, to ensure you have the current ‘jAlbum version’ of the ffmpeg open the jAlbum configuration directory (Menu/Tools/Open directories/Config directory - then look in the ‘bin’ subdirectory for ffmpeg) quit jAlbum, delete ffmpeg and then relaunch jAlbum. When you use a project with a video file it will install ffmpeg, ensuring you have the latest jAlbum delivered version. However, if you want to use the latest version of ffmpeg then see this forum post on how to update ffmpeg. You can get an updated ffmpeg from here. If you are using Mac OS 15.5 (Catalina) or later you may need to open ffmpeg from within the Finder, to avoid getting ffmpeg error in jAlbum, by control clicking the executable file within the bin folder and selecting 'Open'. Once it has been opened in Terminal you can quit it and it will from then on run within jAlbum.

Users may switch to the system version of ffmpeg while using the default video settings by replacing ffmpeg in the user's jAlbum bin directory by a link to the system ffmpeg