convert 256 grayscale to non grayscale color: plugin/filter

Feature requests for VLC.
bubba12
New Cone
New Cone
Posts: 8
Joined: 10 Jul 2015 18:33
Operating System: Windows

convert 256 grayscale to non grayscale color: plugin/filter

Postby bubba12 » 10 Jul 2015 19:08

Greetings;

I thought it would be a neat feature to convert 256 grayscale videos to color

I am going to try to explain algorithms used to convert a grayscale color paletted video to 256 non-grayscale video.

Then I will try to explain how it may work in ffmpeg, I know the Sepia filter is available for vlc media player.

Step 1: get palette from old 256 color video
Step 2a: apply palette to old grayscale (256 color)
Step 2b: it could possibly do this while streaming so you don't have to re-encode the video

in ffmpeg:

get palette from 256 color video that is similar to grayscale: palettegen
Example:
ffmpeg -i HowaWatc1949_edit.mp4 -vf palettegen palette.png

Put palette in video frames?: paletteuse
Example:
ffmpeg -i ffbvideo1.mpg -i palette.png -lavfi paletteuse outputtest.avi
(couldn't get to work)


Note -levfi is for palette.png don't know what it does
references:

High quality gif with ffmpeg:
http://blog.pkh.me/p/21-high-quality-gi ... fmpeg.html

palette gen: https://ffmpeg.org/ffmpeg-filters.html#palettegen
gives example: ffmpeg -i input.mkv -vf palettegen palette.png

Palette use: https://ffmpeg.org/ffmpeg-filters.html#paletteuse
Example given with gif not video: ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: convert 256 grayscale to non grayscale color: plugin/filter

Postby Jean-Baptiste Kempf » 16 Jul 2015 10:35

So, why not doing it? :D
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

bubba12
New Cone
New Cone
Posts: 8
Joined: 10 Jul 2015 18:33
Operating System: Windows

Re: convert 256 grayscale to non grayscale color: plugin/filter

Postby bubba12 » 24 Jul 2015 23:23

Merci pour ton aide
Still learning, :-) not a programmer by trade, as a hobby
have only taken computer science 1+2 and some javascripting/html, not too familiar with OOP, can't find classes and methods...

Found more info: lavfi is mentioned in the ffmpeg docs: 3.1.2 Complex Filtergraphs; http://ffmpeg.org/ffmpeg.html
and is used for encoding

Will keep trying/learning, this is fun

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: convert 256 grayscale to non grayscale color: plugin/filter

Postby Jean-Baptiste Kempf » 25 Jul 2015 16:49

VLC is C, not OOP :)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

bubba12
New Cone
New Cone
Posts: 8
Joined: 10 Jul 2015 18:33
Operating System: Windows

Re: convert 256 grayscale to non grayscale color: plugin/filter

Postby bubba12 » 22 Apr 2016 00:16

VirtualDub has create paletized AVI under tools, will try that. Got it to work with some palettes by using the PsuedoColor filter. I extracted the files to a directory and was able to load the filter from VirtualDub.


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 24 guests