HerzBeatz
(Herz Beatz)
February 13, 2024, 10:53pm
1
I am a beginner and have searched for a solution but cant find one or dont know the correct way of searching
Is there a way for me to make a GIF using a JSON file.
I want to convert this https://services.swpc.noaa.gov/products/animations/sdo-hmii.json to a GIF using ffmpeg shell command
why? i am trying to recreat somethign like this:
There might be other ways to do this. i tried some, but with no luck …
test_gif: “ffmpeg -y -framerate 5 -i ‘Index of /images/animations/sdo-hmii ’ -q 10 /config/www/boxsnap/past/sol.gif”
test2_gif: “ffmpeg -y -framerate 5 -i ‘https://services.swpc.noaa.gov/images/animations/sdo-hmii/*.jpg ’ -q 10 /config/www/boxsnap/past/sol.gif”
a bash file:
{
for i in $(
curl -s https://services.swpc.noaa.gov/products/animations/sdo-hmii.json
| jq -r ‘. | “https://services.swpc.noaa.gov ” + .url’
); do
curl -s “${i}”
done
} | ffmpeg -y -framerate 5 -f image2pipe -i - /config/www/boxsnap/past/sol.gif
Anyone have a suggestion?
koying
(Chris B)
February 14, 2024, 9:46am
2
Tested:
curl https://services.swpc.noaa.gov/products/animations/sdo-hmii.json | jq -r --arg prefix "file 'https://services.swpc.noaa.gov" --arg suffix "'" '$prefix + (.[].url) + $suffix' | ffmpeg -f concat -safe 0 -protocol_whitelist file,http,https,tcp,tls,pipe -i - sol.gif
HerzBeatz
(Herz Beatz)
February 14, 2024, 7:17pm
3
Hey, thank you as soon as i am home i will try, your solution.
With " tested" do you mean that you managed to create a gif file from the images?
HerzBeatz
(Herz Beatz)
February 15, 2024, 8:40pm
4
This was not working at the start but after some testing and digging around the log i found the solution for this issue i had.
I had to also whitelist " fd " and force ffmpeg to overwrite the old file with -y
curl https://services.swpc.noaa.gov/products/animations/sdo-hmii.json | jq -r --arg prefix "file 'https://services.swpc.noaa.gov" --arg suffix "'" '$prefix + (.[].url) + $suffix' | ffmpeg -y -f concat -safe 0 -protocol_whitelist file,http,https,tcp,tls,pipe,fd -i - -vf scale=512x512 -q 10 sol.gif
thank you @koying for the help!