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

burek burek021 at gmail.com
Sat Sep 16 03:05:01 EEST 2017

[01:01:39 CEST] <braininabat> hello, i've been having problems to use the tee funcionality. I have a working stream with ffmpeg, and now I want to also have it store into a file, I am trying to use the same command I use for the stream and adding the tee part based on the tee examples found on the documentation, apparently it starts normally, but Im not getting the stream, the file I do though... any thoughts?
[01:02:43 CEST] <klaxa> paste your command line
[01:08:42 CEST] <braininabat> this is my working stream command: https://pastebin.com/k5ehk84i         this is the tee command not working: https://pastebin.com/P9vWyhwC
[01:09:10 CEST] <braininabat> the stream is only video
[01:09:18 CEST] <braininabat> the file video + audio
[01:10:28 CEST] <braininabat> I am starting to think now it could be ffsever config matter?
[01:11:16 CEST] <klaxa> hmm... ffserver is not really supported anymore
[01:12:40 CEST] <braininabat> hmm... I may be using it still for the stream I guess... what it's been used now in its place?
[01:18:33 CEST] <klaxa> nginx-rtmp, hls or mpeg-dash
[01:18:48 CEST] <klaxa> btw, i can't really find anything wrong with your command :/
[01:22:30 CEST] <braininabat> klaxa, ok thank you, I've been going around it for some time I can't see anything wrong either, I will look into the streaming alternatives you mentioned... thanks!!! gn
[03:01:40 CEST] <grkblood13> whenever I run the following script with a link to a valid mpegts stream as the input I get the error "Output #0, mpegts, to ' ':
[03:01:40 CEST] <grkblood13> Output file #0 does not contain any stream
[03:01:40 CEST] <grkblood13> ". What am I doing wrong?
[03:01:48 CEST] <grkblood13> https://pastebin.com/6CCDzZsN
[03:07:34 CEST] <DHE> can you run: bash -x $THIS_SCRIPT $INPUT and pastebin the whole inupt and output? (feel free to censor any private data with XXXX or the like, but don't remove anything)
[03:08:54 CEST] <grkblood13> ok, 1 minute
[03:09:08 CEST] <DHE> alternatively add "set -x" to the top of your script. what it does is make bash print each line just before executing it. great for debugging
[03:14:26 CEST] <grkblood13> i might have a new problem. Ill need abour 5-10 minutes. i dont expect you to wait around for me.
[03:17:41 CEST] <grkblood13> is ffmpeg -f mpegts -s 1920x1080 -i $1 not a valid video size?
[03:18:06 CEST] <grkblood13> its spitting out Option video_size not found. now
[03:22:20 CEST] <DHE> usually mpegts carries an mpeg style video which doesn't need to be told the resolution. the decoder will figure it out for itself
[06:12:39 CEST] <blap> hola.  not finding the cause of this problem
[06:12:53 CEST] <blap> mpv -af=lavfi='[dynaudnorm=g=5:f=250:r=0.9:p=0.5]' test.mp4
[06:13:03 CEST] <blap> [ffmpeg] src: Media type mismatch between the 'src' filter output pad 0 (video) and the 'Parsed_dynaudnorm_0' filter input pad 0 (audio)
[06:13:36 CEST] <blap> Version: 7:3.3.4-1
[06:55:34 CEST] <blap> found the problem, sorry to bother you
[07:16:29 CEST] <DeadDred> Is it possible to make a video from 1000+ mp3's in a directory and write the name, extracted from the .mp3 title/ID3 data in the video for the duration on each track/mp3?
[07:21:07 CEST] <furq> not in one command
[07:21:23 CEST] <furq> the easiest way to do that would probably be to use mutagen and write a subtitle file to burn in
[07:21:45 CEST] <furq> or you could probably do it with ffprobe and sh if you don't want to use python, which is understandable
[07:25:53 CEST] <DeadDred> Ok seems I might be able to skip the complexity and add subtitles as the Track Names to the video in YouTube although might not look as good
[07:26:23 CEST] <DeadDred> I guess just create a subtitle/CC file with times stamps and upload
[07:27:23 CEST] <furq> well if you're encoding the video anyway you might as well burn it in with ffmpeg
[07:27:31 CEST] <furq> once you have the subtitle file it's just -vf subtitles=foo.ass
[07:27:43 CEST] <furq> and you could do nice transitions and whatnot with that
[07:28:48 CEST] <DeadDred> hmm ok so once the video is compiled I can add the subtitles inside a file to be shown on screen?
[07:29:21 CEST] <furq> no
[07:29:28 CEST] <furq> -vf subtitles burns the subtitles in when you're encoding the video
[07:29:33 CEST] <DeadDred> ok
[07:29:56 CEST] <furq> or you can create a vtt file or whatever youtube wants and upload that separately
[07:30:49 CEST] <DeadDred> can the on screen position of the subtitle be set too? Say if I add a background for the video and crate a space in the image and the show the subtitle there?
[07:31:02 CEST] <furq> sure
[07:31:05 CEST] <DeadDred> ok
[07:31:06 CEST] <furq> !filter subtitles @DeadDred
[07:31:06 CEST] <nfobot> DeadDred: http://ffmpeg.org/ffmpeg-filters.html#subtitles-1
[07:31:28 CEST] <furq> or you can set styles, positioning etc if you use .ass subtitles
[07:31:48 CEST] <DeadDred> ok ty
[07:31:54 CEST] <furq> if you just want one global style and positioning for everything then srt is probably easier
[07:33:03 CEST] <DeadDred> Yah wa thinking of a background and then in the image create a rounded rectangle where I would like to show the track name. Although with 1500 tracks using a background would proably add quite a bit to the file size
[07:33:24 CEST] <furq> static images compress very well
[07:33:44 CEST] <furq> and youtube encodes everything at a roughly fixed bitrate anyway
[07:37:04 CEST] <DeadDred> Crap just read YT has a 11 hour video limit looks like it'll have to be 6+ individual 11 hour video files then
[07:47:27 CEST] <ffmpeg911> Hello, i am not experienced in working with ffmpeg api. How can i implement crop of file. It works with this line "ffmpeg -ss 00:00:09 -i vidseek108.mkv -t 00:00:03 -vcodec copy -acodec copy -y final.mkv"
[07:49:02 CEST] <dystopia_> what do you want to crop
[07:49:54 CEST] <ffmpeg911> Specific range from the file that still gets written
[07:50:37 CEST] <dystopia_> -vf crop=in_width:in_height:crop_left:crop_top
[07:50:47 CEST] <dystopia_> i meant how many pixels did you want to crop heh
[07:51:17 CEST] <ffmpeg911> Ohh, i saw that i throw different exaample
[07:51:21 CEST] <dystopia_> for example if the video was 1920x1080 and you wanted to crop 4 pixels from the left and 4 pixels from the right you would do
[07:51:22 CEST] <ffmpeg911> I use this sample
[07:51:22 CEST] <ffmpeg911> ffmpeg -i vidseek108.mkv -ss 00:00:50.0 -codec copy -t 20 output.mkv
[07:51:44 CEST] <ffmpeg911> it cut out 20s starting from the second 50 in file
[07:51:47 CEST] <dystopia_> -vf crop=1912:1080:4:9=0
[07:52:01 CEST] <dystopia_> you want to cut, not crop?
[07:52:27 CEST] <dystopia_> crop == removing black borders from video
[07:52:27 CEST] <ffmpeg911> crop is for pixels ?
[07:52:49 CEST] <ffmpeg911> I need range of frames from the video file
[07:53:36 CEST] <dystopia_> a cut won't be exact
[07:53:47 CEST] <dystopia_> as it will use the nearest i-frames as cut points
[07:53:55 CEST] <dystopia_> instead of your exact time code
[07:54:07 CEST] <ffmpeg911> I need this one implemented by api methods ffmpeg -i vidseek108.mkv -ss 00:00:50.0 -codec copy -t 20 output.mkv
[07:58:31 CEST] <ffmpeg911> Is it at least hard or easy task ? :)
[09:03:04 CEST] <Fyr> guys, ffmpeg -hwaccels shows only cuvid on Intel 4000 HD on Linux.
[09:03:16 CEST] <Fyr> how do I enable hardware decoding here?
[09:23:57 CEST] <JEEB> Fyr: vaapi library (and development package of course), and the intel vaapi driver
[09:24:09 CEST] <JEEB> then you can build FFmpeg with VA-API
[09:24:26 CEST] <Fyr> JEEB, installed only vaapi-dummy-driver
[09:24:27 CEST] <Fyr> =)
[09:24:52 CEST] <JEEB> or well, FFmpeg itself only needs vaapi itself. then the VA-API library will try to load some driver
[09:25:00 CEST] <JEEB> and fail like in my case when I didn't have intel's driver installed :)
[09:25:51 CEST] <JEEB> tl;dr --enable-vaapi
[09:25:59 CEST] <JEEB> is the thing on FFmpeg's side
[09:27:33 CEST] <Fyr> JEEB, does libx264 need it?
[09:27:40 CEST] <JEEB> no
[09:29:02 CEST] <JEEB> I mean, libx264 is fully software. there's an OpenCL PoC but that's a Proof of Concept that I don't consider worth anyone's time due to it being just one of the lookaheads
[09:29:54 CEST] <JEEB> libx264 is just --enable-gpl (because x264 is GPL unless you corp license it) and --enable-libx264
[10:56:51 CEST] <next> Hi all
[10:57:03 CEST] <next> Stream map '0:2' matches no streams. To ignore this, add a trailing '?' to the map.
[10:57:38 CEST] <next> Show what you need to enter, I do not understand.
[10:57:49 CEST] <next> Pleas.
[10:58:23 CEST] <dystopia_> i think it means map 0:?
[10:58:28 CEST] <dystopia_> but im not certain
[10:58:42 CEST] <dystopia_> if track doesn't exist, no need to use map on it
[11:01:24 CEST] <next> ffmpeg -i X.VOB -i 1.ac3 -i 2.ac3 -map 0:0 -map 0:1 -map 0:3 -c:a copy -c:v copy 0.VOB
[11:02:17 CEST] <next> Stream map '0:2' matches no streams. To ignore this, add a trailing '?' to the map.
[11:04:49 CEST] <next> ffmpeg -i X.VOB -i 1.ac3 -i 2.ac3 -map 0:0 -map 0:1 -map 0:? -c:a copy -c:v copy 0.VOB
[11:05:00 CEST] <next> Invalid media type data for output stream #0
[11:05:00 CEST] <next> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
[11:11:17 CEST] <next> I need to combine two audio with one video.
[11:25:30 CEST] <e-40> can anyone can help me with ffmpeg installation in redhat
[11:25:48 CEST] <moshisushi> Hello! I'm trying to encode and package an audio file with a static image as HLS. My current command line is this: ffmpeg -i myaudio.wav -i myimage.jpg -profile:v baseline  -level 3.0 -pix_fmt yuv420p -start_number 0 -hls_time 5 -hls_list_size 0 -f hls master.m3u8
[11:26:25 CEST] <moshisushi> without myimage.jpg it works fine (but with no video obviously), but if I add the image i only get one single master0.ts segment
[11:26:48 CEST] <Mavrik> moshisushi, try adding -r 30 ?
[11:26:58 CEST] <Mavrik> to make sure you get a 30fps video of the image?
[11:26:59 CEST] <moshisushi> Mavrik: ta I'll give it a shot
[11:27:03 CEST] <e-40> redhat support?
[11:27:03 CEST] <moshisushi> oooh I see
[11:27:38 CEST] <moshisushi> Mavrik: legend! it workded :)
[11:27:50 CEST] <moshisushi> seeing lots of segments being written now
[11:30:50 CEST] <e-40> redhat support?
[11:30:59 CEST] <e-40> how to install in red hat
[11:42:24 CEST] <next> -map 0:v -map 1:a -map 2:a
[11:42:31 CEST] <next> ha ha ha
[11:42:38 CEST] <next> sorry
[11:43:35 CEST] <moshisushi> Mavrik: actually spoke to soon
[11:44:01 CEST] <moshisushi> still only one segment with -r 30 added
[11:44:11 CEST] <Mavrik> Ah, no idea then :/
[11:46:06 CEST] <moshisushi> Mavrik: actually I wonder if it matters where -r is used (the actual argument position)
[11:46:18 CEST] <Mavrik> the ordering tends to be important yeah
[11:46:25 CEST] <Mavrik> Put it next to video parameters :)
[11:46:39 CEST] <Mavrik> Btw, can you also pastebin the output ffmpeg gives you when it starts encoding?
[11:47:05 CEST] <moshisushi> Mavrik: yeah sure
[11:47:44 CEST] <moshisushi> Mavrik: https://pastebin.com/QJ33X6Xs
[11:49:24 CEST] <Mavrik> I don't see anything obviously wrong :/
[11:53:10 CEST] <moshisushi> Mavrik: I'll try encoding the image to a video first then and package it with the loop option or something
[11:53:20 CEST] <moshisushi> I'm sure there's at least an ugly solution lurking somewhere :)
[11:53:59 CEST] <moshisushi> Mavrik: not the first time i've had to preprocess for HLS... my ffmpeg build is quite unhappy about flac in HLS as well.. works fine if decoding to wav first though
[12:30:01 CEST] <next> How do I use the -ilme option?
[12:32:20 CEST] <next> Unrecognized option 'ilme'.
[12:34:11 CEST] <next> -target ntsc-dvd,ilme
[12:34:25 CEST] <next> Ok. sorry
[12:54:57 CEST] <next> ilme bitrate=28771.2kbits/s :(
[12:55:24 CEST] <next> How is this removed?
[12:57:37 CEST] <DHE> you mean interlaced mode?
[12:58:05 CEST] <next> yeah
[12:58:34 CEST] <DHE> it's used as -flags ilme  (see also -flags ildct)
[12:59:15 CEST] <next> I need to save the interlace but the ilme mode gives too much bitrate. How to subtract a high bitrate?
[12:59:49 CEST] <next> Ok.
[13:00:18 CEST] <DHE> if the source is interlaced, you need to encode it in interlaced mode
[13:00:27 CEST] <DHE> from the history it looks like you're encoding to a DVD?
[13:00:47 CEST] <next> yes
[13:07:46 CEST] <next> -target ntsc-dvd,ildct bitrate=28771.2kbits/
[13:08:23 CEST] <next> i need 8000k
[13:10:26 CEST] <next> ildct and ilme one and the same
[13:21:13 CEST] <Yos> Hi everybody, pls forgive my noob-ility, i was wandering if the new snapshot release as per today had some major modifications on osx linking dependencies...  to be more precise, i am totally able to compile a working executable using the stable one with --enable-vda , the snapshot instead gices me this : ERROR: vda requested, but not all dependencies are satisfied: vda_framework pthreads, how comes?
[13:21:57 CEST] <Yos> *give
[13:22:04 CEST] <next> -target ntsc-dvd -flags ilme OK. Sorry
[13:22:29 CEST] <next> Thenks DHE
[13:35:20 CEST] <c_14> Yos: isn't vda eol in favor of videotoolbox?
[13:37:23 CEST] <Yos> c_14: most likely, but this error has no sense at all anyway, i guess
[13:37:30 CEST] <c_14> And yes, there have been recent changes that could have broken the configure code for that (there's also an RFC on the mailing list to remove vda completely)
[13:38:23 CEST] <c_14> Can you upload the content of your config.log to a pastebin service?
[13:39:24 CEST] <c_14> do you need vda, or could you use videotoolbox?
[13:39:35 CEST] <Yos> c_14:	i checked that and it was complaining about a directory (actually non existent) in my actal config
[13:40:22 CEST] <Yos> c_14:	 nope not really was a curiosity since the stable had no such an error
[13:41:27 CEST] <c_14> Yeah, there's been some recent changes in configure with regards to it that nobody can test because none of the devs have an old enough OSX. If you don't need it, I'd just disable it since it probably doesn't have long left to live anyway
[13:43:08 CEST] <Yos> c_14:	 ok i see, that make sense ofc, thanks for your help / advise
[14:15:18 CEST] <moshisushi> Mavrik: i solved it with a rather ugly and slow 2 stage rocket :)
[14:15:26 CEST] <moshisushi> ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -b:a 128k -pix_fmt yuv420p -shortest out.mp4
[14:15:29 CEST] <moshisushi> ffmpeg -i out.mp4 -profile:v baseline  -level 3.0 -pix_fmt yuv420p -start_number 0 -hls_time 5 -hls_list_size 0 -f hls master.m3u8
[14:15:52 CEST] <moshisushi> might be possible to merge the 2
[15:49:09 CEST] <Ducky^> hi all, I'm trying to send encoded video over the network to a second device
[15:49:32 CEST] <Ducky^> I'm only intending to play the video on one device so I'm not using ffserver (yet)
[15:49:44 CEST] <BtbN> ffserver is dead, better leave it like that.
[15:49:54 CEST] <Ducky^> fair enough
[15:50:09 CEST] <Ducky^> I found that a lot of frames are dropped/the video is glitchy when I use udp and I thought I'd try with tcp instead
[15:50:14 CEST] <devinheitmueller> Just set the ffmpeg output to rtp and use VLC.
[15:50:37 CEST] <BtbN> dropped packets on udp usually mean you are overloading the link
[15:50:44 CEST] <devinheitmueller> Is it the Internet?  Or a LAN?
[15:51:04 CEST] <Ducky^> it's a LAN
[15:51:16 CEST] <devinheitmueller> Generally speaking, if it looks bad with UDP switching to TCP wont really help.
[15:51:36 CEST] <devinheitmueller> Try lowering the bitrate and see if you still get frame dropping.
[15:52:06 CEST] <Ducky^> would rtp be better for this or is udp fine as long as the bitrate is right?
[15:52:30 CEST] <furq> rtp is normally over udp anyway
[15:52:38 CEST] <devinheitmueller> RTP and UDP have effectively the same performance characteristics.
[15:52:50 CEST] <devinheitmueller> And as furq pointed out, RTP is generally over UDP.
[15:53:21 CEST] <devinheitmueller> One thing to watch out for is to make sure you dont have a sender with GigE and a receiver with 100 Mbit Ethernet.
[15:53:42 CEST] <furq> are these both wired connections
[15:55:13 CEST] <Ducky^> ffmpeg claims the bitrate is around 2.3kbits
[15:55:19 CEST] <Ducky^> but the video is still very glitchy and blocky
[15:55:29 CEST] <furq> kbps?
[15:55:38 CEST] <Ducky^> yep
[15:55:45 CEST] <furq> that seems unlikely
[15:56:04 CEST] <furq> unless this is just a still frame
[15:56:28 CEST] <Ducky^> no it's 1080p video
[15:56:54 CEST] <Ducky^> it does seem low..
[15:57:08 CEST] <furq> yeah that sounds about three orders of magnitude too low
[15:57:10 CEST] <devinheitmueller> Well 2.3 Mbps would be low for 1080p video.  2.3 kbps is just insane.
[15:57:35 CEST] <furq> is it actually sending data
[15:57:37 CEST] <Ducky^> frame=  833 fps= 24 q=22.0 size=    8744kB time=00:00:34.99 bitrate=2047.0kbits/s speed=0.999
[15:57:44 CEST] <furq> oh
[15:57:46 CEST] <devinheitmueller> Ok, so that is 2048 kbps.
[15:57:48 CEST] <furq> yeah htat's 2mbps
[15:57:51 CEST] <devinheitmueller> As in 2.0 mpbs.
[15:58:05 CEST] <Ducky^> sorry yes, I can't read
[15:58:14 CEST] <furq> so yeah is the receiver wired
[15:58:29 CEST] <furq> if it's over wifi then it might be worth trying tcp
[15:58:38 CEST] <Ducky^> yes all wired, iperf claims 50Mb bandwidth between the two
[15:59:51 CEST] <Ducky^> if I run it locally on the same machine it runs perfectly smooth
[16:01:30 CEST] <DHE> the newest versions of ffmpeg support the -bitrate option for UDP to set the transmission rate. it has to be at or higher than the real total bitrate. if using mpegts also use -muxrate at an equal or lower value
[16:17:30 CEST] <Ducky^> DHE: -bitrate 1000k -muxrate 1000k for e.g. gives me:
[16:18:02 CEST] <Ducky^> [mpegts @ 0x40c7e00] dts < pcr, TS is invalidme=00:00:34.41 bitrate=2233.1kbits/s speed=0.999x
[16:18:04 CEST] <Ducky^>     Last message repeated 13 times
[16:18:06 CEST] <Ducky^> av_interleaved_write_frame(): Cannot allocate memory
[16:18:08 CEST] <Ducky^> Error writing trailer of udp:// Cannot allocate memory
[16:34:22 CEST] <DHE> Ducky^: well ffmpeg is estimating a ~2.3 megabit feed and you've requested a 1 megabit muxrate and transmission rate
[16:50:59 CEST] <Ducky^> DHE would -b:v 1000k be the right option to use here?
[16:51:25 CEST] <Ducky^> after setting that the errors still come through although it isn't running out of memory this time
[16:52:04 CEST] <Ducky^> oh no it still broke after a while
[17:00:08 CEST] <DHE> there's more overhead than that. and don't forget about your audio
[17:00:24 CEST] <DHE> mpegts has around 10% muxing overhead
[19:06:49 CEST] <lightbulb6> is it possible for an expression in ffmpeg to evaluate to a string?
[19:09:10 CEST] <durandal_1707> lightbulb6: no
[19:09:56 CEST] <lightbulb6> durandal_1707: do you know of any way to get the drawtext filter to render different text depending on the frame number?
[19:10:46 CEST] <durandal_1707> using another drawtext with enable set
[19:10:49 CEST] <lightbulb6> I wanted to use the expression mechanism for that with a couple of nested ifs, like if n is 0 (the first frame) then render "foo", else if n is equal to 1, render "bar", etc
[19:11:00 CEST] <lightbulb6> oh
[19:11:25 CEST] <lightbulb6> i see
[19:11:27 CEST] <lightbulb6> thank you
[19:19:23 CEST] <lightbulb6> durandal_1707: "drawtext= text='foo': enable='eq(n, 0)', drawtext= text='bar': enable='eq(n, 1)'" did the trick
[19:19:36 CEST] <lightbulb6> thanks
[19:28:27 CEST] <doublya> is there any way to build ffmpeg with cuda_sdk and still be redistributable?
[19:28:57 CEST] <BtbN> no
[19:29:20 CEST] <BtbN> The License of that stuff is so entirely not (L)GPL compatible, that there is no chance for that.
[19:58:57 CEST] <Fyr> guys, my subtitle files use fonts that are not available on my system. why does FFMPEG not using the fonts available?
[20:00:44 CEST] <c_14> it should fall back to fonts you have
[20:00:59 CEST] <c_14> (But that's a fontconfig thing if it doesn't)
[20:01:20 CEST] <Fyr> I got:
[20:01:20 CEST] <Fyr> Could not create a libass track when reading file '1.srt'
[20:01:28 CEST] <Fyr> Error initializing filter 'ass' with args '1.srt'
[20:03:57 CEST] <Fyr> here is the paste:
[20:03:57 CEST] <Fyr> https://pastebin.com/qAekt4yp
[20:04:11 CEST] <c_14> You can't feed .srt files to the ass filter
[20:04:15 CEST] <JEEB> Fyr: does the ass filter even support srt btw? I thought it'd just try to feed the file to libass
[20:04:16 CEST] <c_14> Use the subtitles filter instead
[20:04:18 CEST] <JEEB> which expects ASS
[20:04:44 CEST] <kepstin> Fyr: does the mkv file have internal subtitles?
[21:01:44 CEST] <Fyr> guys, how to render subtitles into a big video_size, then downscale and burn them into another video?
[21:01:57 CEST] <Fyr> it's supposed to antialiasing.
[21:02:02 CEST] <Fyr> *to be
[21:42:26 CEST] <DHE> probably want to use filter_complex
[21:42:47 CEST] <DHE> make a big blank that's transparent, burn the subtitles into it, scale it, and then overlay onto the real video
[21:43:01 CEST] <DHE> big blank canvas
[22:29:13 CEST] <Ober> Have a lot of 4k Quicktime movs. Converted to webm, but not useful for ios. What is the recommended format for ios? mp4/aac? Looking for preserving the best quality if it can be made smaller than the current quicktime file.
[22:31:42 CEST] <klaxa> i think so, you can put h264+aac in mov too i think
[22:32:37 CEST] <Ober> webm did a great size reduction job. Just trying to do self hosting off s3.
[22:33:07 CEST] <kepstin> you can almost certainly just copy the streams from a mov file to mp4 and it'll work
[22:33:24 CEST] <kepstin> if you do want it smaller, use h264 (via the libx264 encoder)
[22:33:33 CEST] <klaxa> that will not reduce the size reasonably though (which is the goal)
[22:33:40 CEST] <klaxa> yes
[22:37:54 CEST] <Ober> is there a ffmpeg command to get info on a given file?
[22:38:22 CEST] <klaxa> ffmpeg -i file.mp4
[22:38:35 CEST] <kepstin> Ober: in a pinch, "ffmpeg -i filename" will print some info (and exit with an error you can ignore). For more info in a machine-readable format, try ffprobe
[22:39:30 CEST] <Ober> Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 3840x2160, 60121 kb/s, 25 fps, 25 tbr, 60k tbn, 60k tbc (default)     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
[22:39:31 CEST] <Ober>  
[22:39:43 CEST] Last message repeated 1 time(s).
[22:39:43 CEST] <Ober> wonder if h264 will make a difference
[22:40:04 CEST] <alexpigment> mjpeg is a very inefficient codec
[22:40:15 CEST] <alexpigment> h264 will certainly be better in terms of file size
[22:40:52 CEST] <alexpigment> MJPEG doesn't have interframe compression
[22:41:36 CEST] <Ober> ok. good to know. was afraid it would not improve. will the default be to preserve resolution?
[22:41:59 CEST] <alexpigment> yes, the resolution will be preserved if you don't specify a resolution specifically
[22:42:13 CEST] <Ober> thanks.
[22:42:23 CEST] <alexpigment> just make sure and choose a good CRF value for x264
[22:42:36 CEST] <Ober> so mp4-h264/webm should cover everything?
[22:42:44 CEST] <Ober> crf max 32?
[22:42:50 CEST] Action: Ober forgets the scale on crf
[22:42:58 CEST] <alexpigment> i like to use crf of 18-20 or so
[22:43:43 CEST] <Ober> excellent, thanks. moved off all my stuff from youtube to videojs on s3. it was unknown ios would not handle webm by me
[22:43:46 CEST] <alexpigment> but if you're playing on iOS, you probably won't notice any quality loss with something like 22 or 23
[22:43:57 CEST] <alexpigment> oh this is for streaming
[22:44:21 CEST] <alexpigment> you'll probably want to limit the bitrate in some way
[22:44:23 CEST] <Ober> well not rtmp streaming
[22:44:31 CEST] <Ober> just direct web/video tag.
[22:44:40 CEST] <Ober> had not figured out rtmp yet
[22:44:42 CEST] <alexpigment> sure, but crf 18-20 will end up with a large file
[22:44:53 CEST] <kepstin> crf works okish for streaming if you accept big buffers, but it does make the behaviour a bit unpredictable on low bw connections
[22:45:26 CEST] <alexpigment> kepstin: yeah, but he's doing 4k, so it might even bottleneck some "average" connections too
[22:46:05 CEST] <kepstin> quite true. For mobile devices you probably want to downscale to 1080p or even 720p
[22:46:05 CEST] <alexpigment> i'd probably go with -crf 23 and put a maxrate and bufsize of 15M or so
[22:46:12 CEST] <alexpigment> if not downscale, yeah
[22:46:57 CEST] <alexpigment> hell, i don't even know if my iPhone 5S will *play* 4k
[22:47:05 CEST] <kepstin> 720p is acceptable on most phones up to 5" or thereabouts, above that you might want 1080p.
[22:47:24 CEST] <alexpigment> 1080p certainly has hardware support in most modern phones
[22:48:02 CEST] <kepstin> i still find it weird that my phone has a 720p screen, but it can record 4k video on the camera :/
[22:48:51 CEST] <alexpigment> well, anyone smart in the phone world would know that you only want to do high density if you can do integer scaling
[22:48:58 CEST] <JEEB> "your camera has a 320x240 screen and it can take 15 megapixels worth of pictures"
[22:49:19 CEST] <JEEB> I guess that is as weird as that video recording kepstin :)
[22:49:48 CEST] <alexpigment> kepstin: your phone battery probably is much better off for it :)
[22:49:59 CEST] <Ober> thanks. this will help.
[22:50:00 CEST] <alexpigment> there's no way in hell you'd be able to *see* 4K
[22:50:09 CEST] <Ober> nothing worse than a crappy video site
[22:50:18 CEST] <Ober> "the webm downloaded a 1 gb file!"
[22:52:05 CEST] <Ober> what is a realistic max bitrate?
[22:52:09 CEST] <Ober> for mobile devices?)
[22:52:41 CEST] <kepstin> Ober: if you want to be all fancy & state of the art, you'd do a few encodes at different bitrates/video sizes, as DASH with aligned keyframes in the segments, then have an adaptive player.
[22:53:01 CEST] <Ober> yeah. that makes sense.
[22:56:59 CEST] <Cracki> 4k on a big screen, or in magnified still photos, is a good thing
[22:57:11 CEST] <Cracki> more high res footage of riots is also great for law enforcement
[22:59:47 CEST] <kepstin> before i start recording video in 4k on my phone, it prints a message saying that it may quit unexpectedly if the phone overheats.
[22:59:50 CEST] <kepstin> great fun.
[23:02:38 CEST] <Ober>  -b:v 2000 for mobile?
[23:02:56 CEST] <Ober> or is it more like -b:v 2M?
[23:09:17 CEST] <Ober> ffmpeg -i ./20170201_120004.MOV -vcodec h264 -b:v 600k -crf 18 -s hd1080 -acodec aac test2.mp4
[23:15:02 CEST] <Cracki> 600k video bitrate? that's very low
[23:15:07 CEST] <Cracki> while crf 18 is good quality
[23:15:12 CEST] <Cracki> pick either or
[23:18:09 CEST] <microchip_> Ober: in your cmd, -crf overwrites -b:v as it comes after it
[23:19:58 CEST] <Ober> ahh so I should just remove crf?
[23:20:06 CEST] <microchip_> Ober: also, use -c:a instead of -acodec. The latter is old and will be obsolete "soon"
[23:20:42 CEST] <Ober> k
[23:20:52 CEST] <microchip_> Ober: depends. It's not clear what you want to use, crf or bitrate-based encoding
[23:20:53 CEST] <Ober> ffmpeg -i ./20170201_120004.MOV -threads 8 -c:v h264 -b:v 600k -s hd1080 -c:a aac test2.mp4
[23:21:05 CEST] <Ober> I assume for mobile streaming I want constant bitrate
[23:21:16 CEST] <Ober> going to test and see what it yields
[23:21:25 CEST] <Ober> ffmpeg -i ./20170201_120004.MOV -threads 8 -c:v h264 -b:v 600k -s hd1080 -c:a aac test2.mp4
[23:25:58 CEST] <microchip_> Ober: use -c:v libx264. There's not "h264" codec in ffmpeg
[23:26:07 CEST] <Cracki> I can tell you now 600k for fullhd video is going to be bad
[23:26:43 CEST] <microchip_> Ober: for streaming, you also want vbv
[23:29:23 CEST] <Ober> Cracki: recommending for bitrate?
[23:30:04 CEST] <Cracki> 2-10 Mbit/s, depending on footage. if it's a webcam, 600k might be good enough :P
[23:30:11 CEST] <Cracki> any motion and you want to turn it up
[23:30:25 CEST] <microchip_> Ober: for 1080p? at least 5 Mbps and that's the lower end
[23:31:36 CEST] <Ober> or vbv-maxrate recommendations?
[23:31:39 CEST] <Ober> yeah I suck at the math
[23:32:10 CEST] <Ober> lots of motion
[23:33:35 CEST] <Cracki> handheld camcorders output 17-32 Mbit/s, for lectures we (at my uni) compomise by delivering 2M on demand, streaming around 3-8M
[23:34:29 CEST] <Ober> how do you calculate these magic values for a given resolution? --bitrate B --vbv-maxrate R --vbv-bufsize S
[23:34:30 CEST] <Ober>  
[23:34:50 CEST] <redrabbit> you try
[23:34:58 CEST] <redrabbit> and look at the output
[23:35:07 CEST] <redrabbit> then try again with a slight different value
[23:35:08 CEST] <Cracki> bitrate correlates with quality.
[23:35:11 CEST] <redrabbit> then again
[23:35:20 CEST] <Cracki> maxrate and bufsize are relevant for streaming *clients*
[23:35:23 CEST] <Ober> yeah... I can get a 28.8k modem and test
[23:35:31 CEST] <redrabbit> till you are happy with the results
[23:35:37 CEST] <Cracki> bufsize is what a client needs to allocate
[23:36:00 CEST] <Ober> well given it's math, trial and error seems expensive
[23:36:07 CEST] <Cracki> rule of thumb is ~1 second * maxrate = bufsize
[23:36:31 CEST] <redrabbit> i use buffize = 2x maxrate here
[23:37:06 CEST] <redrabbit> (twice the maxrate)
[23:37:40 CEST] <Cracki> bufsize allows the bits to be "distributed across time" a bit more
[23:38:01 CEST] <Cracki> so complex frames can still get their bits without the maxrate getting violated
[23:38:03 CEST] <Ober> thanks.
[23:38:16 CEST] <Cracki> think "leaky bucket", there's a budget the encoder can spend
[23:43:37 CEST] <Ober> thanks for the help. much better progress
[23:44:55 CEST] <redrabbit> if you want great results a lot of trials helps
[23:45:22 CEST] <Ober> no doubt.
[23:45:36 CEST] <Ober> writing a program to do this for me.
[23:46:05 CEST] <redrabbit> i spend whole nights before i was satisfied with my iptv transcoding settings
[23:46:15 CEST] <redrabbit> a handful of them :p
[23:46:32 CEST] <redrabbit> trying over 3G modems / capped links etc
[23:46:36 CEST] <Cracki> one flavor of "trial" is twopass encoding, but that's not for livestreaming
[23:48:15 CEST] <Ober> wow have not heard iptv in 15 years
[23:50:29 CEST] <DHE> bitrate is your target bitrate overall. maxrate is the maximum bitrate you want the video to ever consume, and the bufsize is usually somewhere between 50% and 200% of the maxrate
[23:50:50 CEST] <DHE> usually set bitrate==maxrate for live
[23:51:55 CEST] <DHE> these should give you guidance for what settings to go with. just need to choose a maxrate based on your users, server capabilities, and quality requirements
[23:52:38 CEST] <redrabbit> in some cases you can use crf with maxrate
[23:59:29 CEST] <Ober> so -max_alloc is the buffer size?
[00:00:00 CEST] --- Sat Sep 16 2017

More information about the Ffmpeg-devel-irc mailing list