BtbN changed the topic of #ffmpeg to: Welcome to the FFmpeg USER support channel | Development channel: #ffmpeg-devel | Bug reports: https://ffmpeg.org/bugreports.html | Wiki: https://trac.ffmpeg.org/ | This channel is publically logged | FFmpeg 7.0 is released
iive has quit [Quit: They came for me...]
duskmoss has quit [Remote host closed the connection]
duskmoss has joined #ffmpeg
duskmoss has quit [Remote host closed the connection]
<teletypo>
Hi all! I would love to get some help converting a h264 mp4 video file to single jpeg frames. I'm wondering why https://ibb.co/6nsmLjx yields messed-up rgb frames. I'm using line 164 to get a QImage and then just save() it to a jpeg. Line 151 says "frame format is 0", which maps to AV_PIX_FMT_YUV420P. What am I missing?
teletypo has quit [Ping timeout: 265 seconds]
teletypo has joined #ffmpeg
<teletypo>
oops, sorry, got disconnected.
<StephenLynx>
dont worry, no one replied.
<StephenLynx>
i looked up the code but I barely understand the lib myself.
<StephenLynx>
i can share you something that does what you seem to be trying.
<StephenLynx>
but I don't know exactly what your issue is.
<StephenLynx>
the way you read frames seems to be different from what I've seen, but I've seen enough from this lib to believe it could be valid.
<StephenLynx>
like ignoring when it's a EAGAIN code
<StephenLynx>
and just trying the next frame.
<StephenLynx>
Marth64, what are the "graph" features?
<teletypo>
StephenLynx, I'm guessing I have some issue with stride/layers. Because I don't truly understand them. If you paste some samplecode I'll try it.
<StephenLynx>
i saw that on the command line code but didn't quite understand it.
<StephenLynx>
this code makes 10 thumbnails from the video.
<StephenLynx>
it hardcodes jpeg, but I learned how to guess the format from a filename, if you want that too.
<Marth64>
when you are filtering, particularly when working with multiple filters, ffmpeg api gives you flexibility to chain filters together and apply independent filtering chains per stream
<StephenLynx>
right. and what exactly is a filter? I just want to reduce the dimensions.
<Marth64>
the filter graph is the path which your stream is taking through the filtering engine,
<StephenLynx>
didnt see anything related to that on the scale and remux examples.
<Marth64>
a filter is a module living inside libavfilter. "scale" is one such filter
<Marth64>
and that example is using the scale filter
<StephenLynx>
I see.
<StephenLynx>
is there some kind of literature that explains ffmpeg internal logic and nomenclature? not the API, just the concepts?
<Marth64>
yes
<StephenLynx>
some stuff seems to touch like 4 or 5 different things. you have the codec, the format, contexts, frames, packets
<Marth64>
you must also understand the basic structure of AV content. there is a "format" like avi,mp4,mkv,gif,or network stream, etc. Each format contains streams which are bitstreams of data compressed(usually) by the codec
<Marth64>
a packet is a block of data when reading the format
<Marth64>
a frame is what you get after putting packets together and the decoder makes sense of them
<Marth64>
for example a video frame, a subtitle cue, or clump of audio samples
<StephenLynx>
i see.
<Marth64>
parsing and decoding these things is tricky so context structures are used commonly to hold stateful data needed for the task
<Marth64>
but to the user, AV* apis abstract all this away
<Marth64>
while leaving you some context and flexibility
<StephenLynx>
naturally.
<Marth64>
yes
<teletypo>
StephenLynx, thanks; that's a lot of code. I was hoping to get a clue on what might be wron gwith the sws_getcontext or sws_scale calls. It must be in one of the two I think.
<StephenLynx>
yeah. most stuff with libffmpeg is a lot of code.
minimal has quit [Quit: Leaving]
<Marth64>
it does not have to be
<StephenLynx>
specially conversions from what i've seen.
<StephenLynx>
and specially if you are not making 1:1 conversions. like, changing a video from one format to another seems to be relatively simple.
<StephenLynx>
but complexity seems to scale fairly quickly with what you are changing.
<Marth64>
there are is a dedicated scale example as well as the filtering one from above
<StephenLynx>
yeah, I had read the scaling one and was going to try that approach.
<Marth64>
you can scale with libswscale part of ffmpeg or use filter
<StephenLynx>
I was trying to transfer frame by frame
<StephenLynx>
i got to a point where the size of allocated arrays werent matching.
<StephenLynx>
i tried the remuxing approach but failed.
<Marth64>
are you getting a segfault or something?
<StephenLynx>
nah.
<StephenLynx>
the sizes are not matching.
<StephenLynx>
sec
<StephenLynx>
so this av_image_get_buffer_size(encoderContext->pix_fmt, encoderContext->width, encoderContext->height, 1);gives me the size a buffer should be.
<StephenLynx>
av_image_fill_arrays(outputFrame->data, outputFrame->linesize, outputFrameBuffer, encoderContext->pix_fmt, encoderContext->width, encoderContext->height, 1) ; this fills the buffer and return the size allocated
<StephenLynx>
the code I based myself originally checked if these were the same and failed if they weren't.
<StephenLynx>
and they are not matching.
<StephenLynx>
but anyway, this approach doesn't seem to be the best for this case.
<Marth64>
i would try the filter, probably easier for this honestly
<StephenLynx>
yeah.
<StephenLynx>
will have a look at it too.
<StephenLynx>
but I'm making progress, managed to write my own thumbnailing code based on what I found from that one I pasted.
<Marth64>
this way later if you need to try other scaling filters or maybe hardware accel you have options
<StephenLynx>
and put it into a node's native addon, which is my final goal.
<StephenLynx>
to use libffmpeg to avoid forks by executing ffmpeg.
<Marth64>
do you have a performance need to avoid forks?
<StephenLynx>
yes.
<StephenLynx>
a severe one.
<Marth64>
understandable
<StephenLynx>
linux reserves memory equal to the process creating the fork.
lavaball has quit [Remote host closed the connection]
<StephenLynx>
a user of my software was having frequent OOMs due to this behavior.
<Marth64>
yes was just trying to realize if this is an "at scale" use case or a small project
<StephenLynx>
after I moved execs to native calls, it stopped.
<StephenLynx>
i was able to move captcha generation, image dimensions reading, image thumbnailing (these use imagemagik) and video dimension reading (with ffmpeg) but I didn't had the drive to implement the other ffmpeg uses.
<StephenLynx>
and a few years laters I decided to give it another shot.
<StephenLynx>
i have 3 uses for ffmpeg, video to image thumbnailing, done. gif to gif redimensioning, doing, and audio file thumbnail extraction, not started yet.
MisterMinister has joined #ffmpeg
<Marth64>
best of luck
<MisterMinister>
Any advise on having Webkit or Chromium render HTML page and output as video to FFmpeg??
emmanuelux has quit [Quit: au revoir]
<bpmedley>
MisterMinister: Are you wanting to do screen recording?
<bpmedley>
Or are you wanting to do headless rendering of html and make a recording of that?
<MisterMinister>
headless, similar to what Gstreqamer has with wpesrc
<bpmedley>
Have you seen that Chrome has a --headless mode and multiple ways of interacting with?
Guest1029 has quit [Killed (silver.libera.chat (Nickname regained by services))]
JanC_ has joined #ffmpeg
JanC has quit [Killed (erbium.libera.chat (Nickname regained by services))]
JanC_ is now known as JanC
JanC_ has joined #ffmpeg
JanC has quit [Ping timeout: 260 seconds]
JanC has joined #ffmpeg
Suchiman has quit [Quit: Connection closed for inactivity]
JanC_ has quit [Ping timeout: 265 seconds]
JanC has quit [Ping timeout: 252 seconds]
JanC has joined #ffmpeg
emanuele6 has quit [Ping timeout: 245 seconds]
emanuele6 has joined #ffmpeg
MisterMinister has quit [Ping timeout: 248 seconds]
Traneptora has joined #ffmpeg
StephenLynx has quit [Quit: Leaving]
RedShift has joined #ffmpeg
bitbinge has quit [Remote host closed the connection]
bitbinge has joined #ffmpeg
nrg has quit [Ping timeout: 265 seconds]
Copy_of_nrg has joined #ffmpeg
Copy_of_nrg is now known as nrg
ewomer has joined #ffmpeg
JanC_ has joined #ffmpeg
JanC is now known as Guest7191
Guest7191 has quit [Killed (molybdenum.libera.chat (Nickname regained by services))]
JanC_ is now known as JanC
JanC has joined #ffmpeg
JanC has quit [Killed (tantalum.libera.chat (Nickname regained by services))]
JanC_ has joined #ffmpeg
JanC is now known as Guest9364
JanC_ is now known as JanC
Guest9364 has quit [Ping timeout: 252 seconds]
rvalue- has joined #ffmpeg
rvalue has quit [Ping timeout: 265 seconds]
rvalue- is now known as rvalue
rv1sr has joined #ffmpeg
acidbunny has joined #ffmpeg
JanC_ has joined #ffmpeg
JanC has quit [Ping timeout: 252 seconds]
JanC_ is now known as JanC
Sakura`Kinomoto has quit [Ping timeout: 244 seconds]
SakuraChan has joined #ffmpeg
JanC has quit [Ping timeout: 272 seconds]
JanC has joined #ffmpeg
JanC_ has joined #ffmpeg
JanC is now known as Guest781
Guest781 has quit [Killed (calcium.libera.chat (Nickname regained by services))]
JanC_ is now known as JanC
JanC has joined #ffmpeg
JanC has quit [Killed (tantalum.libera.chat (Nickname regained by services))]
makidoll has quit [Remote host closed the connection]
makidoll has joined #ffmpeg
thelounge226 has joined #ffmpeg
microlappy has joined #ffmpeg
makidoll has quit [Remote host closed the connection]
thelounge226 has quit [Client Quit]
thelounge227 has joined #ffmpeg
microlappy has quit [Client Quit]
thelounge227 is now known as makidoll
makidoll has quit [Client Quit]
makidoll has joined #ffmpeg
delthas has quit [Ping timeout: 260 seconds]
delthas_ has joined #ffmpeg
Suchiman has joined #ffmpeg
luser1 has quit [Quit: Ping timeout (120 seconds)]
luser1 has joined #ffmpeg
lavaball has joined #ffmpeg
Blacker47 has joined #ffmpeg
tokyovigilante_ has joined #ffmpeg
tokyovigilante has quit [Ping timeout: 260 seconds]
tokyovigilante_ is now known as tokyovigilante
Vonter has quit [Quit: WeeChat 4.4.2]
Vonter has joined #ffmpeg
x_x has joined #ffmpeg
makidoll has quit [Quit: makidoll]
makidoll has joined #ffmpeg
emanuele6 has quit [Ping timeout: 252 seconds]
emanuele6 has joined #ffmpeg
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ffmpeg
Kei_N_ has joined #ffmpeg
Kei_N has quit [Read error: Connection reset by peer]
<noobaroo>
Um, i remuxed (i think is the term), twice, first into .mkv and then into .avi, and the mkv is 822 MB and the .avi is 1 GB. When i use mediainfo, for audio it says "Alignment: Aligned on interleaves" i know what A V I stands for but does this mean something special that other containers dont do?
coldfeet has joined #ffmpeg
lavaball has quit [Remote host closed the connection]
Tano has joined #ffmpeg
relue has joined #ffmpeg
luc4 has joined #ffmpeg
coldfeet has quit [Remote host closed the connection]
j45 has quit [Ping timeout: 260 seconds]
j45 has joined #ffmpeg
Sketch has quit [Ping timeout: 265 seconds]
Sketch has joined #ffmpeg
sm1999 has joined #ffmpeg
<kmikita>
noobaroo, what streams are contained? AVI don't produce so much overhead otherwise some trouble exist. The alignment type is not the cause. Are AVI still playable?
x_x has quit [Ping timeout: 260 seconds]
<noobaroo>
kmikita: Yes it seems fine. Um, it's from two files, one that i re-encoded the video only, and one is the original with both tracks. I used -map 0:0 -map 1:1 and stream copy both to get video from the one and audio from the other. i used the same command and just changed the extension to .avi instead of .mkv
<kmikita>
noobaroo, what codec are used in streams?
<noobaroo>
rav1e and aac
<furq>
i'm surprised that even works
<noobaroo>
Yeah me too, i was looking at the Wikipedia page that has a chart of all the containers and i saw it supports both hevc and aac, so i decided to try it. I never use .avi really
x_x has joined #ffmpeg
<kmikita>
noobaroo: I think, AVI has issue with interleaving rav1e, and maybe aac too.
<kmikita>
AVI good for mpeg4+ac3/mp3 and similar
<noobaroo>
That's weird, the video plays fine and seeks normally
<noobaroo>
i would the error would be more verbose
<noobaroo>
would think
<kmikita>
noobaroo, it plays because software well done
<furq>
i vaguely remember avi requires some hack to support formats with bframes that takes extra space
<furq>
i guess it's something to do with that
<kmikita>
AVI couldn't pack b-frames natively
<kmikita>
not to mention the bells and whistles of modern encoders
<kmikita>
furq, agree
<furq>
packed bitstream that's it
<furq>
the suppressed memories are flooding back
<kmikita>
AVI index also have 2Gb issue limit with OpenDML tricks
lec_thege8042726 has joined #ffmpeg
lec_thege8042726 has quit [Client Quit]
luc4 has quit [Quit: Konversation terminated!]
lec_thege8042726 has joined #ffmpeg
MisterMinister has joined #ffmpeg
luc4 has joined #ffmpeg
Sketch has quit [Ping timeout: 260 seconds]
Sketch has joined #ffmpeg
rv1sr has quit []
EmleyMoor has quit [Ping timeout: 252 seconds]
EmleyMoor has joined #ffmpeg
rv1sr has joined #ffmpeg
<Marth64>
run from avi...run for the hills
<nemo_magneet>
lolz
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
Sketch has quit [Ping timeout: 260 seconds]
minimal has joined #ffmpeg
HarshK23 has quit [Quit: Connection closed for inactivity]
Sketch has joined #ffmpeg
lavaball has joined #ffmpeg
Marth64 has quit [Quit: Leaving]
Marth64 has joined #ffmpeg
coldfeet has joined #ffmpeg
StephenLynx has joined #ffmpeg
luc4 has quit [Quit: Konversation terminated!]
lucasta has joined #ffmpeg
teletypo has quit [Quit: Leaving]
Sketch has quit [Ping timeout: 265 seconds]
Hazza has joined #ffmpeg
Haxxa has quit [Ping timeout: 265 seconds]
billchenchina- has joined #ffmpeg
RedShift has quit [Quit: Client closed]
<MisterMinister>
Greetings! Any advice on streaming alpha channel over rtp/udp/tcp? Need to get alpha channel stream into FFmpeg from a Gstreamer...
Sketch has joined #ffmpeg
Juesto has joined #ffmpeg
Juest has quit [Ping timeout: 252 seconds]
Juesto is now known as Juest
relue has quit [Ping timeout: 252 seconds]
lucasta has quit [Remote host closed the connection]
billchenchina- has quit [Remote host closed the connection]
iconoclasthero has quit [Ping timeout: 272 seconds]
HarshK23 has joined #ffmpeg
coldfeet has quit [Remote host closed the connection]
Unit640 has joined #ffmpeg
travisghansen has quit [Ping timeout: 260 seconds]
Dagger has quit [Ping timeout: 272 seconds]
Dagger has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]