GenericMappingTools / gmt-2024-animation

Illustration and movie scripts for 2024 publication on GMT animations
GNU General Public License v3.0
1 stars 0 forks source link

Polishing the elaborate Indy path #9

Closed PaulWessel closed 1 year ago

PaulWessel commented 1 year ago

This is coming along nicely. I made a few changes that you can consider or reject:

  1. Added leading comment with our names and what it does.
  2. Adjusted the GMT logo so it also starts 2 cm from the side
  3. Removed the PROJ_ELLIPSOID setting lke for the other script
  4. Added more comments

Questions: The probing and trimming of the mp3 track: I assume you include this to show how you need to get the same length and thus need original film length and then trim, Alternatively you could just use the final mp3 trimmed file as the original and avoid those two commands? Otherwise, I think you need to add comments to explain this - or we do it when we discuss this script in the paper.

Esteban82 commented 1 year ago

I think it is better to use a trimmed version of the soundtrack. It is not the idea of the paper to discuss ffmpeg.

PaulWessel commented 1 year ago

OK, then I guess just replace the one in git with the other trimmed one and update the script.

Esteban82 commented 1 year ago

Just done!

PaulWessel commented 1 year ago

Looks great. Now I wonder if movie should take a -Asoundfile option and then

#   Create animation
gmt movie main.sh -Iin.sh -Sbpre.sh -Ntmp_${title} -Tdistance_vs_frame.txt -Etitle.sh+d6s+fo1s -Cfhd -Fmp4 -Vi -D60 -K+p -Zs

# Add soundtrack to the animation
ffmpeg -loglevel warning -i tmp_${title}.mp4 -y -i RaidersMarch_trim.mp3 ${title}.mp4

rm tmp_*

could just be

#   Create animation
gmt movie main.sh -Iin.sh -Sbpre.sh -N${title} -Tdistance_vs_frame.txt -Etitle.sh+d6s+fo1s -Cfhd -ARaidersMarch_trim.mp3 -Fmp4 -Vi -D60 -K+p -Zs

Perhaps there are ffmpeg options to ensure ab audiofile can be stretched/shrunk to fit the length of the movie (i.e., imagine you make an animation that is 32 seconds and then you record narration that is 30.4 seconds, it would probably be convenient to have that autoscale to 32 seconds, no?

Esteban82 commented 1 year ago

I think it would be nice.

It seems that there is this option to speed/slow the audio.

Esteban82 commented 1 year ago

It seems that it is possible with the atempo function ( https://ffmpeg.org/ffmpeg-all.html#atempo ) We should use ffprobe to calculate the duration of the video and the audio, and them calculate its ratio.

RATIO=(VIDEO_DURATION/AUDIO_DURATION)