[Ffmpeg-devel-irc] ffmpeg.log.20191206
burek
burek at teamnet.rs
Sat Dec 7 03:05:02 EET 2019
[09:58:36 CET] <jaggz> is there a way I can calibrate a video to remove stable pixel noise?
[09:59:02 CET] <jaggz> (ie. take dark image of blackness and subtract that from the original video)
[10:50:39 CET] <ButtDog> Is it possible to obtain video duration, bitrate, etc similar to FFProbe in the browser front end, from a file input without actually uploading the video?
[13:38:25 CET] <s_p> Can I cut short a .y4m video with ffmpeg? I have videos that are 5s long at 120 fps but I need only the first 2s of the video.
[13:39:50 CET] <s_p> Actually, I only need the first 200 frames. Is there an option to cut a video by the number of frames I want?
[13:41:47 CET] <Seaninho> I'm trying to concat 2 videos(intro, the actual video) and a overlay image in the top right corner. I believe i'm close but I keep getting this error.
[13:42:01 CET] <Seaninho> "Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay_2"
[13:45:05 CET] <klaxa> s_p: ffmpeg -i somefile.y4m -vframes 200 output.mp4
[13:45:46 CET] <klaxa> Seaninho: would help to know your command line with the filter so you can see what the error is referring to
[13:46:19 CET] <Seaninho> @klaxa Yes, i'm very new to ffmpeg so this is obviously a user error.
[13:46:21 CET] <Seaninho> ffmpeg -i cc_intro_video.mp4 -i Coloração.mp4 -i logo-video-watermark.png -filter_complex "[0:v]scale=-1:720[v0];[1:v]scale=-1:720[v1];[2:v]overlay=x=main_w-overlay_w-(main_w*0.01):y=main_h*0.01[v2]; [v0][v1][v3]concat=n=3:v=1:a=0 [v] [a]" -map "[v]" -map "[a]" output.mp4
[13:47:15 CET] <klaxa> i thnik you meant v2 and not v3 in the last [v0][v1][v3] thing
[13:47:20 CET] <klaxa> you never defined v3, but v2
[13:47:33 CET] <klaxa> *think
[13:47:34 CET] <Seaninho> Now i'm getting "No output pad can be associated to link label 'a'"
[13:47:49 CET] <Seaninho> Since i've updated [v3] = [v2]
[13:48:27 CET] <klaxa> you set the number of audio streams to 0
[13:48:33 CET] <klaxa> so no [a] is created
[13:49:10 CET] <klaxa> maybe you want 1 instead of 0?
[13:49:43 CET] <klaxa> so concat=n=3:v=1:a=1
[13:49:51 CET] <Seaninho> I tried doing that and i'm still getting some errors, I had a CLI for just doing the overlay ontop of the video and that worked fine. The minute I introduced the intro video I started having issues.
[13:50:21 CET] <Seaninho> [Parsed_scale_1 @ 0x7f919a403740] Media type mismatch between the 'Parsed_scale_1' filter output pad 0 (video) and the 'Parsed_concat_3' filter input pad 1 (audio)
[13:50:22 CET] <Seaninho> [AVFilterGraph @ 0x7f919a403340] Cannot create the link scale:0 -> concat:1
[13:51:32 CET] <klaxa> do all videos have an audio track?
[13:51:57 CET] <Seaninho> Yes they both have their own audio tracks
[13:52:04 CET] <klaxa> i'm also not sure, but i think overlay does not output audio?
[13:52:18 CET] <Seaninho> You're correct the overlay does not output audio.
[13:52:47 CET] <klaxa> maybe you have to concatenate audio and video separately
[13:54:20 CET] <klaxa> [v0][v1][v2]concat=n=3:v=1:a=0 [v]; [0:a][1:a]concat=n=2:v=0:a=1 [a]
[13:55:00 CET] <Seaninho> Let me try that!
[13:58:26 CET] <Seaninho> I'm getting my initial error now..."Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay_2"
[13:58:45 CET] <Seaninho> Maybe, i'm missing something obvious, i'll paste the new CLI.
[13:58:54 CET] <Seaninho> ffmpeg -i cc_intro_video.mp4 -i Coloração.mp4 -i logo-video-watermark.png -filter_complex "[0:v]scale=-1:720[v0];[1:v]scale=-1:720[v1];[2:v]overlay=x=main_w-overlay_w-(main_w*0.01):y=main_h*0.01[v2]; [v0][v1][v2]concat=n=3:v=1:a=0 [v]; [0:a][1:a]concat=n=2:v=0:a=1 [a]" -map "[v]" -map "[a]" output.mp4
[14:00:11 CET] <klaxa> overlay needs two inputs
[14:00:37 CET] <klaxa> do you want the overlay on the first or the second input video?
[14:00:44 CET] <Seaninho> The second video input
[14:00:59 CET] <klaxa> then add [v1] before [2:v] in overlay
[14:01:09 CET] <klaxa> so it becomes [v1][2:v]overlay=x=...
[14:02:26 CET] <klaxa> yeah should have seen that at the beginning, lol
[14:02:29 CET] <Seaninho> Invalid steam specifier ?
[14:02:36 CET] <klaxa> huh
[14:02:53 CET] <Seaninho> [v1][2:v]overlay=x=main_w-overlay_w-(main_w*0.01):y=main_h*0.01[v2];
[14:03:07 CET] <klaxa> but v1 was just created? :S
[14:03:26 CET] <Seaninho> Saying it matches no streams in the filtergraph
[14:04:07 CET] <Seaninho> Am I not terminating them correctly before each definition?
[14:04:52 CET] <klaxa> hmm... well now that i think about it, you at least don't want [v1] in the concat
[14:04:56 CET] <klaxa> but that's beside the issue
[14:04:59 CET] <s_p> klaxa: Thanks :)
[14:05:10 CET] <klaxa> np :)
[14:06:09 CET] <klaxa> Seaninho: i'll brb, i'll try some stuff out on my machine then
[14:06:20 CET] <Seaninho> @klaxa Okay, i'm a newbie when it comes to video encoding so I guess the question is, what's the right way to create a video with an intro/watermark then convert it to HLS?
[14:06:42 CET] <klaxa> well, you're on the right track ;)
[14:17:30 CET] <klaxa> hmm ok for me this filter complex worked: -filter_complex "[0:v]scale=-1:720[v0];[1:v]scale=-1:720[v1];[v1][2:v]overlay=x=main_w-overlay_w-(main_w*0.01):y=main_h*0.01[v2]; [v0][v2]concat=n=2:v=1:a=0 [v]; [0:a][1:a]concat=n=2:v=0:a=1 [a]" -map "[v]" -map "[a]"
[14:17:53 CET] <klaxa> with two videos with both audio and a png as third input
[14:18:21 CET] <klaxa> does your first video also have audio?
[14:18:30 CET] <klaxa> ah they do
[14:23:56 CET] <Seaninho> Yes it does have audio.
[14:24:00 CET] <Seaninho> I will try this.
[14:28:29 CET] <Seaninho> @klaxa Are you sure you got that to work?
[14:29:21 CET] <klaxa> yes
[14:30:18 CET] <klaxa> https://gist.github.com/klaxa/ab55aaa193b181a06f972709fc0a2b75
[14:32:10 CET] <Fyr> how can I mux an MKV into an MP4 without "Data: bin_data (text / 0x74786574)"?
[14:32:46 CET] <Fyr> "Unsupported codec with id 100359 for input stream 4"
[14:33:38 CET] <klaxa> you can use -map to specifically select the streams you want to copy
[14:33:49 CET] <Seaninho> Ok so when I copied your code from the gist it looks like it's encoding.
[14:34:01 CET] <Fyr> klaxa, tried.
[14:34:08 CET] <klaxa> for example: ffmpeg -i input.mp4 -map 0:v -map 0:a -c copy output.mp4 will only copy video and audio
[14:34:10 CET] <Fyr> FFMPEG still puts it into the MP4.
[14:34:26 CET] <Fyr> I used -map -0:4
[14:34:38 CET] <klaxa> that should also work... weird
[14:35:37 CET] <Fyr> FFMPEG writes an unsupported codec.
[14:35:47 CET] <JEEB> can you show an ffprobe -v verbose -i INPUT pastebin'd of the input :P
[14:35:51 CET] <Fyr> if it's unsupported, why the hell it does write it?
[14:35:53 CET] <JEEB> and then the full terminal output and command line of the copy
[14:36:18 CET] <JEEB> because I have a hunch it's chapters :P
[14:36:38 CET] <JEEB> because there's two ways of doing chapters in mp4, neither of which is official (but people still want them). and the MOV way of doing it is a text stream.
[14:36:57 CET] <JEEB> (the other way is from how lolnero did it back then)
[14:37:12 CET] <Seaninho> History time.
[14:37:13 CET] <klaxa> wow people should just adapt mkv everywhere
[14:37:21 CET] <klaxa> *adopt?
[14:37:28 CET] <klaxa> *use
[14:37:42 CET] <Fyr> ok, JEEB, it seems to be the chapter problem.
[14:37:44 CET] <JEEB> mp4 as a format isn't bad, it's just a problem when there's something that nobody wanted to specify properly :P
[14:38:02 CET] <klaxa> mkv as a format is better tho :P why settle for less?
[14:38:05 CET] <Fyr> is there a way to keep chapters without an unsupported codec?
[14:38:08 CET] <JEEB> how is it better?
[14:38:24 CET] <JEEB> other than it possibly having better tooling back in the day
[14:38:27 CET] <klaxa> yeah was about to say that compatibility is one of the parts where it's worse
[14:38:34 CET] <JEEB> matroska has no proper timestamps
[14:38:37 CET] <klaxa> but it packs more different formats
[14:39:00 CET] <klaxa> also streaming support without hacks
[14:39:03 CET] <klaxa> :^)
[14:39:08 CET] <JEEB> fragmentation is not hacks
[14:39:17 CET] <klaxa> ok :^(
[14:39:28 CET] <JEEB> they almost added proper timestamps to matroska
[14:39:34 CET] <JEEB> but then noted that they wouldn't do it
[14:39:38 CET] <JEEB> an it was (´4@)
[14:39:47 CET] <klaxa> ¯\_(Ä)_/¯
[14:41:19 CET] <JEEB> Fyr: no idea if you can limit yourself to just one of the ways chapters get written, but most likely not? but really, what's your major malfunction with it being visible like that in the output?
[14:41:31 CET] <JEEB> MOV does it like that, as a stream
[14:41:48 CET] <JEEB> we could in theory not show such streams but then we'd be hiding something
[14:43:10 CET] <JEEB> hey, someone actually wrote how the two chapter formats work :P https://github.com/Zeugma440/atldotnet/wiki/Focus-on-Chapter-metadata
[14:43:36 CET] <JEEB> although I'm pretty sure this person is using "timecode" where it's really timestamp
[14:45:04 CET] <JEEB> well, in the mp4 writer there's at least an option to disable the nero chapters
[14:45:21 CET] <JEEB> -movflags disable_chpl
[14:45:32 CET] <Fyr> it's not gonna change the unsupported codec error.
[14:45:48 CET] <JEEB> nope, since the QT/MOV chapter format is what uses an actual text stream
[14:46:11 CET] <JEEB> Fyr: but what's your real problem btw with the text stream track?
[14:46:31 CET] <JEEB> like, what is the problem you're trying to fix? is it then cutting that thing with -c copy and mapping all streams?
[14:47:24 CET] <Fyr> I just found it strange that FFMPEG produces a file it fails to read without error.
[14:48:20 CET] <JEEB> it reads it just fine, you get the chapters read from it just fine
[14:48:48 CET] <JEEB> it just shows up as an "extra" track because it is a track and nobody did the special magic to hide it because it was referred to as a chapter list
[14:50:16 CET] <Fyr> JEEB, both ffprobe and FFMPEG show chapters before stream information.
[14:50:36 CET] <JEEB> that's just how they dump it?
[14:50:42 CET] <Fyr> and then both of them add strange stream in the end, giving warning about unsupported codec.
[14:50:43 CET] <JEEB> not sure what you're trying to say
[14:51:40 CET] <JEEB> yes? the chapter track is parsed just fine. literally the only thing that's left is that you can see the data text track that is being referenced
[14:51:41 CET] <Fyr> I'm trying to say that ffprobe and ffmpeg should show something like: "Nero Chapter format" or "Quicktime chapter format".
[14:52:09 CET] <Fyr> it should not show chapter, then show streams, show the chapters as a strem and give warning about unsupported codec.
[14:52:50 CET] <JEEB> yes, it shows it in a weird way, that I don't disagree with :P
[14:53:32 CET] <JEEB> so more than actually making that referenced text track you dislike that it shows up in the format probe
[14:56:19 CET] <JEEB> although to be honest since MOV doesn't let you have any order limitations, you first have to create the tracks, and then handle chapters if any are there. and you can't really "take back" creating an AVStream easily :P
[14:56:30 CET] <JEEB> it is properly marked as data and that it should be discarded
[14:57:16 CET] <JEEB> in other words, FFmpeg has a problem because it cannot remove streams or at least I don't think that's currently possible :P
[14:57:38 CET] <JEEB> so the best you can do is set the "discard" field to "yes, please discard all"
[14:57:52 CET] <JEEB> anyways, it's complicated due to how this crap works :P
[14:58:31 CET] <JEEB> MOV loved to do this thing of referencing other tracks
[14:58:51 CET] <JEEB> and yes, we could add a codec id for chapters
[14:58:56 CET] <JEEB> to show them a bit better
[14:59:40 CET] <JEEB> but I'm not sure if that is by itself too useful since that codec will never actually be utilized for anything else than printing the info out
[15:00:13 CET] <Fyr> well, it must be easliy understandable info.
[15:00:33 CET] <Fyr> "Unsupported codec" warning is not understandable.
[15:01:03 CET] <Fyr> I think, I'm not the first who has asked here about this warning.
[15:01:45 CET] <JEEB> btw, you would still get the error there with at least ffprobe
[15:01:53 CET] <JEEB> since you get that if there is no decoder for the format
[15:02:06 CET] <JEEB> avcodec_find_decoder(stream->codecpar->codec_id);
[15:02:20 CET] <JEEB> if that doesn't give you a decoder for that codec id, you get that error
[15:02:56 CET] <Seaninho> In your opinon do you think it's acceptable that a website only has 720P for VOD?
[15:03:19 CET] <JEEB> Seaninho: depends on the input is. heck, there's still stuff that is SD only
[15:03:28 CET] <JEEB> *on what the input is
[15:03:53 CET] <JEEB> and when the master is SD, then sure - you can blow that up. but does the user get a better result out of that?
[15:04:58 CET] <Seaninho> The Input is 1080, i'm launching a subscription based VOD websites at the end of the month and was worried about only having my videos in 720P
[15:05:38 CET] <JEEB> it's your business. you should know what is profitable to you or not. there must be a reason why you originally only configured 720p output :P
[15:06:14 CET] <Seaninho> I tried using AWS mediaconvert thinking it would be better than raw FFMPEG myself but it's slow as shit and adds a lot of technical overhead such as back and forth communications with AWS to know when the video is done.
[15:07:28 CET] <Seaninho> I guess I could always update the HLS m3u8 file to have different qualities later.
[15:08:52 CET] <Fyr> I've set -metadata year=2018, but ffprobe of the output file does not output this metadata.
[15:08:58 CET] <Fyr> is it normal?
[15:11:06 CET] <th3_v0ice> Why would this happen while converting from 25fps to 18fps, and resolution from 1080p to 160p: "50 frames in, 0 frames out; 50 frames dropped, 0 frames duplicated."
[15:11:51 CET] <JEEB> ffmpeg.c's "vsync" had fun? I don't know :P post a full command and log on a pastebin or something, and link here
[15:12:09 CET] <th3_v0ice> I am using API :)
[15:12:26 CET] <JEEB> then you are dropping it? or what is logging that?
[15:12:30 CET] <JEEB> since that looks like ffmpeg.c's logging
[15:12:52 CET] <th3_v0ice> I turned on the library logs as well. I can copy them to pastebin
[15:13:54 CET] <JEEB> Fyr: quickly looked through where the mp4/mov writer checks for metadata fields and there's no such thing as "year" there :P you either mean the creation timestamp, or one of the itunes mapped things, where it is "date"
[15:14:25 CET] <Fyr> JEEB, I looked there: https://wiki.multimedia.cx/index.php/FFmpeg_Metadata#QuickTime.2FMOV.2FMP4.2FM4A.2Fet_al.
[15:15:13 CET] <JEEB> Fyr: seems like that documenti s just incorrect
[15:15:16 CET] <JEEB> \251day is mapped to "date"
[15:15:19 CET] <Fyr> ='(
[15:15:24 CET] <JEEB> not "year"
[15:16:05 CET] <th3_v0ice> JEEB: https://pastebin.com/u75QYASw
[15:16:58 CET] <JEEB> th3_v0ice: so you're using the fps filter?
[15:17:18 CET] <th3_v0ice> Yes
[15:17:29 CET] <JEEB> yes, that logs that line
[15:17:57 CET] <JEEB> it sounds like you're never pulling from the filter chain?
[15:18:43 CET] <th3_v0ice> I am actually, since I am feeding it 50 frames at a time, I always pull everything out of it. It works for other segments but not for this one.
[15:40:25 CET] <faLUCE> hello. Can I transform a wav audio to DTS with ffmpeg?
[15:41:03 CET] <faLUCE> (without re-encoding)
[15:45:53 CET] <JEEB> you mean you have wav with the DTS bit stream encapsulated in SPDIF or whatever it is?
[15:46:27 CET] <JEEB> it should probe for taht
[15:46:59 CET] <JEEB> which is perverse, but the wav and w64 things have a set_spdif thing which utilizes the SPDIF demuxer
[15:48:17 CET] <JEEB> it will attempt to probe for the SPDIF sync words within the probe buffer
[15:48:43 CET] <JEEB> and then the codec_id should be set accordingly
[15:51:25 CET] <faLUCE> JEEB: maybe my question is nonsense. because I need that to play this DTS file with an amplifier
[15:52:13 CET] <faLUCE> I know that it reads dts files, but I don't know the codec inside that it accepts
[15:52:27 CET] <JEEB> wat
[15:52:37 CET] <JEEB> if you just have a WAV file with SPDIF'd DTS
[15:52:48 CET] <JEEB> just use alsa or somethign to push it to wherever you want
[15:52:55 CET] <JEEB> no idea how to do it nicely with windows
[15:52:56 CET] <JEEB> :P
[15:53:17 CET] <JEEB> other than actually skipping the DTS-in-WAV part and just playing it with bit streaming
[15:53:20 CET] <JEEB> :P
[15:53:36 CET] <faLUCE> I need to play a 5.1 DTS with an amplifier connected to the optical cable of my soundcard
[15:54:25 CET] <faLUCE> so 1) I have to be sure that 1) the soundcard can output dts format 2) the amplifier plays this dts file
[15:55:03 CET] <JEEB> no fucking idea about 1) , that is an audio hardware related question which is 100% up to your OS or whatever
[15:55:21 CET] <JEEB> usually you just use a player with a proper DTS file or something, and enable spdif pass-through
[15:55:27 CET] <JEEB> and if it doesn't work, it doesn't work :P
[15:55:55 CET] <JEEB> same for 2), how are *we* supposed to know anything about your amplifier
[15:56:08 CET] <faLUCE> JEEB: yes... but I still have to buy the soundcard :-)
[15:56:09 CET] <JEEB> is there any reason why you are not just using a player that can do spdif bit streaming?
[15:56:18 CET] <JEEB> right, so you don't have the hardware yet?
[15:56:28 CET] <faLUCE> yes, I want to buy it
[15:56:37 CET] <JEEB> then you probably want something HDMI based anyways :P
[15:57:06 CET] <faLUCE> I have the amplifier. and it doesn't have hdmi
[15:57:43 CET] <JEEB> ok, then shit sucks. sorry. if it does have X inputs for the separate channels I'd almost rather use that :P
[15:57:49 CET] <JEEB> than doing lossy DTS/AC3 bit streaming
[15:58:18 CET] <JEEB> as in, audio card that has X output channels, and then separately HDMI for future
[15:58:30 CET] <JEEB> rather than buying *now* a card that has no HDMI, but only optical
[16:20:49 CET] <faLUCE> [15:57] <JEEB> than doing lossy DTS/AC3 bit streaming <--- I thought that DTS supports very high bitrates
[16:21:39 CET] <JEEB> for initial generation of DTS which fits 2ch (and thus optical audio), it's all lossy
[16:21:58 CET] <JEEB> the XLL (eXtension LossLess) stuff only works with HDMI
[16:22:32 CET] <JEEB> that is why I say that it's most likely better for you to get proper 5.1 or whatever audio output card, and then have HDMI as well in case you ever get a thing that supports HDMI input
[16:22:34 CET] <faLUCE> JEEB: I see. there's a bottleneck on the transport protocol
[16:23:00 CET] <JEEB> faLUCE: I think in theory the optical cables can do better, but nothing on the *audio* side supports that. and now we have HDMI, so nobody cares.
[16:23:19 CET] <faLUCE> JEEB: you are right that I have to search a board with HDMI support as well
[16:24:09 CET] <JEEB> faLUCE: basically for you it makes sense to get a thing that has proper X channels separately so you can stick them into your amp, as raw audio
[16:24:30 CET] <JEEB> then you can losslessly decode DTS XLL (aka "DTS-HD MA") on the PC
[16:24:33 CET] <JEEB> and play it through those
[16:24:45 CET] <JEEB> which most likely is better than trying to muck around with lossy bit streaming :P
[16:24:51 CET] <faLUCE> JEEB: but in this case the output from the board would be analogic
[16:24:56 CET] <faLUCE> but you are right
[16:25:47 CET] <faLUCE> ok, so, for making things better, if I get an amplifier with HDMI and a sound card with HDMI, can I transmit loseless codecs?
[16:26:56 CET] <JEEB> probably. hardware vendors are sometimes evil and only let you do the old amount of channels in bit streaming
[16:27:25 CET] <JEEB> although even there I wonder if there's much difference to just decoding the audio and passing it through as raw audio
[16:27:32 CET] <JEEB> because you can do 8ch raw PCM with HDMI :P
[16:28:07 CET] <faLUCE> <JEEB> because you can do 8ch raw PCM with HDMI :P <---- this is what I want. But do the amplifiers accept that bitstream?
[16:28:15 CET] <JEEB> why not?
[16:28:19 CET] <JEEB> no DTS decoding required etc
[16:28:42 CET] <JEEB> when you bit stream the "HD" (lossless etc) formats in HDMI, you set the channel count to 8ch after all :P
[16:28:55 CET] <JEEB> but just be wary and make sure you get something that can do both
[16:28:57 CET] <faLUCE> JEEB: because the amplifiers' vendors are evil... maybe they accept only specific formats
[16:29:24 CET] <JEEB> yea, although I think that's mostly a problem in general
[16:29:31 CET] <JEEB> if the thing only takes 2ch in through HDMI
[16:29:35 CET] <JEEB> then it's limited
[16:29:45 CET] <JEEB> or if the card only can output 2ch out through HDMI :P
[16:29:57 CET] <JEEB> but I'm pretty sure there's plenty of sane hardware out there nowadays.
[16:30:15 CET] <faLUCE> JEEB: in each case, I have to check both what the card can output and the amplifier can input
[16:30:28 CET] <JEEB> yes
[16:31:56 CET] <faLUCE> JEEB: not easy task
[16:32:24 CET] <faLUCE> they are very confusing in the descriptions
[16:32:25 CET] <JEEB> well most people I've seen buying things around me have succeeded :P
[16:32:30 CET] <JEEB> not that I know what they've bought
[16:32:37 CET] <JEEB> welcome to hardware :P
[16:32:53 CET] <JEEB> ever tried to buy TVs based on review results?
[16:33:20 CET] <faLUCE> JEEB: I have to ask to hw channel
[16:34:09 CET] <faLUCE> I don't know exactly what to google. maybe "8 channels RAW audio hdmi amplifier"
[16:34:11 CET] <faLUCE> ?
[16:34:18 CET] <faLUCE> (for the amplifier)
[16:37:11 CET] <JEEB> pcm is probably better as a keyword?
[16:37:33 CET] <faLUCE> yeah, I'll try that as well
[16:37:53 CET] <JEEB> I mean, that should be the simplest to find
[16:38:03 CET] <JEEB> and usually if you have truehd/dts-hd ma support for 7.1
[16:38:09 CET] <JEEB> it means it can take in 8ch pcm
[18:58:21 CET] <Soni> can we have sstv support?
[20:44:24 CET] <realies> I'm trying to run ffprobe -hide_banner -v quiet -print_format json -show_format on a input file and it dies with ENOMEM, it's a 4.0G wave file and the system only has 3.8G of ram (and 4.0G swap)
[20:44:39 CET] <realies> is there a way to get that info without loading everything in RAM?
[20:50:45 CET] <JEEB> realies: sounds really weird, what is teh container you're trying to poke?
[20:50:54 CET] <kepstin> it doesn't load everything into ram. with those options it should be barely reading any of the file at all, just the headers and exiting
[20:52:20 CET] <kepstin> (and it's very rare to actually have a process get an ENOMEM on linux since overcommit is usually on, usually it'll get oom-killed instead)
[20:53:03 CET] <DHE> ENOMEM usually only happens for outrageous memory requests
[20:53:28 CET] <kepstin> ffmpeg itself generates an ENOMEM error in some cases, for absurdly large frames/packets and things like that
[20:53:41 CET] <kepstin> can mean a corrupt input file in some cases
[21:04:48 CET] <realies> JEEB, a 4.0G wave file from a zoom recorder
[21:05:20 CET] <realies> DHE, ENOMEM is nodejs saying ffprobe failed (tries to spawn it from there)
[21:05:38 CET] <durandal_1707> realies: use latest ffmpeg
[21:06:48 CET] <realies> running 3.4.6 on ubuntu lts, I'll try get latest git static build
[21:40:27 CET] <realies> funny, ffmpeg runs fine now but when nodejs tries to spawn it it dies with ENOMEM :)
[21:40:30 CET] <realies> *ffprobe
[21:42:20 CET] <saml> nodejs is no mem
[21:42:34 CET] <realies> yup
[21:42:52 CET] <saml> you can download more mem in kubernetes
[21:43:03 CET] <realies> :(
[21:44:25 CET] <Diag> i need mem
[22:23:14 CET] <roxlu> can ffmpeg link against a static x264 lib?
[22:23:33 CET] <JEEB> yes, why not?
[22:24:15 CET] <roxlu> oop I should have added with MSVC
[22:24:31 CET] <roxlu> because of this https://github.com/FFmpeg/FFmpeg/blob/87b7e141a6fda7f450aff4560b776d546af313ed/libavcodec/libx264.c#L32
[22:25:32 CET] <JEEB> I have no idea what X264_API_IMPORTS does
[22:25:36 CET] <roxlu> I've created a static lib and trying to link against it but I get: https://gist.github.com/roxlu/62eb9b76e8237c2e5eaf8f73f839743e
[22:26:10 CET] <roxlu> it means: __declspec(dllimport) is a storage-class specifier that tells the compiler that a function or object or data type is defined in an external DLL.
[22:26:37 CET] <JEEB> and X264_API_IMPORTS sets something related to that?
[22:27:18 CET] <roxlu> yeah I defines the call decl. to be __declspec(dllimport)
[22:28:06 CET] <roxlu> or at least that's my understanding; I might be wrong
[22:28:19 CET] <JEEB> can you cehck with make V=1 if the actual link command contains all the libraries required, and if x264 is there and that specific thing makes it fail, you could add another check to that
[22:29:01 CET] <roxlu> yeah it has, but I think that I might have interpreted --enable-static incorrectly ... it seems to mean that ffmpeg will link with static libs
[22:29:34 CET] <JEEB> --enable-static means just that the libraries you build (libavcodec etc) will be statically linked
[22:29:57 CET] <roxlu> yeah, though I just read: enable-static: use this option to link all libraries statically
[22:30:11 CET] <JEEB> probably means "all *included* libraries"
[22:30:28 CET] <JEEB> whichever library (shared or static) is preferred by your linker for the same link command gets utilized
[22:30:39 CET] <JEEB> like the ld linker auto-preferring shared libs
[22:30:46 CET] <JEEB> or dll.a instead of .a
[22:30:48 CET] <JEEB> for mingw-w64
[22:31:07 CET] <JEEB> linkers can have their own -static thing that only takes in static libs, but taht's separate
[22:31:33 CET] <JEEB> whether you build your FFmpeg as enable shared or static, has no preference regarding which dependency library gets utilized
[22:31:39 CET] <JEEB> that is up to your toolchain if you have both around
[22:32:41 CET] <roxlu> yeah I thought so. So if I bulid a static x264 lib and the the libpath (windows thing) to the dir where this static lib can be found, how come that it tries to link usig those import libs?
[22:33:15 CET] <JEEB> I think it was link for MSVC
[22:33:21 CET] <JEEB> cl was the compiler, and link was the linker?
[22:33:50 CET] <roxlu> ah! I think I saw a note about that somewhere
[22:34:27 CET] <JEEB> anyways, I have no idea what on earth you're talking about but the linker prefers whatever it can find
[22:34:45 CET] <JEEB> unless you can find something special in FFmpeg's configure that sets some specific parameters
[22:34:58 CET] <roxlu> hehe yeah but now you mentioned cl / link, that cl=M$ and link is gcc?
[22:35:07 CET] <JEEB> no?
[22:35:13 CET] <roxlu> oh :)
[22:35:13 CET] <JEEB> ld is the most utilized GNU linker
[22:35:27 CET] <JEEB> msvc has cl and link
[22:35:33 CET] <roxlu> ah ok
[22:36:37 CET] <JEEB> Microsoft (R) Incremental Linker Version 14.13.26131.1
[22:51:32 CET] <roxlu> Ok. so /usr/bin/link was used by the MSVC compiler. I've renamed /usr/bin/link to "link.bak" and recompiling again
[22:53:00 CET] <JEEB> yea I think the MSVC related docs mention that you might have to remove msys(2)'s link.exe :)
[22:53:03 CET] <JEEB> or rename at least
[22:54:27 CET] <roxlu> ok so the __declspec(dllexport) and __declspec(dllimport) are used to "programmatically import/export" symbols. w/e that means
[22:56:45 CET] <roxlu> ah ok (reading up on this), normally when you want to create a dll you have to define what functions you want to export
[22:56:55 CET] <roxlu> you can do this with a .def file or with __declspec(dllexport)
[23:23:17 CET] <roxlu> Ok, so this is going on. I compile and link x264 with MSVC. Then I try to build ffmpeg and get an error about unresolved x264 symbols. All unresolved symbols start with __imp_
[23:23:38 CET] <roxlu> I think that __imp id generated because of the `__declspec(dllimport)`
[23:24:11 CET] <roxlu> and X264_API_IMPORTS is set here for MSVC https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libx264.c#L33
[23:24:56 CET] <roxlu> from my understanding this means that one needs to have a shared lib when compiling with MSVC
[23:25:11 CET] <roxlu> I'm going to build a shared x264 lib and see if that works
[23:34:23 CET] <JEEB> roxlu: and after that you can check if just removing that define helps with the static one
[23:34:35 CET] <JEEB> I would guess 99%+ who do MSVC just do libx264 dll
[23:34:39 CET] <JEEB> so that define is exactly what they need
[23:35:45 CET] <roxlu> JEEB: yeah
[23:36:22 CET] <roxlu> I've got the libx264.dll.lib now .. had to rename it to libx264.lib and recompiling atm
[23:36:44 CET] <BtbN> If you get that kind of error, you probably didn't build libx264 correctly
[23:37:11 CET] <BtbN> In a static build, it should define neither dllimport nor export
[23:37:42 CET] <roxlu> BtbN: yes.
[23:38:03 CET] <roxlu> BtbN: it seems that ffmpeg is trying to link programmatically with imports
[23:38:19 CET] <BtbN> It uses whatever the libx264 headers define
[23:38:25 CET] <roxlu> BtbN: because the source defines this https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libx264.c#L33
[23:38:54 CET] <BtbN> Yeah, with that define in place, it's probably impossible to statically link libx264
[23:39:13 CET] <roxlu> BtbN: because that line is there, the x264.h will use `__declspec(dllimport)` forcing a shared/import lib
[23:39:51 CET] <roxlu> What did you mean with "It uses whatever the libx264 headers define" ?
[23:40:01 CET] <BtbN> https://github.com/mirror/x264/blob/master/x264.h#L55
[23:40:25 CET] <BtbN> With how ffmpeg is currently setup, you cannot statically link libx264 when building with MSVC.
[23:41:15 CET] <roxlu> Ok, thanks. I'm happy to link dynamically
[23:41:22 CET] <roxlu> which is working now
[23:41:25 CET] <BtbN> Well, or just comment out that line
[00:00:00 CET] --- Sat Dec 7 2019
More information about the Ffmpeg-devel-irc
mailing list