#FFmpeg basic, demuxing a video frame by frame

1 messages · Page 1 of 1 (latest)

analog spire
#

I let ChatGPT write my first ever FFmpeg code and I can't understand all its parts (if they're really needed or something is missing).
In particular it started as a single chunk of code inside main, then I put it aside in init and a next_frame but it looks ugly especially next_frame with that double error handling. Why not all requested "frames" are proper frames, what are they? Are audio files and metadata interleaved?
Also there where 2 functions (one in init, one in next_frame) to convert YUV to RGB which I removed, and already did some stuff with YUV totally fine, but now I noticed that sws_getContext() is called with AV_PIX_FMT_RGB24... Shouldn't this have resulted in some mismatching?

royal swanBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

copper dew
#

Waaawaeaa

#

Hi

#

hm that's a lot of code

#

It's 3 kb

analog spire
#

I know, it looked like a bit too much

tender flame
#

you asked a guessing machine to write correct code, now complain to us it guessed wrongly.. sigh

analog spire
#

I'm not complaining, I just asked cause maybe there's some cleaner common practice for a such (I assume) basic task