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

burek burek021 at gmail.com
Mon Feb 19 03:05:01 EET 2018


[00:15:15 CET] <c_14> -v error -stats
[01:04:32 CET] <stelonix> Is ffmpeg capable of capturing animated cursors when taking screenshots?
[01:04:47 CET] <stelonix> I'm trying but the cursor is only visible when it's a static image
[01:05:17 CET] <stelonix> Using this page to test the cursors http://www.echoecho.com/csscursors.htm and the following command:
[01:05:32 CET] <stelonix> ffmpeg -f x11grab -video_size 1920x1080 -i $DISPLAY -vframes 1 screen.png
[01:05:56 CET] <c_14> -grap_mouse 1 ?
[01:05:56 CET] <stelonix> And vanilla-dmz cursors
[01:06:27 CET] <c_14> eeh, -draw_mouse 1
[01:07:23 CET] <stelonix> Still no luck
[01:07:42 CET] <c_14> Then probably no
[02:43:35 CET] <gamlegaz> hey! I'm trying to run the video encoding example over at https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/encode_video.c, but I get the error [libx264 @ 0x...] The encoder timebase is not set. at line 127 (avcodec_open2). However if I try to set the codecs time_base also it says that the codec has no member time_base, does anyone know whats up?
[03:09:29 CET] <dystopia_> thank you very much c_14
[03:11:28 CET] <heicrd> aresample question
[03:12:02 CET] <heicrd> when using ffmpeg to encode 32khz audio to opus, the automatically inserted aresample filter chooses to downsample to 24khz
[03:12:07 CET] <heicrd> instead of upsampling to 48khz
[03:12:18 CET] <heicrd> which comes with a significant loss in quality
[03:12:27 CET] <heicrd> i was wondering if this is intended behavior or considered a bug
[03:12:54 CET] <JEEB> are you using the libopus wrapper or the native opus encoder?
[03:13:02 CET] <heicrd> libopus
[03:13:05 CET] <heicrd> opus just segfaults
[03:13:36 CET] <JEEB> hah :D
[03:13:37 CET] <heicrd> it doesn't however choose 24khz because i don't think 24khz is listed as a supported format in the native opus encoder
[03:13:43 CET] <JEEB> yea
[03:13:52 CET] <JEEB> libopus supports 48000, 24000, 16000, 12000, 8000, 0,
[03:14:03 CET] <JEEB> meanwhile the internal one .supported_samplerates = (const int []){ 48000, 0 },
[03:14:41 CET] <JEEB> not 100% sure but you could look at the output of -v verbose
[03:14:49 CET] <JEEB> which might show you the automated filter chain creation
[03:15:28 CET] <heicrd> [format_out_0_0 @ 0x5641f27f6f20] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[03:15:32 CET] <heicrd> [auto_resampler_0 @ 0x5641f27f9ae0] ch:1 chl:mono fmt:s16 r:32000Hz -> ch:1 chl:mono fmt:s16 r:24000Hz
[03:16:13 CET] <JEEB> it doesn't show the logic regarding how it got to that decision
[03:16:23 CET] <JEEB> oh well
[03:16:46 CET] <heicrd> for what it's worth using opusenc seems to upsample to 48khz as expected
[03:17:01 CET] <JEEB> -af aresample=48000
[03:17:07 CET] <JEEB> will make it upsample
[03:17:20 CET] <JEEB> I do wonder why it picks the lower one, though
[03:17:31 CET] <heicrd> that's what I was wondering
[03:17:33 CET] <JEEB> make a ticket about that, I guess? also the internal one shouldn't crash either
[03:17:50 CET] <heicrd> i figured out how to make it create a proper file but it took me quite a while before i figured out that there was something wrong
[03:17:56 CET] <JEEB> can you check if that has any autoinserted filters in there?
[03:19:02 CET] <heicrd> manually specifying aresample=48000 removes the auto-inserted filter
[03:19:10 CET] <JEEB> yes
[03:19:21 CET] <JEEB> since it can negotiate the sample rate with the encoder
[03:21:39 CET] <heicrd> so should I just file it as a bug report?
[07:48:57 CET] <cousin_luigi> Greetings.
[08:05:47 CET] <SortaCore> hi
[10:38:00 CET] <darsain> is there a filter variable for input framerate, similar to iw, ih, ...? can't find it in docs
[10:45:54 CET] <durandal_1707> darsain: for which filter?
[10:48:09 CET] <darsain> durandal_1707, I'm trying to set max fps, so I envision something like min(inputrate, 30), not sure what is the filter name for that. atm I'm first trying to find the inputrate variable name :)
[10:51:32 CET] <durandal_1707> darsain: such variables are explained in documentation of each filter, better explain what you need
[10:54:33 CET] <darsain> durandal_1707, I need to set max fps. I'm looking at https://ffmpeg.org/ffmpeg-filters.html#framerate and I don't see any mention of available variables, but I might be at a worng place? really not sure, these docs aren't that newbie friendly
[10:56:32 CET] <durandal_1707> darsain: you cant use expression for that option
[10:57:23 CET] <darsain> durandal_1707, is there a filter to set framerate I can use an expression for?
[10:57:31 CET] <durandal_1707> you would need to write some script or similar
[10:57:51 CET] <durandal_1707> none that i know
[11:53:07 CET] <utack> this might sound idiotic: but is there a way to combine luma from one video stream with chroma from a second video stream, frame by frame?
[11:55:41 CET] <fritsch> same resolution?
[11:56:06 CET] <fritsch> exactly same fps?
[11:57:47 CET] <durandal_1707> utack: see mergeplanes filter
[12:12:14 CET] <utack> fritsch chroma would have t obe upscaled, same fps yes
[12:12:22 CET] <utack> thanks durandal_1707
[12:13:02 CET] <utack> mergeplanes sounds exactly like what i need
[12:13:05 CET] <durandal_1707> utack: depends on pix format you set in options
[12:13:55 CET] <durandal_1707> yuv420p would have half chroma resolution in width/height
[12:14:29 CET] <gamlegaz> Why does avcodec_open2 fail the check for time_base  in the videoencoding example? the AVcontext is set to c->time_base = (AVRational){1,25} before calling the open function
[12:48:48 CET] <darsain> I have this crop + scale flter setup: https://kopy.io/7PTPt
[12:49:58 CET] <darsain> the problem is that scale ignores crop, so it adds the bars back in. the best solution would be if there were some iw,ow variable alternatives that take the previous crop into consideration, but I don't see anything in docs
[12:50:06 CET] <darsain> any ideas how to fix this?
[12:51:58 CET] <darsain> the scale filter is just a fancy bulletproof way how to downscale only to a predefined megapixel value specified by 1280*720 number
[13:09:02 CET] <fdsf>  
[13:12:31 CET] <darsain> I guess you cant have multiple filters as separate -vf args...
[13:12:41 CET] <darsain> I've tried combining it into one like this:
[13:12:53 CET] <darsain> -vf "!cropfilter!,scale='trunc(min(sqrt(600*400/(iw*ih))*iw\,iw)/ohsub)*ohsub:trunc(ow/a/ovsub)*ovsub'"
[13:13:02 CET] <darsain> and it now does what it's supposed
[13:13:31 CET] <JEEB> yes, multiple vf options probably just have the last override everything :P
[13:13:44 CET] <JEEB> which is why you had the nonsense result of "scale ignoring crop" which cannot happen normally
[13:13:55 CET] <JEEB> because once an AVFrame comes out of crop it is already cropped
[13:14:26 CET] <darsain> yeah I wish I knew this half an hour ago. would save me half an hour of my life :)
[13:18:17 CET] <darsain> yesterday I've spent 4 hours fixing ffmpeg complaining about input pipe from unzip command. I was trying to concatenate images from zip file into a video, which worked 90% of the time, and 10% it failed for no known reason. I had to resort changing a simle oneliner int oa complicated script that extracts the zip into a tmp folder, constructs a concatenation file, feeds it to ffmpeg, and than clear all the tmp stuff
[13:18:23 CET] <darsain> it made me die a little bit inside
[13:24:26 CET] <bat86> Hi there! can I use the parameter -hwaccel to improve x265 encoding with amd hardware (apu a8-7600) and linux system? thank you
[13:24:52 CET] <JEEB> x265 is a software encoder for HEVC
[13:25:04 CET] <JEEB> so no
[13:25:54 CET] <bat86> libx265?
[13:26:28 CET] <JEEB> yes, that is the library of that project that FFmpeg can utilize
[13:27:37 CET] <bat86> so is it possible to use  -hwaccel with libx265?
[13:27:58 CET] <JEEB> no, as I said it is a software implementation
[13:29:30 CET] <bat86> so there is no way to use harware acceleration?
[13:31:33 CET] <kerio> bat86: x265 is a software encoder for hevc/h.265
[13:31:34 CET] <jkqxz> Not on that hardware, because it doesn't support H.265 at all.
[13:33:50 CET] <bat86> jkqxz: a quick web search show me it does
[13:34:44 CET] <bat86> kerio: yes, my mistake i mean libx265
[13:35:00 CET] <kerio> no, you mean h265
[13:35:59 CET] <jkqxz> Unless I'm mistaken it's a Kaveri with VCE 2.0, which has H.264 only.
[13:40:20 CET] <bat86> jkqxz: digging deeper i found you are right
[18:10:08 CET] <gzp> Hello, how to specify the VTS when using -i filename.iso as source? I would like to convert only vts1, not the other menus and commercials
[18:12:02 CET] <JEEB> I'm not even sure which input thing gets used with an ISO :P
[18:12:14 CET] <JEEB> see which protocol and demuxer is getting used
[18:13:22 CET] <gzp> Input #0, mpeg
[18:13:33 CET] <gzp> Stream #0:0[0x1bf]: Data: dvd_nav_packet
[18:13:50 CET] <gzp> Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 64:45 DAR 16:9], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
[18:14:21 CET] <gzp> but the results will contain everything, instead of vts1 I would like
[18:18:58 CET] <JEEB> that's just the demuxer, the protocol probably would be more interesting
[18:19:13 CET] <JEEB> post the full command line and terminal output with -v verbose on a pastebin like site of your choice
[18:20:36 CET] <gzp> k
[18:24:28 CET] <gzp> JEEB, https://pastebin.com/7CNYwKih
[18:36:36 CET] <furq> i'm surprised there is even an iso demuxer
[18:36:46 CET] <furq> but there's definitely no titleset handling or anything like that
[18:37:05 CET] <furq> you probably just want to rip an individual title with dvdbackup or tccat or something and then use ffmpeg on that
[18:37:35 CET] <gzp> ok, thanks
[18:38:04 CET] <gzp> thought there is something like that :-)
[18:39:43 CET] <furq> you can usually just pipe tccat into ffmpeg if you want to avoid creating a temporary file
[18:40:02 CET] <furq> although that will sometimes miss subtitle streams depending on the dvd layout
[18:50:25 CET] <gzp> dvdbackup is better from this point of view?
[19:05:15 CET] <aphirst> I have some files which are in 23.97... fps and I want to remux them to be 25
[19:05:40 CET] <aphirst> i've tried a few GUI tools and changing the video is easy
[19:06:06 CET] <aphirst> but none seem to automatically rescale the audio
[19:06:37 CET] <aphirst> i would have thought that would also have been simple
[19:07:56 CET] <aphirst> maybe i should have asked in #matroska instead
[20:07:18 CET] <darsain> I'm using cropdetect to cut off black bars, but I have a video that starts with a few seconds of black screen, so the cropdetect tells the encoder to cut out the whole video. is there a way how to tell cropdetect to look at the middle of the video and not the very beginning?
[20:08:10 CET] <darsain> I'm looking at the docs and there is some potential reset_count option, but it's description is really not helping me understant what it actually does
[20:14:00 CET] <davemacdo> Hello #ffmpeg. I was wondering if anybody here might have the time to help me with a streaming project. I have a rpi 3 running Raspbian, and I would like to use ffmpeg to stream the Raspbian desktop to YouTube with rtmp.
[20:14:40 CET] <furq> darsain: cropdetect supports timeline editing
[20:14:54 CET] <furq> so i guess you can do cropdetect=enable=between(t\,10\,20)
[20:15:56 CET] <davemacdo> I have looked into the suggestion here: https://askubuntu.com/questions/893499/how-to-stream-desktop-and-audio-with-ffmpeg-in-youtube
[20:18:57 CET] <darsain> furq, not that proficient with ffmpeg, so I have no idea how to use your suggestion :) just pasting it into -vf produced errors
[20:19:19 CET] <furq> pastebin your command
[20:19:40 CET] <furq> davemacdo: you won't be able to use libx264 on a pi 3, the cpu isn't good enough
[20:20:05 CET] <furq> if you have a build with --enable-omx then h264_omx is the hardware encoder
[20:20:08 CET] <darsain> furq, with your suggestion its: https://pastebin.com/3pV1CtTT
[20:20:13 CET] <darsain> before it was just cropdetect
[20:20:14 CET] <furq> if you don't then you're probably going to need to build it yourself
[20:20:26 CET] <furq> darsain: quote the entire -vf argument
[20:20:53 CET] <davemacdo> furq, how can I tell?
[20:21:06 CET] <furq> davemacdo: ffmpeg -version | grep omx
[20:21:24 CET] <darsain> furq, No such filter: 'cropdetect=enable=between(t,10,20)'
[20:22:04 CET] <davemacdo> Ok. --enable-omx seems to be there.
[20:22:07 CET] <davemacdo> Thanks.
[20:22:19 CET] <furq> darsain: weird, that works fine here
[20:22:37 CET] <furq> -vf "cropdetect=enable=between(t\,10\,20)"
[20:30:06 CET] <darsain> furq, what is that between(t\\,10\\,20) doing btw?
[20:30:31 CET] <furq> the filter will only run between 10 and 20 seconds
[20:31:34 CET] <darsain> oh I cant use that anyway. what if I feed it an 8 second clip? needs to be relative and select a middle point in the video
[20:32:17 CET] <durandal_1707> learn to code :/
[20:32:56 CET] <darsain> I know how to code, it doesn't help decrypting ffmpeg arguments documentation unforunately :(
[20:34:04 CET] <durandal_1707> expressions as options are not always available
[20:38:14 CET] <darsain> I'd expect to do sonething like cropdetect=t=input_time/2, but how do you do that in ffmpeg? is it even supported? 15 minutes in documentation and googling don't make me any wiser
[20:41:49 CET] <durandal_1707> darsain: because its not possible
[20:42:19 CET] <durandal_1707> learn to write shell scripts
[20:52:59 CET] <darsain> ugh, again, I know how to write shell scripts. I wrote a few hundred lines of those just today working with ffmpeg. how does that help me understand how to tell ffmpeg to cropdetect from the middle of the video?
[20:53:37 CET] <darsain> but I get it. you are telling me to go fuck myself. just be straight next time and don't hinde behind euphemisms like "learn to write shell scripts"
[20:54:47 CET] <durandal_1707> well i said that options you are looking for are not expresssions
[20:55:20 CET] <durandal_1707> so cant use what you want, but they could if you change c code
[21:26:45 CET] <blawiz> hmm im using 'ffmpeg -ss $2 -i $1 -c copy -to $3 cut_${2/:/}_${3/:/}_${1:t}.avi' but it still seems to read it as '-t'
[21:27:38 CET] <blawiz> so when i give timestamps 01:25:32.0 and 01:30:16.0 i get a from 1:25 till end of the movie, instead of just to 1:30
[21:43:55 CET] <furq> blawiz: iirc -to only works if you use -ss as an output option
[21:44:51 CET] <furq> actually nvm i guess you can use -to as an input option
[21:45:03 CET] <furq> either way they both need to be on the same side
[21:46:24 CET] <blawiz> hmm whats the difference?
[21:46:50 CET] <furq> -ss 1 -to 2 -i will seek to 1, read until 2, and then stop
[21:47:05 CET] <furq> -i foo -ss 1 -to 2 will read from 0, discard everything until 1, then stop writing after 2
[21:47:49 CET] <furq> -to as an input option uses the input timestamps, as an output option it uses the output timestamps
[21:47:51 CET] <blawiz> hmm, so the first is more effective?
[21:47:58 CET] <furq> the first is quicker, the second is more accurate
[21:48:12 CET] <furq> -ss as an input option is sometimes less accurate
[21:48:32 CET] <blawiz> hmm i just want to cut a movie from pos to pos
[21:48:35 CET] <davemacdo> Ok. So I'll try to be more specific this time with my ffmpeg on rpi 3 question. I'm trying to stream the Raspbian desktop. When I type the following command in terminal, I get an error "Option sample rate note found" ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f x11grab -framerate 30 -ac 2 -i :0.0 -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/xxxxxxxx
[21:48:58 CET] <davemacdo> Isn't the `-ar 44100` setting the sample rate?
[21:48:58 CET] <furq> blawiz: just try it both ways and see which works best
[21:49:22 CET] <furq> davemacdo: input options need to go before the input they apply to
[21:49:33 CET] <furq> you're trying to apply -ar (-sample_rate) to the x11grab input
[21:49:59 CET] <davemacdo> Isn't it already before? Or do you mean immediately before?
[21:50:13 CET] <furq> [input1 options] -i input1 [input2 options] -i input2
[21:50:19 CET] <furq> it looks like you've got them all the wrong way round
[21:56:36 CET] <davemacdo> Hm. I've copied most of the line from Stack Exchange, and I don't really understand all of it. I've found a few references to doing what I'm trying to do, and they all include `-f x11grab`.
[21:57:30 CET] <furq> yeah on closer inspection that command is just broken
[21:57:50 CET] <furq> do you want to stream audio as well
[21:58:05 CET] <davemacdo> I would eventually like to stream audio, but I'll cross the video bridge first.
[21:58:25 CET] <bindi> what are you trying to accomplish, if i may ask?
[21:58:41 CET] <davemacdo> Standalone art project running on Pi, streaming to YouTube.
[21:58:51 CET] <davemacdo> Pi 3
[21:59:01 CET] <furq> http://vpaste.net/2ArI9
[21:59:05 CET] <furq> something like that
[21:59:44 CET] <davemacdo> Thank you for your help. Can you tell me what -f lavfi is doing?
[21:59:52 CET] <furq> lavfi is libavfilter
[22:00:03 CET] <furq> -f lavfi -i anullsrc is a virtual audio input
[22:00:09 CET] <furq> in this case anullsrc which is just silence
[22:00:31 CET] <furq> youtube doesn't like it if you send it flv with no audio stream
[22:00:38 CET] <davemacdo> Ok. So when I get to the audio later, that's where I would start changing.
[22:00:41 CET] <furq> right
[22:00:50 CET] <furq> you'd probably want to change that to -f pulse -i 1
[22:00:54 CET] <furq> or whatever pulse device you want to use
[22:03:12 CET] <furq> it is worth pointing out that the rpi's hardware h264 encoder is not particularly great
[22:04:07 CET] <davemacdo> I don't think I'll be pushing it very hard.
[22:06:44 CET] <davemacdo> "Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width, or height"
[22:07:17 CET] <furq> pastebin the full output
[22:09:30 CET] <davemacdo> https://pastebin.com/mMV1cfC4
[22:09:43 CET] <furq> [h264_omx @ 0x72f530] libOmxCore.so not found
[22:09:44 CET] <furq> oh fun
[22:10:03 CET] <davemacdo> Sounds like I have some work to do.
[22:11:04 CET] <blawiz> i seem to get the same result wheather its to the left or right of -c
[22:12:02 CET] <davemacdo> Might have to try recompiling ffmpeg. (See you in like a week.)
[22:12:30 CET] <furq> there is an --enable-omx-rpi switch
[22:12:40 CET] <furq> i thought that just changed the search path but apparently not
[22:13:40 CET] <davemacdo> is that just `ffmpeg --enable-omx-rpi`?
[22:13:52 CET] <furq> no that's at compile time
[22:14:07 CET] <blawiz> ah i got it :]
[22:14:09 CET] <furq> according to google, raspbian handles it weird
[22:14:11 CET] <davemacdo> Well crap.
[22:14:17 CET] <furq> try apt-get install libomxil-bellagio-bin
[22:14:23 CET] <furq> and/or -dev
[22:14:59 CET] <furq> if that doesn't work then it's fairly easy to cross-compile if you happen to have a desktop debian box there
[22:15:10 CET] <furq> and it shouldn't be that slow to do it on the box itself if you're not building any dependencies
[22:15:33 CET] <furq> on the rpi itself, i mean
[22:16:11 CET] <davemacdo> I don't have a debian box handy. I'm VNC'ing from my iMac. Hopefully that library works.
[22:19:00 CET] <davemacdo> No love after installing the bellagio library. Do I need to tell ffmpeg to look somewhere else for the encoder?
[22:19:59 CET] <Evermore> I know that lossy video codecs almost never round-trip (decode, re-encode the same data) without generational loss, but is the loss minimized by using the same codec on both sides, or does it not matter?
[22:20:30 CET] <furq> Evermore: makes no difference
[22:20:43 CET] <Evermore> ah ok
[22:21:09 CET] <Evermore> Also can ffmpeg use libx264 internally? I had previously written code that used both of them but they might have integrated by now
[22:21:18 CET] <Evermore> I am thinking of writing a video editor as an exercise
[22:21:32 CET] <JEEB> libavcodec has had a libx264 wrapper for quite a while
[22:21:55 CET] <Evermore> great I'll just use that
[22:22:37 CET] <DHE> yeah just use the normal ffmpeg encoder API. it's how libx264 has worked for a long time
[23:30:53 CET] <Elec_A> Hi, I'm using "ffmpeg -r 60 -pattern_type glob -i '*.JPG' -c:v copy output.avi" to create a timelapse, but change -r argument to 25 30 60 does not effect the length of the movie. What I'm missing ?
[23:43:00 CET] <DHE> first of all there is a -framerate option for the JPEG reader that would be preferable to use. that might help
[00:00:00 CET] --- Mon Feb 19 2018


More information about the Ffmpeg-devel-irc mailing list