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

burek burek021 at gmail.com
Thu Feb 8 03:05:02 EET 2018


[02:16:35 CET] <Uuperich> hi, I got a quick question
[02:17:08 CET] <lightbulb6> hello, how do you pad with transparency using ffmpeg? i tried `ffmpeg -i foo.png -filter pad=iw+4:ih+4:2:2:black at 0 test.png` but the resulting padding is black instead of fully transparent
[02:17:47 CET] <Uuperich> I'm converting a bunch of webm to .mp3 files on a debian server i have lying around here. For some reason the output has varying speedups?
[02:18:09 CET] <Uuperich> ranging from 14.x times to 19.x times
[02:18:26 CET] <lightbulb6> Uuperich: it's the encoding speed
[02:18:32 CET] <lightbulb6> it's normal for it to fluctuate
[02:18:40 CET] <lightbulb6> depending on your server's load ad the moment for example
[02:19:03 CET] <Uuperich> but the output mp3 also are garbled
[02:19:12 CET] <DHE> Uuperich: well what's your command?
[02:19:16 CET] <lightbulb6> post the command line you use
[02:19:23 CET] <Uuperich> for FILE in raws/*.webm; do     echo -e "Processing video '\e[32m$FILE\e[0m'";     ffmpeg -i "${FILE}" -y "${FILE%.webm}.mp3"; done;
[02:19:47 CET] <Uuperich> is what i'm using right now, before it also specified bitrate and khz lemme look for it
[02:19:57 CET] <lightbulb6> hmm, are you using the latest git build of ffmpeg?
[02:20:02 CET] <Uuperich> funny thing is that next one worked fine yesterday when I tried it via ssh from work
[02:20:26 CET] <Uuperich> for FILE in raws/*.webm; do     echo -e "Processing video '\e[32m$FILE\e[0m'";     ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${/audio/FILE%.webm}.mp3"; done;
[02:20:34 CET] <Uuperich> that worked yesterday from my work machine
[02:20:38 CET] <Uuperich> the build might be a bit older
[02:20:52 CET] <lightbulb6> if it's from debian repos it's likely very old
[02:20:59 CET] <Uuperich> the server is only a hobby so it idles around for months at a time
[02:21:14 CET] <Uuperich> ok lemme try updating it
[02:21:43 CET] <lightbulb6> try these builds for hassle-free testing https://johnvansickle.com/ffmpeg/
[02:22:21 CET] <lightbulb6> sadly these don't work anymore on my debian vps because the kernel is too old, you may have better luck
[02:25:35 CET] <lightbulb6> also if possible, you could upload somewhere the files which ffmpeg failed to encode (decode?) properly, so others can have a look and maybe spot something useful
[02:25:41 CET] <Uuperich> ok thanks for the quick advice, i'll try from work once more tomorrow since it really confuses me how that worked fine yesterday
[02:25:56 CET] <Uuperich> actually they're already available at audio.animu.date
[02:26:30 CET] <Uuperich> the script fetches webm from a webserver and converts it to mp3 locally (since I cant execute scripts on my webhoster), then uploads them again
[02:26:42 CET] <DHE> lightbulb6: in theory you can specify an alpha channel in your colour selection, but you'll need to use a pix_fmt that has alpha support as well depending on what you're up to
[02:26:46 CET] <Uuperich> and a still very scarce website at least shows all the mp3s
[02:27:23 CET] <Uuperich> you're supposed to hear some samples of japanese
[02:27:50 CET] <Uuperich> what actually comes out sounds like small samples brutally sped up
[02:27:53 CET] <lightbulb6> if it's for the web, you could use opus instead of mp3, as it's royalty free and higher quality than mp3, allows you to save on bandidth for example
[02:28:15 CET] <DHE> obvious question. if you output to .wav instead (just try one or two sample videos) does it sound okay?
[02:28:36 CET] <Uuperich> will try that once my server is done updating, gimme a sec
[02:30:16 CET] <lightbulb6> DHE: great, `format=rgba,pad=iw+4:ih+4:2:2:black at 0` did the trick, thanks!
[02:31:02 CET] <lightbulb6> i've already tried the filter before, but silly me put it after the pad filter rather than before it :P
[02:31:17 CET] <lightbulb6> and all i got was black padding around the image
[02:32:25 CET] <DHE> I thought you might have to do 0x00000000 (RRGGBBAA) or such
[02:33:12 CET] <lightbulb6> the "@0" in "black at 0" means fully transparent black, it's equivalent of 0x00000000
[02:33:36 CET] <lightbulb6> see https://ffmpeg.org/ffmpeg-utils.html#Color for details
[02:34:37 CET] <Uuperich> outputting in .wav fixes the speed issue but introduces a shitload of noice
[02:34:41 CET] <Uuperich> *noise
[02:35:54 CET] <Swervz> Hey would anyone know how to join thousands of fragments downloaded from a streaming site into a video? I found the wiki on Concatenate but that looks like it only works for videos inside a container already. Also found some video but it was not in English so I couldn't understand it
[02:37:11 CET] <klaxa> hmm what's a "fragment" then?
[02:37:30 CET] <klaxa> if ffmpeg can read it, it can concatenate it
[02:37:35 CET] <klaxa> probably
[02:38:11 CET] <lightbulb6> if it's mpeg dash or something like it, you can just concatenate the files directly
[02:38:22 CET] <Swervz> No idea what format its in, I tried using media info on it but I just get the "floating point division by zero" error
[02:38:36 CET] <Swervz> It's a HTTP stream it seems, I guess dash?
[02:38:37 CET] <lightbulb6> you may need an init chunk
[02:38:44 CET] <klaxa> what does ffprobe or ffmpeg -i say?
[02:40:08 CET] <Uuperich> short update: neither .wav nor .opus give any improvement
[02:40:09 CET] <Swervz> let me pastebin the output
[02:41:12 CET] <lightbulb6> try searching for the smallest file in the directory, that would probably be the init/header file, and to get a playable movie out of it you could do `cat init.m4s chk1.m4s chk2.m4s chkn.m4s > movie.m4s`
[02:41:50 CET] <lightbulb6> it works with webm dash streams, so it should work with mpeg dash as well
[02:42:30 CET] <lightbulb6> Uuperich: so does the issue occur with all the webms or some select ones?
[02:42:59 CET] <Uuperich> every single one of them
[02:43:19 CET] <Uuperich> it's 33 little clips, recorded via mpv
[02:43:35 CET] <Uuperich> the weird thing is it worked fine yesterday when I did it manually
[02:44:45 CET] <Uuperich> let me try it manually one more time just to be sure it works in theory
[02:45:46 CET] <lightbulb6> Uuperich: none of the mp3s on that site you linked to work for me, as in they won't even play
[02:46:36 CET] <Swervz> Wtf I was just playing the video in my brower and it kept pausing every second or so and the audio was glitching then my screen went black a couple times and blue with like static
[02:47:23 CET] <Uuperich> lightbulb6, exactly, and the files do the same locally
[02:47:58 CET] <Uuperich> lightbulb6, try it again now
[02:48:11 CET] <Uuperich> when I do it manually it apparently works fine
[02:48:40 CET] <lightbulb6> yeah, works now
[02:49:12 CET] <Uuperich> any bash experts? :>
[02:49:39 CET] <lightbulb6> and what if you make it a simplistic python script rather than bash?
[02:49:42 CET] <lightbulb6> may just work
[02:50:06 CET] <klaxa> well pastebin the script
[02:50:38 CET] <Uuperich> https://pastebin.com/anNBhV2X
[02:50:53 CET] <Uuperich> I might just opt for python just to try it
[02:51:18 CET] <Uuperich> I'm not that versed with linux yet but this is puzzling the heck out of me
[02:52:30 CET] <lightbulb6> have you confirmed the wget part correctly downloads the webms?
[02:52:31 CET] <klaxa> huh that doesn't look wrong at all
[02:52:44 CET] <klaxa> if it works when he runs it manually i would think the files are ok
[02:52:56 CET] <klaxa> can you try removing the echo with the ansi color codes?
[02:53:17 CET] <klaxa> even though that should not do anything at all
[02:54:47 CET] <Uuperich> well let's try
[02:55:52 CET] <Uuperich> upload done, some filesizes changed
[02:56:12 CET] <Uuperich> ...and chrome already barfs at the files
[02:58:12 CET] <Uuperich> i really need some sleep so I'll try around with another computer tomorrow, that used "ideapad" which is my current scriptserver does some weird things
[02:58:40 CET] <Uuperich> if I remember I'll report back, thanks so far for confirming I'm not a total dunce or insance
[02:58:43 CET] <Uuperich> *insane
[03:21:11 CET] <Swervz> Sorry I had to reboot
[03:26:52 CET] <Swervz> klaxa, Here is the output of ffprobe on one of the files https://pastebin.com/yj5YXxTp
[03:27:13 CET] <Swervz> Oh it didnt preserve the line endings :|
[03:27:45 CET] <Swervz> should be fixed now
[03:28:12 CET] <klaxa> have you tried this: <lightbulb6> try searching for the smallest file in the directory, that would probably be the init/header file, and to get a playable movie out of it you could do `cat init.m4s chk1.m4s chk2.m4s chkn.m4s > movie.m4s` ?
[03:29:24 CET] <Swervz> I'm not sure there is one
[03:30:13 CET] <klaxa> hmm... no idea then sorry :/
[03:30:16 CET] <Swervz> Could it be a f4m file maybe
[03:30:27 CET] <Swervz> I think that got filtered out originally when I was downloading
[03:31:05 CET] <Swervz> Oh yeah that's it. In XML format it seems
[03:34:19 CET] <Swervz> How would I concat them on windows? The header is .f4m and the fragments have no file extension
[03:37:09 CET] <lightbulb6> the .f4m is an xml file?
[03:37:31 CET] <lightbulb6> the header should be binary as far as i know...
[03:38:05 CET] <lightbulb6> hls/dash uses an xml manifest, usually with the extension ".mpd"
[03:38:52 CET] <lightbulb6> this file usually describes the available fragment so the player knows which fragments it can download at which time
[03:41:04 CET] <Swervz> Apprently its called Abode Dynamic Streaming for Flash
[03:41:35 CET] <Swervz> metadata is in base64
[03:43:03 CET] <lightbulb6> sorry, never heard of it
[03:43:16 CET] <lightbulb6> can you upload that f4m file somewhere?
[03:44:41 CET] <Swervz> Lets hope it doesnt have any personal info https://pastebin.com/KZ1p6Prk
[03:45:18 CET] <Swervz> I think I may have found a php script to do this but I think it still uses ffmpeg
[03:47:24 CET] <Swervz> Oh it can have embedded auth info so I deleted the paste because it was public and not unlisted
[03:48:01 CET] <Swervz> I forgot they shown up on the front page of pastebin for anyone to see
[03:48:40 CET] <lightbulb6> anyways i don't think it's going to be easy
[03:48:51 CET] <lightbulb6> have fun with their drm and encryption stuff
[03:49:08 CET] <lightbulb6> what tool did you use to download the files in the first place?
[03:51:39 CET] <Swervz> I got the URL from fiddler then just wrote a script to download each one
[03:52:18 CET] <Swervz> they're numbered like _Seg1-Frag1 so I just had to find the last fragment and then say download 1-last
[03:54:09 CET] <lightbulb6> hmm, there's that bootstrapInfo section
[03:54:28 CET] <lightbulb6> it may contain the header neccesary to decode the following chunks
[03:54:56 CET] <lightbulb6> also the drmAdditionalHeader
[03:55:06 CET] <Swervz> I hate adobe drm
[03:55:43 CET] <lightbulb6> i'm just guessing at this point, but you could try to base64 decode these two strings, then concatenate the files (binary)
[03:56:02 CET] <lightbulb6> and then further concatenate this header with the fragments
[03:56:17 CET] <Swervz> I tried decoding them already but I just got a malformed input
[03:56:30 CET] <Swervz> I think I need a drm key
[03:56:57 CET] <Swervz> er decryption key
[03:57:05 CET] <Swervz> probably more trouble that its worth at this point
[03:58:32 CET] <Swervz> "This stream is encrypted with FlashAccess DRM. Decryption of such streams isn't currently possible with this script."
[03:58:40 CET] <Swervz> Guess I'm SOL then
[03:58:54 CET] <lightbulb6> it's from that php script?
[03:59:18 CET] <Swervz> yeah
[04:00:19 CET] <lightbulb6> well then
[04:00:48 CET] <lightbulb6> so you were right about that SOL thing
[04:01:19 CET] <Swervz> hmm well thankyou anyway I guess I'll have to find some other way to get the content
[04:03:12 CET] <Swervz> I just wanted to watch a TV show on a phone with datacap when out but it didn't support their player so I was trying to download it from their site, guess they forced people into getting the content by other means even when they would willingly pay
[04:04:01 CET] <lightbulb6> yeah, drm is anti-consumer
[04:04:11 CET] <lightbulb6> the bad guys usually find ways around anyways
[04:04:38 CET] <prelude2004c> hey everyone.. looking for some help
[04:04:54 CET] <prelude2004c>  ${ffmpeg} -hwaccel cuvid -c:v mpeg2_cuvid -deint 2 -resize 1280x720 -hwaccel_device $gpuenc -max_alloc 100000000 -threads 1 -vsync 0 -fflags +discardcorrupt -i "$stream" .. it wont deinterlace for some reason
[11:59:37 CET] <OnceMe> is it possible to convert mkv to wmv without losing quality or minimal quality loss?
[11:59:51 CET] <OnceMe> I need wmv for my powerpoint presentation, and pp does not accept any other format then wmv
[12:01:42 CET] <BtbN> no
[12:02:07 CET] <OnceMe> why not? :(
[12:02:07 CET] <JEEB> well for minimal quality loss you try setting the quantizer quite low - you will make the file quite a bit larger most likely, but it should maybe play?
[12:02:11 CET] <BtbN> wmv is terrible and does not accept any codecs that are usually in mkv
[12:02:22 CET] <BtbN> And to my knowledge all the wmv-video-encoders are terrible
[12:02:32 CET] <OnceMe> how cloudconverter converts it from mkv to wmv?
[12:02:38 CET] <OnceMe> should I convert it from mkv to avi and then to wmv?
[12:02:39 CET] <BtbN> they re-encode it.
[12:02:45 CET] <JEEB> stream copying will most likely not work, so without loss of quality isn't going to happen
[12:02:51 CET] <JEEB> which is what BtbN is noting
[12:03:13 CET] <OnceMe> can I re-encode it with ffmpeg?
[12:03:18 CET] <OnceMe> I tried setting -q 8
[12:03:18 CET] <JEEB> yes
[12:03:22 CET] <BtbN> unless you use an insanely high bitrate you will get a very noticeable quality hit
[12:03:24 CET] <OnceMe> but quallity loss is still shitty
[12:03:25 CET] <furq> ffmpeg doesn't have a vc-1 encoder iirc
[12:03:32 CET] <furq> which is your best bet for a codec that isn't garbage
[12:03:34 CET] <JEEB> it does have wmv3 tho I think?
[12:03:42 CET] <BtbN> it has some wmv encoder, but it's bad
[12:03:48 CET] <furq> it has wmv1 and wmv2
[12:03:51 CET] <JEEB> oh, nope
[12:03:52 CET] <JEEB> wmv2
[12:03:53 CET] <JEEB> yea
[12:04:16 CET] <JEEB> OnceMe: you just need to know the quantizer range for a given format :P
[12:04:20 CET] <OnceMe> so ffmpeg -i msc.mkv -q 8 -s 640x480 -vcodec wmv2 myvideo.wmv ?
[12:04:20 CET] <JEEB> s/format/encoder/
[12:04:37 CET] <JEEB> something like that, yes, if you want to scale too :P
[12:04:45 CET] <BtbN> I'm pretty sure recent versions of office support .mp4 with h264 and aac just fine.
[12:05:01 CET] <OnceMe> I used SimpleScreenRecorder to record my screen and used H.264 codec
[12:05:07 CET] <BtbN> which you should be able to stream-copy from your mkv
[12:05:18 CET] <furq> https://support.office.com/en-ie/article/Video-and-audio-file-formats-supported-in-PowerPoint-d8b12450-26db-4c7b-a5c1-593d3418fb59
[12:05:21 CET] <furq> yeah
[12:05:24 CET] <furq> PowerPoint 2013, PowerPoint 2016, PowerPoint 2016 for Mac: .mp4 files encoded with H.264 video and AAC audio
[12:05:48 CET] <OnceMe> what about windows?
[12:05:53 CET] <furq> that is for windows
[12:06:02 CET] <OnceMe> so PP 2013 should work with mkv?
[12:06:07 CET] <furq> no
[12:06:07 CET] <BtbN> mp4...
[12:06:17 CET] <furq> it should work with the streams from the mkv remuxed into mp4
[12:06:19 CET] <OnceMe> ok so converting to mp4 from mkv is easier?
[12:06:21 CET] <OnceMe> :D
[12:06:32 CET] <furq> -i foo.mkv -c copy bar.mp4
[12:06:57 CET] <furq> or -i foo.mkv -c:v copy -c:a aac bar.mp4
[12:07:01 CET] <furq> if your audio isn't aac already
[12:07:46 CET] <OnceMe> ok
[12:07:51 CET] <OnceMe> but what about mkv to wmv?
[12:07:55 CET] <OnceMe> so ffmpeg -i msc.mkv -q 8 -s 640x480 -vcodec wmv2 myvideo.wmv ?
[12:07:57 CET] <OnceMe> didnt worked well
[12:08:01 CET] <OnceMe> still have shitty quallity
[12:08:01 CET] <furq> shrug
[12:08:08 CET] <furq> the wmv encoder in ffmpeg is probably garbage
[12:08:11 CET] <furq> and there's no vc-1 encoder
[12:08:23 CET] <furq> i would probably try to find something that'll transcode it to vc-
[12:08:23 CET] <furq> 1
[12:08:31 CET] <OnceMe> how?
[12:09:24 CET] <BtbN> https://www.google.com/search?q=vc-1+encoder like that
[12:12:29 CET] <JEEB> OnceMe: as I noted check the darn range of values of quantizer :P
[12:12:55 CET] <OnceMe> ?
[12:12:58 CET] <JEEB> wmv3/vc-1 is better of course but we don't have it because by the time it came around nobody cared
[12:13:51 CET] <furq> i would just forget about supporting office 2010
[12:14:06 CET] <JEEB> OnceMe: as in, try going up/down with the value :P
[12:19:27 CET] <OnceMe> -q 30?
[12:21:41 CET] <OnceMe> I mean -q 1
[13:04:05 CET] <OnceMe> powerpoint 2013 does not play video in full screen
[13:04:14 CET] <OnceMe> I mean its "full screen" but grayed out box around
[13:04:34 CET] <iranen> https://fosdem.org/2018/schedule/event/rust_av/
[15:58:30 CET] <TAFB_WORK> I use this to stream to youtube live but it doesn't work anymore, youtube live dashboard says "Your encoder is sending data faster than realtime (multipleseconds of video each second). You must rate limit your livevideo upload to approximately 1 second of video each second." please help: https://pastebin.com/7X2tAApC
[15:59:49 CET] <sfan5> is there a reason you're not using a single ffmpeg command?
[16:00:03 CET] <TAFB_WORK> the 4k ip camera stream sudders a lot if I do
[16:02:55 CET] <sfan5> does adding -re to the second ffmpeg command work?
[16:03:08 CET] <TAFB_WORK> let me try :)
[16:05:20 CET] <TAFB_WORK> nope, same error on youtube
[16:05:44 CET] <TAFB_WORK> stupid ip camera has a veriable framerate, 27fps to 30fps or so, hard to get it nice.
[16:09:24 CET] <kepstin> youtube's happier with a constant framerate, so you should use an fps filter (or -r output option) to correct that
[16:09:29 CET] <kepstin> and you should drop the -r input option
[16:13:55 CET] <TAFB_WORK> -r is already on the output
[16:14:01 CET] <TAFB_WORK> oh
[16:14:03 CET] <TAFB_WORK> i see what you mean
[17:18:55 CET] <bledo> Hi, anyone knows who to set pixel format, size and framerate of rawvideo inside a mpegts format over udp?
[17:19:48 CET] <bledo> i'm trying to open a multicast stream whit encoded audio and raw video
[17:26:42 CET] <DHE> mpegts doesn't have a codec code for rawvideo. you can encode it, but pulling it back out will be tricky
[17:52:27 CET] <dkc> hello folks, I'm writting RTP demuxers for video and audio streams. For these demuxers, PTS are supposed to be inferred from RTP timestamps. First question: is that correct that PTS for each stream is expressed in AVStream->time_base units. Second question: these PTS start at epoch, what do you I need to set to let FFmpeg know that and sync audio/video properly?
[18:11:19 CET] <JEEB> for A/V sync all you need to do is to make sure that the timestamps are relevant to each other (as in, if you apply both streams' relevant time base the AVPackets of things that happen during the same time should be during the same time) . and yes, AVPackets come out of a demuxer with the AVStream's time_base
[18:11:25 CET] <JEEB> which is something that a demuxer will set, yes
[18:12:16 CET] <JEEB> timestamps do not have to start from zero so the demuxer doesn't have to do anything for that
[18:12:42 CET] <JEEB> you just have to make sure that the timestamps on the streams' relevant time_bases make sensew
[18:15:48 CET] <dkc> okay, but if one have a timebase of 1/90000 and the other of 1/48000, to make them relevant to one another, you need to specify when is time zero, where they both started to count, right? or am I missing something
[18:19:46 CET] <JEEB> it just means that a packet that's supposed to be at point 1s in your source has 48000 in audio, and 90000 in video
[18:20:07 CET] <JEEB> demuxer's job is to make sure the timestamps are read correctly and are in sync between streams
[18:20:28 CET] <JEEB> (of course if the input timestamps are bonkers you can't do too much about that :P)
[18:25:21 CET] <dkc> To give you a bit of context, on both streams RTP timestamp are derived from their own media clock, so RTP timestamps for two audio packets 1s apart will have a difference a 48000. From that I can easily compute the absolute PTS since epoch but as you said, that makes video and audio timestamps look totaly unrelated
[18:37:14 CET] <dkc> so I've been using the RTP/SDP AVInputFormat, but should I derived my own input format to tweak PTS according to what I want to do?
[19:04:21 CET] <saml> good morning
[19:04:38 CET] <saml> ffmpeg -i [input] -r 24 -filter:v "setpts=0.999*PTS" -y [output]   vs ffmpeg -i [input] -r 24 -y [output]
[19:04:41 CET] <saml> what's better?
[19:23:14 CET] <furq> are you trying to do a 23.976 to 24fps conversion
[19:38:52 CET] <saml> furq, yes
[19:39:11 CET] <saml> https://toolstud.io/video/framerate.php?inputfps=23.976&compare=network&duration=60&duration_unit=seconds&outputfps=24   I found those from here
[19:39:11 CET] <furq> well yeah don't do either of those unless you actually want to reencode
[19:39:19 CET] <saml> i'm doing the interpolation. simple -r
[19:39:30 CET] <saml> oh is there another way?
[19:39:56 CET] <furq> just use mkvmerge/mkvtoolnix and change the fps
[19:39:57 CET] <saml> i'm doing this during (re)encoding.  but I want to know other way as well
[19:40:00 CET] <furq> oh
[19:40:15 CET] Action: saml googles mkvmerge ..
[19:40:26 CET] <furq> if you want to reencode then definitely use setpts or else you'll end up with dup frames
[19:40:29 CET] <saml> i'm mostly .mp4
[19:40:37 CET] <furq> l-smash can probably do it
[19:40:48 CET] <furq> ffmpeg will do it but you need to demux and then remux
[19:40:48 CET] <saml> wow so many things. thanks
[19:41:15 CET] <saml> are you a programmer?
[19:41:22 CET] <saml> or professional video person?
[19:41:25 CET] <furq> the former
[19:41:29 CET] <furq> not really on ffmpeg though
[19:41:30 CET] <saml> where do I find people like you for hire?
[19:42:06 CET] <furq> shrug
[19:42:17 CET] <saml> i guess steal an engineer from youtube or instagram
[19:42:42 CET] <furq> anyway yeah if you're reencoding anyway then just use setpts and atempo
[19:43:07 CET] <saml> http://l-smash.github.io/l-smash/ wow it's asian
[19:43:09 CET] <furq> if you're not then those won't work
[19:44:03 CET] <furq> if l-smash doesn't do it then something like ffmpeg -i foo.mp4 -an -c:v copy -f h264 - | ffmpeg -r 24 -i - -i foo.mp4 -c:v copy -c:a aac -af atempo=1.001 bar.mp4
[19:44:12 CET] <furq> but again, only if you're not reencoding
[19:44:59 CET] <Chloe> saml: check the ffmpeg site for consulting
[19:47:02 CET] <saml> oh nice
[20:39:52 CET] <colekas> hello, I have a question regarding HLS streaming using FFmpeg from John Van Sickle - ffmpeg version N-89882-g4dbae00bac-static
[20:40:36 CET] <colekas> looking at the code, in the .m3u8 the BANDWIDTH parameter in the EXT-X-STREAM-INF is a 10th of my bitrate value
[20:41:04 CET] <colekas> I see in the code that there's a divide by 10 but I am curious why. Nothing in any of the specs I've looked at suggest that's correct
[20:49:23 CET] <JEEB> at least that's a version from the git repo http://git.videolan.org/?p=ffmpeg.git;a=commit;h=4dbae00bac
[20:51:52 CET] <JEEB> and bit rates are in the master playlist
[20:52:57 CET] <JEEB> so `ff_hls_write_stream_info`
[20:53:09 CET] <JEEB> that writes the #EXT-X-STREAM-INF:BANDWIDTH
[20:54:02 CET] <JEEB> colekas: that is `bandwidth += bandwidth / 10;`
[20:54:22 CET] <JEEB> so bandwidth is set to bandwidth + bandwidth / 10
[20:54:26 CET] <JEEB> I guess 10% buffer or so?
[20:54:30 CET] <JEEB> it shouldn't be 1/10
[20:55:01 CET] <JEEB> although it only seems to take into mention the bit_rate field, I wonder if this works at all with CRF+VBV/HRD
[20:55:51 CET] <JEEB> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/hlsenc.c;h=cc13c94e9741a70bf6c07ed6fc701f3b123a68c5;hb=HEAD#l1294
[20:55:54 CET] <JEEB> this is the current code
[20:56:51 CET] <JEEB> it should be video bit rate + audio bit rate + 10%
[20:56:53 CET] <JEEB> more or less
[20:58:50 CET] <colekas> oh
[20:58:53 CET] <colekas> i see
[20:59:50 CET] <colekas> I'm using libx264 and trying the VBV constrained RC model setting maxrate, bufsize and CFR
[21:00:09 CET] <JEEB> yea, CRF doesn't set the bit_rate field
[21:00:17 CET] <JEEB> that thing should be patched to also take maxrate into mention
[21:00:20 CET] <BtbN> the bitrate is written there before a single frame is ever encoded. So it's nothing more than a wild guess.
[21:00:32 CET] <JEEB> it's the avcodec value I guess?
[21:00:53 CET] Action: JEEB closed the tab already but stream->xxx->bit_rate sounded like the bit rate value
[21:01:06 CET] <JEEB> so most likely it was just your audio or something?
[21:01:15 CET] <BtbN> for stuff like crf encoding it's pretty much useless
[21:01:15 CET] <JEEB> since it begins with zero, then adds the video, then adds the audio
[21:01:36 CET] <JEEB> BtbN: yea - I usually utilize the maxrate value if set in that case
[21:01:40 CET] <JEEB> since you need some value there
[21:02:04 CET] <JEEB> how close you end up to that maxrate depends on your CRF and complexity of content
[21:03:00 CET] <colekas> right, and following this guide http://slhck.info/video/2017/03/01/rate-control.html under Constrained Encoding (VBV) I *do not* want to set the bitrate parameter when doing maxrate/bufsize/crf right?
[21:03:29 CET] <JEEB> yea
[21:03:45 CET] <JEEB> it's a missing thing in the HLS main playlist writing logic
[21:04:03 CET] <JEEB> (I've done it in ISML manifest writing, and wbs did it in DASH IIRC)
[21:05:11 CET] <colekas> ah, I see
[21:06:25 CET] <colekas> yes, you're right, it's only taking the set audio bitrate and adding it + 10% to the BANDWIDTH flag
[21:06:39 CET] <JEEB> yup, since the default value for bit_rate is zero
[21:06:44 CET] <JEEB> in the AVCodecContext structure
[21:06:57 CET] <JEEB> and it being zero with CRF is 100% correct
[21:08:53 CET] <furq> i guess maxrate is what you actually want there if this is for adaptive streaming
[21:09:23 CET] <JEEB> I think generally things that write such info out first check bit_rate, then maxrate, and finally zarro if nothing
[21:09:29 CET] <JEEB> if I recall things correctly
[21:09:42 CET] <furq> maxrate then bitrate seems more sensible
[21:10:09 CET] <JEEB> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/movenc.c;h=f43349932b216b45d8dde66d6cc23a435b139236;hb=HEAD#l3949
[21:10:24 CET] <JEEB> yea, I just followed what wbs (?) did with the DASH muxer
[21:10:38 CET] <furq> fair enough
[21:10:39 CET] <JEEB> since people tend to expect the bit rate they set if they set a bit rate
[21:10:49 CET] <furq> yeah you can probably argue it either way
[21:10:53 CET] <furq> either's better than nothing anyway
[21:10:57 CET] <JEEB> yeh
[21:11:29 CET] <JEEB> it makes sense either way :P maxrate would mean the capped rate over whatever buffer, and bit_rate would mean the overall average bit rate without the spikes taken into mention
[21:12:15 CET] <furq> i guess it depends on how players actually use that value
[21:12:30 CET] <furq> i always figured their detection was just "if this starts buffering then drop down"
[21:12:35 CET] <furq> but maybe it's more sophisticated
[21:32:05 CET] Action: rk[ghost] waves
[21:32:08 CET] <rk[ghost]> :)
[21:32:44 CET] <rk[ghost]> i have some flacs, i want to convert to .ogg for streaming. is default setting for highest quality ogg or do i need an extra flag?
[21:36:47 CET] <furq> opus defaults to 128kbps which is what you want, idk about vorbis but probably add -q:a 8
[21:36:57 CET] <furq> you should really be using opus nowadays though
[21:37:34 CET] <furq> actually -q 8 is 256kbps so probably drop down to 4-6
[21:38:52 CET] <rk[ghost]> can you give me a quick explanation of opus vs. vorbis.. all the codec jazz twists my neural network in to spaghetti
[21:38:58 CET] <sfan5> hydrogenaudio says to use -q 5
[21:39:14 CET] <furq> opus is newer and better
[21:39:18 CET] <furq> and maybe more widely supported
[21:39:21 CET] <furq> certainly by browsers
[21:39:37 CET] Action: rk[ghost] uses mplayer to stream XD
[21:40:00 CET] <rk[ghost]> are both apart of the .ogg container? (i still get confused on the structure of audio jazzes :P)
[21:40:12 CET] <sfan5> .ogg can hold both
[21:40:14 CET] <furq> they're both usually muxed into ogg, yes
[21:40:21 CET] <rk[ghost]> ah
[21:40:28 CET] <rk[ghost]> it being abstracted away, i didn't notice..
[21:40:37 CET] <furq> just -i foo.flac foo.opus will get you more or less what you want
[21:40:48 CET] <furq> (also .opus is still ogg)
[21:40:53 CET] <rk[ghost]> ah, hmm.
[21:41:02 CET] <furq> you can mess around with the bitrate if you want but 128kbps vbr is recommended
[21:41:12 CET] <furq> for music, at least
[21:41:13 CET] <rk[ghost]> i see. so ogg is a container and opus/vorbis are the codecs.. or am i simplifying too much?
[21:41:19 CET] <sfan5> no that's correct
[21:41:20 CET] <furq> no that's exactly right
[21:41:33 CET] <rk[ghost]> ha- imagine that...
[21:41:48 CET] <rk[ghost]> thanks ya'll:)
[21:41:51 CET] <furq> there are other codecs you can mux into ogg but none that are of any significance nowadays
[21:41:55 CET] <rk[ghost]> =P
[21:41:57 CET] <rk[ghost]> aye.
[21:42:10 CET] <sfan5> if you want a better overview, https://en.wikipedia.org/wiki/Vorbis and related pages should be a good reference
[21:42:20 CET] <sfan5> furq: flac in .ogg :)
[21:42:29 CET] <rk[ghost]> so the -q flag is for quality and it is integer based which maps to some bitrate in the end?
[21:42:42 CET] <sfan5> basically
[21:42:44 CET] <rk[ghost]> sfan5: thanks but going that route i usually get lost in the details
[21:42:45 CET] <furq> nobody uses ogg flac though and it's poorly supported
[21:42:53 CET] <rk[ghost]> ah i see.
[21:42:56 CET] <furq> rk[ghost]: yes but -q is only for certain codecs
[21:42:59 CET] <rk[ghost]> well, my case is slightly special
[21:43:05 CET] <sfan5> it doesn't map exactly but just ends up roughly at some bitrate
[21:43:10 CET] <rk[ghost]> i am mostly interested in streaming to myself the highest quality i can muster..
[21:43:12 CET] <furq> vorbis uses -q, opus doesn't
[21:43:21 CET] <furq> you'd use e.g. -b:a 192kbps if you wanted higher quality opus
[21:43:26 CET] <furq> or er-
[21:43:27 CET] <rk[ghost]> currently playing around with icecast2/ices
[21:43:29 CET] <furq> -b:a 192k
[21:43:44 CET] <furq> but yeah the opus guys recommend 128k for transparency
[21:43:49 CET] <rk[ghost]> i have some random recordings i took on a .wav recording device that i already converted everything to .flac
[21:44:12 CET] <rk[ghost]> ah, coolio. thanks. bitrate makes a little more sense to me as random # require me knowing the mapping..
[21:44:20 CET] <furq> i'm pretty sure icecast supports flac btw
[21:44:29 CET] <rk[ghost]> i appreciate all ya'lls quick and straightforward help!!
[21:44:31 CET] <sfan5> well bitrate is also arbitrary to some degree
[21:44:39 CET] <sfan5> 128k mp3 is not comparable to 128k opus
[21:44:41 CET] <sfan5> like at all
[21:44:51 CET] <rk[ghost]> furq: you know i thought about testing just to find out.. then somehow that simple route escape my plans. hahaha.
[21:45:22 CET] <rk[ghost]> sfan5: noted, thanks.
[21:45:42 CET] <rk[ghost]> ps) thanks anyone who is a developer for ffmpeg.. you have treated me so well.
[21:47:49 CET] <furq> just tested it, flac works fine over icecast
[21:47:59 CET] <furq> idk how well source clients support it but ffmpeg does
[21:58:55 CET] <rk[ghost]> furq: when i try to do it.. it crashes, maybe i am doing something wrong..
[21:59:06 CET] <furq> what's the error
[21:59:13 CET] <rk[ghost]> the mount point is available, then i try to connect with mplayer
[21:59:18 CET] <rk[ghost]> then the mount point disappears
[21:59:23 CET] <rk[ghost]> i looked at ices log and i get
[21:59:58 CET] <furq> oh i have no idea about ices
[22:00:01 CET] <furq> ffmpeg -re -f lavfi -i sine -c:a flac -f ogg icecast://
[22:00:02 CET] <furq> that works
[22:00:39 CET] <rk[ghost]> ah, okay.. hmm. i suppose if ffmpeg works in place of ices.. i should investigate further..
[22:00:55 CET] <rk[ghost]> ... my system is ignoring my copy/paste.. ha;P
[22:01:41 CET] <rk[ghost]> very very strange
[22:02:43 CET] <rk[ghost]> i hit shift+insert on one screen, and it pastes the error, .. i come back to IRC and it pastes a youtube link -.-
[22:02:57 CET] Action: rk[ghost] cuddles with inconsistent computertek
[22:03:21 CET] <rk[ghost]> anyhoot, i get "corrupt or missing data in file $file"
[22:03:45 CET] <rk[ghost]> in the ices log.. i will investigate ices capabilities futher. maybe it is unable to support flac or maybe i need to tell it specifically what it is.
[22:03:52 CET] <rk[ghost]> thanks again for your assistance.
[22:04:43 CET] <furq> ffmpeg will stream fine to icecast but the support for playlists isn't exactly great
[22:06:04 CET] <rk[ghost]> ah, i noticed that based on how you invoked it
[22:06:10 CET] <rk[ghost]> but i can bashfu... =P!!!
[22:23:31 CET] <jrun> https://paste.pound-python.org/show/4AbQB15Gq4c4wfKgsObg/
[22:23:47 CET] <jrun> that's using cuda on gentoo with mpv
[22:24:07 CET] <jrun> let me know how to give more detail if you need any, please.
[22:29:07 CET] <jrun> very verbose output, it might help:
[22:29:11 CET] <jrun> https://paste.pound-python.org/show/kVXQXTs45m8fDDDNDbbA/
[22:47:05 CET] <FLXX> hi
[23:15:33 CET] <saml> wow muxer (l-smash) bro
[23:16:12 CET] <saml> muxer -i 'a.mp4?fps=24' -o muxer.24.mp4;   ffmpeg -i muxer24.mp4 -i a.mp4 -filter_complex psnr -f null -     gives infinity
[23:16:20 CET] <saml> it really didn't touch frames at all
[23:18:14 CET] <saml> ffmpeg -i a.mp4 -r 24 -filter_complex 'setpts=0.999*PTS'  r.24.mp4;   and psnr is 42  against muxer24.mp4
[23:25:52 CET] <kepstin> saml: that second ffmpeg command re-encodes the video, so that would be expected yeah.
[23:26:35 CET] <kepstin> if you want to set to constant fps without re-encoding, something like "ffmpeg -r 24 -i a.mp4 -c copy r.24.mp4" would do that.
[23:26:37 CET] <saml> ah i see
[23:26:56 CET] <saml> yeah i tried -r as input and gave me lower psnr
[23:27:14 CET] <kepstin> probably just some frames misaligned (not the same exact timestamp)
[23:27:52 CET] <kepstin> obviously you can't use psnr to compare files which had their framerates converted using different methods
[23:28:11 CET] <saml> yup
[23:28:55 CET] <saml> ffmpeg -r 24 -i ski.mp4 -c copy out.mp4;    out.mp4 is still 23.98 fps
[23:29:43 CET] <saml> i got 120fps video. when I did  muxer -i 'a.mp4?fps=24' -o out.mp4;    out.mp4  is now slow mo
[23:30:07 CET] <saml> because muxer doesn't drop frames
[23:30:14 CET] <furq> well yeah that's the whole point
[23:30:15 CET] <saml> that makes sense
[23:30:37 CET] <furq> you can't drop frames without reencoding
[23:30:47 CET] <furq> at least not in most codecs
[23:30:49 CET] <saml> ah i see
[23:31:23 CET] <saml> is there one script to convert frame rates?
[23:31:39 CET] Action: saml scrolls up the log
[23:33:11 CET] <saml> so, input -r  plus atempo filter.   argument to the filter is  target-fps/source-fps
[23:33:16 CET] Action: saml tries
[23:33:25 CET] <furq> i don't think -r does anything as an input option to mp4
[23:37:53 CET] <saml> 120000/1001  fps  to 24 fps is too much
[23:38:09 CET] <saml> for audio tempo to be slowed down 0.2
[23:47:11 CET] <mont3z> Hi, I'm having some issues to decode a RTP opus stream using ffmpeg. The decoder issues no error but the raw frame size is the same as the encoded frame. Everything works fine using libOpus without ffmpeg. Has anyone experience this kind of issue with ffmpeg?
[23:47:37 CET] <mont3z> My problem is the same as the one described here: https://stackoverflow.com/questions/41589934/decoding-opus-using-libavcodec-from-ffmpeg
[00:00:00 CET] --- Thu Feb  8 2018


More information about the Ffmpeg-devel-irc mailing list