Guest User

Untitled

a guest
Jan 8th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. <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.
  2. <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
  3. <Compn> for that specific vf the file is in libavfilter
  4. <Compn> lozarythmic : https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_format.c
  5. <Compn> but that file wont help you much as it calls other code
  6. <lozarythmic> Thanks Compn - it's GMT here so almost lunchtime :)
  7. <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
  8. <lozarythmic> Compn: here's an extract from coworkers script: -pix_fmt yuv422p $outdir/$framefile.%9d.Y
  9. <Compn> yuv422p is a standard pix fmt with color :P
  10. <Compn> lozarythmic : well then try comparing his old script to ffmpeg gray output and see if its the same
  11. <Compn> lozarythmic : but since this is a user question ... you might want to try asking in #ffmpeg
  12. <Compn> this channel is for development of ffmpeg code not 3rd party scripts and such
  13. <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