# Movie. Resolution of master frame (-M)

**URL:** <https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639>\
**Category:** Q&A\
**Created:** [May 3, 2021, 4:24pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639 "2021-05-03T16:24:37Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 3, 2021, 4:24pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/1 "2021-05-03T16:24:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 3, 2021, 7:46pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/2 "2021-05-03T19:46:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 5, 2021, 6:43pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/3 "2021-05-05T18:43:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [May 5, 2021, 7:05pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/4 "2021-05-05T19:05:28Z")

</div>

@pwessel, also in the vein of `-C`_canvas_ 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

```auto
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)?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 5, 2021, 7:11pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/5 "2021-05-05T19:11:19Z")

</div>

Something like this [https://github.com/GenericMappingTools/gmt/issues/3540](https://github.com/GenericMappingTools/gmt/issues/3540) ?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [May 5, 2021, 7:17pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/6 "2021-05-05T19:17:04Z")

</div>

Yup 🙂  
(i’m on v6.2rc)

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 6, 2021, 3:21am UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/7 "2021-05-06T03:21:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 9, 2021, 4:12pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/8 "2021-09-09T16:12:56Z")

</div>

Sorry it took so long :

I’m playing with `movie` again only now …

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

```auto
gmt movie main.sh -Iinclude.sh -Sbpre.sh -Nmov -C21cx21cx120 -Tlist.txt -D1 -Fmp4

```

```auto
$ 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.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 9, 2021, 4:18pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/9 "2021-09-09T16:18:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 9, 2021, 4:25pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/10 "2021-09-09T16:25:22Z")

</div>

6.3.0\_417760f\_2021.07.12

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 9, 2021, 4:33pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/11 "2021-09-09T16:33:55Z")

</div>

In August 12 was (probably) fixed (#[5634](https://github.com/GenericMappingTools/gmt/pull/5634)). Try updating gmt.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 9, 2021, 4:45pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/12 "2021-09-09T16:45:44Z")

</div>

👍

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 9, 2021, 8:05pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/13 "2021-09-09T20:05:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [September 9, 2021, 8:23pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/14 "2021-09-09T20:23:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [September 9, 2021, 8:27pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/15 "2021-09-09T20:27:37Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 9, 2021, 8:32pm UTC](https://forum.generic-mapping-tools.org/t/movie-resolution-of-master-frame-m/1639/16 "2021-09-09T20:32:20Z")

</div>

On the remote machine :

```auto
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) 👍
