Closed ghost closed 3 years ago
This feature would be awesome! As far as I know no NLE supports vector graphics.
This would definitely be interesting, but I'm not sure how effective it would be. FFmpeg's SVG support is spotty, but Qt's isn't so I'd probably hook into that. However the bigger issue is that - from what I've read - there aren't great ways to convert SVGs to OpenGL without just rasterizing them into a texture, which might defeat the point. But at the very least, you'd be able to change the rasterization size within Olive with this paradigm.
If it had to be rasterized, I wonder if you could make it dynamically generate the size based on the Scale property. That way you'd still be dealing with raster images, but no matter how big or small you made it, it would still be equally clear and not pixelated at all.
@DaniSeeh I think that would be the ideal solution, it's composited as a raster image behind the scenes, but the user still gets the benefits of vector graphics. I think that could probably be done fairly simply.
it's composited as a raster image behind the scenes, but the user still gets the benefits of vector graphics.
And this is what I expect ;-)
Nice idea. Could save trouble going into paint programs to upscale/repaint title cards. Also
it's composited as a raster image behind the scenes, but the user still gets the benefits of vector graphics.
I'm assuming it means that whenever the vector graphics are resized it regenerates the raster image right?
@Corruptinator Indeed, the SVG handling code will need to regenerate the raster (and probably the OpenGL texture too) whenever the SVG is resized. Could be slow on larger SVGs, but the result is more or less true vector scaling.
@itsmattkc there is alwasy: https://github.com/memononen/nanosvg for converting SVG into raster.
@itsmattkc, Maybe give the regenerated Vector a "Proxy/Low-Res" option? Have it set on the lowest settings to compensate for playback purposes. (Potentially useful for animation/keyframe purposes.) Then have it on high res upon exporting.
I also didn't think about this but Regenerated Vector Image could be useful for Scrolling Credits at the end of movies or videos.
Edit: Using Inkscape or Vector painting program to put down the fonts and the tags of certain graphics like proprietary stuff you see at the end of movie credits.
@Corruptinator on the larger scale this also feeds into a 'resolution independent' workflow. Edit once, distribute to anything.
This was found in my radar: https://github.com/RazrFalcon/resvg A new SVG library of some sort.
From its own Readme it says,
One of the major differences from other rendering libraries is that resvg does a lot of preprocessing before rendering. It converts shapes to paths, resolves attributes, removes groups and invisible elements, fixes a lot of issues in malformed SVG files. Then it creates a simple render tree with all elements and attributes resolved. And only then it starts to render. So it's very easy to implement a new rendering backend.
Just figured I give heads up that could become of relevance to this feature request.
Looks like that would make implementation of all this easy. Good find. I doubt it makes sense to do prior to the rendering engine rewrite being completed though. Any implementation would just mean more stuff to rewrite later presumably if it didn't fit with the new paradigm.
Wonderful idea, Kdenlive has already this feature though does not render properly when exporting the video. The feature would be a great plus for OLIVE as we can complement the creative flow using Inkscape for logos shapes in layers etc in order to do great jobs of video compositing ... ;)
Or scrolling credits, @enzogian.
Has someone reported before that .SVG files are not able to be imported when working in Windows ? I've heard it does work fine in Linux but Windows does not.
Has someone reported before that .SVG files are not able
Olive NOT support import SVG yet, so for now this is not "Windows issue" ;-)
Has someone reported before that .SVG files are not able
Olive NOT support import SVG yet, so for now this is not "Windows issue" ;-)
Ok, thanks a lot for your reply, then I think I got confused by this post in fb where someone used a SVG but not sure if he has tweaked the imported file somehow.... (he later mentioned something like a "plain svg"... ) https://www.facebook.com/100012237887371/videos/684900745261182/?query=svg&epa=SEARCH_BOX
Well, I just tried the following: renamed a PNG file to have an .svg extension, import it into Olive and drag it onto the timeline. It shows up as image.svg and displays corrects. Maybe the flag he imported is actually a raster image file but with an .svg extension?
Maybe the flag he imported is actually a raster image file but with an .svg extension?
FTR, raster image could be bundled into SVG-file. Maybe, that is what mentioned as "plain svg".
SVG files can reference and embed raster images, but they will still be SVG files. Examples:
Reference to local file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
>
<image
xlink:href="sample.jpg"
y="10.947623"
x="-58.6619"
id="image4515"
preserveAspectRatio="none"
height="171.45"
width="304.79999" />
</svg>
Embedded image
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
>
<image
y="30.073215"
x="34.565918"
id="image4526"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAMCAYAAAC5tzfZAAAABHNCSVQICAgIfAhkiAAAAMpJREFU
KJFj/P///38GJPDn6nWG/58+MTDy8TGwaGsyYAX/oeDfx4//P8Uk/X8rowLHH/1C/v+5ffc/OmCE
2fTR2ZPh7607GIYyqygx8O3YxMDIzg4XY2JgYGD4c+4CVg0MDAwMf+/cY/h94BCKGFwTPvD36nVM
Tf9//sSrCR0wMTAw4A4lmCJZGSyaLM0xJGCAkZ2dgdXBFlMTIzs7A8+UfgYmUVEMDVx9HZjiyJH7
/9Mnhp+r1sEjl83fG0MDhiZiAROpGhgYGBgAduJnjyAHslMAAAAASUVORK5CYII=
"
preserveAspectRatio="none"
height="3.175"
width="3.4395833" />
</svg>
I tried both types but they do not work in Olive, they can't be dragged onto the timeline.
Do not use SVG Native for web content or as an interchange format between applications unless it is going to be processed by underlying platforms only.
So SVG Native is mostly meant for user interfaces. For example, if you want to display some vector shapes like an icon, e.g. a custom arrow head for a scrollbar widget. Performance is critical for UIs, but what we want in Olive is to be able to import arbitrary SVGs and render them correctly. I don't think that SVG Native cuts it, because it supports a small subset of SVG features only.
Merging into #1054
Is it possible import SVG as vector graphics image?