[Ffmpeg-devel-irc] ffmpeg.log.20171010
burek
burek021 at gmail.com
Wed Oct 11 03:05:01 EEST 2017
[01:08:50 CEST] <kevinn> Hi! I am having trouble getting av_parser_parse2 to work correctly. I am compressing a movie with x264 with key_int = 1. So every frame that is generated by x264 should be immediately render-able. However av_parser_parse2 is returning the following: pkt->size = 0 signifying that it doesn't have anything to render
[01:08:59 CEST] <kevinn> any help would be greatly appreciated!
[01:10:26 CEST] <kevinn> This is in reference to the first frame that is produced by x264
[01:23:50 CEST] <teratorn> kevinn: you have to feed some frames first usually before you get any out due to codec latency.. but if they are all keyframes.. who knows?
[01:24:32 CEST] <kevinn> Ya that's what I thought... It should output right off the bat
[01:26:58 CEST] <DHE> still, set tune=zerolatency to be sure
[01:32:30 CEST] <kevinn> hmm, okay I'll try that now
[01:34:21 CEST] <kevinn> just to be clear you mean this right?
[01:34:23 CEST] <kevinn> av_opt_set(mCodec->priv_data, "tune", "zerolatency", 0);
[01:35:59 CEST] <kevinn> DHE: is there anyway to check to see if my x264 frame is actually a keyframe?
[01:36:09 CEST] <kevinn> I set that tune and it is still not working
[01:40:07 CEST] <DHE> the AVPacket has a flag for keyframes
[01:44:09 CEST] <kevinn> okay it is not a keyframe
[01:44:31 CEST] <kevinn> DHE: does that mean x264 is not producing the correct buffers?
[01:45:03 CEST] <kevinn> I noticed that the very next frame produced by x264 has all the correct data inside of it
[01:45:14 CEST] <kevinn> curious what was even in the first frame then...
[01:55:54 CEST] <kevinn> DHE: can you think of any reason why the first frame produced by x264 is not a keyframe?
[01:57:03 CEST] <DHE> sorry, was playing video games
[01:57:25 CEST] <DHE> even if you ask for all keyframes, x264 will buffer frames for bitrate estimation.
[01:57:30 CEST] <DHE> use tune=zerolatency if this matters to you
[01:58:25 CEST] <kevinn> I have both ends tuned to zerolatency though
[01:58:32 CEST] <kevinn> both libav and x264
[01:58:58 CEST] <kevinn> How do I make x264 not be behind by a frame like this
[02:01:37 CEST] <teratorn> kevinn: might just be an implementation detail of the codec
[02:02:27 CEST] <JEEB> kevinn: are you fucking sure it's not just parameter sets first?
[02:02:43 CEST] <JEEB> and then actual pictures
[02:04:02 CEST] <kevinn> ahh, I didn't know the first frame is always the parameter set, sorry, I will account for this going forward
[02:04:31 CEST] <JEEB> it depends, and if you're goddamn using libavcodec just look at the goddamn wrapper
[02:05:45 CEST] <JEEB> since x264_encoder_headers is only called under avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER I would guess it's in either the first packet or the first one is the parameter sets
[02:06:55 CEST] <DHE> wait, he's using x264 directly?
[02:07:09 CEST] <JEEB> fuck if I fucking know. he was saying something on x264dev and something here
[02:07:22 CEST] <JEEB> it's really fucking tiring and he couldn't even bother to check what he's outputting
[02:07:25 CEST] <JEEB> for fuck's sake
[02:07:34 CEST] <DHE> ah that explains the cursing then
[02:07:35 CEST] <DHE> carry on
[02:07:47 CEST] <JEEB> DHE: my comment regarding the headers function was from libx264.c
[02:07:50 CEST] <JEEB> in libavcodec
[02:08:17 CEST] <JEEB> which leads me to think that you get the parameter sets with the initial encoded frame(s)
[02:08:42 CEST] <JEEB> and I know the libavcodec parser at least separates parameter sets into their own packets
[02:08:52 CEST] <JEEB> so if you have PPS/SPS/VPS in HEVC they're all separate
[02:10:30 CEST] <kevinn> DHE: yes I am using x264 directly... should I not?
[02:10:46 CEST] <JEEB> nothing bad with that
[02:11:27 CEST] <JEEB> the reason why you're so irritating is somewhere completely different
[02:12:22 CEST] <DHE> yeah. I just assumed you were using ffmpeg's libavcodec wrapper around it as literally everyone else does
[02:12:49 CEST] <JEEB> you're of the species that instead of checking "what on earth x264 returned to me" decided to start playing with parameter
[02:12:52 CEST] <JEEB> *parameters
[02:13:06 CEST] <JEEB> (he was starting to ask around for min-keyint etc on x264dev)
[02:13:31 CEST] <JEEB> anyways, I hope you all the good
[02:14:06 CEST] <kevinn> I am sorry I really did not want to frustrate you JEEB, I am all good now thank you.
[02:14:21 CEST] <kevinn> I will check that wrapper more carefully too before I ask anymore questions
[02:14:28 CEST] <kevinn> Didn't know it existed
[02:14:43 CEST] <JEEB> the wrapper quite honestly doesn't do too much. just maps the buffers to AVPackets and such
[02:15:02 CEST] <JEEB> the problem really is that you made zero attempt at looking at what was going on it seems
[02:15:21 CEST] <JEEB> like, you could have done something like -show_frames with ffprobe?
[02:15:27 CEST] <JEEB> then found out that there are no frames in there
[02:15:39 CEST] <JEEB> then maybe thought that AVC needs initialization data?
[02:16:03 CEST] <JEEB> and there are other parsers for AVC bit streams of course
[02:16:23 CEST] <kevinn> what should I use for reference then? I checked the flag that AVPackets returned and it said that the frame wasn't a keyframe. I was told on x264dev that if I set keyint=1 then all frames would be a keyframe, hence my confusion
[02:16:39 CEST] <JEEB> BY CHECKING THE FUCKING DATA
[02:16:57 CEST] <JEEB> vittu perkele, I will just stop wasting my time on this
[02:17:32 CEST] <furq> you know it's bad when the swearing is finnish
[02:17:39 CEST] <kevinn> I am sorry JEEB, I promise next time I will check the data.
[02:17:57 CEST] <kevinn> thank you for the help though
[04:29:31 CEST] <eric_hill> trying to extract a video frame from a CCTV camera .DAV file - ffmpeg -y -i in.dav -vcodec libx264 -ss 30 -qscale:v 2 -vframes 1 out.jpg
[04:29:49 CEST] <eric_hill> jpeg looks like an h264 frame, not a jpeg. What am I doing wrong?
[04:32:32 CEST] <kepstin> eric_hill: you have "-vcodec libx264" in there, which is telling it to encode an h264 frame
[04:32:43 CEST] <kepstin> i'm surprised that doesn't error out, tbh.
[04:35:48 CEST] <eric_hill> hmm. If I don't specify it, ffmpeg has trouble figuring out the source .dav is x264 encoded. It's apparently some proprietary Chinese one-off codec...
[04:38:44 CEST] <eric_hill> kepstin, spot on. Removing that worked great. Facepalm. Tx.
[04:45:32 CEST] <Johnjay> JEEB: what is playing with parameters and why is it bad lol?
[05:55:04 CEST] <LunixA380> Hello guys. I have a problem with ffmpeg. It uses 22 GiB (and more, actually it used all the RAM of the VM and then crashed by OOM) hile usually, when I transcode file, it runs in order of hundred of megabytes used.
[05:55:47 CEST] <LunixA380> I guess it is because I try to concat 700+ .ts files (because of HLS technology)
[06:13:38 CEST] <stevenliu> demux hls
[06:13:45 CEST] <stevenliu> or concat format?
[06:16:25 CEST] <LunixA380> concat filter_complex
[06:17:30 CEST] <LunixA380> stevenliu: https://paste.fedoraproject.org/paste/qo1OLGPG3TntAY2mQ8KsqA
[06:17:58 CEST] <LunixA380> When I say "22 GiB" this is not a joke, and despite so much RAM it crashes :/
[06:20:00 CEST] <LunixA380> With a complex filter I can't do -codec copy, otherwise I would have ruled out (or not) the encoder
[06:20:05 CEST] <akkad> did you buy Gibabyte ram? or gigabyte ram?
[06:20:34 CEST] <LunixA380> I talk ion Gibibyte actually. 22 Gibibyte. I don't buy anything, it's cloud though.
[06:20:43 CEST] <LunixA380> I don't have so much RAM at my disposal
[06:48:24 CEST] <LunixA380> Any idea?
[07:35:48 CEST] <LunixA380> The filtergraph feels simple. I have tried to put on loglevel debug, pretty unhelpful. I wonder if scaling the slices before concat is better than concat and scale, but I don't see how. On Internet people says "high memory usage is because ffmpeg thinks there is a cycle and basically stores all the video/audio raw in memory"
[07:36:00 CEST] <LunixA380> Obviously, if it does that, it'll run out of memory
[07:36:21 CEST] <LunixA380> I suspect it does, but I don't have proofs from, say, a log message (if such log message exists)
[08:36:08 CEST] <JEEB> Johnjay_: read the darn context, which was this guy complaining that his first received data from x264 was not a random access picture. instead of taking a look wtf x264 returned him (most likely the headers) he started randomly poking parameters
[09:33:47 CEST] <LunixA380> After investigation, the problem seems to be the concat filter.
[09:34:08 CEST] <JEEB> funky, that filter has been rather stable for me in 2015 or so
[09:34:16 CEST] <JEEB> although I was concatenating very simple things
[09:34:24 CEST] <LunixA380> Well, yes, but
[09:34:34 CEST] <JEEB> (MPEG-2 Video, AVC + raw audio in MXF)
[09:34:34 CEST] <LunixA380> I have tried to just *extract the sound* (audio streams) and leave videos on the side for now. And only for audio it uses
[09:34:40 CEST] <LunixA380> it uses 700 MiB of RAM
[09:35:25 CEST] <LunixA380> I know libvorbis enough to say it will never use so much RAM on its own, and if audio already uses 700 MiB, I easily understand how video can go beyond 22 GiB.
[09:35:54 CEST] <JEEB> the amount of memory used depends on the amount of buffering done
[09:36:02 CEST] <JEEB> that depends on the filter chain and inputs and a few other things
[09:36:09 CEST] <JEEB> what I've mostly seen I don't think went that high
[09:36:14 CEST] <JEEB> but that was a while ago
[09:36:36 CEST] <JEEB> and the synchronization logic IIRC was partly reworked lately, among other things
[09:36:55 CEST] <LunixA380> I know it depends of a lot of things
[09:37:13 CEST] <LunixA380> But the thing I did is: ffmpeg -i [many files] -filter_complex concat audio and that's it
[09:37:30 CEST] <furq> can you not use the hls demuxer
[09:37:41 CEST] <JEEB> oh, HLS demuxer :D
[09:37:44 CEST] <JEEB> that funny little thing
[09:38:37 CEST] <LunixA380> IMO the fact there is many input files is the cause (because the combined size on-disk of .ts files are fair)
[09:39:53 CEST] <JEEB> well I'm not sure how many decoders and demuxers are being brought up :)
[09:40:02 CEST] <JEEB> even if you only utilize the audio tracks
[09:40:05 CEST] <JEEB> in the concat filter
[09:40:17 CEST] <JEEB> also if it's MPEG-TS you can literally just concatenate those together :D
[09:40:21 CEST] <furq> i mean if this is mpegts then you almost certainly don't need to use the...yeah
[09:40:38 CEST] <furq> if you have the m3u8 then i assume you can just use that as the input and it'll do something approaching the right thing
[09:40:43 CEST] <LunixA380> JEEB: I've searched enough Google to know I can do that, I'm literally on it since hours
[09:40:48 CEST] <furq> but failing that you can just cat them
[09:41:18 CEST] <furq> LunixA380: by "literally concatenate" he means cat file1.ts file2.ts > out.ts
[09:41:22 CEST] <furq> except with more than two files obv
[09:41:27 CEST] <LunixA380> I know
[09:41:41 CEST] <furq> it sounds like the filter is just being dumb about that many inputs
[09:42:25 CEST] <LunixA380> But it is told it can desync sound/files between them. I guess it's case-by-case, and I've reviewed the file: they share same aspect ratio etc., but NOT the bitrate.
[09:42:52 CEST] <furq> they don't need to be the same bitrate unless it's supposed to be cbr
[09:43:19 CEST] <LunixA380> No, anyway I just want to reconvert them.
[09:43:29 CEST] <LunixA380> So CBR or not I'll redo them from top to bottom
[09:44:26 CEST] <LunixA380> OK then let's try the "simple solution I reject to do since hours because I fear that it would destroy the file"
[09:44:44 CEST] <furq> i take it you don't have the m3u8
[09:44:50 CEST] <furq> because i would've thought that was the simplest solution
[09:46:09 CEST] <LunixA380> I have the m3u8
[09:46:19 CEST] <LunixA380> I have even 2
[09:46:44 CEST] <furq> if it has relative paths then i would assume you can just do -i foo.m3u8 out.mp4
[09:46:57 CEST] <furq> i've never worked with an m3u8 locally though
[09:47:14 CEST] <LunixA380> And I do what, the concat?
[09:47:28 CEST] <furq> no, literally just that
[09:47:32 CEST] <LunixA380> Ah.
[09:47:37 CEST] <LunixA380> I'm going to try
[09:47:37 CEST] <furq> given an m3u8 as input it'll process all the files in the playlist in order
[09:53:28 CEST] <LunixA380> Well. It _kinda_ works
[09:53:36 CEST] <LunixA380> I've a lot of "Non-monotonous DTS in output stream 0"
[09:55:59 CEST] <LunixA380> Memory usage: insignificant. I can't even give a number given it's so small
[09:56:08 CEST] <LunixA380> I confirm the concat filter make FFMpeg fully cray
[09:56:11 CEST] <LunixA380> crazy
[09:56:49 CEST] <LunixA380> 29 MiB of RAM used vs. 700 with concat filter (both in audio only situation)
[10:02:10 CEST] <Fyr> guys, what container is less CPU-consuming for FFMPEG?
[10:02:28 CEST] <Fyr> I noticed that muxing into matroska is faster than muxing into MP4.
[10:02:43 CEST] <LunixA380> Same codecs?
[10:02:48 CEST] <Fyr> yes
[10:03:13 CEST] <LunixA380> I think ffmpeg has benchmarks flag but I don't know much and whether I'm right
[10:03:13 CEST] <Fyr> especially, MP4 is much slower if I set faststart.
[10:04:30 CEST] <JEEB> yes, since you're essentially going through the full file again
[10:04:40 CEST] <JEEB> although that's not CPU intensive
[10:04:42 CEST] <JEEB> it's IO intensive
[10:04:51 CEST] <Fyr> oh
[10:05:03 CEST] <JEEB> faststart means that the index it would otherwise write at the end
[10:05:11 CEST] <Fyr> JEEB, so, what container is designed to be fast?
[10:05:32 CEST] <JEEB> it will take its contents into memory and start rewriting the file again with its contents having the index in the beginning
[10:05:36 CEST] <JEEB> that is what "faststart" is
[10:05:45 CEST] <JEEB> its contents -> the index's
[10:06:06 CEST] <JEEB> Fyr: uhh, we're going so far into IO bound territory I'm not sure
[10:06:19 CEST] <LunixA380> faststart has index written at the beginning if I recall correctly
[10:06:35 CEST] <JEEB> it can't be written in the beginning to start with, it has to do another pass of muxing
[10:06:36 CEST] <LunixA380> However I think webm has the same constraints by default (doesn't matter if you put a flag or not)
[10:06:51 CEST] <LunixA380> Yes
[10:06:59 CEST] <JEEB> no, matroska is fundamentally different in its structures so at least in theory it doesn't need a "faststart"
[10:07:01 CEST] <LunixA380> Because ffmpeg can't know in advance what the index will contain
[10:07:03 CEST] <JEEB> and webm is matroska
[10:07:07 CEST] <Fyr> I also noticed that TS is faster than MKV.
[10:07:07 CEST] <JEEB> well, d'uh
[10:07:31 CEST] <JEEB> Fyr: if you're really being blocked by the IO then I congratulate you for having a very fast workflow
[10:07:36 CEST] <JEEB> or well, not blocked I mean
[10:07:46 CEST] <JEEB> if you're *CPU* bound with those that's a woah
[10:08:15 CEST] <LunixA380> It's possible if ou do your video files inside tmpfs
[10:10:44 CEST] <LunixA380> "Non-monotonous DTS in output stream 0:0" how top investigate that issue now?
[10:15:05 CEST] <Nacht> Does anyone know that the concat process of FFMPEG has any checks in it to see if it's all correct ?
[10:15:30 CEST] <Nacht> As it, that you're not missing a small portion of data due to the system having a hickup
[10:23:38 CEST] <rabbe> hi, need urgent help
[10:24:03 CEST] <rabbe> i've created an rtmp stream through nginx
[10:24:08 CEST] <rabbe> now i need to record that stream
[10:24:40 CEST] <rabbe> when i do the recording the timestamps in ffmpeg does not correspond to real world time
[10:25:27 CEST] <rabbe> so when i quit recording i don't have a video with the real amount of time that the recording really lasted
[10:30:50 CEST] <LunixA380> Nacht: ffmpeg is not affected by system load if you don't do streaming, the only hiccups you may encounter is if the file is actually failed, or if the software/hardware is
[10:30:59 CEST] <LunixA380> But in normal circumstances, you should be OK.
[10:31:26 CEST] <LunixA380> Have to go, bye
[10:47:30 CEST] <thebombzen> lol it still says "Non-monotonous"
[10:47:39 CEST] <thebombzen> I was wondering when someone would change it to "monotonic"
[10:47:55 CEST] <thebombzen> monotonous is "speaking in a monotone"
[10:48:08 CEST] <thebombzen> "monotonic" means "nondecreasing"
[10:52:53 CEST] <rabbe> using a capture card, i create this stream: ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 10000k -g 60 -f flv rtmp://192.168.0.16/live/test
[10:53:02 CEST] <rabbe> how do i record the rtmp stream?
[10:53:20 CEST] <rabbe> into mp4 file
[10:54:36 CEST] <stevenliu> ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 10000k -g 60 - | ffmpeg -i - -c copy -f flv rtmp://192.168.0.16/live/test -c copy -f mp4 -movflags faststart test.mp4
[10:55:48 CEST] <rabbe> but i only need to record sometimes
[10:56:00 CEST] <rabbe> whereas the rtmp feed should be created all the time
[10:56:10 CEST] <rabbe> forgot to say that
[10:56:46 CEST] <stevenliu> crontab
[10:57:08 CEST] <rabbe> recording times should be decided by robot
[10:57:16 CEST] <rabbe> i just need an ffmpeg command to do it
[10:57:52 CEST] <titbang> https://superuser.com/questions/901339/continuous-streaming-from-an-empty-pipe-then-adding-data-to-the-pipe-on-demand
[10:57:57 CEST] <rabbe> the one i use now seems to lag in time.. so 10 seconds real time will become maybe 2 seconds video file
[10:58:12 CEST] <rabbe> ok, i'll check
[11:08:22 CEST] <rabbe_> titbang: that is not the same thing?
[11:11:25 CEST] <furq> rabbe_: you can use the tee muxer if you want to output an encoded stream to multiple places
[11:11:33 CEST] <furq> there's no way to turn one on or off on demand though
[11:11:38 CEST] <furq> !muxer tee @rabbe_
[11:11:38 CEST] <nfobot> rabbe_: http://ffmpeg.org/ffmpeg-formats.html#tee-1
[11:12:20 CEST] <furq> also you probably don't want to use mp4 because you'll get an unplayable file if any of the inputs or outputs drops out
[11:12:29 CEST] <furq> use mkv, mpegts, flv etc
[11:13:56 CEST] <rabbe_> this works, but gives me too short video: ffmpeg -i rtmp://localhost/live/test -c:v libx264 -crf 18 -vf format=yuv420p /usr/local/nginx/html/video/output.mp4
[11:14:07 CEST] <stevenliu> you can use crontab or write a crontab task scheduler by your self to start record
[11:15:02 CEST] <rabbe_> when i run that the timestamps are not real time, if i kill the process when the time stamps are at 00:00:03 i will get a 3 second video, but in reality it might have recorded during 10 seconds
[11:15:05 CEST] <stevenliu> 1st, what's the info of the rtmp streams ?
[11:15:51 CEST] <rabbe_> ok, hold i will go offline to connect to that network
[11:20:08 CEST] <rabbe> https://pastebin.com/T8ftApJC
[11:21:20 CEST] <rabbe> i have a newer ffmpeg on the server than on this computer that i ran the command at
[11:22:28 CEST] <_julian> hi
[11:22:52 CEST] <rabbe> the plan is to have some Uython code which will spawn a process with ffmpeg, then kill it CTRL-C style.. that should work, right?
[11:23:03 CEST] <stevenliu> you need not transcode, if you want record, just use -c copy should be ok
[11:23:30 CEST] <stevenliu> oh, no, don't use ctrl+c
[11:23:51 CEST] <furq> rabbe: ^C will absolutely not work with mp4
[11:24:09 CEST] <rabbe> ok, so something like: ffmpeg -i rtmp://localhost/live/test -c:copy /usr/local/nginx/html/video/output.mp4 ?
[11:24:15 CEST] <furq> -c copy
[11:24:23 CEST] <rabbe> ok, so something like: ffmpeg -i rtmp://localhost/live/test -c copy /usr/local/nginx/html/video/output.mp4 ?
[11:24:28 CEST] <furq> and like i said, don't use mp4 unless you want unplayable files
[11:24:29 CEST] <stevenliu> if you want record to mp4, maybe you should record to ts or flv at frist, that can use ctrl+c, complete record to flv or ts, you can remux the ts or flv to mp4 and the end
[11:24:34 CEST] <furq> ^
[11:24:59 CEST] <_julian> I'm having an issue with an aac_latm audio track inside mpegts. If I open that stream and run avformat_find_stream_info on it, everything seems fine and I get continuous pts out for each packet. If I skip avformat_find_stream_info, as this does not work well for mpegts live streams I do get lots of packets with pts==0 out of the codec. In both cases AVStream->needs_parsing is AVSTREAM_PARSE_FULL
[11:25:08 CEST] <_julian> any thoughts what could cause this difference in behaviour?
[11:25:11 CEST] <stevenliu> ffmpeg -i rtmp://localhost/live/test -c copy /usr/local/nginx/html/video/output.ts ; ffmpeg -i output.ts -c copy output.mp4;
[11:25:46 CEST] <rabbe> okay i will try that
[11:30:39 CEST] <rabbe> now the timestamps are ahead :) should i have -r 60 somewhere?
[11:31:03 CEST] <rabbe> i get really high framerates
[11:31:44 CEST] <stevenliu> Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1920x1080, 4999 kb/s, 62.50 fps, 60 tbr, 1k tbn, 120 tbc
[11:31:48 CEST] <stevenliu> this is the stream info
[11:31:53 CEST] <stevenliu> 62.50 fps
[11:32:31 CEST] <rabbe> yes, i use -r 60 to create the rtmp: ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 10000k -g 60 -f flv rtmp://192.168.0.16/live/test
[11:32:50 CEST] <rabbe> so i should use 62.5 when recording the rtmp?
[11:33:21 CEST] <stevenliu> no need
[11:33:29 CEST] <stevenliu> -c copy can do everything
[11:34:05 CEST] <rabbe> so the frame rate info when recording can be like > 100 fps?
[11:34:29 CEST] <stevenliu> BTW: -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 10000k cannot control the bitrate , you should set the -bufsize small
[11:34:59 CEST] <stevenliu> yes
[11:35:05 CEST] <rabbe> okay
[11:35:52 CEST] <stevenliu> ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 1600k -g 90 -r:v 30 -f flv rtmp://192.168.0.16/live/test
[11:36:22 CEST] <stevenliu> it will 3s one GOP, and the fps is 30
[11:37:52 CEST] <stevenliu> the video quality it very terrible ultrafast is too fast, but the quality is bad
[11:38:49 CEST] <stevenliu> if you don't care the quality, you can use it, if you care it, maybe insert some B slice is better, but the lantency maybe not good
[11:39:19 CEST] <stevenliu> you can assessment it
[11:39:41 CEST] <rabbe> no, please give me advice :)
[11:40:12 CEST] <rabbe> i want good quality, as long as it will work over network
[11:40:53 CEST] <stevenliu> medium will better, but it will cost lots of cpu cores, if you use soft encode
[11:41:09 CEST] <stevenliu> maybe 8 cores will be cost
[11:41:43 CEST] <rabbe> ok
[11:42:35 CEST] <stevenliu> GOP you can set 2s -g 60 -r:v 30
[11:43:00 CEST] <rabbe> but ok, you say i should first skip these? -b:v 5000k -minrate 5000k -maxrate 5000k
[11:43:19 CEST] <stevenliu> no
[11:44:16 CEST] <stevenliu> ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset medium -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 1600k -g 60 -bf 15 -r:v 30 -f flv rtmp://192.168.0.16/live/test
[11:44:49 CEST] <rabbe> -bufsize small == bufsize 1600k?
[11:45:17 CEST] <stevenliu> no
[11:46:13 CEST] <stevenliu> -bufsize 1600k?
[11:46:22 CEST] <stevenliu> control the buffer size of encoding
[11:46:35 CEST] <furq> fyi -minrate doesn't actually do anything with x264
[11:46:55 CEST] <rabbe> ok
[11:47:48 CEST] <beo> hello, i have a question, if i concatenate mp3 files with ffmpeg, does it reencodes them?
[11:47:59 CEST] <furq> also you don't have an audio stream so those audio options are pointless
[11:48:07 CEST] <furq> beo: not if you use -c copy
[11:48:49 CEST] <beo> right, ty
[11:49:12 CEST] <stevenliu> maybe that is not important now bufsize, really CBR cannot toooo large than the bitrate you set, maybe no decoder or transport network care that, if you use DVB, that is useful
[11:49:13 CEST] <rabbe> but i do get audio from the gopro, although not needed it can be nice to process it ok?
[11:49:24 CEST] <stevenliu> if just TCP, that is no matter
[11:50:55 CEST] <furq> rabbe: you'd need to capture the audio separately
[11:51:30 CEST] <rabbe> but it's included in the hdmi signal, isn't it?
[11:51:47 CEST] <furq> are you actually getting an audio stream
[11:52:39 CEST] <rabbe> i think so
[11:52:48 CEST] <rabbe> not able to test right now
[11:52:56 CEST] <beo> what does "-safe 0" do exactly?
[11:55:48 CEST] <rabbe> but this is your current suggestion? ffmpeg -r 60 -f v4l2 -video_size hd1080 -i /dev/video0 -c:a aac -ac 2 -b:a 128k -c:v libx264 -pix_fmt yuv420p -preset medium -tune zerolatency -x264-params "nal-hrd=cbr" -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 1600k -g 60 -bf 15 -r:v 30 -f flv rtmp://192.168.0.16/live/test
[11:56:12 CEST] <rabbe> then record with: ffmpeg -i rtmp://localhost/live/test -c copy /usr/local/nginx/html/video/output.ts ; ffmpeg -i output.ts -c copy output.mp4;
[11:57:06 CEST] <stevenliu> -bufsize 5000k
[11:57:28 CEST] <stevenliu> if you don't care the bitrate large ~ small ~ large
[11:58:07 CEST] <rabbe> i start recording in python by starting a process running "ffmpeg -i rtmp://localhost/live/test -c copy /usr/local/nginx/html/video/output.ts", then kill it and start a new process running "ffmpeg -i output.ts -c copy output.mp4;"
[11:58:14 CEST] <rabbe> okay
[11:58:19 CEST] <stevenliu> ok
[11:58:53 CEST] <rabbe> at this moment i just want it to work
[11:59:11 CEST] <rabbe> but customer is coming tomorrow, so there is some time to tweak
[11:59:11 CEST] <stevenliu> It should work :D
[11:59:15 CEST] <rabbe> :)
[11:59:35 CEST] <stevenliu> inner peace :D
[11:59:39 CEST] <rabbe> hehe
[11:59:49 CEST] <rabbe> *reading my mantra*
[11:59:55 CEST] <rabbe> now lunch
[12:00:15 CEST] <stevenliu> now dinner :D
[12:00:23 CEST] <rabbe> cheers :)
[12:04:47 CEST] <beo> im getting "Invalid input file index 1 while processing metadata maps" on "ffmpeg -f concat -safe 0 -i mylist.txt -c copy -map_metadata 1 output.mp3" can someone tell me why?
[12:08:10 CEST] <beo> it works with -map_metadata 0 and output file seems fine, but there are many of these warnings during concatenation -> https://puu.sh/xUy0o/20d0e55fc0.png
[12:15:14 CEST] <beo> hm probably nothing to worry about
[13:15:26 CEST] <rabbe> where can i use faststart? where i'm creating the flv over rtmp or where i'm recording the rtmp to .ts or when i convert .ts to mp4?
[13:16:25 CEST] <rabbe> i would like to cut down the time before start recording the rtmp
[13:19:11 CEST] <BtbN> movflags faststart are for mov/mp4 files.
[13:19:28 CEST] <BtbN> And it has nothing to do with that.
[13:19:33 CEST] <rabbe> ok
[13:20:19 CEST] <rabbe> the ffmpeg command to start recording the rtmp, can it start faster after listing the codecs and stuff?
[13:21:09 CEST] <BtbN> it will start as soon as it gets data, not sure what you mean.
[13:21:27 CEST] <rabbe> ok
[13:21:46 CEST] <BtbN> Why not just instruct nginx to record itself?
[13:21:52 CEST] <BtbN> Putting ffmpeg into there seems unneccesary
[13:22:35 CEST] <rabbe> because the rtmp created will be running all the time, whereas i only want to record at specific times
[13:23:42 CEST] <BtbN> So use the controls it has to toggle the recording.
[13:24:21 CEST] <rabbe> hm, okay.. can that convert the stream to some suitable format?
[13:24:33 CEST] <BtbN> It will just dump the flv which rtmp essentially is
[13:24:50 CEST] <rabbe> we do want to have some way of knowing if we're recording or not
[13:25:37 CEST] <BtbN> https://github.com/arut/nginx-rtmp-module/wiki/Control-module
[13:46:26 CEST] <beo> https://trac.ffmpeg.org/wiki/Concatenate how to avoid problems if filename in mylist.txt contains "'" ?
[13:46:48 CEST] <BtbN> escape the '
[13:47:28 CEST] <BtbN> f = f.replace("'", "'\\''")
[13:50:46 CEST] <beo> in a bat-file?
[13:50:47 CEST] <beo> ok
[13:53:34 CEST] <BtbN> That's python, but probably works similar in a lot of languages.
[13:56:19 CEST] <rabbe> using this to get the rtmp: ffmpeg -i rtmp://192.168.0.16/live/test -c copy /usr/local/nginx/html/video/output.ts gets me error: https://pastebin.com/AzrymAru
[15:02:33 CEST] <_julian> it appears my problem is caused by the aac_latm parser splits packets into smaller ones (probably audio frames), but does not insert pts on the new packets...
[15:03:12 CEST] <_julian> I'm just wondering why, when find_stream_info was called the packets which are fed to the parser are already exactly at frame sizes and each has a pts.
[15:14:45 CEST] <fristonio> hey there i am new to ffmpeg development community and would like to work on some beginner issues, any help would be appreciated
[15:16:05 CEST] <DHE> fristonio: got any itches that need scratching? (as the saying goes)
[15:16:15 CEST] <DHE> though first thing would be to read the contributing guide on the web site
[15:21:23 CEST] <fristonio> I have gone through contributing guide, just need some beginner issues to work upon
[15:26:46 CEST] <DHE> had any problems or complaints of your own?
[17:11:16 CEST] <NapoleonWils0n> hi all
[17:12:02 CEST] <NapoleonWils0n> im just wondering how the timeout option works
[17:12:32 CEST] <NapoleonWils0n> is it possible to get ffmpeg to try record for 20 seconds before it quits
[17:13:15 CEST] <NapoleonWils0n> trying to record stream that is a bit flaky and thought i could get ffmpeg to try recording for say 20 seconds before it gives up
[17:26:47 CEST] <Alex__> I have a small inssue compling ffmpeg on centos 7.4 : Update for 3.2.8 or earlier commits, i am able to ./configure without an issue, allthough when i make i get the following error:
[17:27:35 CEST] <Alex__> error: /usr/include/bits/mathdef.h:28:1: error: expected , or ; before typedef typedef float float_t; /* `float' expressions are evaluated as `float'. */
[17:29:03 CEST] <Alex__> gcc -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I./compat/float -I./compat/atomics/gcc -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c11 -fomit-frame-pointer -pthread -D_REENTRANT -I/usr/include/SDL2 -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-in
[17:29:20 CEST] <Alex__> -body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized -MMD -MF libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o libavdevice/alldevices.o libavdevice/alldevices.c
[17:29:34 CEST] <Alex__> In file included from /usr/include/math.h:46:0, from ./libavutil/common.h:36, from ./libavutil/avutil.h:296, from ./libavutil/log.h:25, from libavdevice/avdevice.h:48, from libavdevice/alldevices.c:23: /usr/include/bits/mathdef.h:28:1: error: expected , or ; before typedef typedef float float_t; /* `float' expressions are evaluate
[17:30:04 CEST] <Johnjay_> Okay I admit there is a use for pastebin
[17:30:36 CEST] <Alex__> https://pastebin.com/ZgrAXmT1
[17:32:39 CEST] <Johnjay_> well Alex I compiled the latest snapshot just fine on msys2
[17:32:49 CEST] <Johnjay_> so maybe try that?
[17:33:26 CEST] <Alex__> msys2?
[17:33:44 CEST] <Johnjay_> linux build environment for windows
[17:34:50 CEST] <Alex__> ah, i am tryin to get it to work on centos 7.4
[17:35:02 CEST] <Alex__> i dont have an issue compling on centos 7.3
[17:35:12 CEST] <Johnjay_> ok... so did you download the latest snapshot?
[17:35:42 CEST] <Alex__> latest release 3.2
[17:37:16 CEST] <Alex__> i will try with https://github.com/FFmpeg/FFmpeg/tree/release/3.3
[17:41:18 CEST] <Alex__> nope same issue
[17:42:52 CEST] <Johnjay_> well maybe furq or JEEB can figure it out then
[17:43:16 CEST] <Johnjay_> what gcc version do you have at least?
[17:43:40 CEST] <Alex__> one sec, rebooting system
[17:44:06 CEST] <Alex__> gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
[18:28:01 CEST] <lethalwp> i'm trying to play an UHD-HEVC.mkv file with mpv on recent ffmpeg with open source amdgpu. But it always fallback to software decoding, do you know if there's a way to hardware decode yuv420p10? it worked last year before some yet unknown ffmpeg changes
[18:28:26 CEST] <BtbN> Is that vaapi?
[18:28:35 CEST] <lethalwp> tried vaapi & vdpau
[18:28:48 CEST] <BtbN> I didn't know those even had software fallback
[18:29:10 CEST] <lethalwp> it's mpv or ffmpeg that fallbacks on software decode
[18:29:27 CEST] <BtbN> try with ffmpeg cli directly.
[18:30:01 CEST] <BtbN> I'm not sure if vaapi and/or vdpau even support 10 bit at all though
[18:30:16 CEST] <jkqxz> Support was only added to mesa at the beginning of this year, so it working before seems slightly unlikely.
[18:30:38 CEST] <jkqxz> It should work now with VAAPI on GCN 4/5 (Polaris or Vega).
[18:30:59 CEST] <jkqxz> If it doesn't, paste an ffmpeg log somewhere.
[18:32:34 CEST] <lethalwp> last year i've added some trivial #HWVAAPI patch to ffmpeg and it worked. I now see they changed a lot of code. But i run llvm-git-copr. So trying to pinpoint why it doesn't work
[18:42:55 CEST] <lethalwp> jkqxz: my actual ffmpeg command line to test is : # FFREPORT="level=32" ./ffmpeg -vaapi_device /dev/dri/renderD128 -i /home/lethalwp/hevcds_2160p60_Main10_20M.mp4 -f null - nothing in the logs shows if it uses hw decoding or cpu
[18:43:08 CEST] <lethalwp> (it does open va libraries)
[18:44:35 CEST] <jkqxz> That doesn't tell it to use the device for anything.
[18:54:42 CEST] <lethalwp> jkqxz: i got it, in an earlier mpv version: hwdec=vaapi + vo opengl worked in hardware decode. Now it has to ba hwdec&vo=vaapi ... so it changed but still works :)
[18:58:42 CEST] <jkqxz> -vo=vaapi is really a test output, though it's mostly usable if you don't mind colours being wrong.
[19:01:09 CEST] <jkqxz> GL support via vaapi-copy works now, support via interop for Mesa is pending.
[00:00:00 CEST] --- Wed Oct 11 2017
More information about the Ffmpeg-devel-irc
mailing list