1
votes

I have integrated a custom decoder on FFMPEG framework. The output of this decoder is YUV420 frames, which if required i can convert it to RGB24 frames.

These frames are generated in one of my custom functions. So in order to render these frames on FFPLAY window what has to be done? Is there any specific syntax or procedure to follow?

I'm really new to FFPLAY and have searched enough over this topic on net, but have not got anything related to this issue. If anyone can provide any answers or suggestions regarding this, it will be of great help to me.

Thanks in advance.

--Regards

1
Are you trying to play a file or piped input? If a file please provide a short sample. Are you using the ffplay cli-tool or are you using programatically?llogan
If you have written a new decoder for FFmpeg that outputs YUV 4:2:0 natively, then FFplay should just be able to play the video without any modification. Are you sure you are communicating the colorspace from your decoder to the core engine?Multimedia Mike
@MultimediaMike: Thanks for the reply. I was waiting for a reply like this. Yes i in my native code i.e. C-code, I'm able to generate a YUV 420 frame. However as i have told you i'm really new to this ffplay thing, I have now idea regarding : How to communicate the colorspace from my decoder to the core engine. Any document or any article that can give me an idea regarding this please post it as a reply here and i shall accept it. --Waiting for your reply.Zax

1 Answers

1
votes

I'm a bit rusty on hacking codecs for FFmpeg, but I just checked out the latest git source and I'm assuming that you are working from the same copy. I am further assuming that you inserted your decoder alongside the rest of the codecs in the libavcodec/ directory and that when you build the program and run ffmpeg -formats, you see your new decoder mentioned.

If this is all true, then I will assume that your decoder module exports an init() function which expects to receive a pointer to a AVCodecContext function. This data structure has a member named pix_fmt and this should be set to AV_PIX_FMT_YUV420P in your decoder's case in order to indicate planar YUV 4:2:0.

If this doesn't work, try using the ffmpeg tool to decode the file to the null target, just to test that your decoder is doing something:

ffmpeg -i yourfile.ext -f null /dev/null

Amend your question with the output from this command to give us further clues.