| Contents |
|---|
Videos Settings give you control of the conversion process, which uses FFmpeg, from virtually all video formats to the MP4 HTML5 standard.
Tip: if you just want to see how videos look with a skin then 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
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 different size to any of those then you can enter values in place of $videoWidth and $videoHeight (each in two places) in ‘Use custom settings’.
Use custom settings
If you check the 'Use custom settings' box then you can configure the video conversion process, to mp4, as you want.
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 | ||||
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 | ||||
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
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
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, deleting the ffmpeg file from the jAlbum configuration directory and letting jAlbum re-install it will not normally result in an updated version. See this forum post on how to update ffmpeg. You can get an updated ffmpeg from here
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