Ffmpeg-devel-irc
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
January 2020
- 1 participants
- 62 discussions
[00:00:00 CET] --- Wed Jan 15 2020
1
0
[00:11:37 CET] <tomb^> thank you!
[01:18:26 CET] <KodiakIT> So, cehoyos, like I said, searching the manpage for ocr/OCR & optical just return "pattern not found", and you mentioned something about compiling it in?
[01:19:00 CET] <cehoyos> (where exactly did you search?)
[01:19:14 CET] <cehoyos> https://ffmpeg.org/ffmpeg-filters.html#ocr
[01:19:16 CET] <KodiakIT> man ffmpeg from console
[01:19:21 CET] <KodiakIT> oh
[01:19:38 CET] <cehoyos> I may misremember but I don't think man ffmpeg is very useful
[01:19:43 CET] <cehoyos> There is ffmpeg -h full
[01:19:50 CET] <cehoyos> and ffmpeg -h filter=ocr (not tested)
[01:20:01 CET] <nicolas17> there's more manpages
[01:20:07 CET] <cehoyos> ok
[01:20:14 CET] <nicolas17> like "man ffmpeg-filters"
[01:20:57 CET] <KodiakIT> nicolas17, didn't notice that, I see that in my tab-complete now.
[01:21:43 CET] <nicolas17> and ffmpeg-all for the full 140000 words of documentation :)
[01:52:20 CET] <melatonina> Hello. Is this channel also for programming against libavcodec and friends?
[01:53:14 CET] <relaxed> melatonina: yes
[01:53:17 CET] <melatonina> Ok. #ffmpeg-devel topic says it is
[01:53:21 CET] <melatonina> relaxed: thankx
[02:02:19 CET] <melatonina> I'm trying to setup a transcoding. When I open the encoder, I get the "The encoder timebase is not set." Following some StackOverflow answer, I set the output stream sample rate copying it from the input stream (line 53 in the linked gist). It doesn't work. Additionally, the sample rate is 0/0. How should I set the timebase? https://gist.github.com/mel4tonin4/0d17d202fca32de42671fb4a5c2c5ea4
[02:03:27 CET] <DHE> there's actually a time_base field at AVFormatContext->streams[i]->time_base iirc
[02:04:07 CET] <DHE> if you can get away with it, set it to 1/(samplerate) so that the pts value is identical to the number of samples send to far
[02:09:06 CET] <melatonina> DHE: trying that. Thanks
[02:13:33 CET] <melatonina> DHE: just for checking, I set outputStream.r_frame_rate(AVRational().num(44100).den(1))
[02:13:34 CET] <melatonina> outputStream.time_base(AVRational().num(1).den(44100)) but I'm still getting the same message
[02:16:05 CET] <melatonina> Ok, the codec has no timebase() but codec context does. I set it there and the messages went away
[07:54:48 CET] <st0n3c0ld> hello
[07:55:02 CET] <st0n3c0ld> I can't record my screen. it is always like this : it records the cached screen. not real screen it records windows that aren't there any more. if I record 20 screencasts all of them sho the first recording that i made.
[07:55:04 CET] <st0n3c0ld> why?
[07:55:56 CET] <st0n3c0ld> Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller
[08:56:12 CET] <st0n3c0ld> why it is like this?
[08:56:13 CET] <st0n3c0ld> it is my screen record https://filebin.net/d5jsf0jqauiv1yqq
[08:56:29 CET] <st0n3c0ld> look at the time
[12:43:31 CET] <mlok> gcc is unable to create an executable file.
[12:43:40 CET] <mlok> C compiler test failed.
[12:43:51 CET] <mlok> What would be the first place to look? :)
[12:44:04 CET] <DHE> the config.log file (possibly inside the ffbuild directory depending on your ffmpeg version)
[12:44:30 CET] <mlok> Thanks, I am using a custom compiler
[12:44:49 CET] <mlok> for ARM architecture
[12:45:09 CET] <DHE> oh a cross compiler... well then...
[12:45:13 CET] <mlok> DHE: yeah
[15:22:54 CET] <alazare619> i need a ffmpeg cli string to copy every audio and video container to a mkv
[15:23:33 CET] <alazare619> would that be , map - 0 -c Copy ?
[15:24:24 CET] <alazare619> or -c Copy
[15:24:28 CET] <alazare619> with no map?
[16:12:38 CET] <StephenLynx> hey, I'm trying to make png thumbs out of videos with libavformat. but the remuxing example doesn't work even for videos here.
[16:12:40 CET] <StephenLynx> https://ffmpeg.org/doxygen/trunk/remuxing_8c-example.html
[16:12:42 CET] <StephenLynx> any pointer?
[16:13:06 CET] <StephenLynx> the resulting file seems corrupt and when remuxing to the same format, webm, the file is about 90% smaller
[16:16:32 CET] <JEEB> lol, thumbnail making. i think one of the first things i tested api usage with back in ye olde 2013
[16:17:36 CET] <JEEB> https://github.com/jeeb/matroska_thumbnails/tree/master/src
[16:17:57 CET] <JEEB> really old code and uses old apis but might or might not be useful
[16:49:10 CET] <StephenLynx> anything else.
[16:49:12 CET] <StephenLynx> helps*
[18:50:20 CET] <waleee-cl> is it possible to use another video file as a 'template' for conversions settings? (ie without manually checking it with ffprobe)
[20:10:40 CET] <StephenLynx> JEEB, got stumped on IStream
[20:10:48 CET] <StephenLynx> :\
[20:10:51 CET] <JEEB> that's windows specific thing :P
[20:10:54 CET] <StephenLynx> fml
[20:11:03 CET] <JEEB> I just implemented an AVIO wrapper around windows's IO mechanism
[20:11:16 CET] <JEEB> which it uses for explorer out of process plugins
[20:24:05 CET] <StephenLynx> I assume BITMAPINFO is another windows specific feature, JEEB ?
[20:25:09 CET] <JEEB> also I skipped using libavfilter for scaling/colorspace conversions etc
[21:35:06 CET] <vlt> waleee-cl: I asked a veeery similar question here a few days ago. The concensus seemed to be no because with most video codecs not all the parameters used to encode are stored in the final stream.
[22:59:44 CET] <fatturtle> Hi. I'm trying to transcode flac to opus while preserving the cover art, but I get errors. This is the command I am using 'ffmpeg -i input.flac -map 0:0 -map 0:1 -c:a libopus -c:v copy out2.opus'
[23:33:24 CET] <BtbN> What even is .opus? Does it support cover art, or is it an mp3 like raw stream dump?
[23:35:27 CET] <relaxed> ogg
[23:36:14 CET] <pink_mist> "but I get errors" he says
[23:36:21 CET] <pink_mist> and then doesn't even show us the output
[23:36:34 CET] <kepstin> opus is ogg opus, it uses a similar tag format to ogg vorbis
[23:36:50 CET] <relaxed> I don't think ffmpeg's opus muxer supports covert art
[23:37:17 CET] <kepstin> cover art in ogg vorbis/opus is kind of a hack iirc, since they don't really do binary tags? IIRC some apps store the image base64 encoded in a text tag
[23:38:03 CET] <kepstin> (i think they might actually use a base64 encoded *flac image frame* in the vorbis comment or something ridiculous like that?)
[23:38:35 CET] <furq> https://trac.ffmpeg.org/ticket/4448
[23:40:54 CET] <kepstin> ah, my terminology is wrong, it's a "flac picture block" :)
[23:41:03 CET] <furq> looks like 4442 got fixed so the code is already there
[23:41:25 CET] <furq> and the m4a muxer already has some workaround for the video stream/cover art ambiguity
[23:57:18 CET] <fatturtle> Here is the ffmpeg output https://pastebin.com/evDxwEEi
[23:58:19 CET] <fatturtle> I'm not really sure how you get cover art on opus, but I do know it can be done. I was able to do it using some other tagging software (kid3).
[00:00:00 CET] --- Thu Jan 16 2020
1
0
[00:00:00 CET] --- Tue Jan 14 2020
1
0
[00:31:42 CET] <zumba_addict> can ffmpeg be used to analyzed and guess if there were dropped frames on a video?
[00:31:51 CET] <zumba_addict> analyze^
[00:40:46 CET] <void09> depens on how they were dropped
[00:41:09 CET] <void09> dropped from a stream cause of packet loss/insufficient bandwidth ?
[00:42:15 CET] <zumba_addict> dropped from a stream
[00:43:33 CET] <cehoyos> In general, ffmpeg is not an analyzing tool but a transcoder, for "real" (compressed) video, you will get (many) error messages for damaged streams
[00:43:47 CET] <zumba_addict> got it
[03:36:01 CET] <javashin> hello
[03:36:03 CET] <javashin> amigos
[03:36:45 CET] <javashin> i have a problem a i made a video a large video with simple screen recorder
[03:36:54 CET] <javashin> and its all thrash out
[03:37:07 CET] <javashin> with a lot of flickering
[03:37:15 CET] <javashin> how i can fix the video
[03:37:28 CET] <javashin> i really dont want to re do it again
[03:37:42 CET] <javashin> its there any solution ?
[03:40:26 CET] <nicolas17> javashin: hard to tell you how to fix it if we don't know how it's broken
[03:42:16 CET] <javashin> i made it on freebsd
[03:42:37 CET] <javashin> and looks like the compositor made the flicker happen
[03:43:04 CET] <javashin> without the compositor the videos with simple screen recoder looks fine
[03:43:20 CET] <javashin> the video is complete is not like corrupted or something
[03:44:00 CET] <javashin> its the image thats shows the video flicker a lot
[03:44:17 CET] <javashin> like unwanted visual effect
[11:04:22 CET] <lofo> hi
[11:07:36 CET] <lofo> i was tweaking parameters on OBS and ended up using their "Custom Output (FFmpeg)" panel. On the "container format" field, which is a dropdown list, there is an "mpegts" but also an "rtp_mpegts" and i was wondering was it corresponded to for ffmpeg ?
[11:07:53 CET] <lofo> and what was the difference between "mpegts" and "rtp_mpegts"
[11:08:08 CET] <lofo> people from OBS told me this list was directly pulled from ffmpeg
[11:10:58 CET] <JEEB> it's some muxer available through lavf, you'd have to look it up specifically to figure out what it actually does and what it's useful for.
[11:11:19 CET] <lofo> lavf = libavformat ?
[11:11:41 CET] <JEEB> yes
[11:11:42 CET] <JEEB> .name = "rtp_mpegts",
[11:11:42 CET] <JEEB> .long_name = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"),
[11:12:07 CET] <lofo> thanks JEEB
[11:12:20 CET] <JEEB> seems to just use mpegts and rtp inside
[11:12:40 CET] <JEEB> probably to pass MPEG-TS through RTP, since RTP itself is on the lavf level as well
[11:13:07 CET] <lofo> i dont understand why the two are mangled together
[11:13:39 CET] <lofo> one is a transport protocol the other a container
[11:14:27 CET] <JEEB> as far as I can see, RTP has a separate packetizer and a protocol thing
[11:15:18 CET] <JEEB> and rtp_mpegts is then the packetizer that utilizes MPEG-TS
[11:15:30 CET] <JEEB> not perfect
[11:15:35 CET] <JEEB> but that's how it is atm
[11:22:05 CET] <lofo> ok :)
[11:26:48 CET] <JEEB> of course the fun part with these that utilize other things internally is how you handle option passing :)
[11:27:04 CET] <JEEB> we've had plenty of fun with things like MPEG-DASH or HLS
[11:27:20 CET] <JEEB> where you have the "muxer" doing the playlist writing etc
[11:27:32 CET] <JEEB> and then calling internally mpeg-ts or mp4 muxers
[11:32:24 CET] <lofo> it looks like ffmpeg hits the conceptual limits of "muxer" :)
[11:32:41 CET] <lofo> quite confusing for a noob like me
[13:17:27 CET] <faLUCE> hello. does ffmpeg need to compiled from scratch for ogg/theora support, or are there binaries for linux?
[13:28:25 CET] <tablerice> faLUCE: Seems like ffmpeg should support ogg by default. However, in the general docs it looks like Theora decoding is supported, but encoding is only supported via external libraries
[13:30:16 CET] <faLUCE> tablerice: I need to do screen capture with theora codec. And I don't want to recompile ffmpeg
[13:30:45 CET] <faLUCE> should I switch to another tool?
[13:31:48 CET] <faLUCE> tablerice: solved. I just found recordmydesktop app
[13:32:03 CET] <tablerice> My first thought was OBS
[13:32:20 CET] <faLUCE> what's OBS?
[13:32:21 CET] <tablerice> https://obsproject.com
[13:32:34 CET] <tablerice> Screen recorder / streaming platform
[13:32:41 CET] <tablerice> it runs ffmpeg under the hood
[13:32:46 CET] <pink_mist> afaik it's what most twitch streamers use
[13:33:11 CET] <faLUCE> does it support theora encoding?
[13:33:26 CET] <tablerice> I'm rummaging through the settings right quick...
[13:33:59 CET] <tablerice> Yea, it looks to support theora and ogg
[13:34:31 CET] <faLUCE> tablerice: thanks
[13:35:10 CET] <tablerice> No problem. I just went to settings > output > advanced and chose 'custom output (ffmpeg)'
[14:29:05 CET] <EmmaT> ffmpeg seems to out the files in a different directory than the working directory, or i am doing something wrong
[14:30:15 CET] <pink_mist> if you specified a different directory for ffmpeg to output the files into, sure
[14:30:23 CET] <pink_mist> but otherwise it would definitely use the working directory
[14:30:40 CET] <pink_mist> or maybe you're running a script that changes the working directory for ffmpeg
[14:31:59 CET] <EmmaT> pink_mist i booted up an old project ... on mac now .. and using a different static build which is behaving very strange in terms of output ... but no . .the command lists the output correctly ... i get the playlist file correcty ... the hls files not
[14:33:26 CET] <EmmaT> command
[14:33:27 CET] <EmmaT> ./ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 3000 -i "http://user:password@192.168.0.11:9981/play/stream/service/2ec9eb7f5285a934…" -vf "scale=floor(iw*min(1\,min(1024/iw\,720/ih))/2+0.4999999)*2:-2" -vf setdar=16/9 -crf 24 -preset veryfast -threads 1 -c:v libx264 -r 24 -g 96 -x264opts keyint_min=96 -x264-params scenecut=0 -map 0:v:0 -map 0:a:0 -f hls -hls_list_size 100 -hls_time 4 -hls_flags
[14:33:28 CET] <EmmaT> delete_segments -sn /c/projects/momomo/.generated/Tv/streams/KANAL9_2346076453/
[14:37:18 CET] <pink_mist> well you're specifically setting the output to a dir there
[14:37:29 CET] <pink_mist> I'll presume that means it'll just use that dir
[14:37:50 CET] <pink_mist> but I'm far from an expert ... I would have expected it would complain that it wasn't a filename
[14:50:58 CET] <lofo_> on the commandline tool how does one specify a muxer explicitely ? instead of implicitely choosing it with the output file extension ?
[14:51:31 CET] <JEEB> -f
[14:51:47 CET] <JEEB> -f FORMAT, and formats can be listed with -formats
[14:51:52 CET] <EmmaT> pink_mist maybe it has to do with .generated ... since the output is going to the parent folder
[14:52:36 CET] <lofo_> oh, i'm confused with how the -f option work. take this command for example
[14:52:36 CET] <lofo_> ffmpeg -f avfoundation -i "0" -c:v mpeg2video -q:v 20 -pix_fmt yuv420p -f rtp rtp://192.168.1.47:1234
[14:52:44 CET] <EmmaT> but strange thing is that the playlist is getting in htere
[14:52:45 CET] <lofo_> there are two -f options
[14:53:15 CET] <JEEB> before/after
[14:53:17 CET] <JEEB> input/output
[14:53:28 CET] <lofo_> so you can only specify -f two times ?
[14:53:29 CET] <JEEB> -i INPUT being the differentiator
[14:53:36 CET] <JEEB> for each input and output it can be set
[14:53:45 CET] <DHE> ffmpeg [options for file] [input-or-output file]
[14:53:50 CET] <DHE> and that pattern repeats
[14:54:05 CET] <EmmaT> pink_mist it was that
[14:54:11 CET] <EmmaT> bug!
[14:54:16 CET] <JEEB> ffmpeg -f blah -i blah -f blah -i INPUT_STREAM -f outblah output1 -f outblah output2
[14:54:17 CET] <EmmaT> ffmpeg can not handle .folders
[14:54:20 CET] <lofo_> DHE so i could put as much -f as i want
[14:54:42 CET] <JEEB> there, I have an example with two inputs and outputs set and f set for all of them :P
[14:54:48 CET] <DHE> lofo_: ffmpeg -f image2 -i "%04d.png" -f mp4 -i input.mp4 -filter_compex hstack -f mkv output.mkv
[14:54:59 CET] <DHE> 2 inputs, 1 output, formats for each explicitly set
[14:55:18 CET] <DHE> I'm sure the filter is wrong but you get the idea
[14:55:39 CET] <lofo_> so -i is the only way to differentiate output from input as JEEB stated
[14:55:57 CET] <DHE> "-i" in front of a filename is an input file. else it's an output file
[14:56:08 CET] <lofo_> i get it
[14:56:21 CET] <lofo_> then for -f rtp rtp://192.168.1.47:1234
[14:56:35 CET] <lofo_> rtp is the format ? so i should repalce it with rtp_mpegts ?
[14:57:04 CET] <lofo_> if i want to use rtp_mpegts as a muxer
[14:57:24 CET] <DHE> ffmpeg -muxers # 'D' means input, 'E' means output (decoder, encoder)
[14:57:35 CET] <DHE> err, -formats
[15:11:07 CET] <lofo_> thanks i get the syntax now
[15:11:51 CET] <lofo_> are twitch commands printed to everyone
[15:11:59 CET] <lofo_> oops sorry :/
[16:59:08 CET] <pagios> hi, what is the use of "-g",90 ?
[17:00:08 CET] <pagios> trying to transcode rtmp -> HLS i am using -vf scale -vb bitrate and -g 90 -framerate 30 -hls_time 3 <-- can i optimize this to make it work on a slow machine
[17:03:22 CET] <cehoyos> Your (second) question is missing _all_ necessary information to be answered in a useful way...
[17:03:52 CET] <cehoyos> The option "g" specfies the distance between key frames, I believe it has a very small impact on performance
[17:06:19 CET] <pagios> cehoyos, https://pastebin.com/EA5aL7AJ i am getting these errors continously when the transcoding happens
[17:07:17 CET] <cehoyos> (No errors are shown in your paste) Please do never paste extracts of a random console output, always show us the command line you used together with the complete, uncut console output.
[17:08:00 CET] <cehoyos> Note that your console output (the little that can be seen) indicates that your "slow machine" is fast enough for the task you gave it.
[17:11:33 CET] <pagios> cehoyos, https://pastebin.com/mT9YtJZT this is the command from node and the output
[17:29:39 CET] <cehoyos> Apart from an old binary (that may have less optimizations and more bugs but gets less support), everything looks fine.
[17:35:35 CET] <pagios> cehoyos, is it normal to get these stderr errors?
[17:37:01 CET] <pink_mist> what error?
[17:37:23 CET] <pink_mist> stderr is often used to output information to the user, none of that needs to be an error
[17:46:58 CET] <pagios> pink_mist, cehoyos is there a way to optimize that to make it work on slower cpu
[17:53:47 CET] <cehoyos> Start with a current binary but note that depending on what "slower cpu" means wonders are typically difficult to get...
[17:53:59 CET] <cehoyos> (achieve?)
[17:56:17 CET] <cehoyos> And remember that you can tell the x264 encoder how fast you need it to run (placebo, veryslow, slower, slow, medium, fast, faster, veryfast, superfast, ultrafast)
[17:59:24 CET] <pagios> cehoyos, on a slow pc , better to run placebo?
[18:02:01 CET] <DHE> no. you want a fast setting. veryfast is as far as I'd go because I find quality takes a serious hit for superfast and ultrafast
[18:02:16 CET] <DHE> $ ffmpeg -i filename .... -preset:v veryfast ... output
[18:09:36 CET] <cehoyos> But depending on what a "slower cpu" is, you may have to test superfast and ultrafast...
[23:40:36 CET] <tomb^> Hi, I have a file with audio stream: "Stream #0:1: Audio: pcm_s24le, 48000 Hz, 4.0", I'm trying to make 1 stereo stream out of channel 1&2 (don't need 3 and 4), I tried: "channelsplit=channel_layout=4.0[FL][FR][BL][BR];[FL][FR]amerge=inputs=2[aout]" but I get an error saying "Filter channelsplit:BC has an unconnected output", what am I doing wrong?
[23:46:03 CET] <furq> tomb^: "pan=stereo|c0=c0|c1=c1"
[23:51:03 CET] <tomb^> furq, thanks for the quick reply, it seems to be working, now I'm trying to figure out why :)
[23:58:10 CET] <furq> the error was because you had BL and BR labels not connected to anything
[23:58:26 CET] <furq> you could have also done channelsplit=channel_layout=4.0:channels=FL|FR,amerge=inputs=2
[23:58:43 CET] <furq> but pan is simpler
[00:00:00 CET] --- Wed Jan 15 2020
1
0
[00:00:00 CET] --- Mon Jan 13 2020
1
0
[01:07:06 CET] <Guiri> I'm having trouble getting remuxing a VOB to MKV. The framerate gets changed to 29.58 from 29.97, at which it plays in VLC and is specified on the case. https://paste.centos.org/view/78eb4c88
[01:27:16 CET] <cehoyos> The vob most likely has a framerate of 30000/1001
[01:27:38 CET] <cehoyos> You forgot to paste the complete, uncut console output.
[01:28:29 CET] <cehoyos> Note that you cannot specify "vsync 1 -r xxx" with -vcodec copy -acodec copy, this cannot work
[01:33:05 CET] <Guiri> cehoyos: Thanks, so if I omit vsync and the framerate specification of -r, I still get 29.58 for some reason. Here is the complete output: https://paste.centos.org/view/1d0c217e
[01:37:41 CET] <cehoyos> You request from FFmpeg to change the framerate (I am not saying that this always works, but it is what your command line requests) and you are asking why it changes the framerate (again, I am not completely convinced that this is what happens, 30000/1001 is expected but not garanteed), what is your question?
[01:41:14 CET] <Guiri> My question is why does a stream copy result in a different framerate than what the original stream specifies? One would think that the default argument of -c:v copy would copy the framerate, which is set to 29.97
[01:41:33 CET] <Guiri> My guess is this is because I'm generating the timestamps?
[01:45:52 CET] <cehoyos> If you generate timestamps, then you cannot ask for identical framerate
[01:46:11 CET] <cehoyos> I am still not convinced that you really changed the framerate: Are you seeing A/V desync?
[01:46:23 CET] <cehoyos> What are you trying to achieve?
[01:48:01 CET] <pink_mist> Guiri: perhaps the framerate you were seeing was just from metadata, and the real framerate was never displayed to you until ffmpeg discarded the metadata (assuming it did so)
[01:48:15 CET] <cehoyos> No framerate metadata in vob files
[01:48:27 CET] <pink_mist> oh, guess that can't be it then
[01:48:27 CET] <cehoyos> (would be 90k)
[01:52:00 CET] <nicolas17> Guiri: you're still passing -r (why?)
[02:02:40 CET] <Guiri> pink_mist: good point. And to the latter, I overlooked that
[02:10:03 CET] <danilo82> its possible to use vaapi with ffplay?
[03:04:09 CET] <danilo82> its possible to use vaapi in ffplay?
[04:09:44 CET] <zumba_addict> is there a filter that's better that deshake filter for stabilization?
[04:13:06 CET] <nicolas17> vidstab (needs two passes)
[04:16:18 CET] <zumba_addict> cool, thank you!
[04:21:38 CET] <zumba_addict> my command is this and it's working. However, how should I do 2 passes?
[04:21:41 CET] <zumba_addict> ffmpeg -i PICT0028_vid16x9.mp4 -vf vidstabdetect -vcodec libx264 -crf 22 -pix_fmt yuv420p o.mp4
[04:23:09 CET] <nicolas17> first you run it with the vidstabdetect filter, and you can even throw away the resulting video with "-f null -" as the output
[04:23:29 CET] <nicolas17> the important thing is it will generate a transforms.trf file (you can change the filename with the 'result' parameter to the filter)
[04:24:04 CET] <nicolas17> then you run it again with the vidstabtransform, which will read the .trf file and stabilize the video, this time you do your normal video output
[04:27:06 CET] <zumba_addict> ah
[04:41:54 CET] <lain98> so i ffprobe'd a video and saw that the first frame was not start at pts=0, also AVStream->start_time is incorrectly set to 0. is there a way I could fix avstream->start_time to the correct value using ffmpeg ?
[05:41:29 CET] <super8macht> Hello. is it possible to delete every 3 frame ? it's for my super8 transfer project. I run the projector with 16,66 fps and shoot it with 24 fps, because of the shutter every third frame is half of no.2 half of no.4
[07:50:10 CET] <tinystoat> super8macht: the "select" filter may do what you want.
[08:37:35 CET] <vlt> DHE: Thank you, I'll have a look at the concat demixer.
[08:38:58 CET] <vlt> Is there a way to tell ffmpeg to use exactly the same encoding properties as a given example file (or a specified video track)?
[08:44:53 CET] <nicolas17> vlt: no because video files don't store what encoding parameters they were made with
[08:45:04 CET] <nicolas17> and maybe they were made with a different encoder that doesn't even have the same options
[08:51:47 CET] <vlt> nicolas17: But ffmpeg can determine things like size, pix_fmt, framerate, codec (and "baseline", "main" or "high" for h.264). What else would I need to generate a clip I could concatenate to another video?
[08:52:20 CET] <JEEB> depends on the exact format
[08:52:30 CET] <JEEB> with H.264 and HEVC you need something with exactly the same parameter sets
[08:52:40 CET] <JEEB> which includes those things, but is definitely more than that :P
[08:53:17 CET] <JEEB> it's definitely not impossible but requires tight integration to an encoder so that you know that you can utilize the exact same parameter sets
[14:59:46 CET] <fandangos> Hi all, I'm trying to do a pull request into Kodi to fix the playback of Dolby Vision dual layer content, like UHD Blurays
[15:00:08 CET] <fandangos> the problem is that the codec tag (MKTAG) by FFMpeg is nowhere to be found on those files
[15:00:41 CET] <fandangos> is there anyway to identify Dolby Vision streams besides the MKTAG?
[15:01:29 CET] <fandangos> Here's the output from MediaInfo
[15:01:33 CET] <fandangos> https://pastebin.com/Zv2fndLF
[15:01:53 CET] <fandangos> as you can see the secondary 1080p stream (dolby vision enhancement layer) is mistaken by a secondary video stream
[15:06:25 CET] <fandangos> so how can I differenciate the first stream from the second one?
[15:06:58 CET] <fandangos> I need to drop the second one, or else it results in a green screen
[15:08:37 CET] <JEEB> I would recommend reading Dolby's specs as a base
[15:08:50 CET] <JEEB> they have container wise specs (MPEG-2 TS, MP4)
[15:09:18 CET] <fandangos> https://www.dolby.com/us/en/technologies/dolby-vision/dolby-vision-white-pa…
[15:09:19 CET] <fandangos> this?
[15:09:51 CET] <JEEB> no
[15:10:08 CET] <JEEB> the white papers are generally bullshit
[15:11:10 CET] <fandangos> found it: https://www.dolby.com/us/en/technologies/dolby-vision/dolby-vision-bitstrea…
[15:11:22 CET] <JEEB> yes that sounds like a matching spec
[15:11:37 CET] <JEEB> for MPEG-2 TS
[15:13:02 CET] <fandangos> yes, I'm trying to fix it for UHD BD playback
[15:13:33 CET] <fandangos> so mpeg2 is what I'm looking at
[15:49:02 CET] <fandangos> "The value of stream_type in the PMT shall be set to 0x06." <-- for Dolby Vision enhancement layer
[15:49:28 CET] <fandangos> is PMT the same as PMT_PID in ffmpeg avformat.h?
[15:50:31 CET] <JEEB> pmt PID is just the PID on which the PMT is received (PAT which has a hard-coded PID contains a list of programs and their PMT PIDs)
[15:51:39 CET] <JEEB> not sure if the stream_type is exported to the API client
[15:52:05 CET] <DHE> I suspect not since that byte should just be mapped to the codec most of the time
[15:52:07 CET] <JEEB> or if there should be specific metadata noting it as being an enhancement layer which should be exported from FFmpeg for that AVStream
[15:53:19 CET] <JEEB> parsing the value within libavformat/mpegts.c is most definitely possible, but the problem is how do you tell the clients what you have found
[15:53:45 CET] <JEEB> problem being that in theory internals like stream_type shouldn't probably be just exported to the API client, but instead handled internally if possible
[15:54:10 CET] <JEEB> so that the client could just have generic code for "do not pick streams mapped as enhancement layers"
[15:54:13 CET] <JEEB> or something :P
[15:54:55 CET] <JEEB> (also because it doesn't make much sense to have a list of IDs in all the clients for them to handle the logic)
[15:55:04 CET] <DHE> there may need to be more disposition flags added, such as AV_DISPOSITION_VISUAL_IMPAIRED and the like
[15:55:13 CET] <DHE> (that one already exists for reference)
[15:57:19 CET] <fandangos> you may find this an utter stupid solution but looking at tons of uhd/regular blurays, the solution I came up with is just removed the stream with ID 0x1015 (every DV EL has this address)
[15:58:01 CET] <fandangos> but it would be better if a DL EL flag exists
[15:58:10 CET] <fandangos> *DV
[16:00:26 CET] <JEEB> DHE: yea disposition flag like depending or additive
[16:00:37 CET] <JEEB> (something that means that it doesn't provide a proper image by itself)
[16:01:53 CET] <fandangos> DEBUG: ffmpeg[0x1d261849710X]: [mpegts] pid=1011 pes_code=0x1e1
[16:01:54 CET] <fandangos> DEBUG: ffmpeg[0x1d261849710X]: [mpegts] pid=1015 pes_code=0x1e1
[16:02:13 CET] <fandangos> as you can see not even the pes_code changes from the main movie (pid=1011) and the EL pid=1015
[16:02:55 CET] <JEEB> the stream start location for blu-ray is probably defined
[16:03:01 CET] <JEEB> as in, the area of PIDs to utilize
[16:04:38 CET] <fandangos> it might be, but that is read by libbluray, which I don't think should be touched
[16:05:09 CET] <fandangos> this is the only open source implementation I found about reading the 'DOVI' identifier
[16:05:11 CET] <fandangos> https://github.com/Comcast/gots/blob/master/psi/pmtdescriptor.go#L283
[16:05:35 CET] <fandangos> still, this would not diferenciate the EL and the main movie with the single layer
[16:34:45 CET] <linux123> hi ,when encoding with libx265 it seems to work but the result is black (only audio working) ,any help?
[16:35:54 CET] <linux123> is libx265 working on ubuntu ??
[16:36:25 CET] <linux123> ffmpeg v 4.1.2
[16:39:30 CET] <linux123> ffmpeg -threads 8 -loop 1 -i pic.jpg -i audio.mp3 -c:v libx265 -c:a copy -shortest out.avi
[16:39:37 CET] <HickHoward> so..
[16:39:50 CET] <HickHoward> i'm trying to write a "script" that can read a LATM frame header
[16:40:12 CET] <HickHoward> is there any place i can start for doing just that?
[16:40:22 CET] <HickHoward> (aside from ffmpeg's sourcecode)
[16:49:30 CET] <HickHoward> (and i mean this in a more accessible manner)
[16:54:39 CET] <pink_mist> linux123: your ffmpeg version doesn't say anything about your libx265 version
[16:54:57 CET] <pink_mist> linux123: and it seems it's libx265 you're having issues with
[16:55:23 CET] <th3_v0ice> Why would I get "error while decoding MB, bytestream -6, concealing AC, DC, MV errors..." while using GPU transcoding? Using the API.
[16:56:01 CET] <kepstin> th3_v0ice: those are messages from the software video decoder, fwiw. perhaps your input is corrupt?
[16:57:26 CET] <th3_v0ice> kepstin: Yeah, this is what I get while trying to play my stream. Input is good, tried it with ffplay also.
[16:58:49 CET] <Hello71> linux123: ... avi?
[16:59:05 CET] <Hello71> I mean, I think it's possible, but... why
[16:59:05 CET] <pink_mist> oh lol, didn't even notice that
[16:59:13 CET] <pink_mist> why indeed
[16:59:39 CET] <linux123> ok it just worked ,does libx265 support .avi ? is
[17:00:24 CET] <linux123> I get it it needs to be mp4 ,right ?
[17:00:50 CET] <pink_mist> I'd prefer mkv personally
[17:04:32 CET] <linux123> thanks !!
[17:05:06 CET] <tomb^> Hi all, was wondering if you guys could help, i'm trying to merge 2 audio streams from a 4.0 mxf video file to a stereo stream, I try: "-filter_complex "channelsplit=channel_layout=4.0[FL][FR][BL][BR];[FL][FR]amerge=inputs=2[aout]" but keep getting an error "Filter channelsplit:BC has an unconnected output", what am I doing wrong?
[17:06:22 CET] <kepstin> th3_v0ice: please pastebin your transcoding commandline and the complete console output.
[17:14:31 CET] <th3_v0ice> kepstin: I am using the API, not the console app. But here is a pastebin https://pastebin.com/KM2Qn16F
[17:37:25 CET] <funnybunny2> Is it possible for different frames in an audio stream to have different sample formats?
[17:37:56 CET] <kepstin> th3_v0ice: is that from the transcoding command? or when you playback the transcoded file?
[17:39:45 CET] <kepstin> funnybunny2: in general, no
[17:40:58 CET] <th3_v0ice> kepstin: Input is rtmp stream and output is also rtmp stream on local network. Using FFplay to stream to my PC which is not on a local network. Errors in pastebin are from FFplay while trying to play transcoded stream using the GPU decoder/encoder pair. While using the CPU it plays the stream fine.
[17:41:08 CET] <funnybunny2> Do all the popular formats like mp3, ogg, aac forbit this?
[17:41:13 CET] <funnybunny2> *forbid
[17:41:25 CET] <kepstin> th3_v0ice: i asked to see the log output from the transcoder
[17:41:57 CET] <funnybunny2> It's just that avcodec_receive_frame takes a non-const pointer to the codec context, so it could change the sample format
[17:42:31 CET] <kepstin> funnybunny2: a single stream decoded by a single decoder shouldn't ever change the sample format mid-stream
[17:43:52 CET] <funnybunny2> I wonder if ffmpeg handles that or if it's a legal encoding according to any standard
[17:44:43 CET] <funnybunny2> I guess I'll just write my code such that it blows up and writes out garbage if the sample format changes
[17:44:45 CET] <kepstin> with mp3 i think you can do nasty things with concatenated files that cause the sample rate or channels to change
[17:44:50 CET] <kepstin> but not the sample format
[17:45:13 CET] <funnybunny2> Oh yeah, I recall being able to simple cat mp3 files together
[17:45:29 CET] <funnybunny2> Does the header contain the sample format?
[17:45:36 CET] <funnybunny2> *simply
[17:45:53 CET] <kepstin> with mp3, each individual packet contains a marker that indicates the sample rate and channels, iirc
[17:46:01 CET] <funnybunny2> But not the format?
[17:46:05 CET] <kepstin> with most lossy codecs, sample format is a property of the decoder, not the codec
[17:46:17 CET] <kepstin> ffmpeg's mp3 float decoder will always produce float
[17:49:35 CET] <funnybunny2> Right now my program is playing back an mp3 but it sounds like a helicopter :(
[17:49:41 CET] <funnybunny2> Something is wrong
[17:50:55 CET] <kepstin> is it interleaved or planar sample format? are you dealing with that correctly?
[17:52:52 CET] <funnybunny2> kepstin: Interleaved
[17:53:30 CET] <funnybunny2> I checked that the sample format is s16le and interleaved and I'm just passing it strait to ALSA as a test
[17:53:40 CET] <funnybunny2> I just die on any other formats
[17:53:59 CET] <kepstin> passing it straight to alsa how?
[17:55:32 CET] <funnybunny2> snd_pcm_writei(handle, frame->extended_data[0], frame->linesize[0]);
[17:56:32 CET] <kepstin> did you tell alsa the correct sample rate, sample format, channel count?
[17:59:21 CET] <funnybunny2> kepstin: Yep
[17:59:55 CET] <funnybunny2> I'll post some code in a sec
[18:03:31 CET] <th3_v0ice> kepstin: Do you mean this? https://pastebin.com/RK24Zuaw
[18:05:27 CET] <funnybunny2> kepstin: Here's the code https://pastebin.com/9KD9Z2Jk
[18:19:25 CET] <ePirat> durandal_1707, is seeking for .dav not implemented?
[18:34:11 CET] <funnybunny2> kepstin: Any idea?
[18:38:09 CET] <kepstin> funnybunny2: that's supposed to be a decoder, right? i think you have some confusion between frames and packets
[18:38:36 CET] <kepstin> oh, no, i'm confused
[18:40:07 CET] <funnybunny2> One thing I'm not sure of is what value to set for latency with snd_pcm_set_params https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ga45d5084…
[18:40:14 CET] <kepstin> av_read_frame is just a strangely named function
[18:41:02 CET] <funnybunny2> Also, there is av_receive_frame and av_receive_packet
[18:41:10 CET] <funnybunny2> I never use av_receive_packet
[18:41:58 CET] <durandal_1707> ePirat: it is implemented, and works fine with mpv
[18:42:10 CET] <ePirat> huh weird
[18:42:26 CET] <durandal_1707> weird?
[18:42:43 CET] <ePirat> it does not in VLC for whatever reason
[18:43:33 CET] <durandal_1707> perhaps you use very old ffmpeg
[18:48:26 CET] <ePirat> durandal_1707, hm even though seeking works fine in mpv it seems it has some problems at the end of my file
[18:53:36 CET] <ePirat> durandal_1707, oh I guess its because it does not know the duration of the file
[18:56:34 CET] <durandal_1707> i added code to guess duration in master...
[18:57:19 CET] <kepstin> funnybunny2: hmm. only other thing i can think of is make sure you're not mixing up number of samples vs number of bytes
[18:57:27 CET] <ePirat> durandal_1707, theres no duration given in the dav container?
[18:57:51 CET] <funnybunny2> kepstin: But I'm just dumping the entire frame to ALSA
[18:58:14 CET] <durandal_1707> ePirat: i'm not aware of any, demuxer seeks to the end and tries to find latest packet
[18:58:20 CET] <kepstin> funnybunny2: but you have to tell alsa how long the frame is. what units does it want?
[18:58:50 CET] <kepstin> funnybunny2: does it take byte length of buffer? number of samples in the buffer? if number of samples, do you count 1 for each pair of stereo samples?
[18:59:33 CET] <funnybunny2> kepstin: That's a good point. The documentation is very vauge
[18:59:37 CET] <funnybunny2> kepstin: https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gabc748a5…
[18:59:51 CET] <funnybunny2> It says "size frames to be written"
[19:00:06 CET] <funnybunny2> Along with a pointer to a buffer
[19:00:18 CET] <kepstin> in that context, "frame" means "1 sample for each channel"
[19:00:18 CET] <funnybunny2> I don't know why it's calling it "frames"
[19:00:28 CET] <kepstin> so for stereo s16, a frame would be 4 bytes
[19:00:31 CET] <funnybunny2> Seriously
[19:00:34 CET] <funnybunny2> wtf
[19:00:48 CET] <funnybunny2> So I need to divide by 4
[19:01:22 CET] <kepstin> you need to divide by number of channels, then divide by number of bytes per sample
[19:01:41 CET] <kepstin> or there might be some value in the avframe which already is the number of samples? not sure
[19:01:42 CET] <funnybunny2> Yes which is 4
[19:01:45 CET] <funnybunny2> Holy crap it worked
[19:03:16 CET] <funnybunny2> kepstin: Thanks! :)
[19:03:52 CET] <kepstin> the "choppiness" of the sound would have been from alsa overreading the provided buffer and playing some arbitrary memory :/
[19:03:53 CET] <kepstin> yay C
[19:04:05 CET] <funnybunny2> It's 2 channels and 2 bytes per sample, so 4 bytes per "frame"
[19:05:07 CET] <ePirat> durandal_1707, btw are you aware it has the original recording time in the file somewhere?
[19:05:12 CET] <funnybunny2> Now that I finally have something working with ffmpeg + ALSA, I can generalize it with a working program as a base
[19:05:55 CET] <funnybunny2> I will probably try to get a file which doesn't work with a s16 decoder and explicitly convert to s16
[19:06:43 CET] <funnybunny2> I also don't like how somewhere ffmpeg is outputting "[mp3 @ 0x56548cd35ae0] Could not update timestamps for skipped samples."
[19:07:15 CET] <funnybunny2> And "[mp3 @ 0x56548cd35ae0] Could not update timestamps for discarded samples."
[19:07:36 CET] <funnybunny2> Don't think a library should ouptut stuff like that
[19:09:56 CET] <durandal_1707> ePirat: where?
[19:10:55 CET] <ePirat> durandal_1707, I dont know yet, but it must be somewhere as the player I have here is able to display a timeline of the day with my sample video at the correct time range
[19:12:21 CET] <ePirat> durandal_1707, if you want I can share the sample and time with you if you are interested
[19:17:18 CET] <durandal_1707> ePirat: yes, current date is stored in every packet
[19:42:03 CET] <ChocolateArmpits> How does ffmpeg determine file length when the duration isn't known or the file is still growing but seekable otherwise? Does it attempt to check the size of a few frames and use that as a basis for the whole size?
[19:43:20 CET] <kepstin> depends on the container format
[19:44:08 CET] <ChocolateArmpits> I guess TS demuxer uses that approach?
[19:44:31 CET] <kepstin> if there's a header at the start which indicates a length, it'll just report that. some container formats might have estimation? not sure (probably mostly weird stuff like mp3).
[19:44:46 CET] <kepstin> i'd expect in many cases it just reports that it doesn't know the length
[20:06:51 CET] <ChocolateArmpits> I see
[20:07:18 CET] <ChocolateArmpits> Well in my case, probing a growing MXF does report a length, albeit slightly off by a few seconds
[20:08:15 CET] <ePirat> durandal_1707, Ah ok
[20:09:53 CET] <alazare619> is there a way to make sure hte output file is always same container as original?
[20:11:41 CET] <DHE> in the ffmpeg cli? no
[20:11:58 CET] <DHE> without actually specifying your desired output format which you've determined yourself ahead of time
[20:22:58 CET] <HickHoward> okay
[20:23:15 CET] <HickHoward> is there any way i can hook up an windows build of ffmpeg into a vapoursynth script?
[20:23:58 CET] <HickHoward> i don't want to use any source filter available on vapoursynth because i want ffmpeg to be the source filter i'll ever use in any of my vapoursynth scripts
[20:24:21 CET] <durandal_1707> no
[20:24:31 CET] <ChocolateArmpits> HickHoward, There's vspipe to pipe contacts from vapoursynth to ffmpeg
[20:24:34 CET] <ChocolateArmpits> contents*
[20:24:57 CET] <ChocolateArmpits> You can pipe it to anywhere but ffmpeg works absolutely fine from my experience
[20:26:33 CET] <HickHoward> vspipe is out of the question
[20:26:47 CET] <ChocolateArmpits> Oh source filter
[20:26:49 CET] <ChocolateArmpits> sorry
[20:27:07 CET] <HickHoward> right
[20:29:08 CET] <ChocolateArmpits> Would ffmpeg do something to the stream prior to it getting fed into vapoursynth or do you just want some custom input, say a network stream?
[20:30:31 CET] <HickHoward> the former, yes
[20:30:44 CET] <HickHoward> actually i want it more like the latter
[20:34:07 CET] <ChocolateArmpits> There's nothing that I know of to facilitate such workflow aside from programming that type of interaction via vapoursynth api
[20:34:41 CET] <HickHoward> heh
[20:34:44 CET] <ChocolateArmpits> HOWEVER you could try exploring mpv and see if the vapoursynth script input for filtering could be combined with your desired input
[20:35:12 CET] <ChocolateArmpits> "mpv actually provides a source filter, instead of using a native VapourSynth video source"
[20:36:07 CET] <ChocolateArmpits> I have not used this feature so can't attest how well it works or if it works at all with streaming inputs
[20:37:46 CET] <th3_v0ice> kepstin: Is this what you were looking for? https://pastebin.com/RK24Zuaw
[20:38:34 CET] <ChocolateArmpits> HickHoward, with mpv you can also reencode the content and send it off to wherever you need. It runs ffmpeg/libav/whatever api under the hood so a lot of what you can do with ffmpeg is totally doable with mpv as well, though to a smaller degree
[20:39:17 CET] <HickHoward> nice
[20:39:51 CET] <kepstin> th3_v0ice: hmm. nothing obvious there, can you reproduce this issue with the ffmpeg cli tool?
[20:42:29 CET] <th3_v0ice> kepstin: Nope, ffmpeg works fine. Everything printed on my side looks similar to what FFmpeg is printing.
[20:43:28 CET] <kepstin> this is probably gonna end up being a "please share your code" and maybe someone can look at it and see what you're doing wrong.
[20:43:40 CET] <kepstin> (I'm too busy to look at that today)
[20:49:42 CET] <th3_v0ice> kepstin: Heheh, I will try to create small example that doesnt work. Thanks for your help!
[20:53:13 CET] <HickHoward> fine, i'll give up - i'll use L-SMASH-Works on my vapoursynth script
[20:54:15 CET] <ChocolateArmpits> HickHoward, don't forget ffms2 just in case lsmash doesn't work properly
[20:58:20 CET] <HickHoward> yes but i'm using HolyWu's LSMASH
[20:58:55 CET] <HickHoward> ffms2's latest binary release (from ffms2(user/group) github repo by the way) is there for over 3 years
[20:59:11 CET] <HickHoward> i need something updated to make my script "work"
[21:34:40 CET] <BtbN> Is there some way to segment a stream without getting weird audio glitching when stitching it back together? It seems like some of the seams have a mismatch between audio and video frames, and there's a tiny hitch.
[21:39:02 CET] <kepstin> BtbN: not possible with lossy codecs that use overlapped blocks, you should just encode the audio non-segmented
[21:39:16 CET] <BtbN> I'm not encoding at all
[21:39:21 CET] <BtbN> I'm just stream-copying
[21:39:36 CET] <BtbN> I'm recording an rtmp stream in a ton of short segments
[21:40:29 CET] <pagios> hello all, i am having a problem when transcoding some media, i get on the console this error https://pastebin.com/rurGzX2P , if transcoding is not enabled all is good. when transocding is enabled i am getting dropped frames, vm is yet relaxed on cpu (40% only used and on RAM too, ) what could be the problem?
[21:40:40 CET] <kepstin> hmm. if you're using the ffmpeg segment muxer (or hls or similar) that should be fine
[21:41:04 CET] <kepstin> the concat demuxer should be able to put the segments back together into a single stream before decoding, so it should be good
[21:41:27 CET] <pagios> i am using ['-vf','scale='+,"-vb",,"-g",90,"-framerate",30,"-hls_time",3,"-f","hls",channelPath]
[21:41:48 CET] <ChocolateArmpits> BtbN, are you using flv to store the segments?
[21:42:06 CET] <pagios> kepstin, sorry i didnt get that
[21:42:15 CET] <BtbN> no, .ts
[21:42:18 CET] <kepstin> oh, hmm, that was supposed to trigger a bot
[21:42:35 CET] <kepstin> pagios: please share the complete ffmpeg command line *and* the full ffmpeg output.
[21:42:58 CET] <pagios> the ffmpeg is being used as a commandline inside node
[21:42:59 CET] <BtbN> kepstin, it's ffmpeg segment muxer to 4 second long .ts segments.
[21:43:20 CET] <BtbN> And when stitching them together with the concat demuxer, every now and then on the seams of the segments, there's a tiny but audible hitch
[21:43:54 CET] <kepstin> pagios it's possible that there's something in your ffmpeg command that's single-threaded and cpu limited on your machine.
[21:44:35 CET] <kepstin> use a top program that can show per-cpu processor consumption, and also check steal time if it's a vm
[21:44:44 CET] <pagios> kepstin, i am using a simple ffmpeg where i take an rtmp, use -vf scale -vb -g 90 -hls_time 3 on it
[21:44:48 CET] <kepstin> you probably just don't have enough cpu performance available
[21:45:08 CET] <pagios> kepstin, the cpu seems to be relaxed in top i only see 30 to 40% usage
[21:45:33 CET] <kepstin> pagios: check if a single cpu core is pegged, check steal time.
[21:46:16 CET] <pagios> kepstin, i am using the cx51 on this page https://www.hetzner.com/cloud
[21:46:26 CET] <pagios> it is shared cpu
[21:47:49 CET] <kepstin> shared cpu and realtime multimedia = having a bad day
[21:48:07 CET] <pagios> kepstin, even if i go dedicated cpu same problem when enabling trans
[21:48:32 CET] <pagios> kepstin, could it be disk io to write the segments/
[21:48:58 CET] <kepstin> pagios: i cannot help you futher unless you provide some of the information i've asked for, such as complete ffmpeg command line, complete console output, per-core breakdown of cpu usage.
[21:49:11 CET] <kepstin> it could be disk io if your transcoding makes the file bigger
[21:49:29 CET] <pagios> no it is small chunks
[21:49:55 CET] <kepstin> by "makes the file bigger" i mean "results in a higher bitrate than not transcoding"
[21:56:03 CET] <pagios> kepstin, here is the log, https://pastebin.com/38immBEm
[21:57:00 CET] <kepstin> oh, you're doing multiple scales and encodes in a single command
[21:57:18 CET] <kepstin> the filter chain is single-threaded in the ffmpeg cli tool, so it's probably cpu limited doing the scaling
[21:57:23 CET] <pagios> yes
[21:57:27 CET] <pagios> oh
[21:57:36 CET] <kepstin> doing separate processes per resolution would work better
[21:57:51 CET] <pagios> you mean to fire 4 ffmpeg seperately?
[21:58:12 CET] <pagios> commands
[21:58:29 CET] <kepstin> sure, that's one way of doing it if you don't need them perfectly synced.
[21:58:42 CET] <pagios> yea no need to have them synced
[21:59:06 CET] <pagios> kepstin, but how come "top" doesnt show cpu saturation?
[21:59:30 CET] <kepstin> you need to look at per-core stats
[21:59:42 CET] <kepstin> and even then it might not be obvious if the process gets bounced between cores
[21:59:54 CET] <kepstin> a per-thread breakdown of the ffmpeg process could show it too
[22:01:08 CET] <pagios> kepstin, inside top, i pressed 1 , thats how i see per core ?
[22:03:38 CET] <saber1> does anyone know why timestamp overlay added video has different pts_time compare to the original video? I'd expect them to be the same, since all I wanted was to add overlays to existing frames
[22:04:18 CET] <saber1> could it be related how filtering works? as it has to decodes and reencodes the video?
[22:05:13 CET] <kepstin> sefeng211: the ffmpeg cli tool applies some "cleanups" to timestamp values during decoding (these can be mostly disabled with appropriate options).
[22:05:33 CET] <kepstin> filters can of course also modify timestamps, but you have to explicitly include a filter which does that
[22:05:55 CET] <pagios> <kepstin> a per-thread breakdown of the ffmpeg process could show it too < -- how can i do that
[22:06:15 CET] <saber1> kepstin: okie, thanks, do you know which options to disable that off hand?
[22:06:58 CET] <kepstin> sefeng211: check out the -copyts and -vsync options in the docs for the ffmpeg cli command, might want to try one or another or both.
[22:08:07 CET] <kepstin> pagios: by going "man top" and searching for "thread" and finding out that in the version of top on my system, the "H" key causes it to display individual threads.
[22:08:18 CET] <kepstin> (this might not match your system)
[22:08:36 CET] <pagios> thanks i will have a look at the man page
[22:13:18 CET] <saber1> kepstin: tried vsync 0, 1 and 2, with and witout copyts, they generated some different pts_time, however one of them matches the ones from the original video
[22:13:47 CET] <BtbN> So I figure there is simply no way to properly segment a stream? oO
[22:14:09 CET] <BtbN> Unless I go the super dumb route that just cuts 188 byte chunks ignoring any contents somehow
[22:19:02 CET] <kepstin> BtbN: I'd honestly expect that to work. It's not clear what's going wrong.
[22:20:00 CET] <BtbN> It's not every seam. Like, maybe once every few minutes it messes up
[22:20:07 CET] <BtbN> but in a 4h long video it's still annoying
[22:20:51 CET] <kepstin> might be some sort of timestamp issue. what's the command/output that you're using to put the segments back together?
[22:27:12 CET] <BtbN> https://github.com/esamarathon/VodManager/blob/master/tools/nginx/ffmpeg_re… that's the recording command
[22:27:40 CET] <BtbN> https://github.com/esamarathon/VodManager/blob/master/VodManager/Services/V… and that what stitches it together
[22:34:32 CET] <BtbN> really nothing complicated to it
[22:34:43 CET] <kepstin> hmm. i wonder if it's an issue with the concat demuxer's timestamp handling.
[22:35:04 CET] <kepstin> have you tried just concatenating the ts files directly? or using the concat protocol instead of format? (both are equivalent)
[22:36:34 CET] <BtbN> not yet unfortunately. Since we are only now starting to notice this, way after the fact
[22:38:09 CET] <void09> trying to encode a .dv video file: Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
[22:38:09 CET] <void09> Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
[22:38:09 CET] <void09> Stream #0:1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
[22:38:09 CET] <void09> Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
[22:38:25 CET] <void09> and I get this: [dv @ 0x65ad940] Can't initialize DV format!
[22:38:25 CET] <void09> Make sure that you supply exactly two streams:
[22:38:25 CET] <void09> video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM
[22:38:49 CET] <kepstin> BtbN: iirc the concat demuxer does some extra work to ensure the audio/video packets in each segment are aligned by adjusting timestamps and that could possibly be the cause of the issue.
[22:39:11 CET] <void09> that's probably 2 mono audio streams meant to be interpreted as stereo. as switching to the second one in mpv results in no audio being played
[22:39:11 CET] <BtbN> So just using the concat protocol might help?
[22:39:33 CET] <BtbN> Or, well, just not using ffmpeg at all and naively concating the segments.
[22:39:37 CET] <kepstin> yes, that's equivalent to doing "cat file1.ts file2.ts | ffmpeg -i -"
[22:40:00 CET] <void09> oh ts cutting.. i gave up on that with ffmpeg :\
[22:40:09 CET] <BtbN> cutting works just fine it seems
[22:40:17 CET] <BtbN> the putting it back together does not
[22:40:32 CET] <kepstin> the segment muxer cuts them fine, but the concat muxer isn't the recommended tool for putting them back together
[22:40:55 CET] <kepstin> concat demuxer*
[22:40:59 CET] <void09> I still have some cut pieces I have no idea how to merge (without glitches at the merging points)
[22:41:14 CET] <void09> cutting commercials from .ts tv recordings
[22:41:31 CET] <kepstin> with the segment muxer, the resulting files are actually a single continuous ts stream that's just been split over multiple files
[22:41:53 CET] <kepstin> ... i think
[22:41:56 CET] <kepstin> you know, I'm not actually sure. I hope that's the case.
[22:42:26 CET] <kepstin> if it's initializing a separate ts muxer for each segment, it might just be a bad time for everyone :/
[22:42:34 CET] <BtbN> Well, if you actually cut out segments, you can get some glitches, cause there's a mismatch there
[22:42:41 CET] <BtbN> That's not surprising at least
[22:43:11 CET] <kepstin> BtbN: i wonder if the hls muxer might actually work better for you than the segment muxer :/
[22:43:26 CET] <BtbN> Don't they use the same code?
[22:43:48 CET] <BtbN> For all I'm aware, the HLS muxer can't realtime-timestamp the segments
[22:46:14 CET] <void09> BtbN: there shouldn't be any glitches though, cutting at keyframes
[22:46:25 CET] <BtbN> kepstin, looking at the segment.c code, I probably want to set -individual_header_trailer 0
[22:47:00 CET] <BtbN> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/segment.c;h=bf9e… passed to segment_start here
[22:47:01 CET] <BtbN> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/segment.c;h=bf9e…
[22:47:12 CET] <BtbN> And there, if it's true, it will re-init the context on each segment
[22:47:18 CET] <BtbN> so probably, for .ts, I want to set it to 0.
[22:47:52 CET] <kepstin> void09: i'd expect audio glitches when cutting on keyframes, but video should be fine assuming the keyframes are actually where you hope they are.
[22:48:35 CET] <kepstin> usually programs go to/from commercial breaks on silence tho, so that's probably not gonna be any noticable audio issues
[22:50:16 CET] <void09> kepstin: i exported the pieces with avidemux, cutting only on keyframes. joining them back resulted in glitches (2 seconds of video pause at joining points)
[22:50:51 CET] <kepstin> void09: well, there's many possible reasons for that.
[22:53:39 CET] <kepstin> one fairly common thing is that you have some extra audio packets that are timestamped either before the first video frame or after the last video frame.
[22:56:39 CET] <void09> yeah i thought of that.. but no idea how to fix it
[22:59:58 CET] <BtbN> kepstin, yeah, I'm pretty confident that -individual_header_trailer 0 is what I need
[23:00:50 CET] <BtbN> Maybe even -write_header_trailer 0
[23:00:58 CET] <BtbN> Not sure if that even does anything for .ts
[23:03:03 CET] <kepstin> might as well leave the -write_header_trailer on, it does an extra flush at the end that couldn't hurt
[23:03:23 CET] <kepstin> mpegts muxer doesn't even have a write header function, iirc
[23:08:43 CET] <BtbN> But the segment muxer does have special code for mpegts
[23:08:54 CET] <BtbN> it sets av_opt_set(oc->priv_data, "mpegts_flags", "+resend_headers", 0); every segment start
[23:09:13 CET] <BtbN> which in the mpegts muxer is a special flag which it resets/consumes, and triggers it to re-write the PAT/PMT
[23:10:25 CET] <BtbN> Just re-discovered this lovely script I came up with, to put an intro in front of one of the segments, while keeping timestamps intact, with crossfade: https://github.com/esamarathon/VodManager/blob/master/tools/combine_video.sh
[23:23:48 CET] <void09> ffmpeg -i dvgrab-001.dv -c:a copy -c:v copy lol.mkv
[23:23:54 CET] <void09> ffmpeg -y -i lol.mkv -an -sn -pix_fmt yuv420p -c:v libaom-av1 -aq-mode 1 -crf 23 -b:v 0 -cpu-used 3 -g -1 -strict -2 -pass 1 -passlogfile 'dvgrab-001.dv1' -f matroska /dev/null && ffmpeg -y -i lol.mkv -an -sn -pix_fmt yuv420p -c:v libaom-av1 -aq-mode 1 -crf 23 -b:v 0 -cpu-used 3 -g -1 -strict -2 -pass 2 -passlogfile 'dvgrab-001.dv1' 'dvgrab-001-1.dv'
[23:24:02 CET] <void09> first pass works, but second pass fails with this:
[23:25:29 CET] <void09> nevermind, figured it out
[23:25:35 CET] <void09> i kept the .dv extension for output :\
[00:00:00 CET] --- Tue Jan 14 2020
1
0
[00:00:00 CET] --- Sun Jan 12 2020
1
0
[12:16:49 CET] <Mathijs> I'm streaming live video (BlackMagic Decklink input) of which I'd like to replace the audio with another live audio stream (windows soundcard input). I need to keep both streams in sync. Currently the audio drifts out of sync after a while. Can ffmpeg correct for the slight difference in speeds of both streams?
[13:50:44 CET] <TheWild> hello
[13:51:45 CET] <TheWild> audio in movie is damaged starting from around 2:00 and neither ffmpeg nor mpv wants to play it. I suspect whole audio stream is contained within the file. Is there a way to fix the audio?
[13:58:25 CET] <TheWild> (hmm... but it works on website?)
[13:58:25 CET] <TheWild> Okay, I think I found out the cause. Website served damaged stream to fool youtube-dl.
[15:18:03 CET] <funnybunny2> join #ffmpeg-devel
[15:18:20 CET] <funnybunny2> Hey
[15:20:02 CET] <funnybunny2> I can't include avformat.h and compile with gcc -ansi. Is ffmpeg intended to only support C99? I want to keep my source code C89. What should I do to isolate ffmpeg?
[15:21:38 CET] <funnybunny2> Here are the errors I get: https://pastebin.com/dbQfauTv
[15:22:00 CET] <BtbN> FFmpeg is C99, indeed.
[15:22:58 CET] <funnybunny2> It doesn't seem like there are too many errors so far, but maybe if I use more functions there will be more. I wonder how hard it would be to just make the headers C89 compatible
[15:23:57 CET] <funnybunny2> I can't think of a way apply C89 checking to my own code while also including ffmpeg headers
[15:25:19 CET] <funnybunny2> I guess I'll just deal with it for now
[15:25:26 CET] <funnybunny2> Hope it's not a problem on Windows
[15:25:55 CET] <funnybunny2> Last time the MSVC compiler didn't fully support C99
[15:52:25 CET] <utack> is there a way to use benchmark to determine the time it takes to decode each frame? for example to determine if even the most complex frame in an entire stream could be decoded in under 16ms?
[16:16:48 CET] <DHE> utack: you can try an imprompu decode run: ffmpeg -i input.mp4 -c:v rawvideo -c:a pcm_s16le -f null /dev/null
[16:16:52 CET] <DHE> I think that's right
[16:29:05 CET] <vlt> Hello. How can I prepend a 5 second black clip to a video file without having to recode it? Is there a way to concat two clips if I manage to match their properties somehow?
[16:46:45 CET] <utack> DHE thank you. but would i see if one frame can't be decoded quickly enough?
[16:46:50 CET] <utack> it just tells me the average fps
[16:48:03 CET] <DHE> vlt: the concat demuxer should suffice, but you need to make sure you get the parameters exactly right. h264 for example is sensitive to the profile (baseline, main, high)
[16:48:13 CET] <DHE> (not to be confused with the concat filter)
[17:23:52 CET] <yang> I am trying to create video DVD
[17:23:55 CET] <yang> http://paste.debian.net/plainh/5f314534
[17:23:58 CET] <yang> got some errors
[17:24:28 CET] <yang> ffmpeg -i Contaboscale5.avi -target pal-dvd movie.mpg
[17:25:04 CET] <yang> looking at https://www.savvyadmin.com/tag/growisofs/
[17:25:12 CET] <yang> couldn't find any recent DVD video manual
[17:32:27 CET] <cehoyos> yang: Please provide the command line you tested together with the complete, uncut console output - the errors are unexpected afair
[17:43:41 CET] <yang> cehoyos: https://ufile.io/kih2sjg2
[17:52:34 CET] <cehoyos> Is your input an actual video?
[17:52:45 CET] <cehoyos> I ask because I can reproduce the issue with input from /dev/random
[17:53:32 CET] <cehoyos> Try the output option "-trellis 1"
[18:02:46 CET] <yang> it's an actual video
[18:03:45 CET] <yang> same buffer overflows with ffmpeg -i Contaboscale5.avi -target pal-dvd -trellis 1 movie.mpg
[18:04:30 CET] <cehoyos> It may help if you change the bitrate with -b:v, you could also test with a very old FFmpeg version to check for a regression. (gtg)
[18:17:00 CET] <yang> ffmpeg -i /home/yang/Matroska/Contaboscale5.avi -i /home/yang/Matroska/Contaboscale5.avi -map 1:0 -map 0:1 -y -target pal-dvd -sn -g 12 -bf 2 -strict 1 -ac 2 -aspect 1.3333333333333333 -s 720x576 -trellis 1 -mbd 2 -b:a 224k -b:v 5000k /root/movie/movies/movie_0.mpg
[18:17:08 CET] <yang> this one gives buffer errors aswell
[19:26:52 CET] <mr_lou> So I need to convert a bunch of WAVs into AMRs... but the amr_nb codec is apparently disabled in my ffmpeg. How do I enable it? Do I need to compile ffmpeg myself in order to do that?
[19:27:44 CET] <pink_mist> probably
[19:27:51 CET] <pink_mist> never heard of AMR before
[19:30:17 CET] <mr_lou> It's a limited audio format. I know it from back in the day before iPhone and Android. Cellphone games back then used AMR for streamed audio, typically used for sound effects in games. And MIDI for music.
[19:35:03 CET] <mr_lou> And that's what I need it for. Porting a game to the old phones.
[19:36:25 CET] <BtbN> There simply does not appear to be an encoder for that format. Only a decoder.
[19:36:55 CET] <mr_lou> Oh.... but when I google for "ffmpeg wav to amr", there are plenty of results showing how it's done.
[19:37:01 CET] <mr_lou> Except I don't have the "amr_nb" encoder.
[19:37:14 CET] <mr_lou> "Automatic encoder selection failed for output stream #0:0. Default encoder for format amr (codec amr_nb) is probably disabled. Please choose an encoder manually."
[19:38:36 CET] <BtbN> libopencore-amr appears to have encoding capabilities
[19:39:01 CET] <BtbN> But you will most likely need to build it and ffmpeg yourself
[19:42:59 CET] <mr_lou> :-/
[19:43:42 CET] <mr_lou> Ubuntu does have libopencore... I could try installing that and see...
[19:43:54 CET] <BtbN> That's not how that works
[19:44:03 CET] <BtbN> but at least you won't have to build it yourself then. Only ffmpeg.
[19:44:05 CET] <mr_lou> Why not? It says it's a shared library.
[19:44:23 CET] <BtbN> Installing it won't magically modify ffmpeg to have it built in.
[19:45:03 CET] <mr_lou> Well I don't know enough. Thought maybe ffmpeg looked for external libs too.
[19:45:06 CET] <mr_lou> I guess not.
[19:46:54 CET] <BtbN> It does. At compile time.
[19:48:47 CET] <mr_lou> :->
[19:50:15 CET] <mr_lou> I have a love/hate relationship with that. I hate when apps needs libs that I don't have (anymore) because the app is now looking for an older version. So I always prefer when everything is compiled together - except now of course when I need AMR and have never succeeded in compiling any C stuff.
[19:58:33 CET] <pink_mist> mr_lou: compiling ffmpeg from latest git is the only really supported ffmpeg in this channel ... most people will also support a compile from the latest release, but not everyone will .. if you're getting your ffmpeg from your OS, it's the OS's job to support you
[19:59:05 CET] <mr_lou> .....job?
[19:59:22 CET] <pink_mist> what else would you call it?
[19:59:24 CET] <pink_mist> pastime?
[19:59:54 CET] <mr_lou> Hobby I guess.
[20:00:15 CET] <pink_mist> does your OS get hobbies?
[20:00:27 CET] <mr_lou> O_o
[20:01:38 CET] <mr_lou> I think you may be taking things a bit too serious mate. And I don't, so.... cheers!
[20:35:56 CET] <cehoyos> pink_mist: Did you try a precompiled static binary from the FFmpeg download page? I would expect that to support amr encoding. If not, compilation should be trivial on Ubuntu.
[20:44:09 CET] <pink_mist> cehoyos: I'm not the one that had problems with AMR
[20:54:15 CET] <cehoyos> sorry..
[21:25:03 CET] <funnybunny2> https://ffmpeg.org/doxygen/4.0/group__lavu__sampfmts.html#gaf9a51ca15301871… "The data described by the sample format is always in native-endian order." Native to what?
[21:26:07 CET] <durandal_1707> to your machine/OS
[21:26:32 CET] <funnybunny2> Surely ffmpeg doesn't detect my CPU architecture and convert endianness of samples in audio files
[21:26:50 CET] <durandal_1707> you are deeply confused
[21:27:06 CET] <funnybunny2> Why would it do that instead of just returning the samples as they are in the file?
[21:27:18 CET] <durandal_1707> file can be any endianess
[21:27:37 CET] <funnybunny2> Yeah, but don't specific audio formats specify an endianness?
[21:27:49 CET] <durandal_1707> yes, they do
[21:27:59 CET] <funnybunny2> So why wouldn't ffmpeg leave that untouched?
[21:28:12 CET] <cehoyos> Because that would mean twice as many audio formats for no gain
[21:28:18 CET] <cehoyos> (in nearly all cases)
[21:28:33 CET] <funnybunny2> I don't understand
[21:28:56 CET] <cehoyos> Instead of five (?) internal audio formats, you would twice as many
[21:29:01 CET] <cehoyos> need
[21:29:17 CET] <funnybunny2> Why? I don't get it
[21:29:34 CET] <cehoyos> Instead of only s16, we would have s16le and s16be
[21:29:55 CET] <cehoyos> This would definitely be technically possible, but why?
[21:30:16 CET] <funnybunny2> durandal_1707 is right. I am deeply confused
[21:30:18 CET] <velix> What's the "state of the art" switch for 50fps to 25fps? I've found "-vf setpts=PTS*2 -r 25 -af atempo=0.5" on the web?
[21:30:59 CET] <cehoyos> There is also a fps filter, both variants have advantages and disadvantages
[21:31:10 CET] <cehoyos> But what you provided should work fine
[21:31:26 CET] <funnybunny2> OK, so .wav files for example store PCM samples in little-endian. Suppoes my machine were big-endian. ffmpeg reads the .wav file and returns samples. Why would it convert them to big-endian instead of just returning them as-is?
[21:32:01 CET] <cehoyos> Because we would need twice as many audio formats (and twice as many conversion functions)
[21:32:06 CET] <velix> cehoyos: I hate all those FPS and Audio hz problems... The Big Bang Theory sounds totally different on 44.1 KHz PAL than 48 KHz on DVD and other than 48 KHz on NTSC DVD :(
[21:32:15 CET] <velix> And it sounds different than TV
[21:32:17 CET] <cehoyos> And since wav files take no cpu, the gain would be negligible
[21:32:37 CET] <funnybunny2> Why do you need another audio format?
[21:32:37 CET] <cehoyos> velix: If you hear the difference (I don't), I suspect you are able to fix it...
[21:32:39 CET] <cehoyos> With FFmpeg
[21:32:47 CET] <cehoyos> Is this "who is on first"?
[21:32:52 CET] <funnybunny2> Are you talking about two .wav formats?
[21:33:11 CET] <velix> cehoyos: Yeah, not with ffmpeg I guess. I was working for a professional music studio 15 years ago. We had expensive software for that.
[21:33:13 CET] <cehoyos> No, are you?
[21:33:16 CET] <velix> Also expensive hardware :)
[21:33:24 CET] <velix> DAT vs. CDA always was a problem.
[21:33:28 CET] <funnybunny2> I don't see why it matters what endianness the samples are stored in in the file.
[21:33:49 CET] <cehoyos> I don't think this is a useful argumentation, but since I don't hear the difference you will have to find somebody else to convince you it makes no sense;-)
[21:34:04 CET] <cehoyos> funnybunny2: You claimed that afair
[21:34:14 CET] <cehoyos> We claim it makes no difference...
[21:34:18 CET] <funnybunny2> I just want to hand the samples off to ALSA. Why do I need to check what my CPU native endianness is? It shouldn't depend on that
[21:34:26 CET] <velix> cehoyos: Yeah, I'm audiophil and musican. I can detect those pitch shifts :(
[21:34:31 CET] <funnybunny2> Obviously it's little-endian though...
[21:34:43 CET] <durandal_1707> funnybunny2: ALSA also uses native . so nothing needs to be done
[21:34:51 CET] <cehoyos> There are filters that fix that, I find it unlikely that they are no high-quality
[21:34:59 CET] <funnybunny2> ALSA takes whatever you want
[21:35:05 CET] <funnybunny2> https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gaa14b7f2…
[21:35:23 CET] <furq> velix: if your ffmpeg was built with librubberband then i guess that should be higher quality than atempo
[21:35:41 CET] <velix> furq: thanks! I could recompile it maybe. Thanks for this idea.
[21:35:41 CET] <cehoyos> Note that the internal format is not meant to be provided to also, there are audio "encoders" that produce what (for example) alsa wants.
[21:35:55 CET] <durandal_1707> furq: nope, it do different things with different algorithm
[21:35:56 CET] <cehoyos> If you don't want to use these "encoders", you have to check endianess, yes
[21:36:06 CET] <cehoyos> (seems trivial)
[21:36:26 CET] <funnybunny2> What do you mean "encoders"?
[21:36:44 CET] <cehoyos> There is a pcm_s16le encoder, and alsa accepts pcm_s16le.
[21:36:45 CET] <funnybunny2> I am using ffmpeg to decode the audio into PCM
[21:37:05 CET] <cehoyos> The internal format is not (necessarily) pcm, this is more a coincidence
[21:37:11 CET] <funnybunny2> Then my intent was to just look at the codec sample format and specify that directly to ALSA
[21:37:38 CET] <cehoyos> This is possible (because the sample format is very similar to pcm), but this is not how FFmpeg works in general
[21:37:44 CET] <funnybunny2> Oh
[21:38:02 CET] <funnybunny2> So I am always supposed to explicitly convert samples to PCM with ffmpeg?
[21:38:09 CET] <cehoyos> In general, you have something like: protocol -> demuxer -> decoder -> filter -> encoder -> output
[21:38:41 CET] <cehoyos> You don't have to if you know what you are doing, but you cannot ask "why is there only native s16, I want s16 to be little endian on big endian hardware)
[21:38:41 CET] <furq> if you decode it then you should encode it
[21:38:58 CET] <velix> cehoyos: sorry to crash your discussion: I had problems with the decoder in the past, because it added padding, which made audio off sync
[21:39:14 CET] <cehoyos> .. because there is a pcm_s16le encoder that you can use if you want to be sure to have pcm_s16le
[21:39:18 CET] <velix> But again: normal people might not be able to detect this :)
[21:39:40 CET] <cehoyos> velix: A decoder cannot add padding
[21:40:04 CET] <velix> cehoyos: LAME did. I've reported it and it got fixed.
[21:40:08 CET] <velix> It's a few years ago
[21:40:11 CET] <furq> lame is an encoder
[21:40:13 CET] <furq> in spite of the name
[21:40:17 CET] <velix> furq: lame also does decoding.
[21:40:23 CET] <cehoyos> But not in FFmpeg
[21:40:31 CET] <velix> cehoyos: Yeah and that was the problem.
[21:40:42 CET] <velix> Lame encoding and lame decoding = anything was fine
[21:40:51 CET] <velix> lame encoing and fmpeg decoding = problem
[21:40:56 CET] <funnybunny2> Sounds like thanks to the fact that ffmpeg returns samples in the machines native encoding, I have to potentially do a LE to LE encoding which does absolutely nothing, otherwise add a check for my CPU endianness
[21:41:00 CET] <velix> But it got fixed years ago
[21:41:17 CET] <durandal_1707> funnybunny2: non needed to use pcm encoders
[21:41:25 CET] <cehoyos> funnybunny2: If the conversion does absolutely nothing, there is no problem, no?
[21:41:32 CET] <funnybunny2> cehoyos: Yeah, a waste of time
[21:41:40 CET] <durandal_1707> funnybunny2: just if they are planar/packed formats
[21:41:49 CET] <cehoyos> No, a conversion that does absolutely nothing, is free and does not waste time
[21:41:58 CET] <velix> I've spent lots of time with the LAME community when working in the studio. We needed to create perfect MP3s for online stores (before they did it on their own).
[21:42:23 CET] <funnybunny2> cehoyos: Well I can't say that. I don't know what the ffmpeg encoding functions do. Maybe they still loop through the whole buffer
[21:42:36 CET] <cehoyos> But I can say it.
[21:43:02 CET] <cehoyos> You otoh, could simply benchmark it to proof me wrong (which will be difficult)
[21:43:09 CET] <cehoyos> in this case, I mean;-)
[21:43:16 CET] <durandal_1707> funnybunny2: you only need to worry about planar sample formats, because alsa does not supports that
[21:43:43 CET] <funnybunny2> Wait...
[21:43:54 CET] <funnybunny2> Are you saying there would need to be more formats like more enums
[21:43:57 CET] <funnybunny2> In ffmpeg
[21:44:06 CET] <funnybunny2> Because that's exactly what I think there should be!
[21:44:25 CET] <funnybunny2> Just like https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gaa14b7f2…
[21:44:29 CET] <funnybunny2> https://ffmpeg.org/doxygen/4.0/group__lavu__sampfmts.html#gaf9a51ca15301871…
[21:45:28 CET] <cehoyos> As Paul explained, there are no planar formats in alsa: You can either take care yourself or use the pcm_s16le encoder (as said above)
[21:45:47 CET] <funnybunny2> I know there are no planar formats
[21:45:55 CET] <funnybunny2> I can easily convert ffmpeg samples to interleaved
[21:46:05 CET] <funnybunny2> Has nothing to do with endianness
[21:46:33 CET] <cehoyos> I am curious: How do you "easily" convert from planar to interleaved?
[21:46:33 CET] <funnybunny2> Wait
[21:46:44 CET] <funnybunny2> Are we talking bit endianness or byte endianness
[21:47:05 CET] <durandal_1707> just use alsa endian formats
[21:47:49 CET] <funnybunny2> So
[21:48:37 CET] <funnybunny2> For planar to interleaved, you just loop through all the samples taking one sample from each channel and output in that order
[21:48:51 CET] <funnybunny2> I have some code
[21:49:16 CET] <cehoyos> Do you do that in C? The reason I ask is that above you were concerned about speed and FFmpeg contains heavily optimized funtions to convert between planar and interleaved...
[21:49:45 CET] <durandal_1707> or just use swresample, it does all this conversions for you automagically
[21:50:23 CET] <funnybunny2> Yes, in C
[21:50:39 CET] <cehoyos> That will unavoidably take a lot of time
[21:50:51 CET] <cehoyos> (That can be avoided when not using C)
[21:51:02 CET] <velix> furq: it's built against librubberband now. How can I activate it? :D
[21:51:17 CET] <furq> https://ffmpeg.org/ffmpeg-filters.html#rubberband
[21:51:26 CET] <velix> furq: -filter:a rubberband=tempo=
[21:51:29 CET] <velix> furq: thx
[21:52:25 CET] <funnybunny2> Something like this https://pastebin.com/NBDpZe69
[21:52:45 CET] <cehoyos> Yes, this is very slow
[21:52:52 CET] <nicolas17> why do that yourself in C when ffmpeg already has asm-optimized functions to do the same?
[21:53:04 CET] <funnybunny2> I didn't know it did
[21:53:18 CET] <nicolas17> cehoyos said "FFmpeg contains heavily optimized funtions..."
[21:53:28 CET] <funnybunny2> Yeah, I wrote this code before he said that
[21:53:29 CET] <funnybunny2> lol
[21:54:23 CET] <funnybunny2> So what are these functions?
[21:54:44 CET] <cehoyos> Use the resample filter or libavresample directly
[21:54:55 CET] <cehoyos> (You cannot use the optimized functions directly)
[21:55:01 CET] <durandal_1707> LIBSWRESAMPLE
[21:55:06 CET] <funnybunny2> I followed this tutorial https://steemit.com/programming/@targodan/decoding-audio-files-with-ffmpeg and I guess the author didn't know about them
[21:55:08 CET] <durandal_1707> avresample is deprecated
[21:55:21 CET] <funnybunny2> I dunno
[21:55:34 CET] <funnybunny2> I think his goal was only to graph waveforms or something since he output everything in floating point
[21:55:46 CET] <durandal_1707> stop using random clueless blog post about ffmpeg found on internet
[21:55:56 CET] <cehoyos> Sorry, the filter name is aresample and the library name is libswresample;-))
[21:56:09 CET] <funnybunny2> Well ffmpeg has terrible examples/documentation
[21:56:55 CET] <funnybunny2> I have this https://ffmpeg.org/doxygen/trunk/decode__audio_8c_source.html
[21:57:27 CET] <funnybunny2> But it didn't show how to handle multiple file formats
[21:59:20 CET] <velix> Okay, that doesn't work. The audio is funny now... I think, I have to do more reading.
[21:59:40 CET] <cehoyos> funnybunny2: Did you already see doc/examples?
[21:59:59 CET] <funnybunny2> cehoyos: I saw the one I linked
[22:00:15 CET] <funnybunny2> These? https://ffmpeg.org/doxygen/trunk/dir_687bdf86e8e626c2168c3a2d1c125116.html
[22:00:56 CET] <furq> https://ffmpeg.org/doxygen/trunk/demuxing_decoding_8c-example.html
[22:01:07 CET] <furq> this opens arbitrary input formats/codecs
[22:01:51 CET] <funnybunny2> Yeah, but I don't want to do video
[22:01:58 CET] <funnybunny2> I'm only interested in audio
[22:02:40 CET] <furq> well that part should be the same either way
[22:02:42 CET] <furq> https://ffmpeg.org/doxygen/trunk/transcode_aac_8c-example.html
[22:02:46 CET] <funnybunny2> I essentially want to start by writing aplay
[22:02:51 CET] <furq> this should cover more or less everything you want though
[22:03:25 CET] <funnybunny2> Does aplay use ffmpeg?
[22:04:24 CET] <durandal_1707> nope
[22:04:53 CET] <funnybunny2> Wow, maybe I don't need ffmpeg. I wonder what formats alsa supports
[22:05:49 CET] <durandal_1707> voc, wav, raw or au
[22:05:59 CET] <funnybunny2> Why is it playing my mp3 files...
[22:06:23 CET] <funnybunny2> Oh nevermind
[22:06:26 CET] <funnybunny2> I typed the wrong thing
[22:09:13 CET] <funnybunny2> So what I'm trying to write to get started is just an audio-only ffplay
[22:09:50 CET] <durandal_1707> why? there are already players doing it
[22:10:00 CET] <funnybunny2> That's not my end goal
[22:11:49 CET] <funnybunny2> Oh, it looks like ffplay is using SDL
[22:11:50 CET] <funnybunny2> bleh
[22:12:07 CET] <funnybunny2> See there is no complete example with just ffmpeg and alsa
[22:12:29 CET] <funnybunny2> Which is probably why I'm fumbling around
[22:12:56 CET] <funnybunny2> I've written aplay. I just need to connect it to the ffmpeg decoding
[22:14:23 CET] <funnybunny2> I don't need this demuxing example or this transcoding example
[22:14:35 CET] <funnybunny2> I'm just decoding to PCM
[22:15:29 CET] <nicolas17> if you have an audio file you need to demux it and then decode the resulting packets
[22:16:15 CET] <funnybunny2> By demux you mean just get the first audio stream
[22:16:27 CET] <funnybunny2> That is what https://steemit.com/programming/@targodan/decoding-audio-files-with-ffmpeg does
[22:17:42 CET] <nicolas17> yes
[22:17:46 CET] <cehoyos> If you know exactly what you need, why are you asking here? We believe you have to learn audio filtering with FFmpeg which is explained in doc/examples.
[22:18:12 CET] <nicolas17> decoders expects audio packets, not all the bytes in a file
[22:19:01 CET] <funnybunny2> I guess I will also use the resample library so that I am always passing the same sample format to ALSA
[22:19:09 CET] <funnybunny2> Using this example https://ffmpeg.org/doxygen/trunk/resampling__audio_8c_source.html
[22:19:34 CET] <furq> i'm pretty sure transcoding_aac.c does everything you asked for except outputting to alsa
[22:19:44 CET] <furq> except it encodes to aac instead of pcm
[22:20:00 CET] <furq> which isn't hard to change
[22:20:08 CET] <funnybunny2> OK
[22:20:12 CET] <funnybunny2> I'll look at it
[22:22:47 CET] <funnybunny2> Why does ALSA support so many input sample formats?
[22:23:08 CET] <funnybunny2> If everyone is suggesting I just convert to one specific PCM format to pass to ALSA
[22:24:19 CET] <pink_mist> isn't there an alsa-related channel that might have that answer?
[22:25:22 CET] <funnybunny2> Yeah, good idea
[22:33:10 CET] <velix> Interesting. This works: 1. demux video (v.h264) and audio (a.aac) and remux them: ffmpeg -i a.h264 -r 25 -i b.aac -c copy final.mp4
[22:36:13 CET] <funnybunny2> If converting to a specific PCM format with ffmpeg, what format should I use?
[22:36:30 CET] <funnybunny2> Not sure why it matters
[22:39:29 CET] <velix> Wpw. This also works: "-filter:v fps=fps=25"
[22:45:03 CET] <velix> Is it possible to just skip all 25-50 frames?
[22:45:07 CET] <velix> instead of recoding?
[22:45:07 CET] <cehoyos> velix: Didn't I write that somewhere above?
[22:45:18 CET] <velix> cehoyos: No, really not.
[22:45:37 CET] <velix> I came in with "-vf setpts=PTS*2 -r 25 -af atempo=0.5" - but it stutters the audio
[22:45:44 CET] <cehoyos> funnybunny2: alsa contains internal conversions for these "many input formats", most of them either slow or low-quality or both, s16le should be a safe bet.
[22:45:59 CET] <cehoyos> There is also a fps filter, both variants have advantages and disadvantages
[22:46:13 CET] <cehoyos> ... is what I wrote before
[22:46:52 CET] <funnybunny2> cehoyos: What does fps stand for?
[22:47:08 CET] <velix> frames per second
[22:47:10 CET] <cehoyos> For a filter that I suggested to velix an hour ago and that I now found
[22:47:13 CET] <nicolas17> the fps thing wasn't for you :P
[22:47:16 CET] <cehoyos> h
[22:47:16 CET] <nicolas17> velix: to skip frames without re-encoding you would need the source video to use an intra-only codec
[22:47:17 CET] <cehoyos> he
[22:47:24 CET] <funnybunny2> Oh
[22:47:28 CET] <velix> nicolas17: intra?
[22:47:34 CET] <nicolas17> where each frame is a full image
[22:47:47 CET] <nicolas17> with no compression/prediction between one frame and the next
[22:47:59 CET] <velix> oh okay.
[22:47:59 CET] <cehoyos> You can skip frames with -r and -vf fps, in very specific cases, you can throw away frames without re-encoding (but I believe this is not what you asked for)
[22:48:20 CET] <velix> cehoyos: Actually, I never dealed with 50 fps video before.
[22:48:35 CET] <nicolas17> with common video codecs like MPEG, you can't just throw away every other frame without re-encoding, because compressed frames depend on each other
[22:48:45 CET] <velix> nicolas17: makes sense!
[22:49:03 CET] <velix> Damn... it's for a friend, which stupid Smart TV cannot playback 50 fps.
[22:49:13 CET] <velix> I've got a $20 RPi, which can do anything.
[22:49:17 CET] <velix> I hate smart TVs
[22:49:31 CET] <funnybunny2> cehoyos: You wrote protocol -> demuxer -> decoder -> filter -> encoder -> output. What is the filter?
[22:49:37 CET] <velix> I'll tell him to get a FireTV stick with Kodi...
[22:49:44 CET] <cehoyos> aresample
[22:50:00 CET] <funnybunny2> Isn't that also the encoder?
[22:50:06 CET] <cehoyos> You can grep for it in doc/examples
[22:50:18 CET] <cehoyos> No, there is not encoder called "aresample"
[22:50:58 CET] <funnybunny2> I think just file -> audio stream -> native samples -> s16le -> alsa
[22:51:09 CET] <cehoyos> Yes
[22:51:12 CET] <funnybunny2> OK
[22:51:26 CET] <cehoyos> To get from "native samples" to the pcm_s16le encoder, you need aresample
[22:51:49 CET] <cehoyos> If you don't want to use the pcm_s16le encoder, you need aresample to get from "native samples" to s16
[22:52:00 CET] <funnybunny2> I thought the resampler encodes native samples to s16le
[22:52:28 CET] <cehoyos> No, as I tried to explain before, it would have to do that if we had native and non-native endian audio formats
[22:52:29 CET] <funnybunny2> Oh, I forgot that ffmpeg doesn't have BE and LE
[22:52:43 CET] <cehoyos> But since we only have one native audio format, this is not necessary.
[22:52:57 CET] <funnybunny2> So then the encoder is just the dummy thing I add on at the end in case my machine is stupidly BE
[22:53:06 CET] <funnybunny2> Which it never will be
[22:53:44 CET] <cehoyos> No: If you choose to use the encoder, you always use it
[22:53:45 CET] <funnybunny2> For future proofing I guess
[22:54:23 CET] <funnybunny2> I understand I always use it. I just meant that the only reason to use it is for a hypothetical BE machine
[22:54:33 CET] <cehoyos> But since the alsa hardware will expect native endian audio, I guess you don't absolutely have to use the encoder.
[22:54:47 CET] <funnybunny2> ALSA accepts many different formats
[22:54:56 CET] <cehoyos> Please see above
[22:55:10 CET] <funnybunny2> About the slowness?
[22:55:32 CET] <funnybunny2> Like, it converts everything to native endian at the end?
[22:55:36 CET] <cehoyos> You have to choose something that is supported by your hardware. You cannot know but s16 is the most likely choice
[22:56:01 CET] <cehoyos> If you are unlucky, it will resample everything to 44100 or 48k
[22:56:15 CET] <funnybunny2> But ALSA will just convert if I pass the wrong thing, right?
[22:56:30 CET] <funnybunny2> I understand I want to avoid that though
[00:00:00 CET] --- Mon Jan 13 2020
1
0
[00:00:00 CET] --- Sat Jan 11 2020
1
0
[00:20:15 CET] <void09> vlt ?
[20:19:01 CET] <chadmccan> Hey there. I'm having trouble getting x265 compiled statically with ffmpeg on an Amazon EC2 server. It's complaining that it can't find libgcc_s. I have libgcc_s.so but not .a. Is there a flag I'm missing when using cmake3 to put x265 together?
[00:00:00 CET] --- Sun Jan 12 2020
1
0