[Ffmpeg-devel-irc] ffmpeg.log.20170515

burek burek021 at gmail.com
Tue May 16 03:05:01 EEST 2017


[00:28:56 CEST] <sikilikis> I need help with some problem. Here is my command + the error i get: https://pastebin.com/BUNqaYyB
[00:29:12 CEST] <sikilikis> I have used this same command previously with ffmpeg 3.2.4 stable and it worked then
[00:29:32 CEST] <sikilikis> this is running on a raspberry pi 3. I recently formatted the sd card and installed +recompiled everything fresh
[00:29:38 CEST] <sikilikis> using the latest version of ffmpeg
[01:07:29 CEST] <sikilikis> nobody has any hints as to what my problem is?
[01:19:44 CEST] <arin20> Hi, quick CLI noob question, could you tell me the syntax for adding a chapters.txt file to an mkv encode? Thanks in advance
[01:22:28 CEST] <arin20> The chapters file is already prepared
[02:27:46 CEST] <sikilikis> can someone help me? I'm using the most recent ffmpeg on a raspberry pi 3. I'm trying to use the hardware encoder but i'm getting some generic error. Here is my command and the error: https://pastebin.com/zAvbijN0
[02:29:02 CEST] <sikilikis> that command used to work on ffmpeg 3.2.4 stable. i reinstalled the OS on the pi and now it isnt working
[02:35:18 CEST] <thebombzen> sikilikis: what if you use the omx command line tools
[02:35:40 CEST] <sikilikis> I have no idea what that is. I've never needed them before
[02:37:19 CEST] <sikilikis> here is the full output: https://pastebin.com/EDpPZ1wR
[02:41:59 CEST] <hiihiii> hello
[02:45:27 CEST] <sikilikis> oh my god i'm an idiot. I forgot to do the memory split on the raspberry pi
[02:48:06 CEST] <hiihiii> suppose you have a 60fps clip whose frames are A B C A B C A B C ...
[02:48:33 CEST] <hiihiii> what can you do to drop the C frames
[02:49:27 CEST] <hiihiii> I tried to duplicate "fps=90,fps=60" but i got A C A C A C instead
[02:55:26 CEST] <hiihiii> with "fps=90,select=gte(n\,1),fps=60" I believe that the select filter will be applied first before fps=90
[02:55:31 CEST] <hiihiii> ?
[02:56:23 CEST] <hiihiii> if that's not the case then I'd get C A C A C A which is okay for me
[03:15:29 CEST] <arin20> Ah never mind, I'll just add the chapters later with mkvtoolnix
[03:15:35 CEST] <arin20> Thanks anyway, take care
[03:16:44 CEST] <hiihiii> got it. "fps=90,select=gte(n\,1),fps=60,select=gte(n\,1),..." this skips two frames but I get A B A B ..etc nonetheless
[03:19:05 CEST] <hiihiii> looks ugly though. is there anything I could possibly to  optimize this??
[03:22:49 CEST] <thebombzen> sikilikis: haha user error would do it
[03:23:05 CEST] <thebombzen> but yes I meant "what about the command-line tools" not because they would work but because they can help you diagnose the problem
[03:23:23 CEST] <thebombzen> hiihiii: use -vf framestep=3
[03:23:27 CEST] <thebombzen> !filter framestep
[03:25:58 CEST] <hiihiii> it says "Select frame after every 'step' frames."
[03:26:20 CEST] <sikilikis> well now I'm running into general performance issues
[03:26:28 CEST] <sikilikis> again, no idea why and it was working perfectly fine before
[03:26:45 CEST] <sikilikis> its not overheating either and doesn't seem to be hitting memory issues
[03:27:08 CEST] <hiihiii> framestep=3 would drop 2 frames and output 1
[03:27:17 CEST] <hiihiii> I'm trying to do the reverse of that
[03:27:30 CEST] <hiihiii> output the first 2 then drop the third
[03:29:40 CEST] <thebombzen> at worst you could use -vf select
[03:29:48 CEST] <thebombzen> although there's probably an easier way to do it
[03:30:27 CEST] <hiihiii> I apologies maybe I had thrown you off with fps=90
[03:32:12 CEST] <thebombzen> this is a bit of a hack
[03:32:20 CEST] <thebombzen> but you could use fps=120,framestep=3
[03:32:37 CEST] <thebombzen> which will duplicate every frame and then select every 3rd frame
[03:33:59 CEST] <hiihiii> but that  'every 3rd frame' is what I'm trying to dodge
[03:34:26 CEST] <thebombzen> hm?
[03:34:53 CEST] <hiihiii> A B C A B C A B C   to   A B A B A B  and not   A C A C A C
[03:35:13 CEST] <hiihiii> or C C C
[03:35:22 CEST] <thebombzen> I believe I just answered your question
[03:35:46 CEST] <thebombzen> "you could use fps=120,framestep=3 which will duplicate every frame and then select every 3rd frame"
[03:36:11 CEST] <thebombzen> duplicating every frame takes you to aabbccaabbccaabbccaabbcc
[03:36:16 CEST] <thebombzen> what happens if you select every 3rd frame from that
[03:36:37 CEST] <thebombzen> you drop 'cc' and the 'ab' in the middle of aabb
[03:36:42 CEST] <thebombzen> and you're left with aabbaabbaabb
[03:36:48 CEST] <thebombzen> errr
[03:36:50 CEST] <thebombzen> ababababab
[03:36:51 CEST] <thebombzen> typo
[03:37:23 CEST] <hiihiii> I think you need to errr again
[03:37:50 CEST] <hiihiii> wait
[03:38:03 CEST] <hiihiii> it selects 1 then drops two
[03:38:20 CEST] <hiihiii> I thought it drops 2 then selects 1
[03:38:25 CEST] <hiihiii> ok
[03:39:04 CEST] <thebombzen> either way if you care about the exact frames dropped
[03:39:11 CEST] <thebombzen> you should be using vf select
[03:41:46 CEST] <hiihiii> okay thx anyway
[03:43:07 CEST] <thebombzen> hiihiii: try -vf 'select=if(mod(n\,3)\,1)'
[03:43:29 CEST] <thebombzen> don't forget the single quotes and the backslashes (part of the filter)
[03:43:50 CEST] <thebombzen> note that with -vf select, this will return variable framerate video
[03:44:02 CEST] <thebombzen> this will drop every third frame but won't change the timestamps
[03:44:06 CEST] <hiihiii> already tried it
[03:44:15 CEST] <hiihiii> it doesn't work for my case
[03:44:19 CEST] <thebombzen> why not
[03:44:31 CEST] <thebombzen> how does it "not work"
[03:45:16 CEST] <thebombzen> there's more than one way for it to do the wrong thing
[03:46:04 CEST] <thebombzen> also hiihiii if you want to rebase it from 60 to 40 constant framerate once you drop the frames then you should then you should append a setpts filter
[03:46:11 CEST] <thebombzen> probably setpts=N/40/TB
[03:47:19 CEST] <hiihiii> for 'select=if(mod(n\,3)\,1)' to work in my case i'd have to skip the first 3 frames
[03:47:25 CEST] <thebombzen> why
[03:47:36 CEST] <hiihiii> which mean I'll need to do a nother select
[03:47:45 CEST] <thebombzen> skipping 3 frames would do nothing
[03:47:51 CEST] <thebombzen> because this filter is cyclic mod 3
[03:48:06 CEST] <hiihiii> then there's the problem you added that I haven't heard of until now
[03:48:33 CEST] <hiihiii> the frames are indexed starting from 0
[03:48:46 CEST] <hiihiii> 0 1 2 3 4 5 6 7 8 9 10
[03:48:53 CEST] <thebombzen> okay, then add 1
[03:49:00 CEST] <thebombzen> -vf 'select=if(mod(n+1\,3)\,1)'
[03:49:13 CEST] <hiihiii> 0 1 2 X 4 5 X 7 8 X 10
[03:50:07 CEST] <hiihiii> huh didn't know you could do arithmetic
[03:50:20 CEST] <thebombzen> why wouldn't you think that
[03:50:29 CEST] <thebombzen> when this literally modular arithmetic
[03:50:51 CEST] <thebombzen> also, 0 is 0 mod 3 so it wouldn't be 0 1 2 X 4 5 X 7 8 X 10, it would be X 1 2 X 4 5 X 7 8 X 10
[03:51:01 CEST] <hiihiii> because of that. modulo is a function and not an operator
[03:51:17 CEST] <thebombzen> that's becaue there's no modulus key on the keyboard
[03:51:54 CEST] <hiihiii> so my mind just jumped to the conclusion that you couldn't especially since you could only use certain preset "macros" like n and whatnot
[03:52:09 CEST] <thebombzen> n is not a macro here
[03:52:16 CEST] <hiihiii> % is modulo in a lot of languages
[03:52:24 CEST] <thebombzen> only in C-based languages
[03:52:31 CEST] <thebombzen> and not in standard mathematical notation
[03:52:38 CEST] <thebombzen> unlike +, -, *, and /
[03:53:07 CEST] <hiihiii> you could also say I was lazy to check
[03:54:53 CEST] <hiihiii> -vf 'select=if(mod(n+1\,3)\,1)' I'll try it
[03:55:12 CEST] <hiihiii> it's late now so I'll be off
[03:55:48 CEST] <hiihiii> bye
[06:11:43 CEST] <damdai> what is best way to extrat  subtitle file from  .mkv file
[06:29:09 CEST] <dystopia_> mkvmerge
[06:29:22 CEST] <dystopia_> well mkvmerge gui is easiest
[06:29:49 CEST] <dystopia_> you can do it with the command line too though with -a and -v to omit audio and video
[06:37:59 CEST] <damdai> that created mka file
[06:38:05 CEST] <damdai> not srt file
[06:44:31 CEST] <dystopia_> you used gui or command line?
[06:47:48 CEST] <thebombzen> damdai: ffmpeg -i input.mkv -map s -c copy output.srt
[06:48:04 CEST] <thebombzen> assuming the sub is subrip
[06:48:18 CEST] <damdai> what if it's vobsub
[06:49:22 CEST] <thebombzen> well do you want the subs to be identical or do you just want it to a subrip
[06:49:38 CEST] <thebombzen> cause if you just want a subrip file do: ffmpeg -i input.mkv -map s output.srt
[06:51:10 CEST] <dystopia_> damdai http://i.imgur.com/i2MXVnz.png
[06:51:27 CEST] <dystopia_> or do what thebombzen said heh
[06:51:45 CEST] <damdai> Stream mapping:
[06:51:45 CEST] <damdai>   Stream #0:2 -> #0:0 (dvd_subtitle (dvdsub) -> subrip (srt))
[06:51:45 CEST] <damdai>   Stream #0:3 -> #0:1 (dvd_subtitle (dvdsub) -> subrip (srt))
[06:51:45 CEST] <damdai>   Stream #0:4 -> #0:2 (dvd_subtitle (dvdsub) -> subrip (srt))
[06:51:45 CEST] <damdai> Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[06:51:58 CEST] <thebombzen> well there's three subtitle streams
[06:52:26 CEST] <thebombzen> if you want to select only one of them then you're going to need to do -map 0:2 or -map 0:3 or -map 0:4, depending on which one you want
[06:52:39 CEST] <damdai> how do i do all 3 then
[06:52:42 CEST] <dystopia_> mkv merge is the same though kinda, mkvmerge -o output.mkv -A -v -T input.mkv
[06:52:45 CEST] <dystopia_> bah
[06:52:48 CEST] <dystopia_> you need to map them
[06:52:50 CEST] <thebombzen> you can't put 3 subtitle tracks in a single subrip file
[06:53:06 CEST] <damdai> i mean to 3 different files
[06:53:07 CEST] <thebombzen> subrip files only support one subtitle track
[06:53:25 CEST] <dystopia_> -map 0:x
[06:53:32 CEST] <dystopia_> x being the one you want to dump each time
[06:53:40 CEST] <thebombzen> you could do: ffmpeg -i input.mkv -map 0:2 first.srt -map 0:3 second.srt -map 0:4 third.srt
[06:54:34 CEST] <gregors> hi there. I'm trying to compile ffmpeg-3.3.1 on a banana pi (arm). ./configure gives me an "ERROR:frei0r.h header not found". Can somebody help?
[06:54:45 CEST] <damdai> thebombzen  okay, then what does  -map s do
[06:54:54 CEST] <thebombzen> "s" is a stream selector
[06:54:57 CEST] <thebombzen> it means "all subtitle streams"
[06:56:12 CEST] <thebombzen> see https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1 for a more indepth description
[06:56:18 CEST] <damdai> -map 0:2  didn't work
[06:59:37 CEST] <damdai> thebombzen what is the difference between "ffmpeg -i input.mkv -map s output.srt" and "ffmpeg -i input.mkv -map s -c copy output.srt"
[06:59:58 CEST] <thebombzen> -c copy means codec copy. it tells ffmpeg to output whatever subtitle codec came in
[07:00:12 CEST] <damdai> subtitle codec?
[07:00:24 CEST] <thebombzen> yes, like dvd_subtitle or subrip
[07:00:42 CEST] <damdai> if you don't use -c copy , what format does it use
[07:01:05 CEST] <dystopia_> it should use same as imput also, unless you specify otherwise
[07:01:32 CEST] <damdai> ffmpeg -i input.mkv -map s output.srt  worked on different mkv file with one subtitle file
[07:01:43 CEST] <damdai> but doesn't work on this 3 subtitle one
[07:02:14 CEST] <dystopia_> ffmpeg -i input.mkv -map 0:2 s output.srt
[07:02:26 CEST] <dystopia_> you tried this? and 0:3 and 0:4
[07:02:56 CEST] <damdai> [NULL @ 0000000002835520] Unable to find a suitable output format for 's'
[07:02:56 CEST] <damdai> s: Invalid argument
[07:04:57 CEST] <dystopia_> instead of s
[07:05:01 CEST] <dystopia_> try -scodec copy
[07:05:47 CEST] <dystopia_> ffmpeg -i input.mkv -map 0:2 -scodec copy -an -vn output.srt
[07:05:48 CEST] <dystopia_> i guess
[07:06:32 CEST] <damdai> doesn't work
[07:06:35 CEST] <damdai> still
[07:06:45 CEST] <dystopia_> :(
[07:06:59 CEST] <damdai> i think it uses vobsub
[07:07:00 CEST] <dystopia_> i dunno, i would just use mkvmerge's gui unless you are scripting this or somthing
[07:07:18 CEST] <damdai> not text based subtitle
[07:07:38 CEST] <damdai> does ffmpeg not support  vobsub?
[07:18:50 CEST] <thebombzen> dystopia_: that's wrong
[07:19:06 CEST] <thebombzen> damdai: the output format is determined from the filename
[07:19:11 CEST] <thebombzen> unless you tell ffmpeg otherwise
[07:19:56 CEST] <thebombzen> damdai: it doesn't work because that's a typo
[07:20:04 CEST] <thebombzen> do this: ffmpeg -i input.mkv -map 0:2 output.srt
[07:20:05 CEST] <thebombzen> not this ffmpeg -i input.mkv -map 0:2 s output.srt
[07:20:14 CEST] <thebombzen> as in, do what I told you to do.
[07:20:16 CEST] <thebombzen> A bit ago.
[07:21:06 CEST] <thebombzen> so to answer your questions:
[07:21:14 CEST] <thebombzen> [01:00:42] <damdai> if you don't use -c copy , what format does it use
[07:21:50 CEST] <thebombzen> ^ it automatically selects one from the output file format, which in turn is automatically determined from the output filename.
[07:22:11 CEST] <thebombzen> [01:01:32] <damdai> ffmpeg -i input.mkv -map s output.srt  worked on different mkv file with one subtitle file
[07:22:21 CEST] <thebombzen> ^ [00:53:06] <thebombzen> subrip files only support one subtitle track
[07:22:41 CEST] <thebombzen> [01:07:38] <damdai> does ffmpeg not support  vobsub?
[07:23:30 CEST] <damdai> what typo?
[07:24:01 CEST] <thebombzen> ^ ffmpeg does support vobsub but it's called dvdsub.
[07:24:04 CEST] <thebombzen> as for what typo, the 's'
[07:24:06 CEST] <thebombzen> the 's' was a typo
[07:24:20 CEST] <thebombzen> [01:20:04] <thebombzen> do this: ffmpeg -i input.mkv -map 0:2 output.srt [01:20:05] <thebombzen> not this ffmpeg -i input.mkv -map 0:2 s output.srt
[07:24:21 CEST] <damdai> it doesn't work  with or without s
[07:24:45 CEST] <thebombzen> you're saying this doesn't work: ffmpeg -i input.mkv -map 0:2 output.srt
[07:24:52 CEST] <damdai> correct
[07:25:13 CEST] <thebombzen> there's lots of ways something can "not work"
[07:25:21 CEST] <thebombzen> that doesn't provide any information really
[07:26:22 CEST] <damdai> Stream #0:2 -> #0:0 (dvd_subtitle (dvdsub) -> subrip (srt))
[07:26:22 CEST] <damdai> Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[07:44:34 CEST] <Threads> damdai dvb_subtitle is picture subtitles you cant use ffmpeg to extract them
[07:45:14 CEST] <damdai> ffmpeg doesn't support picture subtitles?
[07:45:40 CEST] <Threads> best to use subtitle edit for that sort of thing
[07:45:59 CEST] <Threads> http://www.nikse.dk/subtitleedit/
[10:34:42 CEST] <ergZay> hi, i have a broken file that appears to have had the colormatrix encoded to limited so even when using a limited colormatrix the black levels are already at 20 and white levels at 230
[10:34:55 CEST] <ergZay> is there a way to apply a filter to expand these out again to the full range?
[13:39:16 CEST] <eMDi> hello ev1
[13:40:20 CEST] <eMDi> need help with concating files into one videofile. i receive everytime error :( Unsafe file name , but switch -safe 0 is used
[13:59:06 CEST] <eMDi> solved, thanks. bye
[15:42:44 CEST] <Nacht> Are there standard rules as to what number a video or audio PID can have for an MPEG-TS stream ? Like is video always lower then audio ?
[15:49:48 CEST] <DHE> no particular rules. some number/ranges are reserved though. any reason to change the defaults?
[15:53:03 CEST] <Nacht> Making bumpers to fit around a video, so the PID's have to match. Was just wondering if there was some logic in the PID, since I see quite a range of different PIDs
[15:53:16 CEST] <Nacht> 33, 34, 251 252, 481, 482 etc.
[15:55:50 CEST] <DHE> nothing in particular. I think it just defaults to putting PMTs in one "region" and the the main elementary streams in another...
[15:57:24 CEST] <Nacht> I see, thank you for the info :)
[15:57:58 CEST] <DHE> ... bumpers?
[16:03:44 CEST] <Nacht> Bumpers, as in a short intro and outro around a clip.
[16:04:30 CEST] <Nacht> An example of a crappy intro bumper: https://www.youtube.com/watch?v=IKoxoYYsq5A
[16:14:11 CEST] <DHE> that's not the intended use of multiple PIDs
[16:14:44 CEST] <DHE> they're intended so you can have multiple programs (audio + video streams) or multiple streams (eg: multiple language audio tracks) or both inside a single bitstream.
[16:16:27 CEST] <Nacht> That's not it. I had recieved bumpers, which I converted to TS with FFMPEG. But I wanted to merge them with TS from an HLS stream. Which had different PID's. So I had to manipulate the default PID's of ffmpeg.
[16:43:38 CEST] <termos> any good reason why my libffmpeg transcoded stream plays in ffplay but not in a flash player?
[16:44:36 CEST] <termos> example stream: rtmp://46.137.108.163/live/transcoder_test1
[16:47:34 CEST] <Nacht> What about ? rtmp://46.137.108.163:1935/live/transcoder_test1
[16:48:22 CEST] <termos> same issue for me with specifying the port
[17:10:08 CEST] <sikilikis> I have a general question. When using alsa as an input to record audio from an application, what causes the Alsa buffer xrun error?
[17:11:41 CEST] <sikilikis> This is on a raspberry pi 3. everything was working for me perfectly fine, even between reboots, but then at somepoint I began getting them more and more. Now I can't even format the OS and recompile everything without still seeing this
[17:12:06 CEST] <sikilikis> makes me think either my SD card is becoming crappy or the hardware itself is failing, but I won't know until I understand what that error actually is and why it happens
[17:15:27 CEST] <sikilikis> this *was* being used to stream music and a looping animation to youtube. And it used to work perfectly. No change in software or hardware (that I know of). then more and more alsa buffer xrun errors popped up, making the audio choppy and eventually making the stream suffer
[17:43:14 CEST] <debianuser> sikilikis: Alsa buffer overrun means that the application is reading audio data from the buffer slower than the soundcard putting it there, so eventually the buffer overruns and some audio samples are lost.
[17:48:53 CEST] <faLUCE> hello, I fill my demuxer's packets with a read callback ( int read_packet(void *opaque, uint8_t *buf, int buf_size){...} ), which is called by av_read_frame(). Is there a way to make av_read_frame() return EAGAIN when I don't have data to put into read_packet()? I tried to return "-1" from read_packet() when I don't have data, but I don't understand if it is the proper way to manage this case.
[17:52:00 CEST] Last message repeated 1 time(s).
[18:04:09 CEST] <sikilikis> which application would that be? ffmpeg or the media player?
[18:06:55 CEST] <sikilikis> or in other words, should I be worrying about optimizing ffmpeg or is this due to something else in the system?
[18:10:31 CEST] <kepstin> sikilikis: well, the issue is that ffmpeg isn't running fast enough, but that's probably due to resources on the system - e.g. if you're writing to an sd card and the card is wearing out, writes will get slower, ffmpeg runs slower, then you get alsa xruns
[18:10:53 CEST] <sikilikis> does ffmpeg write to the sd card?
[18:10:59 CEST] <kepstin> sikilikis: only if you tell it to
[18:11:10 CEST] <kepstin> I don't know what you're doing with it...
[18:11:29 CEST] <sikilikis> its streaming audio and looping images to youtube
[18:11:34 CEST] <kepstin> if you're streaming video over wifi - maybe your wifi is congested, so ffmpeg can't stream fast enough, so it's causing xruns
[18:11:45 CEST] <sikilikis> with the output being redirected to /tmp, which should be a ramdisk
[18:11:48 CEST] <sikilikis> its ethernet
[18:11:59 CEST] <sikilikis> and it was working perfectly fine before.
[18:11:59 CEST] <faLUCE> help me please!
[18:12:07 CEST] <kepstin> sikilikis: could just be cpu limitations as well, depending on the encoder in use
[18:12:11 CEST] <sikilikis> only thing that changes were the mp3s I'm playing, but in no major way
[18:12:49 CEST] <sikilikis> I didnt change any of the software. It just started to get alsa errors. I ended up formatting the card and reinstalling the OS. recompiled the newest version of ffmpeg and its the same thing
[18:13:07 CEST] <sikilikis> only software running on it (besides the OS) is mpg123 and ffmpeg
[18:13:23 CEST] <kepstin> faLUCE: you have a *very* esoteric dev question, repeating it and shouting "help me please!" is not gonna magically get you a solution faster.
[18:13:24 CEST] <sikilikis> its on a rpi 3
[18:14:09 CEST] <sikilikis> I don't have my ffmpeg command on me cuz I'm at work, but I don't think its a problem with ffmpeg. Like I said it was working before
[18:14:14 CEST] <kepstin> sikilikis: well, it's a performance thing, you're just gonna have to start profiling bits of the system to see where the bottleneck is
[18:14:21 CEST] <sikilikis> I just need to know what might cause them to begin with
[18:14:33 CEST] <sikilikis> do you think a bad sd card could be a source of this?
[18:14:33 CEST] <kepstin> e.g. start by running 'top' and see if the cpu usage is the limit before looking at other things
[18:14:52 CEST] <faLUCE> kepstin: it's not an esoteric question!
[18:14:56 CEST] <faLUCE> It's a basic question
[18:14:56 CEST] <kepstin> sikilikis: hard to say. it could be, but it's unlikely
[18:15:08 CEST] <sikilikis> its not the cpu. I've noticed the opposite actually. I see more cpu drops
[18:15:23 CEST] <sikilikis> temperatures are fine as well
[18:15:34 CEST] <sikilikis> I don't see any indication that its power
[18:15:47 CEST] <kepstin> sikilikis: check memory usage - you want to make sure you have no swap, since swap on sd card will cause nasty latency issues.
[18:15:57 CEST] <sikilikis> no I have no swap
[18:16:32 CEST] <sikilikis> i reinstalled the OS but the issue appeared before that. and again, it worked perfectly for days. Weeks even. Then it kind of started to hiccup
[18:16:47 CEST] <sikilikis> at first doing some reboots helped for a bit but it would always return
[18:16:56 CEST] <kepstin> make sure that when looking at cpu usage, you have something that shows you per-core - if ffmpeg is using all of one core and the others are idle, that's indications of a problem
[18:16:59 CEST] <sikilikis> and now, even after reinstalling the OS and recompiling ffmpeg, it continues
[18:17:33 CEST] <sikilikis> I use htop. It shows all four cores and I don't see any huge jumps
[18:18:18 CEST] <sikilikis> but it's still weird that it began out of nowhere. That's why I asked if it could be sd card corruption. The other alternative is that the cpu itself is starting to fail
[18:18:30 CEST] <sikilikis> or the hardware encoder. I'm not too familiar with the raspberry pi's hardware
[18:18:59 CEST] <sikilikis> but would you agree that it's probably not an issue with ffmpeg itself?
[18:20:19 CEST] <kepstin> well, the ffmpeg cli tool is inherently single-threaded, and not designed for realtime work, so it's really sensitive t bottlenecks elsewhere that'll cause it to hiccup the entire encode.
[18:21:32 CEST] <kepstin> i find it kind of surprising how many people are using underpowered rpi hardware to stream video to youtube, there's probably a market for someone to make a dedicated optimized app for that :/
[18:21:41 CEST] <sikilikis> hmm. Well in my case it does appear to use the four cores.
[18:22:30 CEST] <sikilikis> also most people stream video feed from a webcam. usually anyway. I havent heard of any other use case except my own
[18:22:45 CEST] <kepstin> that's really odd, with the hw encoder in use, ffmpeg shouldn't be running any stuff in extra threads. It's probably just bouncing the single ffmpeg thread among cores?
[18:23:21 CEST] <sikilikis> maybe I dunno. each core will hover around 15-25% usage and it will list multiple ffmpeg processes, which I assume are different threads
[18:23:45 CEST] <sikilikis> well now like I said I'll see more 0% usages with some occasional jumps
[18:23:53 CEST] <kepstin> ... make sure you aren't running multiple ffmpeg processes
[18:24:06 CEST] <sikilikis> oh yeah, in my case I'm also displaying text and the text is dynamic. So that probably uses up some cpu
[18:24:25 CEST] <sikilikis> it's not running multiple ffmpeg processes. never has
[18:24:56 CEST] <sikilikis> before I was using ffmpeg 3.2.4 stable if that helps anything, but I doubt that's the issue
[18:25:12 CEST] <furq> what lists multiple ffmpeg processes
[18:25:20 CEST] <furq> if that's regular top then that's definitely not right
[18:25:28 CEST] <kepstin> sounds like it's htop? I forget if it shows threads separately by default
[18:25:35 CEST] <kepstin> should be an option to switch that on/off
[18:25:35 CEST] <sikilikis> its htop yeah
[18:25:43 CEST] <furq> yeah if it's htop then that's probably fine
[18:25:56 CEST] <furq> the threads will show up as children of the main process
[18:26:39 CEST] <sikilikis> yeah I like htop because it shows per-core usage
[18:27:03 CEST] <kepstin> so does top, just hit '1' while it's running ;)
[18:27:09 CEST] <sikilikis> when it worked, each core hovered around like 15-25%
[18:27:21 CEST] <furq> quiz time: what does the h stand for
[18:27:23 CEST] <furq> you have five seconds
[18:27:34 CEST] <furq> you all lose
[18:27:37 CEST] <sikilikis> now its a bit more dynamic but I don't think I saw any cpu spikes
[18:27:51 CEST] <furq> it obviously stands for "hisham"
[18:27:58 CEST] <sikilikis> its lower than usual. I'm going to try more once I get home but that's where it stands for now
[18:28:00 CEST] <furq> that's the most useless bit of trivia i know
[18:28:41 CEST] <sikilikis> I'm sure there are worse trivia bits to know
[18:29:49 CEST] <sikilikis> basically, if it worked before and nothing in the system changed, then it stop working, what are the possible causes?
[18:30:02 CEST] <furq> bad feng shui
[18:30:05 CEST] <dystopia_> user error
[18:30:21 CEST] <sikilikis> I don't think it's overheating and throttling. Had a fan on it the whole time and its been relatively cool lately
[18:30:41 CEST] <furq> i'd be surprised if you could ever load a pi 3 enough to need a fan
[18:30:56 CEST] <furq> unless you live in the sahara
[18:31:03 CEST] <sikilikis> yeah I'm going to try it without a fan and see what happens. Maybe I never needed it
[18:31:08 CEST] <furq> i mean it ships with no heatsink
[18:31:09 CEST] <sikilikis> we get an occasional heat wave here
[18:31:17 CEST] <sikilikis> it has a heatsink on it at least
[18:31:23 CEST] <furq> i put one on mine mostly for comedy value
[18:31:23 CEST] <dystopia_> isnt an rpi too weak to do anything with ffmpeg?
[18:31:27 CEST] <furq> because i had a spare one of the right size
[18:31:31 CEST] <sikilikis> but yeah the hottest it got with the fan is like 55C
[18:31:50 CEST] <kepstin> dystopia_: most people with rpis are using the hardware encoder
[18:31:54 CEST] <sikilikis> and that was during a hot week where it got to the 90s
[18:32:02 CEST] <furq> shame it doesn't have a hardware aac encoder really
[18:32:15 CEST] <kepstin> that said, the rpi3 is a 1.2ghz quad core, it could probably run x264 with a fast preset almost usefully :/
[18:32:19 CEST] <sikilikis> but yeah, if we rule out heating issues, what's left
[18:32:47 CEST] <furq> the only thing that comes to mind is different videocore stuff
[18:32:50 CEST] <furq> if you reinstalled everything
[18:33:09 CEST] <furq> if you're running a newer firmware then the vc stuff should've been updated
[18:33:16 CEST] <furq> i don't see why that'd cause alsa issues though
[18:34:32 CEST] <furq> also yeah the tjmax of the pi cpu is like 85C
[18:34:40 CEST] <furq> so 55 isn't even getting warm
[18:35:54 CEST] <furq> oh
[18:35:57 CEST] <furq> were you overclocking it before
[18:36:10 CEST] <sikilikis> no. I'm not even sure how to overclock the pi 3
[18:36:19 CEST] <furq> obviously if you wiped the card then your /boot/config.txt is gone
[18:36:22 CEST] <sikilikis> it probably doesnt need it though
[18:36:30 CEST] <kepstin> hmm, awesome, one of my scripts is generating a command that causes ffmpeg to eat lots of ram and get oom killed. time for some script debugging...
[18:36:33 CEST] <furq> yeah i'm just thinking of things that could've changed
[18:36:54 CEST] <sikilikis> the version of ffmpeg changed. But this happened to both stable 3.2.4 and the current latest
[18:36:58 CEST] <sikilikis> so I don't think it's that
[18:37:42 CEST] <james999> surprise Jeremy Corbyn wants a tax hike for those with £80,000 or higher. How much does he make? £75,000
[18:37:43 CEST] <sikilikis> the wipe didn't fix the issue. So the only thing that stayed the same between those is the hardware (an sd card, a flash drive for extra storage, and the pi itself) and the mp3 files
[18:38:08 CEST] <furq> james999: he'd make more than 80k if he won
[18:38:12 CEST] <furq> and if he doesn't win then it's not happening
[18:38:16 CEST] <furq> so uh
[18:38:54 CEST] <furq> this is why you shouldn't get your opinions from image macros on your bad uncle's facebook wall
[18:39:09 CEST] <james999> T_T
[18:39:22 CEST] <james999> So Teresa May is making £150,402?
[18:39:27 CEST] <furq> don't ask me
[18:39:38 CEST] <furq> i think the 80k tax hike is a bad idea anyway
[18:39:44 CEST] <james999> that's what the top google result tells me
[18:40:14 CEST] <james999> but, but... image macros are fun and educational!
[18:40:20 CEST] <furq> you can't call it a "robin hood tax" when you're going after people who make 80k and ignoring companies sending all their money to luxembourg
[18:41:14 CEST] <furq> same with hiking corporation tax. it's only going to affect people who aren't doing well enough to absorb it
[18:41:40 CEST] <furq> everyone with enough money to absorb it isn't paying it anyway
[18:42:26 CEST] <james999> yeah. same problem with taxes here in the US now that I think about it
[18:42:44 CEST] <james999> anyway I posted a comment about what you said, so thanks for the clarification
[18:43:02 CEST] <furq> helping the world, one bad facebook wall at a time
[18:43:40 CEST] <furq> like a much more severely punished sisyphus
[18:44:17 CEST] <anchi> Hello! I have a questiong regarding ffmpeg command that does not seem to function well
[18:46:30 CEST] <anchi> I should send command here?
[18:46:40 CEST] <anchi> ffmpeg -i input.mp4 -loop 1 -i image.png -filter_complex "[1:v]format=rgba,scale=-2:240,fade=in:st=4:d=1.5:alpha=1,fade=out:st=9:d=0.3:alpha=1[png];[0:v][png]overlay=x='min(-1.5*w+6*w*t,0)':y=3*(H-h)/4-0:shortest=1:enable='between(t,4,10)'" -y output.mp4
[18:48:51 CEST] <james999> should the "x=" be "x:"?
[18:49:11 CEST] <furq> no
[18:49:35 CEST] <furq> anchi: what's the problem with it
[18:50:29 CEST] <anchi> I will change it to x:
[18:50:38 CEST] <furq> it shouldn't be x
[18:50:40 CEST] <furq> :
[18:51:00 CEST] <anchi> but this happens whenever I add enable=between
[18:51:17 CEST] <anchi> without this it's good
[18:51:21 CEST] <anchi> it has transition
[18:52:14 CEST] <furq> try changing the in start and out start to 1 and 5
[18:52:19 CEST] <furq> or 0 and 5, rather
[18:52:42 CEST] <anchi> ok I will try that. it seems I cannot use -loop 1 and enable between together
[18:55:16 CEST] <anchi> ok I changed between 1 to 5 still no sliding from left to right
[19:07:24 CEST] <JodaZ> guys, something must be wrong with ffmpeg default settings, "the scene" has been shitting on a group for using ffmpeg for like a year now giving examples like this: https://i.imgur.com/1A416M2.jpg
[19:10:03 CEST] <faLUCE> Do you know if is there another good library that I can use for demuxing mpegts, other than libav?
[19:10:25 CEST] <furq> JodaZ: what am i even looking at here
[19:10:49 CEST] <BtbN> looks like normal movie motion blur to me
[19:11:18 CEST] <furq> that just looks like a bad soufce
[19:11:19 CEST] <furq> r
[19:12:43 CEST] <furq> the standards (inasmuch as they're worth listening to) don't even mention ffmpeg
[19:12:52 CEST] <furq> other than to say you shouldn't use ffmpeg's ivtc filters or aac encoder
[19:13:12 CEST] <furq> and the aac encoder being disallowed makes sense because they disallow cbr aac
[19:13:39 CEST] <dystopia_> faLUCE, haali media splitter ?
[19:15:49 CEST] <faLUCE> dystopia_: is it a library?
[19:16:42 CEST] <faLUCE> dystopia_: there's not the source code and the website is very obscure
[19:16:55 CEST] <BtbN> I think it's a dshow filter?
[19:35:00 CEST] <kepstin> you can convince ffmpeg's ivtc filters to give decent results if you have clean input, but you have to check the result to make sure :/
[19:38:07 CEST] <JEEB> well, you have to check the result of all IVTC and deint filters anyways
[19:38:17 CEST] <JEEB> if you care about the output that is
[19:46:45 CEST] <anchi> so guys expression evaluation x='min(-1.5*w+5*w*t,5)' is ignored if I add enable='between(t,4,10)' to the command
[19:46:53 CEST] <anchi> else it works
[20:37:45 CEST] <Fenrirthviti> Any recommendations for taking an RTMP ingest and making it available for playback on mobile? I don't care the format, I'm willing to install any additional libraries or tools needed on my server (linux) to accomplish this. Currently have nginx-rtmp being used for ingest, I need to figure out some way of getting playback working for mobile
[20:38:09 CEST] <Fenrirthviti> hls isn't an option through nginx-rtmp directly because the fragments are all bugged to shit and playback fails after the first two
[20:40:05 CEST] <BtbN> hls from nginx-rtmp works fine for me.
[20:40:14 CEST] <furq>  same
[20:41:13 CEST] <Fenrirthviti> Mind sharing a config sample? Nothing I do seems to work.
[20:41:33 CEST] <Fenrirthviti> Inspection of the playlist fragments is constant CC errors that break playback.
[20:41:49 CEST] <BtbN> sounds to me like you're sending super long gops or something
[20:42:23 CEST] <Fenrirthviti> I'm just using whatever nginx-rtmp does by default
[20:42:47 CEST] <furq> what are you sending to it
[20:43:15 CEST] <Fenrirthviti> h.264/aac flv stream
[20:43:33 CEST] <Fenrirthviti> from OBS, x264 encoded
[20:43:51 CEST] <Fenrirthviti> rtmp playback works fine, then I'm using ffmpeg to copy the stream to the hls block
[20:45:32 CEST] <Fenrirthviti> https://gist.github.com/Fenrirthviti/b8c69c9715b7d974289b723f1d273e8b is the config I'm using, nothing fancy
[20:45:42 CEST] <Fenrirthviti> and sorry, not using ffmpeg currently, just pushing it
[20:46:00 CEST] <Fenrirthviti> but tried using ffmpeg with exec_push and same result
[20:47:09 CEST] <furq> you'll want to make sure you're using 5-second gops in OBS
[20:47:20 CEST] <furq> or set hls_fragment to whatever OBS is using
[20:47:44 CEST] <furq> i assume that sets the m3u duration header, and i know modern iOS blows up if your fragments exceed that length
[20:47:57 CEST] <Fenrirthviti> just set to auto, so whatever x264 is using by default
[20:47:58 CEST] <Fenrirthviti> 2 I think?
[20:48:40 CEST] <furq> no
[20:48:46 CEST] <furq> x264 uses 250 frames by default
[20:48:49 CEST] <furq> which is probably more than five seconds
[20:49:02 CEST] <Fenrirthviti> ah ha.
[20:49:20 CEST] <furq> i mean maybe OBS does something different
[20:49:58 CEST] <Fenrirthviti> no, you can keyframe int manually for x264, default is just auto though
[20:50:15 CEST] <Fenrirthviti> and I think OBS changes based on certain streaming services, like Twitch or whatever, but doesn't apply to custom destinations
[20:55:22 CEST] <Fenrirthviti> Nope, that didn't work.
[20:55:24 CEST] <Fenrirthviti> Same issue.
[20:56:31 CEST] <kepstin> bah, so I have a video file (webcam source, recorded server-side from rtmp stream) with  a 191 minute jump in timestamps
[20:56:53 CEST] <kepstin> and when I run it through an 'fps' filter to even out the framerate, all of the frames it queues up to fill the gap cause ffmpeg to oom
[20:57:46 CEST] <kepstin> inserts 275237 duplicated frames.
[20:58:10 CEST] <furq> is it h264
[20:58:37 CEST] <kepstin> both input and output are h264, yeah
[20:58:39 CEST] <ChocolateArmpits> kepstin, try generating timestamps just before the fps filter
[20:58:46 CEST] <ChocolateArmpits> use setpts/asetpts
[20:58:55 CEST] <furq> you should be able to rewrite the timestamps by demuxing and remuxing it
[20:59:02 CEST] <kepstin> ChocolateArmpits: not sure how that would help, the timestamps are correct. the stream just has no frames for 191 minutes
[20:59:22 CEST] <kepstin> and I need to fill that gap by repeating the last frame I have so it looks good
[20:59:23 CEST] <furq> ffmpeg -i foo.mp4 -c copy out.264; ffmpeg -r 30 -i out.264 -c copy out.mp4
[20:59:43 CEST] <ChocolateArmpits> kepstin, so what's the problem with the fps filter ?
[20:59:46 CEST] <kepstin> in particular, I cannot remove the gap because that'll cause a/v desync
[20:59:48 CEST] <furq> oh right do you actually need an appropriately sized gap
[20:59:48 CEST] <ChocolateArmpits> if you need it filled anyways
[21:00:11 CEST] <furq> ChocolateArmpits: it's running out of memory
[21:00:14 CEST] <kepstin> ChocolateArmpits: it queues up all 275237 filler frames at the same time, causing an oom from the memory needed to do so
[21:01:06 CEST] <ChocolateArmpits>  i see
[21:01:38 CEST] <Fenrirthviti> Thanks for the input guys. This is going to be beyond my skillset to sort out and I don't want to waste your time expecting me to have knowledge I don't.
[21:01:57 CEST] <furq> Fenrirthviti: what players are you testing it with
[21:02:10 CEST] <Fenrirthviti> vlc and video.js, plus an HLS inspector I found
[21:02:15 CEST] <furq> oh right
[21:02:31 CEST] <furq> yeah if it's not working with proper players then there's some bigger issue
[21:02:47 CEST] <Fenrirthviti> https://pub.rachni.com/img/javaw_2017-05-15_14-02-44.png
[21:02:53 CEST] <furq> iOS's player is particularly picky about spec violations, but hls.js is pretty robust in my experience
[21:02:54 CEST] <Fenrirthviti> is what I get from the inspector tool
[21:03:03 CEST] <Fenrirthviti> VLC plays the first two fragments fine, then just locks up
[21:03:11 CEST] <Fenrirthviti> I can't even restart playback without restarting the player completely
[21:03:23 CEST] <Fenrirthviti> video.js does the same thing pretty much
[21:03:36 CEST] <furq> what gop length/framerate are you using
[21:03:37 CEST] <Fenrirthviti> I've found dozens of similar reports regarding nginx-rtmp and HLS playback
[21:03:47 CEST] <furq> weird
[21:03:54 CEST] <Fenrirthviti> I'll be perfectly honest, I have no idea what gop length means.
[21:03:56 CEST] <furq> it's always worked fine for me, and i've not seen anyone complain about it
[21:03:57 CEST] <Fenrirthviti> If you mean keyframe int?
[21:03:59 CEST] <furq> yeah
[21:04:05 CEST] <furq> group of pictures
[21:04:06 CEST] <Fenrirthviti> 120 right now
[21:04:18 CEST] <Fenrirthviti> 2 seconds @ 60fps
[21:04:30 CEST] <furq> oh
[21:04:34 CEST] <furq> 250 was probably fine then
[21:04:40 CEST] <Fenrirthviti> https://gist.github.com/Fenrirthviti/a147d290da2a0a967070bedf86359f6c
[21:04:42 CEST] <Fenrirthviti> not sure if this helps
[21:04:51 CEST] <Fenrirthviti> that's what ffprobe says
[21:07:04 CEST] <kepstin> right, for now I guess I'll just use a computer with a ton of ram and transcode this video by itself with an fps filter to fix the timestamps, then use that as input for my processing scripts. better than nothing :/ (the full filter chain has something like 10  inputs and a bunch of hstack/vstack/pad/etc., so it seems more likely to oom)
[21:08:49 CEST] <furq> Fenrirthviti: it's probably not good that it's yuvj420p
[21:09:00 CEST] <furq> but that shouldn't break in the way you described
[21:10:32 CEST] <furq> maybe download the stream with ffmpeg -v debug and see what errors you get
[21:11:59 CEST] <kms_> how to restream from my rtsp cam to youtube?
[21:12:36 CEST] <kms_> i try this ffmpeg -i rtsp://... -acodec copy -vcodec copy -f flv rtmp://...
[21:12:43 CEST] <kms_> but dont work
[21:13:32 CEST] <furq> oh no
[21:13:37 CEST] <furq> it's the dreaded "dont work" error
[21:15:52 CEST] <DHE> is that like "error failed" ?
[21:15:59 CEST] <durandal_1707> kepstin: why it have hstack/vstack/pad?
[21:16:23 CEST] <kepstin> durandal_1707: because I have 10 webcam videos that I'm laying out in a grid
[21:20:30 CEST] <kepstin> you'll note that you can't tile 10 equal-sized videos to fill a rectangle with hstack/vstack, which is why there's a pad in there too ;)
[21:22:19 CEST] <kepstin> anyways, I guess I'll take a look at the fps filter code later, I wonder why all these frames are being queued and why it's not just generating frames only as needed on the request_frame callback? or is there something weirder going on...
[21:34:25 CEST] <Fenrirthviti> furq: Output file #0 does not contain any stream
[21:34:28 CEST] <Fenrirthviti> So that's promising.
[21:34:45 CEST] <Fenrirthviti> the inspector fails half the time opening it with the same error too
[21:36:40 CEST] <Fenrirthviti> And yeah, ffmpeg reports the same error as my inspector: [mpegts @ 0x1553180] Continuity check failed for pid 0 expected 1 got 0 | [mpegts @ 0x1553180] Continuity check failed for pid 4097 expected 1 got 0
[21:40:19 CEST] <kms_> Invalid UE golomb code
[21:44:29 CEST] <kepstin> hmm, come to think of it, why am I running an fps filter before the hstack/vstack/etc? I think the framesync code in those should handle the timestamp jumps on their own, duplicating frames as needed
[21:44:46 CEST] <kepstin> then a single fps filter afterwards to get everything at the rate I want
[21:45:51 CEST] <BtbN> why not just setpts to something sane?
[21:47:22 CEST] <kepstin> in this case, the timestamps are correct - there is simply a long gap with no frames in the video. If I use setpts to change the timestamps, then i'll have A/V desync
[21:48:51 CEST] <ChocolateArmpits> kepstin, what about using -re ? Is realtime transcoding not an option ?
[21:49:34 CEST] <kepstin> ChocolateArmpits: wouldn't change anything except make it slower. This is batch processing from file sources to file output, has to run as fast as possible
[21:50:03 CEST] <kepstin> I mean, the real fix is that on the rtmp server side when originally saving the webcam files, we should disconnect the stream if there's no frames in X time :/
[21:50:22 CEST] Action: kepstin is gonna poke his server folks about that
[22:27:42 CEST] <faLUCE> Do you know if is there another good library that I can use for demuxing mpegts, other than libav?
[22:28:01 CEST] <BtbN> ffmpeg!
[22:28:29 CEST] <faLUCE> BtbN: it doesn't provide an asyncrhonous API
[22:29:05 CEST] <faLUCE> BtbN: then I'm forced to do the demuxing task in a blocking manner, and this is ugly
[22:29:38 CEST] <BtbN> It's how every other application does it.
[22:29:52 CEST] <faLUCE> BtbN: I'm sure that this is not true
[22:30:20 CEST] <BtbN> if you say so
[22:30:21 CEST] <faLUCE> using threads because the API is broken is ugly, IMHO
[22:31:07 CEST] <BtbN> A blocking api is not broken. It's blocking, a lot of APIs are, and there's nothing wrong with it. That's what threads exist for.
[22:32:19 CEST] <faLUCE> BtbN: really not. Threds are intended for taking advantage of multi-core mobos. Absolutely NOT for decoupling tasks, which is the UGLIEST way of coding
[22:32:36 CEST] <BtbN> Do what you want to make your life harder then, I'm not going to stop you.
[22:33:07 CEST] <faLUCE> BtbN: using the async programming is not harder than threads, if you know what you are doing
[22:33:36 CEST] <BtbN> But there is no advantage, and a lot more boilerplate around it.
[22:33:50 CEST] <faLUCE> on the other hand, using threads make things harder because of mutexes, deadlocks, no-portability etc.
[22:34:00 CEST] <BtbN> sorry, but that's bullshit.
[22:34:04 CEST] <faLUCE> BtbN:  don't absolutetly agree.
[22:34:16 CEST] <faLUCE> BtbN: for me, the bullshit is your opinion
[22:34:32 CEST] <james999> hi i'm a neutral third party, what is this about
[22:34:53 CEST] <BtbN> just some guy making his life hard because threads are evil in his weird world.
[22:34:54 CEST] <faLUCE> james999: I'm searching for an async mpegts demux library
[22:35:28 CEST] <faLUCE> (or some other guy that doesn't know what he is talking about)
[22:36:21 CEST] <BtbN> You're spending tons of time, multiple weeks now, to solve a problem that has basically been solved already. And you don't think you are doing something wrong?
[22:37:01 CEST] <faLUCE> BtbN: absolutely not. I created a 100% async library and I work with async A/V since years
[22:37:08 CEST] <james999> well i'm confused because i thought threads implmented asynchronous behavior?
[22:37:52 CEST] <haroldp> I have a working nginx config that uses ffmpeg to convert some crappy IP cams to RTMP for embedding in a web page.  But it sucks and I'd like to switch to Dash or HLS or some such.  Can someone help me update my config for that?  I'm not having much luck.
[22:39:38 CEST] <kepstin> james999: yep, threads, particularly cooperative threads like we used to have back on single-processor machines, were great for that sort of thing. With languages like python with the way it handles locking, it's still the only thing they're useful for :/
[22:39:59 CEST] <faLUCE> james999: no, threads are meant for synchronous programming
[22:40:16 CEST] <BtbN> uhm, what? No, not at all.
[22:40:32 CEST] <faLUCE> BtbN: are you serious??
[22:40:48 CEST] <BtbN> they are running asynchronous by definiton, that's the whole point of them.
[22:41:44 CEST] <kepstin> keep in mind that on linux, you more or less can't even do async io on files at all, either the IO completes immediately or it blocks. Most "async" IO libraries that deal with file io use threads in the background because of this :/
[22:41:45 CEST] <faLUCE> BtbN: threads are meant for SYNCHRONOUS programming, while event loop is meant for ASYNCHRONOUS programming. No need to explain more
[22:42:31 CEST] <BtbN> You must have never used Qt or some other decent library with a similar concept.
[22:43:05 CEST] <kepstin> for example, qt or glib, which have "asynchronous io" with event loops as a feature, implement the async io by using io threads :/
[22:43:10 CEST] <faLUCE> BtbN: as said before, I'm absolutely certain of what I'm saying. And I deal with threads and event loopers since years
[22:44:07 CEST] <faLUCE> so, if for example x264 uses internal threads, it's not a matter of the API, which is strictly asynchronous
[22:44:24 CEST] <BtbN> kepstin, threads are kind of the only portable way do do that, as otherwise you end up with platform specific things like epoll
[22:44:56 CEST] <kepstin> BtbN: polling on files doesn't do anything useful on linux, iirc it always returns writable/readable even if a write/read would block :/
[22:45:21 CEST] <faLUCE> BtbN: this is not true. the select()/poll() __template__ is absolutely portable.
[22:45:39 CEST] <BtbN> But it has quite a few issues by itself, which is why epoll was invented.
[22:47:00 CEST] <BtbN> If you're just handling a single file, it doesn't really matter, but once you are handling a lot of them, select/poll are kind of troublesome
[22:48:15 CEST] <faLUCE> BtbN: I would like to know why I can handle lot of devices in the same loop without any threads. As well as THIS library does (http://www.live555.com/liveMedia/)
[22:49:09 CEST] <faLUCE> threads used for decoupling stuff is shitty programming
[22:49:42 CEST] <BtbN> Because with select/poll you only learn that one of your fds had an event fired
[22:49:49 CEST] <BtbN> You then have to figure out which one
[22:49:53 CEST] <faLUCE> and what about libcurl??? does it use threads?? absolutely not
[22:49:58 CEST] <BtbN> if you are handling a lot of them, that becomes very limiting
[22:50:17 CEST] <faLUCE> BtbN: then tell to libcurl developer that his library is very limiting
[22:50:28 CEST] <faLUCE> he will laugh
[22:51:10 CEST] <BtbN> Yeah, because you always do hundrets of thousands of http requests in parallel, sure...
[22:51:55 CEST] <BtbN> If you are dealing with any notable amount of FDs, you need either epoll or threads to do so efficiently
[22:52:08 CEST] <BtbN> Or even both
[22:52:39 CEST] <faLUCE> BtbN: obviously this is false: it's up to the USER to decide to use threads or not, with the same library, in certain conditions. It's not UP to the library, unless it performs HEAVY tasks (like x264)
[22:53:01 CEST] <faLUCE> BtbN: I'm sure you don't know what you are talking about, forgive me.
[22:53:11 CEST] <faLUCE> but now, I don't want to convince anyone
[22:53:22 CEST] <BtbN> You are either trolling or have no clue what you are talking about.
[22:53:35 CEST] <furq> you know libcurl has examples for both epoll and threads for parallel requests, right
[22:53:37 CEST] <BtbN> Just gonna put you on ignore, don't want to waste my time with that bullshit anymore.
[22:54:05 CEST] <faLUCE> BtbN: this is strange: I think the same about your convintions. And do what you want (ignore/don't ignore), it's not  a matter, for me.
[22:57:19 CEST] <james999> so far the only thing i've learned is that Qt uses threads for non-blocking i/O
[22:57:31 CEST] <james999> because you don't want your program to freeze when a file doesn't exist or something
[22:57:42 CEST] <BtbN> When the disk is slow primarily
[22:57:53 CEST] <furq> that's the only way to do it on posix systems
[22:57:55 CEST] <BtbN> Or it's a mounted network share in disguise or something
[22:58:16 CEST] <BtbN> if a file plain doesn't exist you will get told so immediately
[22:58:29 CEST] <furq> someone else can probably explain in detail why aio is worthless
[22:58:41 CEST] <furq> i've had it explained to me but it was hard to make out over the anguished screaming
[22:58:44 CEST] <faLUCE> james999: do yu know wxwidgets ?
[22:58:49 CEST] <BtbN> well, unless it's a slow network mount, and even open'ing the file takes a while
[22:58:56 CEST] <james999> i've used programs with wxwidgets, don't know more
[23:01:09 CEST] <faLUCE> james999: they have a strict async API
[23:01:19 CEST] <furq> i'm sure that works well for file io
[23:03:22 CEST] <james999> <faLUCE> james999: no, threads are meant for synchronous programming
[23:03:36 CEST] <james999> I stil am confused what you meant by this
[23:03:49 CEST] <kepstin> yep, they have an async api. it's obviously implemented with threads, at least for file io... maybe not for network sockets.
[23:04:02 CEST] <kepstin> and probably depends on platform too
[23:04:04 CEST] <furq> i would hope it isn't for networking stuff
[23:04:18 CEST] <kepstin> i dunno if the windows overlapping io stuff works usefully on files?
[23:04:43 CEST] <furq> i believe iocp works as you'd expect with files
[23:04:52 CEST] <BtbN> Windows has an entirely separate API for files as well
[23:05:08 CEST] <furq> or "works", rather, since "works as you'd expect" is subject to interpretation when you're talking about windows
[23:06:47 CEST] Action: kepstin should look into some of these async io systems, he's curious how they pass the io completion message from the io thread into the event loop in the main thread.
[23:07:19 CEST] <kepstin> probably a few ways you could do it, e.g. signals or having a pipe that's being polled or something
[23:07:41 CEST] <BtbN> kepstin, at least Qt just sends one of its signals
[23:11:38 CEST] <faLUCE> james999: what does confuse you?
[00:00:00 CEST] --- Tue May 16 2017


More information about the Ffmpeg-devel-irc mailing list