Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <lozarythmic> Hello! I'm trying to find out some information on how conversion is done. One of my co-workers has been extracting color frames to grayscale by extracting the Y pixel values from a video and exporting them to a frame. I think that '-vf format=gray' does pretty much the same thing but I'd like to have a look at the code that does it.
- <lozarythmic> Unfortunately while I am a bit of a coder I'm not really into C and was hoping one of you gurus could point me at the right file? I've had a look through the some of the code on GitHub but I'm really just poking around in the dark
- <Compn> for that specific vf the file is in libavfilter
- <Compn> lozarythmic : https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_format.c
- <Compn> but that file wont help you much as it calls other code
- <lozarythmic> Thanks Compn - it's GMT here so almost lunchtime :)
- <Compn> lozarythmic : depending what your coworker is doing, it could be the same, or different. there are a few ways to do greyscale conversion iir
- <lozarythmic> Compn: here's an extract from coworkers script: -pix_fmt yuv422p $outdir/$framefile.%9d.Y
- <Compn> yuv422p is a standard pix fmt with color :P
- <Compn> lozarythmic : well then try comparing his old script to ffmpeg gray output and see if its the same
- <Compn> lozarythmic : but since this is a user question ... you might want to try asking in #ffmpeg
- <Compn> this channel is for development of ffmpeg code not 3rd party scripts and such
- <lozarythmic> A couple of lines down in the script he adds a header to that .Y file and turns it into a .pgm: echo "P5\n$width $height\n255" >$yfname.pgm
Add Comment
Please, Sign In to add comment