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

burek burek at teamnet.rs
Wed Sep 11 03:05:05 EEST 2019


[02:16:04 CEST] <Retal> Hello guys
[02:16:04 CEST] <Retal> I am trying get info about UDP stream bitrate info. I see frame size, fps.....
[02:16:04 CEST] <Retal> but no bitrate: bitrate: N/A
[02:16:04 CEST] <Retal> how to find bitrate info for UDP streams?
[02:18:38 CEST] <cehoyos> You have to calculate it (yourself), it is not part of the metadata iirc
[02:33:23 CEST] <Retal> cehoyos: how ?
[02:35:45 CEST] <cehoyos> If you copy the stream to /dev/null with ffmpeg, the status and the completion line both contain the bitrate iirc
[02:36:05 CEST] <cehoyos> If you write the stream to a file, you can calculate the bitrate (after writing)
[04:24:53 CEST] <danilo82> where can i see informations about the options for compilation?
[04:26:14 CEST] <pink_mist> ./configure --help
[06:12:41 CEST] <noumenon> <noumenon> here's a bit of a different question, based on something I'm about to do: I'm going to extract a certain audio clip from a specific time in a video using ffpmeg; would I be better off first cutting out the right part of the video and then extracting the audio, or extracting the entire audio first and then collecting the right part of it?
[06:13:04 CEST] <noumenon> or better yet, if there's built-in support for doing it all at once, that would be nice
[06:17:26 CEST] <DHE> while it can be done, ffmpeg as a CLI app is a bit of a blunt tool. depending on your exact needs, ffmpeg can extract the audio, save to .wav or something, and you can edit with a tool like audacity if that's your preference
[06:17:51 CEST] <wozencroft> Is it possible to play videos on the suckless surf browser?
[06:18:51 CEST] <noumenon> DHE: seems like it fits the bill nicely, extract the audio and then trim out the specific small clip I'm after
[06:19:16 CEST] <noumenon> was thinking of writing a small command for doing those two in succession for a specific time in a video, so that I can easily get small audio clips from videos
[06:19:32 CEST] <pink_mist> wozencroft: this is #ffmpeg, not #the-suckless-surf-browser
[06:19:43 CEST] <noumenon> that's why I was wondering whether or not extract entire audio and then trim is better than trim video and extract audio or vice versa
[06:19:50 CEST] <DHE> yeah ffmpeg can do that in one shot, but getting precise measurements into ffmpeg can be hard. coarse measurements and then something precise like audacity might work nicely
[06:20:17 CEST] <noumenon> right
[06:21:49 CEST] <noumenon> don't really need the precision either, since I'd be stuffing them into kdenlive where I can trim them more accurately too
[06:22:07 CEST] <noumenon> but you say you can do both in one shot, any trick to this?
[06:22:40 CEST] <DHE> ffmpeg -i inputfile.mp4 -ss [starttime-in-seconds] -t [duration-in-seconds] -map 0:a output.wav
[06:22:54 CEST] <DHE> I think that'll do
[06:23:05 CEST] <VadPerevad> wozencroft: copy link, play with mpv
[06:23:43 CEST] <noumenon> heh, was that off the top of your head?
[06:23:43 CEST] <noumenon> mad skills
[06:24:01 CEST] <DHE> make sure it works first. :)
[06:25:21 CEST] <noumenon> yeah, gonna try it now, finding a suitable clip
[06:25:21 CEST] <wozencroft> VadPerevad: Thx, that would be a good workaround. IT'd be great to get that working though
[06:27:51 CEST] <VadPerevad> wozencroft: if you need lite youtube version, there is tonvid dot com - copy link, play with mpv - easy as egg
[06:27:56 CEST] <noumenon> hmm
[06:27:58 CEST] <noumenon> [wav @ 0x56443e1b0c40] WAVE files have exactly one stream
[06:27:58 CEST] <noumenon> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
[06:27:59 CEST] <noumenon> Error initializing output stream 0:1 --
[06:28:16 CEST] <noumenon> when I tried your command @ DHE
[06:29:11 CEST] <noumenon> with the inputfile.mp4 replaced with my movie file and starttime and durations replaced as well
[06:29:19 CEST] <DHE> you included -map 0:a ?
[06:29:29 CEST] <wozencroft> VadPerevad: Ok, I see, thx.
[06:29:32 CEST] <noumenon> yep
[06:29:50 CEST] <DHE> hmm.. can you pastebin the entire output of ffmpeg there?
[06:29:56 CEST] <noumenon> certainly
[06:31:22 CEST] <noumenon> https://pastebin.com/raw/Z1jg16A8
[06:31:41 CEST] <DHE> ah. you have 2 audio streams. you'll have to pick one.
[06:32:04 CEST] <DHE> 0:1 for the 5.1 surround, or 0:2 for the stereo version...
[06:32:22 CEST] <noumenon> hmm, I see; does it matter?
[06:32:52 CEST] <noumenon> like, if I pick the surround, will people with surround speakers be able to hear it in surround if it's preserved somehow all the way to them?
[06:32:53 CEST] <DHE> well, if this were an over the air broadcast usually the stereo feed is also the "Described video" variant for visually impaired viewers. but that metadata isn't indicated here.
[06:33:15 CEST] <DHE> at least that's how it is here in canada
[06:34:03 CEST] <noumenon> that doesn't tell me much
[06:34:15 CEST] <DHE> I'd start with the 5.1 version and see how it works out
[06:34:21 CEST] <noumenon> yeah, I'll try
[06:34:29 CEST] <noumenon> so -map 0:1 I guess, right
[06:34:32 CEST] <DHE> never tried 5.1 to a .wav file so...
[06:34:34 CEST] <DHE> yeah that's right
[06:35:33 CEST] <noumenon> awesome, that worked just fine
[06:36:08 CEST] <noumenon> and not a very complicated command either; what exactly does -map do?
[06:36:14 CEST] <noumenon> I guess I can go RTFM, heh
[06:36:29 CEST] <DHE> it selects which input streams get mapped into the output stream
[06:36:45 CEST] <DHE> since i knew that the default would try to pull in video and audio to a .wav which clearly isn't going to work
[06:37:02 CEST] <noumenon> oh, so the two audio streams were input streams from the movie; now I understand better what you meant previously
[06:37:32 CEST] <DHE> summarized on lines 19,23,27 of your output
[06:37:54 CEST] <noumenon> yes, I see now
[06:38:03 CEST] <noumenon> thanks a bunch
[08:40:26 CEST] <pingufan> Good morning.
[08:43:31 CEST] <pingufan> I am trying to recode an .mkv to make it more compact.   I use the same settings as earlier (before I upgraded my PC to openSuSE Leap 15.0).  I want to encode in h.264 but I see always see mpg2 as video format.   Can somebody, please, check if my settings are correct?
[08:43:57 CEST] <pingufan> ffmpeg -i "$SRC" \
[08:43:58 CEST] <pingufan>   -vcodec libx264 -vf hqdn3d=8:8:12:12 -x264opts keyint=5 -r 25 \
[08:44:00 CEST] <pingufan>   -acodec ac3 -ac 2 -target film-dvd -s 1920x1080 -crf 19 \
[08:44:01 CEST] <pingufan>   -map 0:0 -map 0:1 \
[08:44:03 CEST] <pingufan>   -y "$TRG"
[08:47:46 CEST] <DHE> keyint=5 is crazy low for h264. most people use 60 or way higher
[08:49:16 CEST] <pingufan> Ok. But except of that ...
[08:50:07 CEST] <pingufan> I was able to squeeze down a full Bluray movie of 40GB to 8GB without noticable quality loss in FullHD.
[08:51:01 CEST] <pingufan> This I want to do again, but I always get an MPEG2 video and no h.264
[08:52:23 CEST] <pingufan> Or is it h.264 but only mentiones as mpeg2 in mplayer and ffplay ?
[08:53:17 CEST] <DHE> I'm going to need to see this output that claims it's mpeg2. you may be misreading it
[08:57:05 CEST] <pingufan> Ok, I try by pastebin...
[08:57:52 CEST] <pingufan> Here you see what mplayer shows:   https://pastebin.com/Tj67ZGqQ
[08:59:45 CEST] <DHE> hmm.. it does claim mpeg2, and 9 megabits is high enough that it may not be immediately apparent if it's h264 or not by visual inspection if you don't know what to look for
[09:00:20 CEST] <DHE> ... I think -target is being taken literally. 9 megabit MPEG2 is exactly right for DVD video
[09:00:28 CEST] <DHE> and overriding all your other settings
[09:02:53 CEST] <pingufan> What shall I choose instead?   Seems that something was changed then in ffmpeg. This is exactly the same script I used before on openSuSE 13.2, and there it produced h.264.   Now I had to add "pal-" as prefix, too.
[09:04:12 CEST] <pingufan> What I want to generate is an h.264 encoded .mkv file in 1920x1080 resolution and CRF 19 for quality.
[09:04:35 CEST] <DHE> don't set a target. just take that clause out and leave the rest
[09:06:15 CEST] <pingufan> Yes, this solved it.
[09:07:27 CEST] <pingufan> Do you know the shell script   "ffx264"?   I tried with it, too, before I asked here.  It asks a lot but then also created an mpeg2.
[09:12:40 CEST] <pingufan> Thank you so much for your help, DHE
[11:50:51 CEST] <Radiator> Hi all, I have a bit of a struggle there, I have a GeForce GTX 1050Ti and I try to decode from h264. I used the example here (https://ffmpeg.org/doxygen/4.1/hw_decode_8c-example.html) using the keyword cuda to decode the stream from a camera. It says that h264 isn't supported through cuda even though it seems to be. I've done some research and it
[11:50:51 CEST] <Radiator> seems that it would want to use the decoder H264_cuvid for NVIDIA. Any idea how acheive that or if I am wrong, how to actually decode using cuda ?
[11:59:30 CEST] <SimAV> Radiator, does "ffmpeg -hide_banner -decoders | grep h264_cuvid" print something?
[11:59:48 CEST] <JEEB> (making sure it's the same FFmpeg as the libraries being utilized)
[12:02:16 CEST] <Radiator> SimAV: Yes it does, it gives me "V..... h264_cuvid           Nvidia CUVID H264 decoder (codec h264)"
[12:02:28 CEST] <JEEB> Radiator: also have you checked at which point the code fails?
[12:02:59 CEST] <JEEB> are you able to create a hwaccel device for your type etc?
[12:03:11 CEST] <JEEB> since I think at that point it should be talking to cuvid
[12:03:28 CEST] <Radiator> It's right after calling the method avcodev_get_hw_config
[12:03:57 CEST] <Radiator> *avcodec_get_hw_config
[12:04:56 CEST] <JEEB> ok, so you do have the hwdevice type at least
[12:05:05 CEST] <Radiator> Yup
[12:05:46 CEST] <JEEB> I think your best bet is to heighten the verbosity
[12:05:55 CEST] <Radiator> And I did make sure that I enabled cuda and cuvid at the built of the lib
[12:06:07 CEST] <JEEB> av_log_set_level
[12:06:24 CEST] <JEEB> for example I guess AV_LOG_DEBUG
[12:06:53 CEST] <Radiator> Give me a minute I'll try that
[12:07:00 CEST] <JEEB> also make sure that if you are using an older version of FFmpeg, you wlil have to initialize the libraries
[12:07:14 CEST] <JEEB> that was probably removed from the examples after that requirement for API usage was removed
[12:07:30 CEST] <Radiator> I'm on the latest available for my distribution
[12:08:07 CEST] <JEEB> which is?
[12:08:59 CEST] <JEEB> anyways, Feb 2018 is when that change was made into the example so any release branch branched after that should have that
[12:09:19 CEST] <Radiator> N-94800-gcb8c353032
[12:09:31 CEST] <Radiator> That's the version i get using ffmpef -version
[12:09:40 CEST] <Radiator> ffmpeg*
[12:09:58 CEST] <JEEB> which is very recent
[12:10:01 CEST] <JEEB> so that shouldn't be the case
[12:10:05 CEST] <SimAV> Radiator, did you try decoding using the ffmpeg CLI programm, to see whether all dependencies can be fulfilled and required access is granted?
[12:10:47 CEST] <JEEB> anyways, I have no idea if that example currently works (unfortunately), but bumping the log level should help
[12:12:15 CEST] <Radiator> SimAV: I haven't no, I am not very familiar with the CLI but I'll give it a shot
[12:13:30 CEST] <JEEB> I think the thing you listed is the separate decoder, which also exists.
[12:13:55 CEST] <JEEB> now to remember which was the option to set which hwaccel you want to utilize in ffmpeg.c
[12:14:02 CEST] <JEEB> clearly it has hwaccel related code :P
[12:14:23 CEST] <JEEB> you cna list them from the ffmpeg.c command line app with `ffmpeg -hwaccels`
[12:14:46 CEST] <JEEB> ok, so just that :P
[12:14:47 CEST] <JEEB> -hwaccel hwaccel name  use HW accelerated decoding
[12:14:59 CEST] <JEEB> (found with `ffmpeg -h full |grep hwaccel`)
[12:15:21 CEST] <JEEB> and if that works, and seem sto utilize hwaccel, you can peek into ffmpeg.c
[12:15:26 CEST] <JEEB> which is under fftools/ffmpeg.c
[12:15:42 CEST] <JEEB> although I think a lot of its hwaccel stuff is in a separate file dedicated to hwaccels
[12:16:05 CEST] <JEEB> or actually, multiple :P
[12:16:25 CEST] <JEEB> because hwaccels require different initialization from the client, and you can't really nicely abstract that
[12:16:45 CEST] <Radiator> JEEB: It has it and when I look at the configuration I do have the enable-cuvid
[12:16:57 CEST] <SimAV> Radiator, might "cuvid" instead of "cuda" help?
[12:17:12 CEST] <JEEB> SimAV: decoders != hwaccels
[12:17:33 CEST] <Radiator> Oh
[12:17:43 CEST] <JEEB> anyways, Radiator - try with ffmpeg.c with `ffmpeg -v verbose -hwaccel HWACCEL_NAME -i INPUT -f null -`
[12:17:50 CEST] <JEEB> you get a list of hwaccels with -hwaccels
[12:18:11 CEST] <Radiator> I did that and it lists me the divice types available "vdpau vaapi drm"
[12:18:28 CEST] <JEEB> ok, so at least your ffmpeg.c binary doesn't have it
[12:18:45 CEST] <JEEB> which is why I wanted ot make sure you are linking against the same thing
[12:18:54 CEST] <JEEB> and makign sure it's the same stuff getting utilized
[12:19:41 CEST] <JEEB> and yes, there are cuvid or so decoders as well, those were added before hwaccel interface was added for more optimized hw decoding usage
[12:19:59 CEST] <JEEB> as in, you can output to a texture instead of getting the picture into RAM etc
[12:20:06 CEST] <Radiator> Nevermind, using the cuda hwaccel works with ffmpeg
[12:20:22 CEST] <JEEB> post the full command line and log on pastebin or so and link here
[12:20:26 CEST] <JEEB> just for verification
[12:23:29 CEST] <Radiator> https://pastebin.com/MfXBzFnh
[12:25:00 CEST] <JEEB> yup, nvdec is utilized
[12:27:42 CEST] <Radiator> So, should I disable cuvid ?
[12:28:53 CEST] <Radiator> In my current configuration I have --enable-cuda-sdk --enable-cuvid --enable-nvenc and other stuff not related to it
[12:29:03 CEST] <Radiator> I don't have --enable-nvdec
[12:29:38 CEST] <SimAV> I didn't have the problem yet, that too much was enabled in ffmpeg ;)
[12:32:08 CEST] <Radiator> enable components until it works
[12:33:55 CEST] <Radiator> Well, let's build , thanks for your help !
[13:21:47 CEST] <Radiator> Well, even by enabling the nvdec in the config, it doesn't work
[13:22:45 CEST] <JEEB> if it works in ffmpeg.c with the hwaccel you want to utilize, look at how ffmpeg.c additionally does stuff?
[13:22:51 CEST] <JEEB> it's under fftools/*.c
[13:23:03 CEST] <JEEB> you can find those functions you're calling in the example there, too
[13:23:12 CEST] <JEEB> also did you try with the debug verbosity?
[13:23:31 CEST] <Radiator> Yup, that's what I'm looking at right now
[13:23:45 CEST] <Radiator> Yes I did the verbose, but it doesn't help much
[13:24:09 CEST] <JEEB> in your case since the example is short and such, I'd probably recommend testing out AV_LOG_DEBUG
[13:24:26 CEST] <Radiator> That's the level I'm at
[13:24:28 CEST] <JEEB> ok
[13:24:42 CEST] <JEEB> (AV_LOG_VERBOSE is just different, that's why I noted)
[13:26:36 CEST] <Radiator> AV_LOG_VERBOSE doesn't help neither, sadly
[13:31:22 CEST] <JEEB> yea it won't :)
[13:31:26 CEST] <JEEB> if debug didn't ,verbose won't either
[13:31:37 CEST] <JEEB> I just noted that verbose is verbose and you used that wording :)
[13:31:43 CEST] <JEEB> thus I wanted to make sure you tried debug
[13:32:11 CEST] <JEEB> which you apparently did, and that's why I noted that juts to say "btw, 'verbose' is a different level" to explain why I commented on trying debug :)
[13:34:07 CEST] <Radiator> My bad I should've said debug ^
[13:34:16 CEST] <JEEB> np :)
[13:34:26 CEST] <JEEB> anyways, time to look at what the example is doing vs ffmpeg.c
[13:34:40 CEST] <JEEB> or well, probably the hwaccel specific files under fftools/
[13:35:03 CEST] <Radiator> Yup, it's a damn maze tbh
[13:36:02 CEST] <JEEB> `git grep "avcodec_get_hw_config" -- fftools/` and similar should help a bit to see where to look at for various logic
[13:36:30 CEST] <Radiator> You're the real mvp here sir
[13:39:51 CEST] <SimAV> Radiator, what is *exactly* the string your example outputs before it exists?
[13:41:03 CEST] <Radiator> "Decode h264 does not support device type cuda"
[13:41:12 CEST] <Radiator> *decoder
[13:46:53 CEST] <SimAV> Radiator, https://ffmpeg.org/doxygen/4.1/libavcodec_2utils_8c_source.html#l01757
[13:47:47 CEST] <SimAV> this function just looks at '->hw_configs' of the first argument
[13:48:37 CEST] <SimAV> https://ffmpeg.org/doxygen/4.1/libavcodec_2h264dec_8c_source.html#l01050
[13:49:12 CEST] <SimAV> the number of entries of hw_configs depends on the configuration on compile time
[13:49:51 CEST] <snooky> moin
[13:49:55 CEST] <SimAV> maybe it's a good idea to check how many iterations the for loop makes, before it exits with the failure-message (due to reaching the final NULL in hw_configs)
[13:50:54 CEST] <Radiator> Yeah, I'll see how big it is and check depending my actual configuration
[13:52:47 CEST] <SimAV> Radiator, furthermore, it might help to print as well config->device_type
[13:54:20 CEST] <SimAV> so you can see over which entries it iterates halfway-successfully
[14:02:06 CEST] <Radiator> Welp... I have only 3 decoders available which corresponds to the earlier output I got offering me to use only "vpdau vaapi drm"
[14:03:22 CEST] <SimAV> Radiator, might it be that you have multiple versions of ffmpeg and its libraries on your system?
[14:04:05 CEST] <Radiator> I doubt it, whenever I rebuilt it, ffmpeg is modified and re compile behind it
[14:04:24 CEST] <Radiator> Doing the ffmpeg -version shozs me the new configuration
[14:04:30 CEST] <Radiator> shows*
[14:06:26 CEST] <SimAV> so you are using the same library as "ldd `which ffmpeg` | grep avcodec" indicates?
[14:07:53 CEST] <Radiator> It shows me nothing
[14:08:59 CEST] <Radiator> We might have a beggining of solution there !
[14:09:06 CEST] <SimAV> interesting...
[14:09:12 CEST] <SimAV> ldd `which ffmpeg` | grep avcodec
[14:09:12 CEST] <SimAV>         libavcodec.so.58 => /usr/lib64/libavcodec.so.58 (0x00007f7d6ae1d000)
[14:10:10 CEST] <Radiator> What version of ffmpeg do you have ?
[14:10:34 CEST] <SimAV> so JEEB might have been right with his suspect, that you are linking against a different libraries?
[14:10:56 CEST] <SimAV> version 4.2 (on gentoo linux)
[14:11:18 CEST] <Radiator> It could be
[14:12:10 CEST] <Radiator> I'll try to re build the library and set the PREFIX locally and refer it in the compilation
[14:13:38 CEST] <SimAV> Radiator, what does "ldd YOUREXAPLEBINARY | grep avcodec" print?
[14:13:54 CEST] <SimAV> as well nothing? or is there some output?
[14:14:32 CEST] <Radiator> There's some output
[14:14:37 CEST] <Radiator> Quite the same thing as you
[14:14:56 CEST] <SimAV> ah, then your example uses a shared library
[14:15:22 CEST] <SimAV> but the ffmpeg you invoke, does not use a / the same shared library for libavcodec
[14:15:53 CEST] <SimAV> the ffmpeg you invoke is not the system's one?
[14:16:44 CEST] <Freneticks> how is it possible that -strftime_mkdir 1 make directory for /%Y%m%d/ the 2 first day but not for the next days ?
[14:17:05 CEST] <Freneticks> (archlinux latest ffmpeg)
[14:17:33 CEST] <BtbN> Sounds like timestamp overflowing back to 0
[14:18:11 CEST] <Freneticks> timestamp overflowing ?
[14:24:54 CEST] <Radiator> SimAV: I tried with both, the system and the locally compiled one and they have the same output and behavior
[14:25:36 CEST] <xeberdee> Hi - using the pp lb linear blend filter. Described as applying a '(1 2 1 )' filter to lines. What does that mean?
[14:28:17 CEST] <Radiator> SimAV The dynamic library isn't updated at all, it's from months ago so clearly not the lately installed one
[14:32:27 CEST] <xeberdee> or can anyone point me to a source of information?
[14:37:01 CEST] <SimAV> xeberdee, https://en.wikipedia.org/wiki/Digital_image_processing#Digital_image_transformations
[14:37:58 CEST] <SimAV> xeberdee, I don't know this filter, but I would assume that "(1 2 1)" refers to the kernel that is used for convolution
[14:38:56 CEST] <Radiator> SimAV JEEB: I made it work ! It was the library linked suring compilation of the example... I had to link the local built library
[14:39:02 CEST] <xeberdee> SimAV: Thanks . that's very interesting
[14:39:18 CEST] <Radiator> Thank you both !
[14:41:22 CEST] <Freneticks> BtbN: you can enlight me ?
[14:49:50 CEST] <SimAV> Freneticks, I'm still struggling to understand your sentence...
[14:51:16 CEST] <SimAV> Freneticks, can you please describe your problem again?
[14:51:47 CEST] <dwqq> hello, why ffmpeg gets 300% cpu when i am trying to stream rtsp camera stream to youtube in 420p?
[14:52:57 CEST] <dwqq>  2035 root      20   0 1143112 204368   8504 R 168.4  5.4   4:08.83 ffmpeg
[14:53:06 CEST] <dwqq> it;s 170% now lmao
[14:53:18 CEST] <SimAV> dwqq, what command are you using?
[14:53:41 CEST] <BtbN> Freneticks, there's only so much precision the timestamps can have, depending on the timebase. Though I don't think strftime uses the timestamps, but bases on wallclock time.
[14:53:41 CEST] <SimAV> dwqq, it probably decodes and reencodes the video and audio. If that's not necessary, use something like -c:v copy -c:a copy
[14:53:52 CEST] <BtbN> You mean -c copy
[14:54:20 CEST] <dwqq> ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i rtsp://admin:admin@192.168.1.21 -tune zerolatency -vcodec libx264 -preset slow -crf 18 -pix_fmt yuv420p -f flv rtmp://a.rtmp.youtube.com/live2/**** -nostdin -nostats
[14:54:49 CEST] <BtbN> -preset slow transcoding is gonna use some CPU time, yes
[14:55:27 CEST] <dwqq> it was working well with medium but i had errors.... i need a stable stream at 420p
[14:55:30 CEST] <SimAV> dwqq, yuv420p doesn't specify any resolution, but the format/'bitdepth per pixel'
[14:56:00 CEST] <dwqq> i want to stream 420p at all, can u guide me please? i am new ^^
[14:56:12 CEST] <SimAV> dwqq, what do you mean by 420p?
[14:56:26 CEST] <dwqq> youtube resolution, i read the docs but it's hard...
[14:56:30 CEST] <SimAV> do you want to have a certain resolution of you video (420 lines high?)
[14:56:53 CEST] <dwqq> i want the youtube user to watch the stream at 420p
[14:57:01 CEST] <BtbN> 420p is a super uncommon resolution, why would you want that?
[14:57:13 CEST] <BtbN> Do you mean 480p?
[14:57:21 CEST] <dwqq> yes sorry
[14:57:28 CEST] <dwqq> 480* my bad
[14:57:58 CEST] <BtbN> Add a scale filter than that tells it to scale to that resolution.
[14:58:55 CEST] <dwqq> because the network is not the best, i want to downgrade the analysis to 480p
[14:59:19 CEST] <dwqq> how to add a scale filter? is my command okey?
[14:59:22 CEST] <SimAV> dwqq, which network, the one between your rtsp camera?
[14:59:37 CEST] <SimAV> *between your rtsp camera and your PC or between your PC and youtube?
[14:59:37 CEST] <dwqq> nah i am using optical cable
[14:59:44 CEST] <dwqq> the out
[14:59:49 CEST] <dwqq> pc and yotuube
[15:00:14 CEST] <dwqq> my laptop will explode with 300% cpu
[15:00:44 CEST] <BtbN> There is no such thing as 300% CPU
[15:01:10 CEST] <BtbN> Also, keep in mind that scaling will also use CPU, and encoding 480p also is not free
[15:01:27 CEST] <dwqq> what you mean not free?
[15:01:58 CEST] <BtbN> Processing and Encoding video
[15:02:07 CEST] <dwqq> i have to pay for that?
[15:02:20 CEST] <BtbN> Your CPU has
[15:02:32 CEST] <SimAV> BtbN, on any reasonable CPU thats basically for free compared to libx264 with preset slow ;)
[15:02:34 CEST] <dwqq> what cpu you recommend?
[15:02:52 CEST] <dwqq> i use libx264 with preset slow for 300% :D
[15:03:02 CEST] <BtbN> Again, 300% is meaningless
[15:03:23 CEST] <BtbN> Do you mean 100% on 3 cores? 30% on 10 cores? Something entirely else? And what clock speed?
[15:03:28 CEST] <dwqq> poor dell :P
[15:03:33 CEST] <dwqq> 300% on 4 cores
[15:03:39 CEST] <BtbN> That's not how that works.
[15:03:57 CEST] <BtbN> Anyway, scale it down to 480p and see how it performs.
[15:04:08 CEST] <dwqq> how? with crf?
[15:04:21 CEST] <SimAV> https://trac.ffmpeg.org/wiki/Scaling
[15:04:22 CEST] <Freneticks> SimAV: BtbN so this is my full command : ffmpeg -i "http://lolcat" -loglevel warning -sn -map 0 -c copy -f hls -hls_time 120 -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration+temp_file -strftime 1 -strftime_mkdir 1 -hls_segment_filename "/mnt/XXX/%%Y%%m%%d/segment_%%Y%%m%%d%%H%%M%%S_%%%%04d_%%%%08s_%%%%013t.ts" -y "xxx/playlist_tmp.m3u8"
[15:04:44 CEST] <Freneticks> this create the folder for the first 2 days
[15:04:57 CEST] <Freneticks> but after it just put the segment inside the same directory
[15:05:59 CEST] <dwqq> ohh thank you sim :))
[15:06:42 CEST] <dwqq> brb, i ll inform u with results
[15:06:51 CEST] <SimAV> Freneticks, I'm confused by the huge amount of %% in your filename
[15:07:31 CEST] <Freneticks> SimAV: sorry systemd need 2 %% to escape one, so it's only 2 for ffmpeg
[15:08:45 CEST] <BtbN> Is your system clock going wild or something? Cause that string is actually passed to strftime almost untouched.
[15:10:40 CEST] <Freneticks> BtbN: I can assure you that no.
[15:11:18 CEST] <Freneticks> BtbN: I don't even have Ntpd
[15:11:30 CEST] <BtbN> That usually makes things worse.
[15:12:08 CEST] <BtbN> ntpd is a bit overkill, but something like chrony or timesyncd do a good job at keeping the clock steady.
[15:12:50 CEST] <Freneticks> yeah cool but my clock is like 2 min late
[15:12:56 CEST] <Freneticks> not crazy wild
[15:13:25 CEST] <Freneticks> Why ffmpeg put my segment in the way i say, and 2 day after put everything in the same, that ? weird ?
[15:13:42 CEST] <SimAV> dwqq, and try something like "-preset veryfast" if CPU usage is to high
[15:14:01 CEST] <BtbN> ffmpeg really just calls strftime and uses whatever it returns. So any weirdness like this must be coming from the system itself.
[15:14:44 CEST] <Freneticks> okay
[15:15:06 CEST] <BtbN> My first idea would be systemds cgroup magic it does to services
[15:15:23 CEST] <dwqq> SimAV what if i downgrade the camera resolution to 480p? can i pass it as it is?
[15:16:12 CEST] <SimAV> dwqq, if you can make your camera output the resolution and use the codec you want to push to youtube, ffmpeg can forward it without decoding/reencoding it
[15:16:39 CEST] <dwqq> yes i can, give me a moment
[15:17:02 CEST] <SimAV> then do not specify "libx264" but "copy" as codec(s)
[15:18:46 CEST] <Freneticks> BtbN: cgroup magic make weird thing about strftime ?
[15:19:31 CEST] <SimAV> BtbN, can you paste a link pointing to where ffmpeg "really just calls strftime and uses whatever it returns"?
[15:20:25 CEST] <dwqq> camera has h.264/h.265/mjpeg
[15:20:30 CEST] <SimAV> strftime would replace %% by %
[15:20:32 CEST] <dwqq> using 264
[15:21:29 CEST] <SimAV> BtbN, so there must be at least additional replacements taking place.
[15:21:35 CEST] <JEEB> `git grep "strftime" -- libavformat/hlsenc.c`
[15:21:47 CEST] <JEEB> will show you all the usage spots so you can check around them
[15:21:48 CEST] <JEEB> :)
[15:22:13 CEST] <JEEB> you can see how much extra poking is done
[15:22:49 CEST] <JEEB> same git grep with the hls_segment_filename keyword probably brings out the variable into which the string gets pushed
[15:23:54 CEST] <SimAV> JEEB, segment_filename without hls_
[15:25:11 CEST] <BtbN> SimAV, he's using systemd...
[15:26:01 CEST] <Freneticks> BtbN: https://linux.die.net/man/3/strftime this function ?
[15:26:01 CEST] <cousin_luigi> Greetings.
[15:26:13 CEST] <BtbN> yes, that function.
[15:26:33 CEST] <BtbN> Or a variant of it at least
[15:27:35 CEST] <cousin_luigi> Having trouble with playing an av1 clip. ffplay recognises as such but then it tells me "No codec could be found with id 32797". Not sure on which library/build switch it relies for decoding.
[15:28:02 CEST] <JEEB> libdav1d is recommended, but libaom also works
[15:28:13 CEST] <dwqq> ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -tune zerolatency  -vcodec libx264 -preset medium -crf 18 -pix_fmt +  flv ${YOUTUBE_URL}/${YOUTUBE_KEY}Y} -nostdin -nostats
[15:28:17 CEST] <dwqq> is it ok?
[15:28:40 CEST] <SimAV> dwqq, you still ask ffmpeg to reencode your video!
[15:29:02 CEST] <dwqq> i remove crf and pix_fmt?
[15:29:11 CEST] <BtbN> And there's spurious + and missing params in that command.
[15:30:35 CEST] <dwqq> ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -tune zerolatency  -vcodec libx264 -preset medium -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}Y} -nostdin -nostats
[15:30:37 CEST] <dwqq> now better/
[15:30:38 CEST] <cousin_luigi> JEEB: Is it something available on ffmpeg 3.4.4 ?
[15:30:49 CEST] <cousin_luigi> JEEB: It's the one I'm stuck with on my distro.
[15:30:59 CEST] <JEEB> then your distro has not built it with either
[15:31:12 CEST] <JEEB> so if oyu want to use what your distro provides you're SOL
[15:31:51 CEST] <cousin_luigi> JEEB: I could submit a maintainance request if that version of ffmpeg potentially supports it.
[15:32:00 CEST] <cousin_luigi> Should I bother or is it too old?
[15:32:21 CEST] <JEEB> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=configure;h=51c5db53e6fbee70f944191acca00e624fadbe26;hb=refs/heads/release/3.4
[15:32:29 CEST] <JEEB> seems like no entries for "aom" or "dav1d"
[15:32:30 CEST] <JEEB> so nope.avi
[15:32:48 CEST] <cousin_luigi> k, thanks
[15:32:51 CEST] <JEEB> (libaom was added first and thus I searched it first)
[15:33:01 CEST] <JEEB> (not because it is faster/better, which it isn't ;) )
[15:34:17 CEST] <dwqq> 299.7  3.5   0:37.54 ffmpeg
[15:36:02 CEST] <cousin_luigi> JEEB: I see that in fact it was added in 4.0. Do you think it might be a backportable feature?
[15:36:35 CEST] <cousin_luigi> nevermind, I'm probably doing it wrong.
[15:37:12 CEST] <SimAV> cousin_luigi, what keeps you from requesting newer ffmpeg versions?
[15:38:33 CEST] <SimAV> you should be able to find some "critical" bug CVEs for old ffmpegs if you need an argument ;)
[15:39:53 CEST] <JEEB> they probably don't want to rebuild the world against a new branch (which thus can have a new ABI)
[15:41:37 CEST] <SimAV> dwqq, you are still not copying the video stream, but reencoding it
[15:44:59 CEST] <cousin_luigi> Perhaps I could simply have mpv built against ffmpeg4.
[15:45:10 CEST] <cousin_luigi> Which is available in parallel.
[15:45:49 CEST] <dwqq> idk it gets down to 30%...
[15:47:07 CEST] <dwqq> https://imgur.com/a/ob5cNef camera settings here
[15:47:32 CEST] <dwqq> if you can help me to pass it as it is, i would appreciate
[15:48:13 CEST] <dwqq> I am using ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -tune zerolatency  -vcodec libx264 -preset slow -threads 4 -f flv ${YOUTUBE_URL}
[15:48:23 CEST] <dwqq> 30% cpu
[15:48:35 CEST] <dwqq> 30-80% range... still high
[15:48:43 CEST] <SimAV> ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -c:v copy -f flv ${YOUTUBE_URL}
[15:51:17 CEST] <dwqq> omg, that;s all?
[15:51:40 CEST] <dwqq> why i am using 232004 params... :$
[15:51:56 CEST] <dwqq> ty man, u rock, works!
[15:52:02 CEST] <SimAV> <SimAV> dwqq, it probably decodes and reencodes the video and audio. If that's not necessary, use something like -c:v copy -c:a copy
[15:52:13 CEST] <dwqq> i don't have audio at all, i wanna cut it
[15:52:30 CEST] <dwqq> i had read -noan smothing like that but it didn't worked
[15:53:17 CEST] <SimAV> well, if audio is required, you have to make some up. but that's what you did using "-f lavfi -i anullsrc"
[15:53:20 CEST] <cousin_luigi> Looks like I'm SOL. Thanks everyone.
[15:54:46 CEST] <dwqq> rtsp stream to youtube requires lavfi anullsrc for me in order to work
[15:55:26 CEST] <dwqq> it won't work without these settings, i got this config by searching on the internet
[15:56:27 CEST] <dwqq> why u wrote audio is required? is audio youtubes requirement?
[15:56:57 CEST] <dwqq> i think it shows a muted video...
[15:57:44 CEST] <dwqq> 5 oclock, g2g, i ll be back tomorrow, thanks sim
[15:58:16 CEST] <Radiator> dwqq: fyi rtsp doesn't need -i anullsrc for me
[15:58:38 CEST] <Radiator> Actually even -f lavfi isn't required
[15:59:15 CEST] <Radiator> -rtsp_transport tcp is tho
[16:01:03 CEST] <SimAV> Radiator, does your rtsp source deliver audio as well?
[16:05:52 CEST] <Radiator> Good point, it doesn't
[16:08:22 CEST] <SimAV> Radiator, if the rtsp source doesn't deliver audio, but the sink requires audio, you have to make some audio up in between. That's what "-f lavfi -i anullsrc" does, by adding another source, which just outputs zeros as audio.
[16:09:11 CEST] <SimAV> if the sink doesn't require audio, you are fine without...
[16:09:51 CEST] <Radiator> Ok !
[16:14:03 CEST] <Radiator> Since we are talking about rtsp, any idea how to mimic -rtsp_transport using the lib ?
[16:14:19 CEST] <JEEB> give rtsp_transport AVOption to the module :)
[16:14:23 CEST] <JEEB> (avformat context)
[16:14:35 CEST] <JEEB> if ffmpeg.c itself doesn't find a custom option in itself
[16:14:38 CEST] <JEEB> (like -hwaccel)
[16:14:54 CEST] <JEEB> then it passes the options to each module one by one, until they get eaten
[16:15:07 CEST] <JEEB> as AVOptions
[16:16:07 CEST] <JEEB> see functions beginning with `av_opt_`
[16:16:16 CEST] <Radiator> Yeah I found it in libavformat/rtsp.c in const opt section. I know it sets the RTSPState->lower_transport to the wished value (RTSP_LOWER_TRANSPORT_TCP in my case)
[16:16:40 CEST] <Radiator> Thanks, I didn't know you could assign opt like that
[16:16:49 CEST] <Radiator> That will be very usefull
[16:16:58 CEST] <JEEB> https://lists.ffmpeg.org/doxygen/trunk/group__avoptions.html
[16:17:12 CEST] <JEEB> hint: google `site:ffmpeg.org doxygen trunk KEYWORD`
[16:17:26 CEST] <JEEB> or any other search engine of your preference that takes similar syntax :)
[16:17:43 CEST] <JEEB> in your case it's option setting stuff
[16:18:05 CEST] <Radiator> If i can't find a solution with that, no one can, thanks for all the info !
[16:23:00 CEST] <SimAV> Freneticks, did you just start your ffmpeg command on different days or was it running for multiple ones?
[16:24:50 CEST] <lyncher> hi, with libavfilter what is the currently recommended API calls to dynamically register a new filter?
[16:25:13 CEST] <lyncher> register_* are now deprecated
[16:26:43 CEST] <kepstin> dynamically registering filters is not supported. (filters usually need to access private apis anyways so it's not like you can really write one outside of ffmpeg)
[16:30:24 CEST] <Freneticks> SimAV: I started the command many days ago yes
[16:32:34 CEST] <lyncher> can't I use av_filter_iterate to add a new filter when the returned element is NULL?
[16:42:07 CEST] <kepstin> lyncher: the list of filters is a static/const array, you can't add to it at runtime.
[19:28:06 CEST] <wildefyr> hi, so I am trying to extract the cover art directly from an audio file then pipe it to convert, i have to use '-f [something] -' to get it to pipe, but something like png isn't a valid option
[19:28:09 CEST] <wildefyr> ideas?
[19:30:34 CEST] <another> -c:v png -f image2 -
[19:32:57 CEST] <lain98> how likely is it that when i demux a video, the first video frame in the stream as actually way over at the end or after a considerable number of frames ?
[19:33:46 CEST] <lain98> and is there a better way to seek to any video frame other than just iterating till the stream index matches the video stream index
[19:34:38 CEST] <JEEB> without seeking only the google advanced edit list code can have the stuff jump in the file :P
[19:34:47 CEST] <JEEB> but that you can disable
[19:35:09 CEST] <wildefyr> another: doesn't seem to work my friend, "Output file # does not contain any stream"
[19:35:22 CEST] <JEEB> "advanced_editlist" with the value 0
[19:35:27 CEST] <JEEB> to the avformat context :P
[19:36:25 CEST] <JEEB> lain98: the packets are returned in some order according to interleaving etc. for some containers there's support for saying "I'm not interested in streams X,Y,Z"
[19:37:49 CEST] <lain98> but is it likely ?
[19:38:25 CEST] <lain98> ive tried a lot of videos with ffmpeg -show_frames and for most the video frame is in the first few
[19:38:37 CEST] <lain98> *al
[19:38:40 CEST] <lain98> *all
[19:38:54 CEST] <wildefyr> nvm another my test file was not a good test file
[19:39:00 CEST] <JEEB> by setting the stream's discard value to AVDISCARD_ALL you tell the module that you don't care about a stream
[19:39:22 CEST] <JEEB> (note: depends on which demuxer implements it or not)
[19:39:50 CEST] <JEEB> lain98: I don't understand what you are asking about "likely", after all it depends also in how the stuff is in the file (although I think lavf will also attempt to improve the interleaving)
[19:40:07 CEST] <JEEB> so if your thing is horribly interleaved it will attempt to improve it if it can
[19:44:19 CEST] <kepstin> wildefyr: why are you trying to pipe it to convert? ffmpeg can do a bunch of transformations using its own builtin filters.
[19:44:47 CEST] <wildefyr> kepstin: i just knew already what to do with convert
[19:44:50 CEST] <lain98> the AVDiscard enum seems related to I/B/P. whereas i wanted to skip audio frames
[19:45:07 CEST] <wildefyr> simple resizing, instead of tracking down how to do it purely in ffmpeg
[19:46:34 CEST] <kepstin> wildefyr: i'd bet that would be easier to learn how to do in ffmpeg than learn how to do pipe output :)
[19:47:10 CEST] <wildefyr> well either way i've learnt something new
[19:47:12 CEST] <wildefyr> !
[20:35:00 CEST] <AiNA_TE> -an skips audio, -vn skips video, -sn skips subs
[20:35:13 CEST] <AiNA_TE> what will skip menus/metadata/text
[20:36:21 CEST] <kepstin> depends what exactly you're talking about, but `-map_metadata -1` will remove a lot of that sort of stuff
[20:36:59 CEST] <kepstin> (note that -vn/-an/-sn are shortcuts for things that can be done using various -map options)
[20:37:18 CEST] <AiNA_TE> Stream #0:2[0x1e01]: Unknown: none ([13][0][0][0] / 0x000D)
[20:37:19 CEST] <AiNA_TE> this
[20:37:57 CEST] <AiNA_TE> which ffmpeg reports it can not detect codec type and media info reports as a "Menu"
[20:39:55 CEST] <kepstin> I think ffmpeg might treat that as a 'data' track, which would mean the `-dn` option skips it.
[20:40:26 CEST] <kepstin> other than that, you could instead use the -map option, which provides more flexibility
[21:05:44 CEST] <AiNA_TE> thank you kepstin
[23:55:43 CEST] <qmr> what is gamma=1 2 3  or whatever?  stops?  I need to push something 3 stops or so
[23:59:10 CEST] <Diag> ey furq you here? Im getting a permissions error when i try to build ffmpeg
[23:59:39 CEST] <BtbN> don't run "make install"
[23:59:44 CEST] <Diag> oh
[23:59:49 CEST] <Diag> just make?
[23:59:52 CEST] <BtbN> And if you do, use a prefix in your homedir
[00:00:00 CEST] --- Wed Sep 11 2019


More information about the Ffmpeg-devel-irc mailing list