Dump frame data to the disk

34 views
Skip to first unread message

Ura Sigal

unread,
Oct 22, 2020, 9:12:42 AM10/22/20
to jav...@googlegroups.com
Hello.
I'm using bytedeco ffmpeg bindings to decode h264 inputs - here is the code:
......
while (av_read_frame(fmt_ctx, pkt) >= 0) {
  if (pkt.stream_index() == v_stream_idx) {
     ret1 = avcodec_send_packet(codec_ctx, pkt);
     ret2 = avcodec_receive_frame(codec_ctx, frm); 
        if (ret2 >= 0 && ret1 >=0){
                    long time  = frm.pts();
.......
What I need is to write the decoded frame - 'frm' to a disk as YUV.
Any suggestions are welcome.

Samuel Audet

unread,
Oct 22, 2020, 10:13:41 AM10/22/20
to jav...@googlegroups.com, Ura Sigal
Using FFmpegFrameGrabber would be easier than using FFmpeg directly.

Samuel Audet

unread,
Oct 24, 2020, 8:13:06 PM10/24/20
to Ura Sigal, javacv
It looks like we can use the ffmpeg program to get that:
https://medium.com/@jina.liu/a-practical-guide-for-vmaf-481b4d420d9c

From Java, we can run the ffmpeg program this way:
http://bytedeco.org/javacpp-presets/ffmpeg/apidocs/org/bytedeco/ffmpeg/ffmpeg.html

On 10/23/20 11:09 PM, Ura Sigal wrote:
> Hello, I did eventually manage to get YUV of a particular frame and write
> it to disk.
> I'm looking for any code examples showing how to calculate VMAF of
> particular pair of frames (YUVs) (something like QualitySSIM.compute(..)) ?
> Thank you.
Reply all
Reply to author
Forward
0 new messages