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
alexherbo2 has quit [Remote host closed the connection]
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ffmpeg
realies4 has joined #ffmpeg
realies has quit [Ping timeout: 252 seconds]
realies4 is now known as realies
Unit640 has quit [Quit: Leaving]
realies has quit [Ping timeout: 272 seconds]
<StephenLynx>
ok, so. I did manage to scale a gif with libffmpeg. but it doesn't loop and a buffer size doesn't match.
<StephenLynx>
i did base myself off the scale example
<StephenLynx>
but I had to end up adding all the stuff related to output context.
<StephenLynx>
so I could get a frame.
koi has joined #ffmpeg
<StephenLynx>
i did think I manage to get it to convert fully with just 2 arrays, but the gif came out broken.
bibble has quit [Quit: bibberly bobberly]
realies has joined #ffmpeg
bibble has joined #ffmpeg
<StephenLynx>
if I use the scaling methods with buffers directly, it produces a mangled result that doesn'twork at all.
<StephenLynx>
if I use the frames and packets, it comes out a bit glitchy without loop.
realies9 has joined #ffmpeg
realies has quit [Ping timeout: 248 seconds]
<StephenLynx>
https://pastebin.com/WN5Aqvwn if anyone wants to read it. the part that the sizes are not matching is 200
realies9 has quit [Client Quit]
realies has joined #ffmpeg
mven97 has quit [Quit: Goodbye.]
realies8 has joined #ffmpeg
realies has quit [Ping timeout: 246 seconds]
realies8 is now known as realies
mven97 has joined #ffmpeg
emmanuelux has quit [Quit: au revoir]
realies4 has joined #ffmpeg
realies has quit [Ping timeout: 252 seconds]
realies has joined #ffmpeg
realies4 has quit [Ping timeout: 244 seconds]
HarshK23 has joined #ffmpeg
System_Error has quit [Ping timeout: 260 seconds]
System_Error has joined #ffmpeg
ewomer has joined #ffmpeg
<StephenLynx>
ok, how would I got to set the loop option? I'm using av_opt_set_int(outputFormatContext,"loop", 0, AV_OPT_ALLOW_NULL); but it returns AVERROR_OPTION_NOT_FOUND
realies has quit [Ping timeout: 244 seconds]
<StephenLynx>
i seem to have been able to set the option, but it doesn't get written.
<StephenLynx>
i tried using av_write_trailer
<StephenLynx>
but it requires to write the header. which requires me to put a stream in it. which requires the stream to be a gif stream. but even then it just fails to write the trailer.
deostroll has quit [Quit: Connection closed for inactivity]
nrg has joined #ffmpeg
realies has joined #ffmpeg
Juesto has joined #ffmpeg
Juest has quit [Ping timeout: 265 seconds]
Juesto is now known as Juest
Suchiman has joined #ffmpeg
luc4 has quit [Quit: Konversation terminated!]
emanuele6 is now known as batnuele6
alexherbo2 has joined #ffmpeg
moviuro has joined #ffmpeg
realies has quit [Ping timeout: 276 seconds]
lullerhaus has quit []
lullerhaus has joined #ffmpeg
sm1999 has joined #ffmpeg
<noobaroo>
Okay so when i use ffmpeg to download a m3u8 live stream and the connection is slow, either on their end or mine, how can i make it so that when it skips, the timestamps don't manually count in realtime until video resumes ?
StephenLynx has joined #ffmpeg
Haxxa has quit [Ping timeout: 272 seconds]
Haxxa has joined #ffmpeg
minimal has joined #ffmpeg
MisterMinister has joined #ffmpeg
microchip_ has quit [Quit: There is no spoon!]
rsx has quit [Quit: rsx]
manwithluck has quit [Remote host closed the connection]
manwithluck has joined #ffmpeg
microchip_ has joined #ffmpeg
lucasta has joined #ffmpeg
Rena has quit [Quit: $WITTY_QUIT_MESSAGE]
Rena has joined #ffmpeg
lavaball has quit [Remote host closed the connection]
bitbinge has quit [Remote host closed the connection]
bitbinge has joined #ffmpeg
<StephenLynx>
any tips on setting options? I need to set the loop option on a gif output stream. for libffmpeg.
cmc has quit [Remote host closed the connection]
cmc has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]
billchenchina- has joined #ffmpeg
lucasta has quit [Remote host closed the connection]
ewomer has joined #ffmpeg
Mister_D has joined #ffmpeg
MisterMinister has quit [Ping timeout: 260 seconds]
cmc has quit [Remote host closed the connection]
cmc has joined #ffmpeg
alexherbo2 has quit [Remote host closed the connection]
coldfeet has quit [Remote host closed the connection]
lavaball has joined #ffmpeg
alexherbo2 has joined #ffmpeg
lec_thege8042726 has quit [Remote host closed the connection]
<BtbN>
libffmpeg is not a thing outside of google-patched stuff
<BtbN>
And I think -loop is a ffmpeg.c thing, not at the library level
<BtbN>
Just loop yourself if you're interacting with the API
kyzer has joined #ffmpeg
Traneptora has quit [Quit: Quit]
<StephenLynx>
BtbN, there is a way to make gifs loop using the library. the binary can do it.
<StephenLynx>
so I should be able to do it.
<StephenLynx>
and I NEED to make the file loop.
<StephenLynx>
even if I don't use the options, I need the info to be written in the binary.
<DeHackEd>
av_dict_set(&avdictionaryptr, "loop", "0"); and then pass that when calling avformat_write_header when making the gif
<DeHackEd>
correction, there is another parameter to av_dict_set
<StephenLynx>
right, but what do I pass? The avformatcontext? the AVCodecContext? the outputformat on the avformatcontext?
sm1999 has quit [Quit: WeeChat 4.5.0-dev]
<DeHackEd>
in avformat_write_header
<StephenLynx>
no to which function. but what of the pieces I have around. AVFormatContext can be passed to it, but doesn't fit av_dict_set.
<StephenLynx>
i get a cannot convert ‘AVFormatContext*’ to ‘AVDictionary**’ when trying to compile.
<StephenLynx>
oh wait
<StephenLynx>
there is a second argument to write header that takes the dictionary.
<StephenLynx>
ok, I see it now.
minimal has quit [Quit: Leaving]
<StephenLynx>
still not looping.
Traneptora has joined #ffmpeg
<ePirat>
StephenLynx, can you share a code snippet of what you are doing?
<Vortico>
Hi, is there a filter that auto-levels each frame's brightness, contrast, or gamma? The `normalize` filter only looks at the min/max values, not average values.
<StephenLynx>
i tried using avio_open but it didn't change anything
x_x has quit [Remote host closed the connection]
cmc has quit [Read error: Connection reset by peer]
x_x has joined #ffmpeg
<ePirat>
StephenLynx, the error check on av_dict_set is wrong
<ePirat>
it wont tell you about unrecognized options
<StephenLynx>
yeah, that was for something else.
<StephenLynx>
it should be innocuous.
<ePirat>
for that you need to iterate over the opts after you called avformat_write_header()
<StephenLynx>
i wasn't getting an error.
<ePirat>
also you set loop to 0
<StephenLynx>
infinite loop, right?
<ePirat>
no
<StephenLynx>
let me try something else.
<ePirat>
oh wait yes
<ePirat>
its the gif muxer so yeah 0 should be infinite loop
<ePirat>
can you iterate over the dict after calling avformat_write_header so you see if it applied the option at all?
<ePirat>
StephenLynx, whatever you are using is old then :D
<StephenLynx>
4.3 IIRC.
<ePirat>
that is ancient
<StephenLynx>
4.2 actually.
<StephenLynx>
yeah, I added some stuff that used the library years ago, but then it seemed it was deprecated on newer versions and changing anything seemed like the biggest chore of my life, which everything with this lib seems to be, so I just kept using the old version.
<StephenLynx>
ok, I can confirm the dictionary is being set.
<StephenLynx>
how do I confirm that is being written to the output now?
<StephenLynx>
the part that writes the header is not failing.
<StephenLynx>
now, another thing. how do I know this "loop" option actually works in this context?
<ePirat>
what do you mean "in this context"?
<StephenLynx>
I looked around the code and it seems there is SOMETHING that inherits from gif that if "loop" exists, then it adds the data.
<StephenLynx>
but I checked every single variable I had around and none seemed to be the same class.
<StephenLynx>
and I checked after getting the codec right for gic.
<StephenLynx>
gif
Tano has quit [Quit: WeeChat 4.3.4]
<StephenLynx>
so it seems that even if the codec is gif, it doesn't inherit from the thing I see on libavformat/gif.c
<StephenLynx>
so I'm starting to think this "loop" is only used if you are going through the filter engine.
<StephenLynx>
specially since I could not set "loop" through options. it would either segfault or tell me the option didn't exist./
<StephenLynx>
AVOutputFormat ff_gif_muxer this thing
<ePirat>
if you iterate over the dict after calling avformat_write_header and it does not contain the option, it means it was used.
<StephenLynx>
ok, let me check that.
<StephenLynx>
segfault
<StephenLynx>
so probably it was used.
<ePirat>
sounds like your code is wrong if it segfaults :D
<ePirat>
Like the doc states: "On return this parameter will be destroyed and replaced with a dict containing options that were not found."
<StephenLynx>
yeah,I think it's right. im not iterating, just forcing it to get "loop".
<ePirat>
how do you "force it to get loop"?
<StephenLynx>
av_dict_get(opts, "loop", NULL, 0);
<StephenLynx>
then try to print value from the return.
<StephenLynx>
it segfaults because there is nothing returned, it was used.
<StephenLynx>
so it is just throwing "loop" on the output context
<StephenLynx>
but is not using it was the gif muxer would.
<ePirat>
> av_dict_get(opts, "loop", NULL, 0);
<ePirat>
that should not segfault
<StephenLynx>
if all options were used
<StephenLynx>
wouldn't it?
<ePirat>
no
<StephenLynx>
now, THAT is not segfaulting
<StephenLynx>
printing the value of the return is.
<StephenLynx>
it works fine if I do it before writing the header.
<ePirat>
well you gotta check if it returns NULL of course
<StephenLynx>
yeah, im not doing that.
<StephenLynx>
see
<StephenLynx>
it returns null.
<StephenLynx>
so, anyway. it is writing "loop" but that is not the whole thing.
<ePirat>
if its applying correctly you probably want to dig into the gif muxer why its not used
<StephenLynx>
yes.
<StephenLynx>
the question is, am I even getting a gif muxxer? i looked around avclass values
<StephenLynx>
none said it was the gif muxxer.
<StephenLynx>
which is why I could not set "loop" as an option.
<StephenLynx>
because it failed the validation.
<StephenLynx>
i can forcefully write as a dictionary, but that doesn't mean anything.
<ePirat>
oh well you never ask for the gif muxer specifically so it will use the output file name, which is not in your code but passed as argument to your program
<ePirat>
of course if that does not end in .gif it likely wont use the gif muxer
darkapex has quit [Remote host closed the connection]
darkapex has joined #ffmpeg
<StephenLynx>
i am passing a .gif extension as the output.
<StephenLynx>
and using that to guess the codec and everything else.
<StephenLynx>
is there something else to get a muxer?
<ePirat>
if you want to be sure just pass "gif" as format_name to avformat_alloc_output_context2
<StephenLynx>
no change.
<StephenLynx>
im almost just replicating that piece of code from gif.c
<ePirat>
actually…
<ePirat>
you are writing just directly to the file, that can not work. you need to have the muxer to the writing of course
<StephenLynx>
yeah.
<StephenLynx>
i was noticing this.
<StephenLynx>
the oformat seems to be the muxer.
<StephenLynx>
but I remember when I tried setting the loop option on it, I got a segfault.
<StephenLynx>
printf("%s\n", outputFormatContext->oformat->long_name); gives me the long_name I see on gif.c
<StephenLynx>
.long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
alexherbo2 has quit [Remote host closed the connection]
nobiz has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]
jkhsjdhjs has quit [Ping timeout: 244 seconds]
<StephenLynx>
now I get a segfault when I try to open the codec with the dictionary.
<StephenLynx>
changed avcodec_alloc_context3(outputFormatContext->video_codec); to avcodec_open2(encoderContext, outputFormatContext->video_codec, NULL); so I could use the dictionary
<StephenLynx>
segfault.
<StephenLynx>
wonder if I need both.
ewomer has joined #ffmpeg
duskmoss has quit [Remote host closed the connection]
<StephenLynx>
added both, still not using the loops.
<StephenLynx>
still not writing the trailer, by the way.
<StephenLynx>
can't get that thing to work.
<BtbN>
Just randomly guessing is a sure way to disaster with C
<ePirat>
yeah
<BtbN>
look at the docs, headers and if in doubt the code itself, and figure out how to do stuff correctly
<ePirat>
you really instead should take one of the examples and adapt to your needs if you dont want to figure out how the API works
<StephenLynx>
im trying to take the examples.
duskmoss has joined #ffmpeg
<StephenLynx>
but there's 2 things that are huge roadblocks. 1: there are a thousand ways to go about anything. 2: context is very sparse.
<BtbN>
There's rarely more than one or two ways
<StephenLynx>
one of the examples dont even use packets, they just rawdog buffers.
billchenchina- has quit [Remote host closed the connection]
rv1sr has quit []
dionisis has quit [Remote host closed the connection]
duskmoss has quit [Remote host closed the connection]
jkhsjdhjs has joined #ffmpeg
ZLima12 has quit []
nobiz has joined #ffmpeg
duskmoss has joined #ffmpeg
ZLima12 has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]
ewomer has joined #ffmpeg
ewomer has quit [Client Quit]
ghodawalaaman has quit [Read error: Connection reset by peer]
ghodawalaaman has joined #ffmpeg
mikehu44 has quit [Ping timeout: 264 seconds]
Vonter has quit [Ping timeout: 246 seconds]
murb has quit [Quit: zzz]
murb has joined #ffmpeg
five6184803391 has quit [Remote host closed the connection]
five6184803391 has joined #ffmpeg
ewomer has joined #ffmpeg
mven973 has joined #ffmpeg
mven97 has quit [Ping timeout: 245 seconds]
mven973 is now known as mven97
echelon has quit [Ping timeout: 260 seconds]
lavaball has quit [Remote host closed the connection]
echelon has joined #ffmpeg
Juest has quit [Ping timeout: 260 seconds]
Juesto has joined #ffmpeg
Juesto is now known as Juest
System_Error has quit [Remote host closed the connection]
Juesto has joined #ffmpeg
Juest has quit [Ping timeout: 265 seconds]
Juesto is now known as Juest
System_Error has joined #ffmpeg
SuicideShow has quit [Ping timeout: 265 seconds]
SuicideShow has joined #ffmpeg
<StephenLynx>
ok, so according to https://ffmpeg.org/doxygen/2.1/group__opt__set__funcs.html#details when you use these functions, the first parameter is a pointer to something which first element is a pointer to AVClass. When I look at the headers, I see AVFormatContext fits that. but the class it uses is AVFormatContext.
<StephenLynx>
so I can't set the loop option, because that is from the gif_muxer_class which uses the name GIF muxer.
<StephenLynx>
so I try the oformat. and that one do uses the gif muxer class as the priv_class.
<StephenLynx>
but if I try to use av_opt_set_int function on it, I get a segfault.
five6184803391 has quit [Remote host closed the connection]
five6184803391 has joined #ffmpeg
minimal has joined #ffmpeg
Tano has joined #ffmpeg
MisterMinister has joined #ffmpeg
lec_thege8042726 has joined #ffmpeg
ewomer has quit [Ping timeout: 272 seconds]
Mister_D has quit [Ping timeout: 265 seconds]
<Marth64[m]>
StephenLynx: Thats a really old doxygen page
ewomer has joined #ffmpeg
<StephenLynx>
hey. any tips on how to get a gif encoder to accept the loop value and write it? haven't had much luck, but at least I found where is the gif muxer.