ahhh! ok... i was just coming back to write that i've spent the last few hours mucking about trying to get this to work... apparently it is possible to crash something in FG so nothing is output when doing this but i did finally realize that and restarted FG at which point i was able to grab mjpeg data and save it to a file... it is grainy and i had to force wall clock time stamps to get (eg) accurate 15 seconds of video... otherwise it would take like 2+ minutes for 15 seconds and the playback was really fast... i don't know anything about this stuff but some tweaking is needed somewhere and whatever bug(s) i triggered when i was testing also need to be found and stomped out but that'll have to come later...
so FWIW: here's the ffmpeg command line i used...
- Code: Select all
ffmpeg -y -report -loglevel debug -f mjpeg -use_wallclock_as_timestamps 1 -i "http://myFGsystem:5500/screenshot?stream=y" -t 15 FGTest.mpg
specifically i had to:
1. force mjpeg with "-f mjpeg"
2. force wall clock with "-use_wallclock_as_timestamps 1" for accurate recording length of 15 seconds
i also used -report to get a log and i forced the debug logging so i could see on the screen when things started working as desired... this after a couple of hours of nothing being recorded until i finally restarted FG... i have a log ffmpeg log file if you're interested in seeing it... apparently FG is spewing a LOT of frames that ffmpeg is detecting as dupes... and there's also something about buffer underruns but i haven't taken the time to try to determine the proper buffer size needed as this was just a fun experiment since you got my curiosity up about it
i will note that my FG is set to 2560x1600 resolution and is being run in a window on a 4k monitor via an RTX2060 GPU... during this testing, FG was running at KRDU with OSM data enabled and was averaging 30fps consistently at 1500ASL in the UFO with it spinning in place at one right-arrow speed (easiest way to describe it)...
whatever the bugs are i've stumbled across, FG terminates with a core dump... sometimes it does that by itself and other times when i exit the sim via ESC and Enter... i did have it hang on exit with a thread still running one time when i exited while ffmpeg was still recording... so apparently there's something in the web server stuff that needs some love and attention...
i should also note that i was testing this with FG on one system and recording via ffmpeg on another system...
so anyway, there it is... it does work but there may be problems encountered...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."