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
x_x has quit [Ping timeout: 260 seconds]
EmleyMoor has joined #ffmpeg
<ePirat> StephenLynx, I had already told you to pass the options to avformat_write_header()
<StephenLynx> that didn't work.
<ePirat> well your issues lies elsewhere
<StephenLynx> also, i read the source code, the loop is checked on tail.
<StephenLynx> trailer*. and I didn't manage to get the trailer to write.
<ePirat> yes, like I said your issues evidently lies elsewhere, not with passing the options
<StephenLynx> maybe the header sets the options first and then they get written when writing the trailer?
YuGiOhJCJ has joined #ffmpeg
<ePirat> avformat_write_header initialized the muxer so thats where the options need to be given
<StephenLynx> I see.
EmleyMoor has quit [Ping timeout: 276 seconds]
<StephenLynx> now, what about streams? when you use write header, it requires a stream to be there.
<StephenLynx> but at the same time, I manage to remux the whole image without streams.
<ePirat> yeah you need create a new stream with avformat_new_stream, set the codec parameters with avcodec_parameters_copy before you call the write_header function
<ePirat> and avio_open(&out_avfctx->pb, filepath, AVIO_FLAG_WRITE); before the write header too of course, else there is nowhere to write
iconoclasthero has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<StephenLynx> I see.
iconoclasthero has joined #ffmpeg
johnjaye has joined #ffmpeg
<johnjaye> Would I be correct in assuming ffmpeg has no way to "just" combine arbitrary audio files?
<johnjaye> I can convert both files to mp3 and use the concat filter. But I can't just feed 2 arbitrary audio files in and combine them
<furq> the concat filter does exactly that
EmleyMoor has joined #ffmpeg
<furq> you might need to change sample rate, channel count etc but you can do that in the same filterchain
EmleyMoor has quit [Ping timeout: 252 seconds]
<StephenLynx> ePirat, im getting "Invalid argument" when I try to write the trailer. I wonder if it's rejecting the loop value.
<StephenLynx> hm, no. I sent null instead of the dictionary and I get the same issue.
<StephenLynx> i think the issue is here if (!gif->prev_pkt)
<StephenLynx> it's the only case it returns EINVAL
five6184803391 has quit [Remote host closed the connection]
five6184803391 has joined #ffmpeg
EmleyMoor has joined #ffmpeg
Pixi has quit [Quit: Leaving]
<StephenLynx> alright. I had to use av_interleaved_write_frame instead of directly writing the data.
<StephenLynx> the gif now is a bit glitchy tho, it spits some warnings and is too fast.
<StephenLynx> >Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
<StephenLynx> but I made progress and got some more insight.
<StephenLynx> heaven knows I need insight for this.
EmleyMoor has quit [Ping timeout: 252 seconds]
<StephenLynx> alright ,I set some stuff on the package and now it works. the checksum is not the same as the one ffmpeg produces, but the size is idental.
<StephenLynx> identical.
<StephenLynx> so yeah, go me. took me a week and some raging but I cracked it.
kasper93_ has joined #ffmpeg
kasper93 has quit [Ping timeout: 265 seconds]
minimal has quit [Quit: Leaving]
rex_victor has joined #ffmpeg
rex has quit [Read error: Connection reset by peer]
five6184803391 has quit [Remote host closed the connection]
five6184803391 has joined #ffmpeg
kasper93_ is now known as kasper93
Suchiman has quit [Quit: Connection closed for inactivity]
batnuele6 is now known as emanuele6
Teraii has quit [Quit: %Ho Ishuudaa%]
Teraii has joined #ffmpeg
Vonter has joined #ffmpeg
StephenLynx has quit [Quit: Leaving]
FH_thecat has quit [Quit: Leaving]
zsoltiv_ has quit [Ping timeout: 265 seconds]
System_Error has quit [Ping timeout: 260 seconds]
FH_thecat has joined #ffmpeg
iconoclasthero has quit [Ping timeout: 260 seconds]
ghoulpine has quit [Ping timeout: 248 seconds]
rex_victor is now known as rex
EmleyMoor has joined #ffmpeg
EmleyMoor has quit [Ping timeout: 260 seconds]
rvalue has quit [Ping timeout: 252 seconds]
System_Error has joined #ffmpeg
cmc has quit [Ping timeout: 260 seconds]
cmc has joined #ffmpeg
ZLima12 has quit []
ZLima12 has joined #ffmpeg
rv1sr has joined #ffmpeg
mikehu44 has joined #ffmpeg
darkapex has quit [Ping timeout: 252 seconds]
vulpine has joined #ffmpeg
vulpine has quit [Ping timeout: 248 seconds]
MisterMinister has quit [Ping timeout: 252 seconds]
vulpine has joined #ffmpeg
vulpine has quit [Ping timeout: 252 seconds]
<johnjaye> furq: i don't think so as these were 2 m4a files clipped from a single source
<johnjaye> so channel rate and such shouldn't matter
<johnjaye> essentially i wanted to remove the segment of the file from t1 to t2
<johnjaye> so I clipped the ends and combined them. or tried to
<johnjaye> i assumed there's some reason concat wouldn't work with m4a but would mp3
coldfeet has joined #ffmpeg
<ePirat> johnjaye, the concat filter should work, maybe thats not what you actually used though? ffmpeg has various ways to concat only one of them being the filter
<ePirat> would help if you show what you did
<johnjaye> first i tried filter_complex. that didn't work
<johnjaye> then I tried concat with a txt file and that didn't work either
<johnjaye> i.e. a filename that said file a.m4a file b.m4a and then
<johnjaye> ffmpeg -f concat -i mylist.txt -c copy output.m4a
x_x has joined #ffmpeg
<johnjaye> oh it worked now. huh
<johnjaye> as for the filter_complex command I don't recall exactly what I did
<johnjaye> it was something like ffmpeg -i a.m4a -i b.m4a -filter_complex "[0:a] [1:a] concat=n=2:a=1 [a]" -map "[a]" output.m4a
<ePirat> that should work
<johnjaye> it says Stream specifier ':a' in filtergraph description [0:a] [1:a] concat=n=2:a=1 [a] matches no streams.
<ePirat> johnjaye, you need to use: concat=n=2:v=0:a=1
<ePirat> else concat expects a video stream
lavaball has joined #ffmpeg
gebra has joined #ffmpeg
vulpine has joined #ffmpeg
five61848033912 has joined #ffmpeg
five6184803391 has quit [Ping timeout: 252 seconds]
five61848033912 is now known as five6184803391
psykose has joined #ffmpeg
vulpine has quit [Ping timeout: 276 seconds]
coldfeet has quit [Ping timeout: 245 seconds]
Dagger has quit [Ping timeout: 265 seconds]
Dagger has joined #ffmpeg
HerbY_NL has joined #ffmpeg
HerbY_NL has quit [Client Quit]
evilscreww has joined #ffmpeg
coldfeet has joined #ffmpeg
vulpine has joined #ffmpeg
vulpine has quit [Ping timeout: 252 seconds]
evilscrewws has joined #ffmpeg
evilscreww has quit [Ping timeout: 250 seconds]
vulpine has joined #ffmpeg
turlando_ has quit []
five61848033913 has joined #ffmpeg
turlando has joined #ffmpeg
five6184803391 has quit [Ping timeout: 252 seconds]
five61848033913 is now known as five6184803391
screwface has joined #ffmpeg
evilscreww has joined #ffmpeg
evilscrewws has quit [Ping timeout: 250 seconds]
vulpine has quit [Ping timeout: 265 seconds]
Blacker47 has joined #ffmpeg
screwface has quit [Ping timeout: 250 seconds]
militantorc has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
ewomer has quit [Ping timeout: 252 seconds]
ewomer has joined #ffmpeg
ewomer has quit [Ping timeout: 248 seconds]
ewomer has joined #ffmpeg
Tano has quit [Quit: WeeChat 4.3.4]
vulpine has joined #ffmpeg
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
vulpine is now known as ghoulpine
minimal has joined #ffmpeg
ewomer has quit [Ping timeout: 252 seconds]
ewomer has joined #ffmpeg
iconoclasthero has joined #ffmpeg
sentriz has quit [Ping timeout: 260 seconds]
evilscreww has quit [Quit: Leaving]
sentriz has joined #ffmpeg
rv1sr has quit []
swamp_ has joined #ffmpeg
zmt01 has quit [Ping timeout: 260 seconds]
zmt00 has joined #ffmpeg
mrelcee has quit [Ping timeout: 252 seconds]
mrelcee has joined #ffmpeg
swamp_ has quit [Ping timeout: 260 seconds]
<johnjaye> amazing, that worked!
<johnjaye> i had absolutely no idea from the error or the doc that was the problem
zmt00 has quit [Ping timeout: 260 seconds]
<noobaroo> When I Google "mp4 vs mkv" i get a lot of junk that is meant for stupid people and obviously stupid itself
<noobaroo> Stuff saying "mkv is higher quality and bigger file size due to being less compressed"
<DeHackEd> that's not true at all... mkv is a container. it provides features like chapters and probably supports more codecs, but the file size and compression is a codec thing, not a container thing
<noobaroo> That might be the case often times but it's completely irrelevant to the question, it's just a coincidence
<DeHackEd> that is horrible
<noobaroo> Yup. So I want some legitimate answers but I'm not smart enough to skim through source code. I found this http://forum.doom9.org/showthread.php?t=183085 . What are the differences between mkv vs mp4 when it comes to seeking and timestamps, etc?
<ePirat> johnjaye, I will try to get the error message for this case to be more helpful
<ePirat> it is indeed not quite clear
<noobaroo> Like, a moov atom can't be moved to the beginning until the end of encoding. So it is unplayable until the end. And if something kills the process midway, the entire first half of the file is lost forever with no surefire way to repair. Whereas an mkv plays even while encoding
<noobaroo> And according to the linked forum: "There are no timestamps in mkv. DTS is not used, like in mp4 or mpeg-ts and instead of PTS durations are used with JUST millisecond precision (last thing is fixable at least)."
ttys000 has quit [Quit: Textual IRC Client: www.textualapp.com]
arbitercoin has joined #ffmpeg
SakuraChan has quit [Remote host closed the connection]
ttys000 has joined #ffmpeg
<johnjaye> ePirat: ah thanks that would be amazing.
<johnjaye> just to be clear, concat method is "demuxing" right?
<ePirat> what do you mean?
<johnjaye> meaning. both audio streams are dumped into a container, but no effort is made to join them as a single stream?
<johnjaye> but the filter_complex did the reencode to one full stream?
<johnjaye> this is what the stackexchange answer I was following said
rv1sr has joined #ffmpeg
<ePirat> with the concat filter you do the whole journey, demux, decode, concat, encode, mux
<johnjaye> oh. ok
<ePirat> whereas the other you mentioned is just the concat demuxer, if you use that with -codec copy it will not re-encode.
<johnjaye> what's it called what i described, where you sort of have 2 different streams sitting in 1 container? or is that not a thing for m4a?
<johnjaye> I did
<johnjaye> -c copy
<ePirat> it will still remux so its one stream in the output
<johnjaye> ok i think i understand. i vaguely recall there's some mode where mp3 files are simply strung together
<johnjaye> sort of like 'cat file1 file2 > file3'. but i wasn't sure what it was called
<ePirat> some container formats can tolerate that to a degree, yeah
<ePirat> (not the case for m4a)
<johnjaye> fascinating
<johnjaye> the different container formats seem so impenetrable and complicated. I don't know much about their abilities
<johnjaye> as the previous poster said, I'm stuck in the zone of being smart enough to ask the question but not smart enough to comprehend the answer or discover it.
microchip__ has joined #ffmpeg
microchip_ has quit [Ping timeout: 260 seconds]
microchip__ has quit [Ping timeout: 245 seconds]
microchip__ has joined #ffmpeg
StephenLynx has joined #ffmpeg
microchip__ is now known as microchip_
LurkingBOB has joined #ffmpeg
coldfeet has quit [Remote host closed the connection]
MightyBOB has quit [Ping timeout: 252 seconds]
mven978 has joined #ffmpeg
mven97 has quit [Ping timeout: 252 seconds]
mven978 is now known as mven97
microchip_ has quit [Quit: There is no spoon!]
microchip_ has joined #ffmpeg
Sakura`Kinomoto has joined #ffmpeg
dkh4 has joined #ffmpeg
GingerGeek_ has joined #ffmpeg
sunyibo_ has joined #ffmpeg
synapt has joined #ffmpeg
WereSquirrel has joined #ffmpeg
JanC has joined #ffmpeg
JanC has quit [Killed (lead.libera.chat (Nickname regained by services))]
Disavowed_ has joined #ffmpeg
DvdKhl has joined #ffmpeg
relue_ has joined #ffmpeg
gvg_ has joined #ffmpeg
relue has quit [*.net *.split]
sunyibo has quit [*.net *.split]
Forza has quit [*.net *.split]
gvg has quit [*.net *.split]
NaviTheFairy has quit [*.net *.split]
dkh has quit [*.net *.split]
Disavowed has quit [*.net *.split]
GingerGeek has quit [*.net *.split]
xpilot has quit [*.net *.split]
Arokh has quit [*.net *.split]
073AAJEHX has quit [*.net *.split]
DvdKhl is now known as Arokh
dkh4 is now known as dkh
minimal has quit [Quit: Leaving]
Forza has joined #ffmpeg
lucasta has joined #ffmpeg
gothicserpent has quit [Quit: gothicserpent]
gothicserpent has joined #ffmpeg
MisterMinister has joined #ffmpeg
Tano has joined #ffmpeg
Haxxa has quit [Ping timeout: 276 seconds]
Haxxa has joined #ffmpeg
Suchiman has joined #ffmpeg
lucasta has quit [Quit: Leaving]
<StephenLynx> also, a question about memory alignment. how do I figure which value to use? I looked around and saw 32, which did work my system. but I also read that it can vary between systems.
<StephenLynx> and apparently between formats. gif requires 4, but I was using 1 just fine for jpg and png.
rvalue has joined #ffmpeg
kasper93 has quit [Remote host closed the connection]
vampirefrog has quit [Ping timeout: 265 seconds]
Rena has quit [Ping timeout: 265 seconds]
Rena has joined #ffmpeg
Rena has quit [Ping timeout: 245 seconds]
Renb has joined #ffmpeg
Renb has quit [Ping timeout: 260 seconds]
Rena has joined #ffmpeg
HarshK23 has joined #ffmpeg
Rena has quit [Read error: Connection reset by peer]
Rena has joined #ffmpeg
DarkSkyes has joined #ffmpeg
LurkingBOB is now known as MightyBOB
bitbinge has quit [Ping timeout: 260 seconds]
Sketch has quit [Remote host closed the connection]
snoriman has quit [Quit: WeeChat 4.4.1]
kasper93 has joined #ffmpeg
bitbinge has joined #ffmpeg
Sketch has joined #ffmpeg
rvalue has quit [Read error: Connection reset by peer]
boxrick has quit [Ping timeout: 248 seconds]
boxrick has joined #ffmpeg
meinside has quit [Ping timeout: 248 seconds]
rvalue has joined #ffmpeg
meinside has joined #ffmpeg
georgereynolds88 has joined #ffmpeg
georgereynolds8 has quit [Ping timeout: 248 seconds]
georgereynolds88 is now known as georgereynolds8
StephenLynx has quit [Remote host closed the connection]
minimal has joined #ffmpeg
ShadowJK has quit [Remote host closed the connection]
dallemon has quit [Quit: The Lounge - https://thelounge.chat]
dallemon has joined #ffmpeg
ShadowJK has joined #ffmpeg
StephenLynx has joined #ffmpeg
<StephenLynx> if anyone said anything about memory alignment, im back
<BtbN> If you use the appropiate functions to allocate memory, you don't need to think about it
<StephenLynx> im using av_image_alloc BtbN . how do I know what is proper?
<BtbN> On whatever CPU instructions your ffmpeg binaries where compiled with
<BtbN> you can't really know and don't need to
<BtbN> just use ffmpegs functions to allocate memory
<StephenLynx> but the ffmpeg function is complaining about memory alignment.
<BtbN> "the ffmpeg function"?
<StephenLynx> av_image_alloc
<BtbN> That function allocates memory, so that sounds weird
<BtbN> What are you doing?
<StephenLynx> av_image_alloc(outputFrame->data, outputFrame->linesize, encoderContext->width, encoderContext->height, encoderContext->pix_fmt, 32);
<StephenLynx> this, to be more precise.
<StephenLynx> it complained if I used 4 instead of 32.
<StephenLynx> and would fail if I used 1.
<StephenLynx> if I dont perform that step, it fails saying "bad dst image pointers"
<BtbN> That's the linesize alignment/stride, not memory alignment.
<StephenLynx> it fails with that error from the swscaler to be more precise.
<BtbN> What's required there is up to the encoder
<StephenLynx> well, the argument is called "align" and the warning is Warning: data is not aligned! This can lead to a speed loss
<StephenLynx> but I dunno.
<StephenLynx> so, is that a "proper" ffmpeg function?
<StephenLynx> so
<BtbN> That's where that warning comes from, and you seen what alingment it wants, in which case
<StephenLynx> I see a binary and with 15? I guess?
<StephenLynx> im not too versed in lower level programming.
<StephenLynx> so im gonna assume if it uses 15, either 16 or 32 works.
<BtbN> It's easier to think of it in hex
<StephenLynx> yeah.
<StephenLynx> 15 is the last hex value, then it loops to 0.
<BtbN> 0xf, so the first byte has to be 0 for the check to pass
<BtbN> i.e. it's at least 16 byte aligned
<BtbN> the first half-byte I mean
<StephenLynx> right, but the question is, how do you figure this out without looking up the source code?
<StephenLynx> what if im not using ARCH_X86
<BtbN> increase the alignment until it stops complaining
<StephenLynx> or is memory alignment only an issue here?
<BtbN> Then it doesn't warn
<BtbN> SSE and MMX obviously only exist on x86
<StephenLynx> what if someone wants to write portable code and doesn't have access to other archs?
<DeHackEd> another opinion... AVFrame has a different memory allocation function, av_frame_get_buffer, with an automatic alignment option. you could use that... but are you not using AVFrame objects?
<BtbN> Then they'll find out whenever someone runs the code on x86
<StephenLynx> ok, ill check that out, DeHackEd
<StephenLynx> ty
<DeHackEd> according to the code it just defaults to 32, which might be excessive depending on the hardware since it's just a constant and probably set to something maximally safe....
<BtbN> 32 is safe as long as no avx512 is thrown into the mix
<BtbN> then you need 64
<StephenLynx> yup, that worked great and it removed the need to manually freeing the memory.
<StephenLynx> ok, so no more worrying about that.
<BtbN> If you manually allocate a frame, under normal conditions you also need to free it
<StephenLynx> also, valgrind complained about AVDictionary *opts; so I changed to initialize it to 0. should I be concerned in either case?
<StephenLynx> valgrind didn't point out any leaks with av_frame_get_buffer.
<StephenLynx> while it would point out a leak with av_image_alloc if I didn't free it.
<StephenLynx> so probably get buffer sets something that lets av_frame_free free it maybe.
Juest has quit [Ping timeout: 245 seconds]
<DeHackEd> when you pass a dictionary to the various option-collecting functions like avformat_write_header, it pulls out options applicable to itself and leaves behind unrecognized options. if anything was left behind, you have bad options.
<ePirat> StephenLynx, an AVDictionary needs to be initialised to NULL, which represents an empty dict.
<StephenLynx> so not initializing it can cause issues?
Juest has joined #ffmpeg
<BtbN> not initializing anything is just a bad idea
<BtbN> cause it'll be random junk
<StephenLynx> yeah.
<StephenLynx> i remember having issues like that in the past.
<StephenLynx> ok, so to NULL then.
<BtbN> You should look at the dict documentation and see how to use it properly
<DeHackEd> uninitialized will be a junk pointer. I'm surprised it didn't just crash.
<BtbN> not just guess
<ePirat> DeHackEd, same…
<StephenLynx> at least valgrind picks up on that kind of stuff.
Blacker47 has quit [Quit: Life is short. Get a V.90 modem fast!]
ewomer has quit [Read error: Connection reset by peer]
j45 has quit [Ping timeout: 248 seconds]
ewomer has joined #ffmpeg
j45 has joined #ffmpeg
acidbunny has quit [Remote host closed the connection]
haritz has quit [Ping timeout: 276 seconds]
dallemon has quit [Quit: The Lounge - https://thelounge.chat]
dallemon has joined #ffmpeg
Erhard has quit [Remote host closed the connection]
System_Error has quit [Remote host closed the connection]
System_Error has joined #ffmpeg
System_Error has quit [Remote host closed the connection]
System_Error has joined #ffmpeg
Exa has quit [Quit: see ya!]
Exa has joined #ffmpeg
Exagone313 has joined #ffmpeg
Warcop has quit [Remote host closed the connection]
Warcop has joined #ffmpeg
Exa has quit [Ping timeout: 252 seconds]
Exagone313 is now known as Exa
haritz has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]
kyzer has quit [Ping timeout: 260 seconds]
ewomer has joined #ffmpeg
Marth64[m] has quit [Quit: Leaving]
ewomer has quit [Quit: WeeChat 4.4.2]
foul_owl has quit [Ping timeout: 265 seconds]
SuicideShow has quit [Ping timeout: 276 seconds]
SuicideShow has joined #ffmpeg
markizano has quit [Quit: Poweroff]
marcj has quit [Ping timeout: 276 seconds]
lavaball has quit [Quit: lavaball]
marcj has joined #ffmpeg
rv1sr has quit []
YuGiOhJCJ has joined #ffmpeg
Marth64 has joined #ffmpeg
markizano has joined #ffmpeg
Juesto has joined #ffmpeg
Juest has quit [Ping timeout: 276 seconds]
Juesto is now known as Juest
relue_ has quit [Read error: Connection reset by peer]
Juest has quit [Ping timeout: 260 seconds]
Juest has joined #ffmpeg