[Ffmpeg-devel-irc] ffmpeg.log.20191125
burek
burek at teamnet.rs
Tue Nov 26 03:05:02 EET 2019
[00:38:46 CET] <Hello71> last I checked, the status of this conversation is that you were asked for your libaom version, you told us your ffmpeg version, and then you were told that that doesn't help, then you ditched
[00:38:59 CET] <Hello71> and also that "it doesn't work" is useless
[01:40:28 CET] <classsic> Hi, someone really know what mean the "-re" flag ?
[01:40:43 CET] <classsic> I read this: "-re (input)Read input at native frame rate. Mainly used to simulate a grab device, or live input stream (e.g. when reading from a file). Should not be used with actual grab devices or live input streams (where it can cause packet loss). By default ffmpeg attempts to read the input(s) as fast as possible. This option will slow down the
[01:40:43 CET] <classsic> reading of the input(s) to the native frame rate of the input(s). It is useful for real-time output (e.g. live streaming)."
[01:41:59 CET] <classsic> but i´m not sure what mean, I need to retransmit rtsp ip camera to rtsp server like this : ffmpeg -i rtsp://.....-vcodec copy -f rtsp rtsp://...
[01:42:38 CET] <classsic> If I put the -re flag;i get smooth stream, but have a delay, if not I get choppy playback
[01:51:06 CET] <furq> classsic: don't use -re with live inputs
[01:52:24 CET] <classsic> ok, why?
[02:20:05 CET] <montana> whose fault is this? ffmpeg or libaom-av1
[02:20:09 CET] <montana> [17:02] <montana> ffmpeg -i input.mkv -c:v libaom-av1 -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv
[02:20:09 CET] <montana> [17:02] <montana> output.mkv result in 5 second video
[02:25:04 CET] <cehoyos> Your question makes no sense / complete, uncut console output missing
[02:25:26 CET] <classsic> my?
[02:26:15 CET] <montana> cehoyos what part doesn't make sense: output.mkv result in 5 second video
[02:26:29 CET] <montana> cehoyos and input.mkv is not 5 second video
[02:26:39 CET] <cehoyos> You didn't mention that
[02:26:41 CET] <cehoyos> ...
[02:26:45 CET] <montana> sorry, my bad
[02:26:50 CET] <montana> i thought it was obvious
[02:27:03 CET] <cehoyos> Like the missing complete, uncut console output?
[02:27:18 CET] <Hello71> like I said, they were already asked for that
[02:27:52 CET] <cehoyos> True
[02:28:50 CET] <montana> there is no error message
[02:28:56 CET] <montana> it encodes like everything is working
[02:29:06 CET] <cehoyos> All the better if everything is working
[02:29:21 CET] <montana> but output.mkv result in 5 second video
[02:31:06 CET] <montana> cehoyos explain why it's creating 5 second video
[02:31:16 CET] <montana> when input.mkv is 40 seconds
[02:31:43 CET] <cehoyos> Sorry, did you already provide the absolute minimum of required information? (I may have missed it, sorry if I did!)
[02:32:02 CET] <montana> ffmpeg v4.2.1
[02:32:53 CET] <cehoyos> While this version is not supported here, I did not ask for the version: What is needed for every FFmpeg-related (usage) question, is the command line you tested together with its complete, uncut console output. Sorry if I wasn't clear before.
[02:33:21 CET] <montana> no idea what you are asking
[02:33:45 CET] <cehoyos> Sorry, I am not a native speaker, I cannot explain it any better
[02:36:37 CET] <montana> cehoyos try transcoding: https://x0.at/57-.mkv to av1, does it work on your end?
[02:37:04 CET] <cehoyos> Please provide the command line you tested together with the complete, uncut console output if you need support.
[02:37:39 CET] <montana> ffmpeg -i 57-.mkv -c:v libaom-av1 -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv
[03:26:08 CET] <nicolas17> montana: what's the OUTPUT of that command
[03:26:10 CET] <nicolas17> pastebin it
[03:26:30 CET] <montana> typical encoding messages. nothing unusual
[03:26:49 CET] <pink_mist> you're not helping us help you
[03:26:51 CET] <nicolas17> sigh
[03:26:59 CET] <nicolas17> then there's nothing unusual in your problem
[03:27:17 CET] <montana> it results in 5 second video output.mkv
[03:28:07 CET] <montana> nicolas17 what happens if you type: ffmpeg -i 57-.mkv -c:v libaom-av1 -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv
[03:28:24 CET] <montana> https://x0.at/57-.mkv
[03:29:01 CET] <pink_mist> montana: why can't you just copy/paste the commandline output?
[03:29:42 CET] <montana> Output #0, matroska, to 'output.mkv':
[03:29:43 CET] <montana> Metadata:
[03:29:44 CET] <montana> encoder : Lavf58.29.100
[03:29:46 CET] <montana> Stream #0:0: Video: av1 (libaom-av1) (AV01 / 0x31305641), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 5 fps, 1k tbn, 5 tbc (default)
[03:29:46 CET] <montana> Metadata:
[03:29:47 CET] <montana> DURATION : 00:00:40.607000000
[03:29:48 CET] <montana> encoder : Lavc58.54.100 libaom-av1
[03:29:49 CET] <montana> Side data:
[03:29:50 CET] <montana> cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[03:29:51 CET] <montana> Stream #0:1: Audio: opus ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, mono, fltp (default)
[03:29:52 CET] <montana> Metadata:
[03:29:53 CET] <montana> title : simple_aac_recording
[03:29:55 CET] <montana> DURATION : 00:00:40.541000000
[03:29:59 CET] <nicolas17> I knew this would happen
[03:31:35 CET] <cehoyos> Allow me to guess: There is no issue;-)
[03:31:54 CET] <montana> cehoyos output.mkv result in 5 second video
[03:32:00 CET] <cehoyos> I don't think so
[03:32:24 CET] <montana> what do you mean?
[03:32:41 CET] <cehoyos> That this is the first time you test the av1 encoder
[03:33:09 CET] <montana> what does that have to with anything, everybody's first should never work?
[03:33:18 CET] <cehoyos> Let
[03:33:29 CET] <cehoyos> Let's make a deal:
[03:33:47 CET] Action: SpiritHorse down
[03:33:51 CET] <montana> first time i used ffmpeg's mp3 encoder, it worked
[03:33:57 CET] <montana> first time i used ffmpeg's x264 encoder, it worked
[03:34:08 CET] <montana> first time i used ffmpeg's aac encoder, it worked
[03:34:08 CET] <cehoyos> Either you show us the complete, uncut console output of your encoding and I try to help you or you stop asking questions: Is that acceptable for you?
[03:34:17 CET] <nicolas17> and use a pastebin
[03:34:19 CET] <nicolas17> like pastebin.com
[03:35:40 CET] <montana> cehoyos i just pasted it
[03:35:44 CET] <cehoyos> No
[03:36:21 CET] <pink_mist> montana: we wanted the COMPLETE and UNCUT commandline output. what you pasted is not that.
[03:36:25 CET] <cehoyos> But as said: There is no problem if you don't want to post it, but in this case please stop asking questions (here)
[03:37:21 CET] <montana> is there way to output a complete log to a text file
[03:37:51 CET] <cehoyos> Yes, but I would slightly prefer if you only copy and paste what is shown on the console
[03:37:58 CET] <cehoyos> the option name is "-report"
[03:38:05 CET] <montana> i see, let me try
[03:42:11 CET] <montana> https://x0.at/1X2.log
[03:42:58 CET] <cehoyos> First: The FFmpeg version you are testing is old, this can make a difference in general and I am quite sure it makes a difference for av1 encoding, which is a recent encoder wrapper
[03:43:18 CET] <montana> https://x0.at/HmM.txt
[03:43:27 CET] <nicolas17> you told me to try the command myself, it has been 15 minutes and it's still running :P
[03:43:45 CET] <montana> nicolas17 wow really?
[03:44:01 CET] <nicolas17> it produced 12 seconds of video
[03:44:03 CET] <nicolas17> frame= 59 fps=0.1 q=-0.0 size= 209kB time=00:00:12.42 bitrate= 138.0kbits/s speed=0.0153x
[03:44:09 CET] <nicolas17> still going
[03:44:27 CET] <montana> did you type the exact command i typed?
[03:44:54 CET] <nicolas17> yes
[03:45:20 CET] <cehoyos> The encoder is expected to be slow (this is what you don't know because you have never tested it before)
[03:45:31 CET] <nicolas17> and your log file seems to show it produced 11.82 seconds of video
[03:45:35 CET] <cehoyos> It runs approximately at 1/100 of realtime for your input video
[03:46:09 CET] <montana> nicolas17 if i play it, it plays only 5 seconds
[03:46:18 CET] <nicolas17> did it finish?
[03:46:29 CET] <montana> finish what?
[03:46:39 CET] <nicolas17> did ffmpeg exit by itself?
[03:46:44 CET] <cehoyos> Encoding takes at least 90 minutes
[03:46:52 CET] <cehoyos> for the given input file
[03:46:58 CET] <montana> https://x0.at/-12.mkv here is output.mkv
[03:47:19 CET] <montana> nicolas17 yes
[03:48:11 CET] <nicolas17> if I try to play my output.mkv it also has like 5 seconds... but that's because ffmpeg is still running, the file is incomplete
[03:48:48 CET] <nicolas17> oh it plays 9 seconds now
[03:49:50 CET] <cehoyos> I am already at 25;-)
[03:49:57 CET] <montana> cehoyos so you are saying in av1 context 4.2.1 is old?
[03:50:20 CET] <montana> what version are you using, may i ask
[03:50:26 CET] <nicolas17> frame= 74 fps=0.1 q=-0.0 size= 297kB time=00:00:15.42 bitrate= 157.7kbits/s speed=0.013x
[03:50:41 CET] <cehoyos> No, I am saying that 4.2.1 is old and in general unsupported, for av1 this may make a bigger difference than for other use cases
[03:51:04 CET] <cehoyos> 95767 which is not completely up-to-date either but newer than your version
[03:51:23 CET] <montana> what is this then? ffmpeg version git-2019-11-23-d65aaf8
[03:51:40 CET] <cehoyos> That looks current
[03:52:52 CET] <montana> so 1 minute video takes 100 minutes to encode?
[03:53:33 CET] <montana> is that what you mean by ? It runs approximately at 1/100 of realtime for your input video
[03:53:35 CET] <Hello71> that's pretty fast
[03:53:42 CET] <Hello71> if your video is under 60 fps
[03:53:57 CET] <montana> Hello71 it's 5fps video
[03:53:57 CET] <nicolas17> this is like 5fps
[03:54:13 CET] <cehoyos> Yes (on my old but reasonably fast computer), for your input file and -r 5 that is, see "speed=0.07" in your console output that tends to go down further
[03:54:35 CET] <Hello71> eh, that's kinda slow, but not that surprising if you're using libaom
[03:54:52 CET] <Hello71> if you use rav1e and have lots of cores and have avx then that would be really slow
[03:54:55 CET] <montana> how much faster is: rav1e encoder
[03:55:08 CET] <cehoyos> Test and find out yourself!
[03:55:19 CET] <cehoyos> Since it takes so long, most people have never tested...
[03:55:38 CET] <montana> what is equivalent command ffmpeg -i 57-.mkv -c:v libaom-av1 -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv of rav1e
[03:55:40 CET] <Hello71> so, it only took like five tries to get montana to spill the libaom version
[03:55:47 CET] <cehoyos> (It cannot be ten times faster in case this is not obvious)
[03:55:52 CET] <cehoyos> You mean: Five by me?
[03:56:12 CET] <Hello71> well didn't you ask for the output like three times
[03:56:21 CET] <Hello71> then before it was two or three times
[03:56:28 CET] <Hello71> so I reckon it was at least five tries
[03:56:32 CET] <cehoyos> -c:v librav1e
[03:56:54 CET] <montana> ffmpeg -i input.mkv -c:v librav1e -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv
[03:56:57 CET] <montana> would that work?
[03:57:14 CET] <cehoyos> Only if your ffmpeg binary was compiled with librav1e support, yes
[03:57:24 CET] <Hello71> hm, Arch ffmpeg doesn't have rav1e. it should be in 4.2.1, right?
[03:57:30 CET] <cehoyos> no
[03:57:40 CET] <Hello71> oh. well that explains it
[03:58:42 CET] <Hello71> also I'm sure rav1e people do benchmarks. and ffmpeg should have negligible overhead at 5 fps
[03:59:15 CET] <cehoyos> It is expected to be measurably faster
[03:59:56 CET] <Hello71> iirc it's much faster if you have multiple cores. although it's possible I'm thinking of dav1d...
[04:00:06 CET] <nicolas17> it is faster
[04:00:13 CET] <nicolas17> libaom has crap multithreading
[04:00:20 CET] <montana> is libaom-av1 only capable of using 1 core?
[04:00:32 CET] <nicolas17> montana: it tries to use more but it's bad at it, let's say
[04:00:35 CET] <Hello71> iirc, no but it sucks
[04:00:40 CET] <montana> nickster i see
[04:00:42 CET] <montana> Hello71 i see
[04:01:10 CET] <montana> how does youtube encode to av1 so fast then
[04:01:47 CET] <cehoyos> They are likely using a proprietary encoder, but in any case, they throw a lot of cpu on encoding, smaller files mean a lot for them
[04:02:29 CET] <montana> you mean youtube does not use libaom-av1?
[04:02:42 CET] <cehoyos> It would surprise me (but I don't know)
[04:02:58 CET] <cehoyos> I forgot to ask;-)
[04:03:34 CET] <Hello71> I would wager a guess that youtube doesn't use ffmpeg for encoding at all
[04:03:48 CET] <cehoyos> Why do you think so?
[04:04:02 CET] <nicolas17> I thought they used ffmpeg in order to support many input formats
[04:04:05 CET] <cehoyos> (You really shouldn't bet too much)
[04:05:03 CET] <Hello71> decoding maybe
[04:05:10 CET] <SpiritHorse> google (youtube) owns a patent portfolio ffmpeg can only drool over, so it's safe to say they aren't on some github release of ffmpeg
[04:05:18 CET] <SpiritHorse> but there are probably some similarities
[04:05:21 CET] <cehoyos> They aren't
[04:05:33 CET] <cehoyos> Because FFmpeg doesn't use github-releases;-)
[04:05:39 CET] <montana> spirithorse lol, that's funny
[04:05:56 CET] <SpiritHorse> case in point ;)
[04:06:09 CET] <Hello71> I mean, they *could* use a heavily patched ffmpeg for encoding. knowing google though it's probably some proprietary system for maximum parallelism
[04:06:44 CET] <cehoyos> They are using a patched (as opposed to heavily patched) version of FFmpeg, not completely current but (somehow) reasonable
[04:07:13 CET] <SpiritHorse> heavily, heavily patched
[04:07:28 CET] <SpiritHorse> more so by the day, unfortunately
[04:07:40 CET] <nicolas17> how long does it take to process a newly-uploaded youtube video?
[04:08:09 CET] <nicolas17> if it was "heavily parallelized" I would expect it to take the same time regardless of length (one GOP per server? :P)
[04:11:08 CET] <furq> what do you think youtube are patching into their ffmpeg
[04:11:43 CET] <Hello71> well, they definitely have a bunch of filters
[04:11:54 CET] <cehoyos> They definitely have demuxer patches, they also don't like some of our timestamp code
[04:12:19 CET] <cehoyos> I wasn't aware that they are using any of our filters, I thought they don't like them
[04:12:27 CET] <furq> yeah i can't imagine why they would heavily patch it
[04:12:42 CET] <furq> it's not like they're using crazy proprietary encoders
[04:13:34 CET] <Hello71> not parallelized per video, but parallelized for maximum CPU utilization efficiency, with minimal overhead when switching to the next video in the queue
[04:13:49 CET] <Hello71> maybe the ffmpeg api already offers enough flexibility for that though
[04:14:12 CET] <cehoyos> They don't like the api (anymore), they claim to be using the cli now...
[04:14:19 CET] <Hello71> well I'm saying that they have filters, which might be patched into ffmpeg, or might be using the api, or something else
[04:15:02 CET] <cehoyos> They could produce intermediate files with the cli
[04:16:16 CET] <cehoyos> Finished: speed=0.00701x
[04:16:43 CET] <Hello71> the cli probably fits better with their orchestration. running 100000 encoding machines is very different from running 10. idk how many they have, but if they really have "300 hours of video every minute" then surely they must have at least a few tens of thousands
[04:17:08 CET] <montana> cehoyos wow, how long did the encoding last
[04:17:50 CET] <Hello71> speaking of speed, why does the speed usually stall at the start, then jump up, then go down slowly? is it just a choice between "overcount the startup time" and "undercount the codec buffering time"?
[04:19:06 CET] <cehoyos> 40 / 0.007?
[04:20:33 CET] <montana> anybody know how much faster rave1 is compared to libaom ?
[04:20:55 CET] <montana> my build does not include rave1
[04:22:40 CET] <montana> hello71 are you talking for libaom-av1 ?
[04:25:02 CET] <cehoyos> https://www.phoronix.com/scan.php?page=news_item&px=Rav1e-Encoder-8-Titles-Speed
[04:25:22 CET] <montana> how bad was encoding speed for x265/vp9 when it first came out
[04:26:16 CET] <montana> i should have said libvpx
[05:13:03 CET] <montana> hi, i am looking for ffmpeg build with rav1e
[05:13:14 CET] <montana> anybody have it
[05:16:38 CET] <Jakob6174> I'll check one sec
[05:17:29 CET] <Jakob6174> How do you check what it was built with again?
[05:19:46 CET] <nicolas17> see if it appears in -codecs?
[05:22:29 CET] <montana> Jakob6174 just type ffmpeg -i input.mkv -c:v librav1e -crf 30 -b:v 0 -c:a copy -r 5 -strict experimental output.mkv
[05:22:37 CET] <montana> if that works
[05:26:44 CET] <Jakob6174> Thanks @montana. Sorry @nicolas17 it says unknown encoder
[05:26:58 CET] <montana> okay, that means no
[05:29:49 CET] <Jakob6174> If you want to build ffmpeg easily, I recommend this https://github.com/m-ab-s/media-autobuild_suite
[07:29:11 CET] <montana> hi, i am looking for ffmpeg build with rav1e
[08:27:41 CET] <void09> I want to use a remote file as input for a filter, do you think it's possible somehow ? fmpeg -i "video.mkv" -vf "removelogo=f=https://i.imgur.com/file.png" -f nut -c:v rawvideo - | mpv -
[08:27:50 CET] <void09> this does not work
[10:43:45 CET] <jokoon> how fast is it to extract keyframes of a video?
[10:54:38 CET] <captain-bob4> Hi team, I'm working on a new filter based off of https://github.com/nervous-systems/ffmpeg-opengl/ and I'm running into some issues. Basically everything works as long as it's part of a single input only video only filtergraph (-vf). Even if I retain all of those limitation but try to use -lavfi or -filter_complex instead, the process fails without an error.
[10:55:30 CET] <captain-bob4> Should I ask this question in ffmpeg-devel instaed?
[10:57:16 CET] <kurosu> captain-bob4: I think so, but not sure who to talk to
[10:57:57 CET] <kurosu> (and obviously if they would be available)
[10:58:16 CET] <captain-bob4> Can\should I just ask the channel there?
[11:00:05 CET] <kurosu> I think so, people will pick up the discussion, but that might wait a few hours
[11:01:23 CET] <captain-bob4> Ok, thanks. I didn't want to "break the rules" and I wasn't entirely sure this qualifies for the development of ffmpeg itself
[11:04:20 CET] <kurosu> imo, it may depend if the filter would be then upstreamed, but it's really inside of libav* libs, not just using them, afaik, so should be fine
[11:06:18 CET] <captain-bob4> I'd be more than happy to share it and I think that it could be very relevant to others, after the modifications I made the filter could be used to render videos using external glsl shaders
[13:08:49 CET] <pagios> hello, is it possible to create a playlist m3u8 file as fast as possible? by default it is getting created as soon as the second segment is created and that is slow, as i need to wait for like 15sec or so
[13:09:45 CET] <JEEB> I guess that means as soon as one segment has finished
[13:09:47 CET] <BtbN> You need 3 segments to be able to play it back anyway.
[13:10:02 CET] <JEEB> I don't think you can make valid HLS playlist with a *partial* segment
[13:10:07 CET] <JEEB> since you don't know its duration etc
[13:10:17 CET] <pagios> meansi have to reduce the ssegment sizes?
[13:10:26 CET] <pagios> hls_size 1 ?
[13:11:09 CET] <JEEB> yes, if you want it around quicker, you will have to finish and write segments/fragments more often
[13:11:42 CET] <pagios> can i write first 3 segments quickly then start writing bigger ones to have less impact on disk IO ?
[13:53:56 CET] <pagios> JEEB, BtbN i tried hls_segment_size 1 and -g 1 still ffmpeg doesnt create the playlist.m3u8 quickly, the hls .ts file is big
[13:55:28 CET] <BtbN> It has to put at least one full gop into a segment
[13:56:51 CET] <pagios> BtbN, ok so should i set hls_segment_size to 2?
[13:57:12 CET] <BtbN> you can set it to whatever you like, but the smallest it will be is the length of one GOP
[13:57:38 CET] <pagios> GOP is 1 sec no?
[13:57:46 CET] <BtbN> GOP is whatever it is
[13:57:58 CET] <pagios> keyframe is set to 2 sec
[13:58:04 CET] <BtbN> can be anything from Intra-Only to 10 seconds, 30 seconds, or even infinite
[13:58:36 CET] <pagios> ok, so what would be the ideal arguments to use to generate the playlist the soonest?
[13:58:59 CET] <BtbN> However short you want it to be. But keep in mind that very short GOP hurts the quality quite a bit
[14:00:17 CET] <pagios> BtbN, i used now -g 2 and hls_time 1
[14:00:23 CET] <pagios> it is pretty fast
[14:00:37 CET] <BtbN> -g 2 will create a keyframe every other frame
[14:00:49 CET] <BtbN> that will either blow up the file size tremendously, or look like shit
[14:01:29 CET] <pagios> ill omit it
[14:01:56 CET] <BtbN> HLS just isn't a low-latency format. You will always have a ton of latency just by how it works
[14:33:10 CET] <pagios> BtbN, yea its not a matter of latency for me, more like get a grip on the m3u8
[14:33:20 CET] <BtbN> ?
[14:51:58 CET] <Atlenohen> Hello
[15:07:14 CET] <Atlenohen> Does FFMPEG do VFR by default or does it have to be specified to the encoder?
[15:08:08 CET] <Atlenohen> As frames come, with their pts, they get put in, will it "just work" ?
[15:08:11 CET] <BtbN> Encoders generally don't care about framerate or timestamps.
[15:08:13 CET] <JEEB> I think whether ffmpeg.c attempts to do """vsync""" (duplicating or deduplicating frames) depends on the output container
[15:08:23 CET] <JEEB> FFmpeg as a library generally doesn't care as long as you're going onwards
[15:08:40 CET] <JEEB> unless there is a muxer or something that cares about things like that and will scream
[15:08:45 CET] <Atlenohen> Oh, I'd definitely want to make sure this "vsync" is avoided
[15:09:16 CET] <JEEB> you can see what ffmpeg.c does internally with -debug_ts
[15:09:45 CET] <JEEB> and the relevant options for do not touch my timestamps are -vsync passthrough and -copyts
[15:09:58 CET] <JEEB> you might be OK with just one of them, but both should minimize the attempts that ffmpeg.c might do
[15:10:13 CET] <JEEB> whether ffmpeg.c does something depends on the output container etc etc if I recall correctly
[15:10:15 CET] <Atlenohen> Actually I'm dealing with FFmpeg API, not the command line
[15:10:18 CET] <JEEB> ok
[15:10:25 CET] <JEEB> then there is no vsync per se
[15:10:30 CET] <JEEB> that's why I noted both cases
[15:10:42 CET] <JEEB> ffmpeg.c has various more or less helpful things, API is pretty straightforward
[15:11:05 CET] <Atlenohen> Oh okay
[16:23:17 CET] <realies> what's the difference between peak and RMS normalisation?
[16:38:35 CET] <fling> How do I insert empty samples where I have audio shifted with itsoffset?
[16:38:40 CET] <fling> dumb players are ignoring it
[16:54:02 CET] <faLUCE> hello. I have three audio ac3 files: input1.ts, input2.ts and input3.ts. I would like to put them all into a dvd with three chapters. Do I have to exec ffmpeg -i inputX.ts -target pal-dvd outputX.vob (where X is 1,2,3) for all three files and then put them into an ISO container?
[16:54:52 CET] <pink_mist> I think you should use a real dvd-mastering program for that kind of thing
[16:55:39 CET] <faLUCE> pink_mist: why?
[16:56:19 CET] <pink_mist> I simply don't believe ffmpeg is the right tool for the job
[16:57:08 CET] <faLUCE> but I was able to create the VOB files
[16:57:20 CET] <DHE> ffmpeg might be able to prepare the raw video, but that's it.
[16:58:09 CET] <faLUCE> DHE: do you mean the VOB file?
[17:21:13 CET] <faLUCE> In addition: I executed ffmpeg -i inputX.ts -target pal-dvd -acodec copy outputX.vob but it seems to re-encode audio. what's wrong?
[17:27:27 CET] <fling> How do I set channel count for aevalsrc?
[17:27:30 CET] <fling> I want it to be stereo
[17:29:22 CET] <durandal_1707> fling: use c option
[17:31:17 CET] <fling> durandal_1707: thanks
[17:50:23 CET] <kepstin> fling: you can use the adelay filter to insert silence at the start of an audio track. requires re-encoding, of course.
[17:51:22 CET] <kepstin> faLUCE: the way target interacts with other ffmpeg options is kinda weird
[18:37:30 CET] <realies> durandal_1707, using your code to append a reversed 1 second of an audio stream to the beginning of it (asplit[a][b],[b]atrim=end=1,areverse[b],[b][a]concat=a=1:v=0) and wondering how to make it the same happen for the end of it (last second, reversed, appended to the end) within the same filter chain, would I go with using other variables than a
[18:37:30 CET] <realies> and b as a starter?
[18:38:27 CET] <realies> my idea is to have some contextual audio to be used with the dynaudnorm filter and then trim the extra second of audio from the start/end as the last stage
[18:40:33 CET] <durandal_1707> realies: alt boundary mode does not work for your usecase?
[18:40:57 CET] <realies> unfortunately it boosts the signal too much when audio starts too close to the beginning of the file
[18:42:02 CET] <durandal_1707> realies: for appending reversed signal you need to know length of audio
[18:43:07 CET] <realies> I guess I can do a pass before that to get that value
[18:43:36 CET] <realies> already doing volumedetect to normalise to 0 dB
[18:44:43 CET] <kepstin> that seems unnecessary/redundant if you're doing dynaudnorm or loudnorm
[18:45:55 CET] <realies> kepstin, normalising to 0 dB as an intermediate step to feed into a noise reduction filter
[18:46:12 CET] <realies> (which is outside of ffmpeg)
[18:46:51 CET] <kepstin> hmm, i dunno how useful peak normalization would be for that, but ok.
[18:57:16 CET] <faLUCE> I have a file audio recorded in a bad way, with a resulting waveform heavy normalized, with poor dynamic variations. is there a way to de-normalize it, so to hear crescendos, accents etc. ?
[18:59:50 CET] <nicolas17> I'd prefer to play with it interactively in a program like audacity
[19:12:58 CET] <faLUCE> nicolas17: I was searching for a general algorythm to apply to all the file
[19:20:09 CET] <realies> so, getting "output_i" : "-19.03", from loudnorm which I assume should be around -19 LUFS, running through https://youlean.co/youlean-loudness-meter/ says -16 LUFS though
[19:20:18 CET] <realies> could it be because of the stereo output bus?
[19:28:26 CET] <MarioMey> Hello, there. I use ffmpeg from console in Linux. I can see what is the frame number that ffmpeg is encoding, but I would like also to know how the total frames of the input video. Something like:
[19:28:36 CET] <MarioMey> frame= 5439/10000 fps= 29 q=-1.0 Lsize= 14622kB time=00:03:01.48 bitrate= 660.0kbits/s speed=0.965x
[19:29:15 CET] <MarioMey> Is there any way to do it? Or it is a suggestion to devs to include this value as information?
[19:29:25 CET] <nicolas17> ffmpeg doesn't necessarily know that information
[19:29:45 CET] <kepstin> realies: if you're working on a mono file that you expect to be played back by duplicating to both channels on a stereo system, use the 'dual_mono' option to the loudnorm filter.
[19:30:41 CET] <kepstin> and then of course you have to also make sure any other meters you use are set to the same mode
[19:31:48 CET] <nicolas17> MarioMey: afaik the only reliable way to know the total number of frames is to demux the entire video from start to finish and then do it again for the actual transcoding, that would be slow and in some cases not possible (live stream? pipe from another process?)
[19:32:59 CET] <MarioMey> Ok, I understand. I don't need an exact number. It's for knowing the progress.
[19:33:28 CET] <MarioMey> Also ffmpeg doesn't know the duration of the video?
[19:33:32 CET] <nicolas17> also, the "frame=" in the progress bar is the number of frames encoded so far into the *output*; input and output won't necessarily have the same number of frames, there could be -ss or -t, filters, frame rate changes, etc
[19:34:05 CET] <MarioMey> Yes, you are right.
[19:35:26 CET] <nicolas17> ffmpeg knows the duration of the input video in seconds, but it's not entirely reliable... I don't know in which exact cases it could fail
[19:35:36 CET] <nicolas17> and it's not necessarily constant frame rate, there could be dropped frames
[19:36:18 CET] <fling> kepstin: I used concat, should I switch to adelay?
[19:36:33 CET] <kepstin> adelay would certainly be easier to use
[19:36:39 CET] <fling> ok
[19:37:01 CET] <nicolas17> I once used 'number of bytes read from the input file' as a very rough idea of encoding progress% :)
[19:37:27 CET] <nicolas17> pv -d $(pidof ffmpeg)
[19:37:44 CET] <fling> but should be fine if bitrate is not far from constant
[19:37:45 CET] <MarioMey> What does it do?
[19:37:56 CET] <kepstin> MarioMey: because of how filters work, ffmpeg doesn't know the length of the output until it's reached the end.
[19:38:52 CET] <nicolas17> "pv shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA."
[19:39:08 CET] <nicolas17> "-d PID[:FD]: Instead of transferring data, watch file descriptor FD of process PID, and show its progress."
[19:39:22 CET] <fling> so if your ffmpeg is reading input from a pipe then you could put pv in between
[19:39:31 CET] <fling> can also read the file by pv directly and pipe it to ffmpeg
[19:39:42 CET] <fling> it will be accurately enough for most cases
[19:40:00 CET] <nicolas17> fling: with -d it pokes at /proc/$pid/fdinfo
[19:40:04 CET] <nicolas17> so you can do it on a running ffmpeg
[19:40:09 CET] <fling> sure
[19:40:33 CET] <nicolas17> without interferring with ffmpeg's ability to eg. seek in the input file
[19:41:32 CET] <fling> how can I drop five first frames of one of the inputs?
[19:41:38 CET] <fling> they are coming with negative pts
[19:41:41 CET] <fling> like -5, -4 etc
[19:43:20 CET] <MarioMey> pv -d $(pidof ffmpeg)
[19:43:23 CET] <MarioMey> I LOVE IT
[19:43:25 CET] <MarioMey> :D
[19:43:42 CET] <MarioMey> I don't know how it works... but it is awesome.
[19:45:04 CET] <MarioMey> For the moment, it's ok. In the future, I would like to have a script that mix both commands.
[19:45:11 CET] <nicolas17> fling: -vf 'select=gt(pts\,0)' maybe? if I understand properly it will drop frames with negative pts
[19:45:42 CET] <nicolas17> wait, use gte to get pts=0 too
[19:48:07 CET] <fling> nicolas17: it should happen before the streams are getting synced together
[19:48:24 CET] <fling> should I pipe it from a separate ffmpeg?
[19:53:00 CET] <MarioMey> Thanks, people!
[19:55:33 CET] <montana> hi, i am looking for ffmpeg build with rav1e
[20:09:43 CET] <fling> nicolas17: thanks, I will try this
[20:34:48 CET] <ManiakNL> Hi all :)
[20:35:37 CET] <ManiakNL> I currenly has a .sh file to start recording from a RTSP stream to a mkv file.
[20:35:58 CET] <ManiakNL> In general this works great, but in some occassions it produces a 0b video file and i am not sure why
[20:36:10 CET] <ManiakNL> My ffmpeg command is:
[20:36:14 CET] <ManiakNL> ffmpeg -rtsp_transport tcp -i $rtspstream -acodec copy -vcodec copy $filepath </dev/null >/dev/null 2>>$logfile
[20:37:49 CET] <ManiakNL> A log of a failing recording can be found here:
[20:37:50 CET] <ManiakNL> https://pastebin.com/tjF12y6m
[20:38:50 CET] <ManiakNL> A log for a successfull recording can be found here:
[20:38:53 CET] <ManiakNL> https://pastebin.com/SJEH03Br
[20:39:10 CET] <ManiakNL> Is there anything i can do as a fallback if a recording fails?
[20:40:21 CET] <ManiakNL> I'm calling the ffmpeg application that is supplied with HomeAssistant (Hassio) The way that is set up prohibits me to upgrade to a newer version of ffmpeg i'm afraid.
[20:41:19 CET] <furq> ManiakNL: try increasing analyzeduration/probesize
[20:41:48 CET] <ManiakNL> Good suggestion! Let me check the documentation on how to do that
[20:42:09 CET] <furq> also you can use -nostdin instead of redirecting stdin, and you shouldn't ever need to redirect stdout
[20:42:13 CET] <furq> log output is always on stderr
[20:42:40 CET] <ManiakNL> I'm quite new to linux so i was actually already happy that i managed to log something to a file
[20:42:58 CET] <ManiakNL> I don't actually execute the sh file by hand. It's done using HomeAssistant
[20:43:28 CET] <furq> well yeah -analyzeduration 10M -probesize 10M before -i
[20:43:31 CET] <furq> 5M is the default for both
[20:43:51 CET] <ManiakNL> 10M as in minutes?
[20:43:58 CET] <furq> million
[20:44:14 CET] <furq> µs for analyzeduration, bytes for probesize
[20:44:27 CET] <furq> so 5 seconds and 5MB
[20:44:33 CET] <ManiakNL> Ok i will update the start script!
[20:45:02 CET] <ManiakNL> So the following command would be correct?
[20:45:03 CET] <ManiakNL> ffmpeg -rtsp_transport tcp -analyzeduration 10M -probesize 10M -i $rtspstream -acodec copy -vcodec copy $filepath </dev/null >/dev/null 2>>$logfile
[20:45:11 CET] <furq> it's correct
[20:45:15 CET] <ManiakNL> Thanks
[20:45:16 CET] <furq> not totally sure if it'll fix the problem though
[20:45:22 CET] <ManiakNL> Any other improvements i can make?
[20:45:45 CET] <furq> nothing i can think of but i've never dealt with rtsp much
[20:46:14 CET] <ManiakNL> My first attmept was without the -rtsp_transport tcp but that produces a lot of artifacts
[20:46:20 CET] <ManiakNL> My first attmept was without the -rtsp_transport tcp but that produced a lot of artifacts
[20:46:36 CET] <ManiakNL> Oh sorry, i thought using the up arrow allowed me to EDIT the text
[20:47:27 CET] <ManiakNL> Ok so another problem i rarely see:
[20:47:46 CET] <ManiakNL> Sometimes it start recording fine
[20:47:49 CET] <ManiakNL> But suddenly it stops
[20:48:06 CET] <ManiakNL> But then checking the last line of the log
[20:48:10 CET] <ManiakNL> frame= 906 fps= 10 q=-1.0 Lsize= 22591kB time=00:01:29.97 bitrate=2056.9kbits/s speed=1.02x
[20:48:18 CET] <ManiakNL> It did not contain an error
[20:48:36 CET] <ManiakNL> As if it was still recording eventhough it wasn't recording anymore
[20:49:30 CET] <ManiakNL> So either ffmpeg did not produce an error or i fail to log the error using my command
[20:49:47 CET] <ManiakNL> ffmpeg -rtsp_transport tcp -analyzeduration 10M -probesize 10M -i $rtspstream -acodec copy -vcodec copy $filepath </dev/null >/dev/null 2>>$logfile
[20:56:44 CET] <void09> I want to use a remote file as input for a filter, do you think it's possible somehow ? fmpeg -i "video.mkv" -vf "removelogo=f=https://i.imgur.com/file.png" -f nut -c:v rawvideo - | mpv - <- this does not work
[21:29:08 CET] <kepstin> void09: the reason that doesn't work is that : is a special character in filter commands, so you need to escape it
[21:29:21 CET] <void09> ohh
[21:29:36 CET] <void09> I thought it might be that
[21:29:41 CET] <void09> how to escape ? :)
[21:29:47 CET] <kepstin> backslashes
[21:30:12 CET] <kepstin> i recommend putting filters in single quotes ' '
[21:30:29 CET] <kepstin> otherwise you need multiple backslashes, since double quotes in shell do their own backslash escaping
[21:31:15 CET] <void09> the whole filter in single quote then a backslash for the url ?
[21:31:19 CET] <void09> no, for the ":"
[21:31:33 CET] <kepstin> either -vf 'removelogo=f=http\://example.com/img.png' or -vf "removelogo=f=http\\://example.com/img.png"
[21:31:52 CET] <kepstin> or however else you feel like doing your shell escaping
[21:32:39 CET] <kepstin> (that said, i'm going on the assumption that removelogo uses the standard ffmpeg io stuff here, which seems like a good assumption, but I haven't actually checked that it supports arbitrary urls)
[21:33:52 CET] <kepstin> yeah, should work, it uses the generic load image stuff.
[21:34:07 CET] <void09> mpv --vf 'removelogo=f=https\://i.imgur.com/qfImXkc.png' video.mkv
[21:34:18 CET] <void09> Error parsing option vf (option parameter could not be parsed)
[21:34:18 CET] <void09> Setting commandline option --vf=removelogo=f=https\://i.imgur.com/qfImXkc.png failed.
[21:34:39 CET] <kepstin> mpv is not ffmpeg
[21:34:45 CET] <void09> oh crap :D
[21:35:04 CET] <kepstin> (you can use ffmpeg filters in mpv, but it's a bit convoluted to do so)
[21:35:11 CET] <kepstin> you can use ffplay to test it
[21:35:50 CET] <nicolas17> my version of mpv says "most actual filters are available via the lavfi wrapper"
[21:36:00 CET] <void09> i wanted to use mpv because i can seek the file when opening it that way. if i stream from ffmpeg, i am stuck to present moment
[21:36:15 CET] <nicolas17> so all filters should work
[21:36:18 CET] <nicolas17> but perhaps option parsing is different
[21:36:34 CET] <kepstin> yeah, you can use some thing like --vf lavfi=removelogo=blah in mpv, but you might need to deal with multiple levels of parameter escaping
[21:36:44 CET] <kepstin> and I dunno how that works in mpv
[21:36:50 CET] <nicolas17> just wget the image and use it locally
[21:37:07 CET] <void09> nicolas17: I can already do that, but this is not what i wanted to do
[21:37:55 CET] <void09> I am thinking if there's a way to automatically pick the logo remove image based on file name, from a remote url
[21:38:25 CET] <void09> so one command would work with work on all files, that is the idea here
[21:39:39 CET] <kepstin> sounds like something that could be done fairly reasonably with mpv's lua scripting.
[21:41:27 CET] <void09> but first i have to make it work with an url
[21:42:03 CET] <kepstin> it should work fine with a url, go ahead and test it with ffplay
[21:42:22 CET] <void09> i try it with ffmpeg streaming and it does not work
[21:42:45 CET] <void09> [Parsed_removelogo_0 @ 0x5624cf385d40] No option name near '//i.imgur.com/qfImXkc.png'
[21:42:45 CET] <void09> [AVFilterGraph @ 0x5624cef7e500] Error initializing filter 'removelogo' with args 'f=https://i.imgur.com/qfImXkc.png'
[21:43:13 CET] <void09> I did -vf 'removelogo=f=https\://i.imgur.com/qfImXkc.png' -f nut -c:v rawvideo - | mpc -
[21:43:13 CET] <nicolas17> did you escape the : ?
[21:43:14 CET] <kepstin> you didn't correctly escape the : in one of the ways i told you to do
[21:43:33 CET] <kepstin> hmm. that should be correct...
[21:43:43 CET] <kepstin> I hate ffmpeg filter escaping, it's a pain :)
[21:44:01 CET] <void09> can try it yourself and see :P
[21:44:03 CET] <kepstin> are you sure that's the exact command you ran, copy-pasted? you didn't use double-quotes or something? :)
[21:45:48 CET] <kepstin> hmm, so it is. you need to double-up on the backslashes there
[21:46:09 CET] <kepstin> no idea why that happens, escaping in ffmpeg filter chains is a mess :)
[21:46:52 CET] <void09> that works :)
[21:47:03 CET] <kepstin> if you're using double-quotes you need \\\\
[21:47:04 CET] <void09> ok now, to make it work with seeking, any idea ?
[21:47:27 CET] <kepstin> works with seeking in ffplay, should work in mpv if you figure out what escaping syntax to use there
[21:47:39 CET] <void09> I won't, lol
[21:47:46 CET] <void09> not without spoonfeeding
[21:48:15 CET] <void09> i should ask in mpv maybe
[21:49:39 CET] <void09> yeah simpole forward seeking works in mpv too (slowly), but ffplay does not have a progress bar
[22:04:29 CET] <montana> hi, i am looking zeranoe's freenode name/account
[22:39:07 CET] <cre8radix> Ahoy, how do i fit a 16:9 movie into a 4:3 frame?
[22:39:21 CET] <cre8radix> is this the right place to ask this?
[22:41:10 CET] <nicolas17> cre8radix: you want letterboxing?
[22:41:17 CET] <cre8radix> yep
[22:41:23 CET] <cre8radix> nicolas17: i do
[22:42:05 CET] <nicolas17> the 'pad' video filter
[22:47:46 CET] Action: cre8radix tries
[22:54:34 CET] <cre8radix> nicolas17: i cant figure it out& https://ffmpeg.org/ffmpeg-filters.html#pad-1
[22:54:46 CET] <cre8radix> is that what you meant?
[22:54:50 CET] <nicolas17> yes
[22:55:14 CET] <nicolas17> to apply a video filter, you use -vf 'pad=...'
[22:55:38 CET] <nicolas17> let's see
[22:55:57 CET] <nicolas17> you want original width, and a height modified to be 4:3
[22:56:59 CET] <nicolas17> -vf 'pad=iw:iw*3/4:-1:-1'
[22:57:15 CET] <kepstin> no, that's not what you want.
[22:57:18 CET] <nicolas17> passing -1 as x and y make the filter put the image in the center
[22:57:27 CET] <kepstin> pad doesn't resize the inputs, it only can make videos
[22:57:30 CET] <kepstin> bigger
[22:57:47 CET] <kepstin> er, wait, nvm
[22:57:50 CET] <kepstin> i have it backwards
[22:58:03 CET] <kepstin> thought you wanted 4:3 in a 16:9 frame
[22:59:13 CET] <kepstin> it might be tricky if your input video is anamorphic or otherwise has a sar != 1
[22:59:24 CET] <kepstin> but otherwise that's fine ^^
[22:59:36 CET] <cre8radix> nicolas17: yeah i know&
[23:00:02 CET] <cre8radix> its been killing me
[23:00:49 CET] <nicolas17> sar != 1 should go to hell along with interlacing
[23:02:51 CET] <kepstin> if you have a specific target resolution, you might need to use a combination of the scale and pad filters.
[23:04:51 CET] <cre8radix> nicolas17: it should go from 720x428 to 320x240
[23:06:44 CET] <cre8radix> ehm& 1024x428 to 320x280
[23:11:21 CET] <nicolas17> I don't know what the heck that is but it's not 16:9 or 4:3
[23:11:22 CET] <nicolas17> o_o
[23:13:49 CET] <void09> one more thing.. how do I scan a file for any kind of errors (audio/video/container etc), and display the timestmap or byte count where the error occured in the file ?
[23:15:07 CET] <kepstin> void09: ffmpeg isn't designed to detect "any kind" of errors (although it can detect some). with appropriate settings, ffmpeg will abort on errors, and you can tell the time from the stats output i guess.
[23:15:19 CET] <kepstin> if you want more detail you'd have to make your own tool using ffmpeg libraries.
[23:17:40 CET] <cre8radix> nicolas17: right
[23:21:42 CET] <kepstin> cre8radix: if I had to guess, you have a pal (576-line) standard definition video which was anamorphic 16:9 widescreen, then scaled to 1:1 sar (gives 1024x576) - but which contained a video wider than 16:9 with black bars on top and bottom that have been cropped out.
[23:22:08 CET] <kepstin> but that's a pretty wild guess :)
[23:24:10 CET] <void09> ok, is there a tool that scans for errors and displays details ?
[23:25:00 CET] <void09> ffmpeg -v error -i "outputvideo.mkv" -f null - 2>test.log this is what i use now, to just check for errors, but it does not display time/byte offset
[23:25:00 CET] <kepstin> void09: not that I know of.
[23:26:37 CET] <kepstin> void09: if you change that ffmpeg command to include the stats output, the last update of the stats should be right before the error it aborts on
[23:27:00 CET] <void09> how do i do that ?
[23:27:04 CET] <kepstin> that's about as good as you'll get without custom tools or tools that i'm not aware of
[23:27:46 CET] <kepstin> don't use "-v error", or alternately re-enable stats with the "-stats" option.
[23:29:07 CET] <kepstin> note that you'll probably also want the -xerror option so ffmpeg actually stops on the error rather than attempting to conceal it and continue.
[23:30:07 CET] <void09> attempts to conceal it ?
[23:30:51 CET] <kepstin> ffmpeg is designed in part for players, and the desired behaviour there in case of minor corruptions is to keep going as best as possible.
[23:31:19 CET] <kepstin> particularly since video will be fine after the next keyframe anyways
[23:31:40 CET] <void09> ok i ran it with stats.. and i got a 16.9 mb file :\
[23:31:45 CET] <void09> trying with xerror now
[23:32:18 CET] <void09> ffmpeg -v xerror -stats -i "file.mkv" -f null - 2>outputvideo.log
[23:32:19 CET] <void09> this good?
[23:32:31 CET] <void09> hm no it does not run
[23:32:41 CET] <kepstin> the -stats option just prints continuous updates of file postion, you'd only need the last line. feel free to use tail or something to grab only the last part of the output.
[23:32:49 CET] <kepstin> -xerror is an option
[23:32:57 CET] <kepstin> it's not a value for the -v option
[23:33:03 CET] <void09> ok, doing -xerror now
[23:33:29 CET] <void09> oh so it only stops when there's an error if i use xerror
[23:33:35 CET] <void09> but what if there's multiple errors?
[23:33:52 CET] <kepstin> stop at the first one
[23:37:13 CET] <kepstin> i suppose without -xerror it'll print error log messages mixed in with the stats output, which might let you see multiple errors.
[00:00:00 CET] --- Tue Nov 26 2019
More information about the Ffmpeg-devel-irc
mailing list