seangottarun / gpxoverlay Goto Github PK
View Code? Open in Web Editor NEWPython project that takes GPS data and overlays it onto a video with custom user-defined HTML widgets
Python project that takes GPS data and overlays it onto a video with custom user-defined HTML widgets
On my mac, after installation I have the following error.
python3 overlay_speed.py
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.29)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[image2 @ 0x7fbf18008a00] Could find no file with path 'temp/speed%d.png' and index in the range 0-4
temp/speed%d.png: No such file or directory
Traceback (most recent call last):
File "/Users/bonaime/git/GPXOverlay/examples/overlay_speed.py", line 77, in <module>
convert_overlay_to_video(frame_name_format, output_overlay_path, fps)
File "/Users/bonaime/git/GPXOverlay/GPXOverlay/overlay.py", line 23, in convert_overlay_to_video
ffmpeg
File "/usr/local/lib/python3.9/site-packages/ffmpeg/_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
(video) C:\Users\antip\Documents\GPXOverlay\examples>python overlay_elevation.py
Traceback (most recent call last):
File "overlay_elevation.py", line 14, in
main()
File "overlay_elevation.py", line 9, in main
elevation_overlay = overlay.Overlay('sample-data-short.gpx', 'video.mp4')
AttributeError: module 'GPXOverlay.overlay' has no attribute 'Overlay'
Win10, python 3.8. Other examples work.
beautifulsoup4==4.9.1
ffmpeg-python==0.2.0
imgkit==1.0.2
Jinja2==2.11.2
matplotlib==3.3.1
numpy==1.19.1
Pillow==7.2.0
When each overlay frame is created, the top of the png image has some random noise. It seems to be an existing unresolved upstream issue with wkhtmltopdf
(see issue wkhtmltopdf/wkhtmltopdf#2629). The affected lines in GPXOverlay/frame.py
should be
# Use imgkit to generate png from temporary HTML file
options = {'quiet': '', 'transparent': '', 'width': 500, "crop-w":500, 'disable-smart-width': ''}
imgkit.from_file('temp/updated_speed.html', f'temp/speed{id}.png', options=options, css=SPEED_CSS_PATH)
As mentioned in #5 (review), when the GPS data video is overlayed on the original input video, the audio stream is dropped. According to ffmpeg-python documentation,
Some ffmpeg filters drop audio streams, and care must be taken to preserve the audio in the final output. The
.audio
and.video
operators can be used to reference the audio/video portions of a stream so that they can be processed separately and then re-combined later in the pipeline. This dilemma is intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the way while users may refer to the official ffmpeg documentation as to why certain filters drop audio.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.