Movie. Resolution of master frame (-M)

The master frame of a movie has the resolution defined by the canvas (-C), right? So, is it not possible to have the movie with one resolution and the master frame with another?

Not possible today, but I could imagine a +rdpi modifier to -M that could accomplish it.

Ok. It could be useful to create an smaller image (in Mb) for youtube for example.

@pwessel, also in the vein of -Ccanvas option, I sometimes got error messages (resulting in empty videos) due to the input size (ffmpeg).
I don’t have the exact error line but it’s something like

width/height not divisible by 2 (<width>x<height>)

Is there a way to issue a warning before full process (similar to the “destination directory non-empty” one)?

Something like this https://github.com/GenericMappingTools/gmt/issues/3540 ?

Yup :slight_smile:
(i’m on v6.2rc)

Looking at movie.c, those checks do happen before we start processing, but they are warnings, not errors. Also, the checks are only performed if you specify a movie output (ffmpeg) not gif, and it is not checked if you are using -Q for a dry run. Not sure what you want me to change here?

Sorry it took so long :

I’m playing with movie again only now …

So here’s what I have after running the following command :

gmt movie main.sh -Iinclude.sh -Sbpre.sh -Nmov -C21cx21cx120 -Tlist.txt -D1 -Fmp4
$ bash movie.sh 
movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 1 -y -i "mov_%02d.png" -vcodec libx264  -pix_fmt yuv420p mov.mp4
[libx264 @ 0x7f7f87812e00] width not divisible by 2 (2521x2521)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
movie [ERROR]: Running FFmpeg conversion to MP4 returned error 256 - exiting.

The thing I find troublesome is that we’re computing everything only to have it crashed at the last step.

What GMT version are you using? Are you using the master? I have a similar issue (with personalied canvas) recently and I think it was fixed.

6.3.0_417760f_2021.07.12

In August 12 was (probably) fixed (#5634). Try updating gmt.

:+1:

edit : problem persists with 6.3.0_50be0be_2021.08.11 on linux remote machine

There is a check in movie for this and it passes for your. But then those same dimensions are passed via PS_MEDIA and picked up by psconvert and it apparently rounds up to give you one extra pixel. And then it all falls apart when ffmpeg comes along.

I will make a dummy movie with your -C and see what I can learn.

1 Like

Tried with this short script and it makes a 2520x2520 PNG and movie. Please run it and let me know.

#!/bin/bash
cat << EOF > main.sh
	gmt begin
		gmt basemap -R0/15/0/15 -Jx1c -B -X2c -Y3c
	gmt end
EOF
gmt movie main.sh -Nmov -C21cx21cx120 -T5 -D1 -M2,png -V -Fmp4

On the remote machine :

movie [INFORMATION]: FFmpeg 4.3.1 found.
movie [INFORMATION]: Paper dimensions: Width = 21c Height = 21c
movie [INFORMATION]: Pixel dimensions: 2520 x 2520
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create parameter initiation script movie_init.sh
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: Create master frame script movie_master.sh
movie [INFORMATION]: Single master plot (frame 2) built: mov.png
movie [INFORMATION]: Create main movie frame script movie_frame.sh
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 19 cores
movie [INFORMATION]: Execute movie frame scripts in parallel
movie [INFORMATION]: Frame 0 of 5 completed [ 20.0 %]
movie [INFORMATION]: Frame 2 of 5 completed [ 40.0 %]
movie [INFORMATION]: Frame 1 of 5 completed [ 60.0 %]
movie [INFORMATION]: Frame 3 of 5 completed [ 80.0 %]
movie [INFORMATION]: Frame 4 of 5 completed [100.0 %]
movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 1 -y -i "/gpfs/loomis/scratch60/fedorov/gd428/GMtest/mov/mov_%01d.png" -vcodec libx264  -pix_fmt yuv420p mov.mp4
[png @ 0x55b69ca937c0] chunk too big
[png @ 0x55b69ca9b240] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[libx264 @ 0x55b69ca96d00] width not divisible by 2 (2521x2521)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
movie [ERROR]: Running FFmpeg conversion to MP4 returned error 256 - exiting.

On the local (mac) :+1: