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

burek burek021 at gmail.com
Wed May 23 03:05:01 EEST 2018


[00:33:25 CEST] <vlt> Hello. How can I use ffmpeg to grab the video data from /dev/video0 on host A and make it available to another ffmpeg instance on a remote host B?
[00:34:35 CEST] <vlt> I want low CPU consumption on host A while network bandwidth should not be a problem.
[00:44:27 CEST] <kerio> "make it available" how
[00:46:33 CEST] <kerio> i'd say ffmpeg -f v4l2 -framerate whatever -video_size whatever -pixel_format whatever -i /dev/video0 -c:v copy -f nut -write_index 0 tcp://0.0.0.0:12345?listen=1
[00:51:26 CEST] <Cracki> send uncompressed frames?
[00:51:51 CEST] <klaxa> >network bandwidth should not be a problem.
[00:54:08 CEST] <kerio> i'm not aware of a "dumber" protocol other than mpegts with compatible codecs
[00:54:27 CEST] <kerio> then again, there's not much weirdness that can come out of a v4l2 device
[00:54:36 CEST] <furq> kerio: remember -f nut defaults to mpeg4
[00:54:52 CEST] <kerio> furq: remember that i wrote -c:v copy
[00:54:55 CEST] <furq> oh so you did
[00:55:10 CEST] <kerio> i did
[00:55:13 CEST] <kerio> get rekt
[00:55:13 CEST] <furq> still if it's just video i'd probably use y4m
[00:55:16 CEST] <furq> that's the simplest thing possible
[00:55:21 CEST] <kerio> wasdat
[00:55:35 CEST] <furq> https://wiki.multimedia.cx/index.php/YUV4MPEG2
[00:55:45 CEST] <kerio> fair
[00:56:06 CEST] <kerio> can i go one step further and suggest rawvideo
[00:56:26 CEST] <kerio> ok real talk tho
[00:56:33 CEST] <kerio> add a -vsync passthrough at the beginning of the command line
[00:56:35 CEST] <kerio> and maintain the timestamps
[00:56:35 CEST] <furq> actually idk if y4m is suitable for network streaming
[00:56:46 CEST] <furq> probably just use mpegts
[00:56:53 CEST] <kerio> ...except that the timestamps are based on the monotonic clock of the first box so they're pretty useless on the second one
[00:59:06 CEST] <JEEB> if you need raw+timestamps
[00:59:15 CEST] <JEEB> then I recommend NUT. FFmpeg can read and write it
[00:59:23 CEST] <JEEB> and it's a streaming container
[00:59:25 CEST] <JEEB> IIRC
[00:59:30 CEST] <JEEB> like MPEG-TS
[01:13:40 CEST] <kerio> it's nuts
[01:13:51 CEST] <kerio> ( a° \– a°)
[01:15:56 CEST] <Cracki> >nut
[01:16:15 CEST] <Cracki> I haven't seen innuendo in this channel before
[01:32:39 CEST] <furq> Cracki: just don't ask about subtitles
[01:33:02 CEST] <Cracki> sounds like something kinky
[01:34:27 CEST] <Cracki> oh btw, how do I "transplant" metainfo such as "this is rec 709"? I do some custom stuff outside of ffmpeg, but in the end I'd like to copy over the attributes of the source. only resolution changes (I'm doing a kind of cropping).
[01:35:00 CEST] <Cracki> I wanna make sure the video editing software (premiere) sees the data to be the right color space, not whatever it guesses from 640x810
[01:35:25 CEST] <Cracki> (input and output is h.264)
[01:37:52 CEST] <furq> there's no way to copy it, you'd have to pull it from ffprobe first
[01:38:09 CEST] <Cracki> that's ok
[01:38:24 CEST] <Cracki> just need some keywords to search for
[01:38:33 CEST] <furq> then iirc -colorspace bt709 -color_trc bt709 -color_primaries bt709
[01:38:39 CEST] <Cracki> hm that was easy
[01:38:47 CEST] <Cracki> thx
[01:38:48 CEST] <furq> depends on the encoder though
[01:38:52 CEST] <furq> x264 definitely supports those
[01:39:28 CEST] <Cracki> good enough
[01:39:32 CEST] <furq> you can also edit it while remuxing in h264 with -bsf:v h264_metadata
[01:39:46 CEST] <Cracki> oh, depends on encoder? any way to remux a file and add the info then?
[01:39:48 CEST] <Cracki> ah ok
[01:39:54 CEST] <Cracki> bsf are nice
[01:40:01 CEST] <furq> !bsf h264_metadata
[01:40:01 CEST] <nfobot> furq: http://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata
[01:40:46 CEST] <furq> that's new in 3.4 or 4.0 iirc
[04:11:00 CEST] <aszlig> furq: okay, got the encoder for the intermediate format working so far, however it seems that pts seems to be codec-specific...
[04:11:15 CEST] <aszlig> so here is the code: https://gist.github.com/aszlig/c25e531734476e3496be2e85797d08d8
[04:12:07 CEST] <aszlig> when encoding to mpeg4/avi everything works as expected, but if i use vp9/webm the frame timing is incorrect
[04:13:47 CEST] <aszlig> a workaround for this would be to duplicate each frame until i get the expected duration
[04:14:07 CEST] <aszlig> so is this really a workaround or is this what i'm supposed to do?
[04:15:03 CEST] <aszlig> or is there a way to encode pts in a codec-agnostic way?
[04:16:40 CEST] <aszlig> i dug around in different sites and mailing list threads but so far i have only found outdated information or weird threads with either no real answers or the thread going entirely off-topic
[04:17:25 CEST] <kepstin> all codecs in ffmpeg should have basically the same pts handling, I'm guessing that if you're running into problems it might be due to the container?
[04:17:49 CEST] <kepstin> tbh, i'm not very familiar with libavformat :/
[04:21:26 CEST] <kepstin> the ffmpeg mkv/webm muxer uses a fixed 1/1000 timebase, but I thought (i might be wrong?) that there was something in libavformat to convert from your stream timebase automatically.
[04:22:14 CEST] <aszlig> kepstin: oh, wait... fixed timebase...
[04:22:24 CEST] <kepstin> if it's working, the pts values in your webm output should be going up by 16/17 every frame to be 60fps.
[04:22:28 CEST] <aszlig> kepstin: that means, that the timebase really is codec-specific, right?
[04:22:55 CEST] <aszlig> kepstin: well, they're varying
[04:22:56 CEST] <kepstin> format specific, not codec specific. Some formats support arbitrary (or nearly so) timebases, some are fixed
[04:23:47 CEST] <kepstin> 60fps in 1/1000 timebase is 16.66 repeated pts increments, so there's some rounding that has to happen
[04:23:49 CEST] <aszlig> like for example 20 120 312 333 ...
[04:24:27 CEST] <aszlig> kepstin: so you're saying that pts should always be incremented in time_base steps?
[04:24:47 CEST] <kepstin> that's really variable, that's kind of odd.
[04:25:19 CEST] <kepstin> the way pts works is that if you multiply pts by the time base fraction, you get the frame time in seconds.
[04:25:38 CEST] <aszlig> the input i'm getting is basically screen changes along with a timestamp in nanoseconds of the time where the screen change has happened
[04:26:00 CEST] <kepstin> hmm, so it's vfr, not fixed times then?
[04:26:06 CEST] <aszlig> yep
[04:26:15 CEST] <kepstin> if so, it all seems to be working as expected?
[04:26:24 CEST] <kepstin> note that avi doesn't support vfr, so it's kinda weird.
[04:26:25 CEST] <aszlig> kepstin: only with avi
[04:26:52 CEST] <kepstin> webm does natively support vfr, so each frame should be getting appropriate pts values for the variable time between frames
[04:26:56 CEST] <kepstin> it's all working like it should.
[04:28:48 CEST] <aszlig> here is a sample of the resulting videos:
[04:29:03 CEST] <aszlig> https://redmoonstudios.org/~aszlig/fdbc/test.avi
[04:29:06 CEST] <aszlig> https://redmoonstudios.org/~aszlig/fdbc/test.webm
[04:29:50 CEST] <aszlig> both encoded with the same source posted above
[04:31:37 CEST] <kepstin> why are you using a 1/60 timebase, anyways? if you're doing vfr stuff with timestamps from a clock, you should probably use something like AV_TIME_BASE (1/1000000 aka microseconds) to make calculations a bit easier
[04:32:05 CEST] <aszlig> so if the avi doesn't support vfr, then ffmpeg maybe does some magic and duplicates frames?
[04:33:03 CEST] <kepstin> iirc: ffmpeg uses the framerate you've set on the context, and drops frames that are too fast, and inserts null frames to fill in gaps to do a sort of pseudo-vfr
[04:33:12 CEST] <kepstin> avi is weird and old
[04:33:14 CEST] <kepstin> it's all hacks
[04:33:17 CEST] <aszlig> kepstin: i did use that while testing and getting a webm file where mpv reported 1000 fps
[04:33:29 CEST] <kepstin> please don't use it, particularly for modern codecs like h264 :)
[04:33:39 CEST] <aszlig> kepstin: well, i don't intend to
[04:33:50 CEST] <kepstin> if you have a vfr mkv file, tools will likely not be able to determine a framerate, yes
[04:34:02 CEST] <aszlig> that's why i'm trying to fix the timing issues with webm
[04:34:51 CEST] <aszlig> kepstin: okay, so mpv displaying 1000 fps should be fine, great :-)
[04:35:24 CEST] <kepstin> it looks like you're not setting the pts values correctly somewhere, yeah, that webm does play back much faster than real time. hmm.
[04:36:10 CEST] <kepstin> i'd guess it's an issue in how you're calculating the pts from your input timestamp
[04:37:02 CEST] <kepstin> i dunno why the avi plays back realtime tho, assuming that code's the same for both
[04:38:29 CEST] <kepstin> are both your examples from the exact same source/input video?
[04:39:03 CEST] <aszlig> they are
[04:39:28 CEST] <aszlig> and this is why i assumed that the pts is correct because it oddly works for the avi
[04:40:31 CEST] <kepstin> so the pts values in the avi and mkv are the same for matching frames
[04:41:00 CEST] <kepstin> which is wrong, in the mkv they should be much larger to compensate for the difference in timebase
[04:41:18 CEST] <aszlig> https://redmoonstudios.org/~aszlig/fdbc/testinput.xz <- this is the input data for those two samples
[04:41:54 CEST] <kepstin> so i dunno what's up, but for some reason the timestamps aren't being converted from the 1/60 of your stream timebase to the 1/1000 of the mkv/webm timebase
[04:42:01 CEST] <aszlig> kepstin: what do you mean by "the same" for matching frames?
[04:43:19 CEST] <aszlig> ah, you mean in relation to the timebase
[04:43:28 CEST] <kepstin> the first 4 frames in both videos have pts values 0, 1, 3, 4. So in the avi, that's 0*1/60, 1*1/60, 3*1/60, 4*1/60. In the mkv, that's 0*1/1000, 1*1/1000, 3*1/1000, 4*1/1000
[04:43:36 CEST] <alyssa> Is it possible to build *just* ffplay, linking against the (Debian) system ffmpeg rather than compiling all the libs?
[04:43:43 CEST] <kepstin> so obviously the mkv will play back about 16 times faster
[04:44:15 CEST] <aszlig> kepstin: which seems to be happening here
[04:44:21 CEST] <aszlig> hmm...
[04:45:02 CEST] <aszlig> kepstin: so in some way the time_base hasn't been converted correcly, or is that something i need to do for the corresponding format?
[04:45:02 CEST] <kepstin> alyssa: the build system doesn't support linking tools to external ffmpeg libs, but if you build an ffplay from a matching ffmpeg version which is configured the same way it'll probably work with the system libraries.
[04:45:18 CEST] <kepstin> alyssa: still not generally recommended tho, imo.
[04:46:30 CEST] <kepstin> aszlig: unfortunately, i'm not familiar enough with the libavformat api to tell you where it's going wrong
[04:46:59 CEST] <alyssa> kepstin: okay.... was really not looking forward to rebuilding all of ffmpeg (which I assume is time consuming given the sheer number of codecs, etc support)
[04:48:24 CEST] <aszlig> kepstin: no problem, at least i now know where i should dig into, so thanks a lot :-)
[04:50:17 CEST] <kepstin> aszlig: I suspect you're gonna need a `av_packet_rescale_ts(packet, avcodeccontext->time_base, avstream->time_base);`
[04:50:31 CEST] <kepstin> in before you send the avpacket to the muxer
[04:52:04 CEST] <aszlig> you mean after avcodec_receive_packet?
[04:52:13 CEST] Action: alyssa decides ffplay is unbuildable :p
[04:52:27 CEST] <kepstin> aszlig: yeah
[04:53:05 CEST] <kepstin> alyssa: I though debian had ffplay packaged tho, so this is kinda odd
[04:53:21 CEST] <alyssa> kepstin: it does, I want to hack on it though (without touching the rest of the lib)
[04:53:50 CEST] <kepstin> alyssa: if you want to hack on it (particularly if you want to contribute upstream), you should be starting from git master anyways
[04:54:10 CEST] <kepstin> alyssa: and building the libs is a one-time thing, after that it'll only rebuild stuff that changed (i.e. ffplay itself)
[04:54:28 CEST] <alyssa> fair enough
[04:58:26 CEST] <aszlig> kepstin: i've seen av_packet_rescale_ts mentioned a few times, but thought it won't be necessary because i'm setting the time_base for the stream myself
[04:59:22 CEST] <kepstin> you can set a suggested timebase, iirc, but the format can choose to ignore it
[04:59:30 CEST] <kepstin> aszlig: from the docs! "May be set by the caller before avformat_write_header() to provide a hint to the muxer about the desired timebase. In avformat_write_header(), the muxer will overwrite this field with the timebase that will actually be used for the timestamps written into the file (which may or may not be related to the user-provided one, depending on the format). "
[05:00:41 CEST] <aszlig> kepstin: yep, just stepped through with gdb and found out about it myself :-/
[05:01:28 CEST] <aszlig> but yeah, that at least resolves my problem and also gets rid of a few lines of code, yay :-)
[05:01:41 CEST] <aszlig> thanks a lot again =)
[05:03:20 CEST] <kepstin> note that once you've done this change, you can set the timebase of your stuff to whatever you like internally, even use something like AV_TIME_BASE (1/1000000 aka microseconds) to make time calculations easier, if you like.
[05:04:11 CEST] <kepstin> although it looks like you're doing something in your code to make it so the max framerate is 60fps? if so, maybe just stick with 1/60 to make that easier :)
[05:04:42 CEST] <aszlig> kepstin: nah, ideally i don't want to set the framerate at all
[05:05:04 CEST] <aszlig> i only did that as a workaround
[05:05:59 CEST] <kepstin> the only thing you should be careful about is making sure that once the pts values are converted to the format's timebase, you don't have two frames with the same pts.
[05:06:20 CEST] <kepstin> this isn't often an issue with mkv, since it's unlikely you'll get two frames within the same ms :)
[05:07:17 CEST] <aszlig> kepstin: i already took care of that in the first place: https://gist.github.com/aszlig/c25e531734476e3496be2e85797d08d8#file-encode-c-L354-L355
[05:08:34 CEST] <kepstin> aszlig: but that's checking in the codec timebase, not in the stream (format) timebase :)
[05:08:57 CEST] <kepstin> either way, unlikely to be a problem
[05:10:04 CEST] <aszlig> kepstin: oh, right... nice catch =)
[05:10:50 CEST] <kepstin> (it'll only ever be a problem if your codec timebase is much smaller than the stream timebase, which probably won't happen unless you use a really big denominator like, uh, AV_TIME_BASE)
[05:11:29 CEST] <kepstin> and even then, with e.g. mkv/webm it's not an issue unless you have frames <1ms apart.
[05:12:16 CEST] <aszlig> i need to refactor that part anyway, because right now i'm dropping those frames, but what i really want in the end is update to the latest state (aka: "last" instead of "head" for same-time frames)
[05:12:50 CEST] <kepstin> heh, that's fun code to write
[05:13:24 CEST] Action: kepstin wrote code to do that recently when he updated the fps filter to the newer filter api :/
[05:21:30 CEST] <aszlig> kepstin: well, in my case it shouldn't be that difficult, right? just writing frame data and sending it only whenever there is a time difference in the next packet or it's the last packet
[05:23:29 CEST] <aszlig> because i need to write frame data anyway, because they're deltas
[05:27:02 CEST] <kepstin> yeah, should be pretty simple then
[05:27:45 CEST] <kepstin> if (!(new_pts > prev_pts)) continue; // or so :)
[05:34:39 CEST] <alyssa> :tada: everything is working as expected
[05:34:45 CEST] <alyssa> kepstin: thanks! :)
[05:35:10 CEST] <aszlig> oh, forgot to mention ;-)
[05:35:20 CEST] <aszlig> kepstin: everything is working as expected for me too =)
[05:35:30 CEST] Action: alyssa high-fives aszlig 
[05:35:34 CEST] <aszlig> so rescale_ts did the trick
[05:38:58 CEST] <fa0> Hello
[05:40:05 CEST] <fa0> Using tools like mkvtoolnix and handbrake, I do some stuff with, I see sometimes the Audio tracks shows as Unknown/Undetermined
[05:40:26 CEST] <fa0> I'm trying to have then listed with English for the moment, and thought this would work, but not having success;
[05:40:39 CEST] <fa0> ffmpeg -i "$i" -c:v copy -c:a libmp3lame -b:a 114k -metadata:s:a:0 language=eng output.mp4
[05:41:43 CEST] <fa0> disregard "$i" I use the cmd in a script file, it really reads as thisl
[05:41:53 CEST] <fa0> urxvt -g 120x32 -e ffmpeg -i "$i" -c:v copy -c:a libmp3lame -b:a 114k -metadata:s:a:0 language=eng "$OUTPUT/${i%.*}.avi"
[05:47:12 CEST] <aszlig> kepstin: haha... "timebase 1/1000000000 not supported by MPEG 4 standard" :-D
[05:48:48 CEST] <kepstin> heh, yeah, that's probably a thing :)
[05:49:51 CEST] <aszlig> kepstin: well, i thought i could just directly use nanoseconds as time base, but that's probably too much for some codecs
[05:50:39 CEST] <kepstin> yeah, most of the ffmpeg internal stuff doesn't go any smaller than microseconds
[06:23:55 CEST] <fa0> The DOCs say this; To set the language of the first audio stream:
[06:23:57 CEST] <fa0> ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
[06:24:21 CEST] <fa0> but when I run ffprobe -i file the lang is not show on the first audio stream... hmm
[06:24:47 CEST] <fa0> Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 114 kb/s
[06:25:31 CEST] <fa0> On an mp4 video with aac ffprobe shows it like this;
[06:25:34 CEST] <fa0> Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
[06:26:04 CEST] <fa0> So I was assuming with this cmd, the mp3 would show the same as Stream #0:1(eng):?
[06:27:11 CEST] <fa0> I also ran it as; -metadata:s:a:1 language=eng OUTPUT
[06:27:18 CEST] <fa0> anyone, any thoughts here?
[06:40:04 CEST] <fa0> If anyone is breathing, I added in -map 0 but still not working;
[06:40:05 CEST] <fa0> urxvt -g 120x32 -e ffmpeg -i "$i" -map 0 -c:v copy -c:a libmp3lame -b:a 114k -metadata:s:a:0 language=eng "$OUTPUT/${i%.*}.avi"
[06:40:45 CEST] <fa0> When I start the encode, the output in the term shows it as Stream #0:1(eng) so I don't get why ffprobe after the encode is over shows nothing?
[06:41:06 CEST] Action: fa0 bangs head
[06:42:15 CEST] <fa0> Ahh AVI doesn't support language metadata, or is this just a ffmpeg thing?
[07:07:19 CEST] <wfbarksdale> what you tryina do fa)
[07:07:23 CEST] <wfbarksdale> fa0
[07:08:41 CEST] <fa0> wfbarksdale: hi, add a language to an audio stream, which I thought was suppose to be --> -metadata:s:a:0 language=eng
[07:09:50 CEST] <fa0> When I start encoding it the output in the term will show as; Stream #0:1(eng), but I check it when done with ffprobe it just shows then as Stream #0:1
[07:13:59 CEST] <wfbarksdale> mp4?
[07:16:24 CEST] <fa0> avi
[07:17:54 CEST] <fa0> wfbarksdale: I read something online that avi doesn't support language meta tagging, so not sure...
[07:18:19 CEST] <wfbarksdale> literally know nothing about the AVI container, sorry man
[07:18:26 CEST] <wfbarksdale> but yeah, that might be right
[07:18:29 CEST] <wfbarksdale> heard it sucks
[07:19:05 CEST] <wfbarksdale> maybe find the spec for AVI container online and do some control+f on it?
[07:20:04 CEST] <wfbarksdale> if AVI is not required you might try converting to mp4 then try your commands
[07:21:55 CEST] <fa0> with mkvmerge gui I can easily do it, but seems silly to mux some crappy avi to mkv... hmm
[07:22:15 CEST] <fa0> yeah let me also try them as mp4
[07:23:30 CEST] <wfbarksdale> are you trying to embed both audios in the same file?
[07:30:40 CEST] <fa0> wfbarksdale:  embed both? There's only one audio stream and it's listed as und/unknown, just trying to tag the audio tracks as 'eng' is all...
[07:30:55 CEST] <wfbarksdale> ahh
[07:31:08 CEST] <wfbarksdale> i thought you where trying to embed a second audio stream
[07:31:29 CEST] <wfbarksdale> well, still, it may be that the tag only works in mp4 container
[07:31:39 CEST] <wfbarksdale> the AVI container spec would confirm or deny this
[07:33:05 CEST] <fa0> ok
[07:33:07 CEST] <wfbarksdale> sorry you just got this guy <---- here helping you, typically peeps here are very generous with helping out
[07:33:21 CEST] <fa0> trying to find that cmd I read earlier for the avi
[07:33:22 CEST] <fa0> LOL
[07:34:30 CEST] <fa0> Ahh found it;
[07:34:31 CEST] <fa0> https://superuser.com/questions/783895/ffmpeg-edit-avi-metadata-and-audio-track-naming
[07:34:50 CEST] <fa0> Look at the last comment... Took quite a long time for me to figure this out...
[07:35:00 CEST] <fa0> -metadata IAS1=eng
[07:35:34 CEST] <fa0> Not sure, I tried, but didn't seem to work...
[07:39:11 CEST] <fa0> Sounds like a good mouth full but it no workie LOL
[07:39:15 CEST] <fa0> hmm
[07:42:27 CEST] <fa0> wfbarksdale: mp4 works...
[07:42:35 CEST] <fa0> urxvt -g 120x32 -e ffmpeg -i "$i" -map 0 -c:v copy -c:a copy -metadata:s:a:0 language=eng "$OUTPUT/${i%.*}.mp4"
[07:42:39 CEST] <wfbarksdale> noice, hi five!
[07:43:19 CEST] <fa0> now, does just copying the avi to an mp4 like this in ffmpeg really convert it to an mp4?
[07:43:22 CEST] <wfbarksdale> mp4 is very flexible
[07:43:34 CEST] <fa0> -c:v copy -c:a copy
[07:43:45 CEST] <wfbarksdale> does it play correctly?
[07:44:12 CEST] <fa0> yes
[07:44:47 CEST] <wfbarksdale> like i said, i know nothing about AVI, but my understanding is that the codec copy should work just fine
[07:45:31 CEST] <fa0> I meant, what I was asking, when I look online to convert from one container to another it's simply this;
[07:45:34 CEST] <fa0> ffmpeg -i infile.avi youroutput.mp4
[07:46:03 CEST] <wfbarksdale> it seems like that would work
[07:46:14 CEST] <wfbarksdale> whats the codec of your avi
[07:46:18 CEST] <fa0> yeah that's what everywhere
[07:46:55 CEST] <wfbarksdale> could you paste me the ffprobe output from your AVI?
[07:46:59 CEST] <TheAMM> copy reminds me, is there a way to remux an mkv (ie -c copy) with video + multiple audio channels without looking at the file beforehand?
[07:47:15 CEST] <fa0> ffprobe shows;  Stream #0:0(und): Video: msmpeg4v3
[07:47:30 CEST] <TheAMM> I mean tracks, ffmpeg -i many_tracks.mkv -c copy remuxed.mkv loses the additional audio tracks
[07:47:32 CEST] <wfbarksdale> msmepg4v3 is not something i am familiear wtih
[07:47:40 CEST] <wfbarksdale> is that microsfot mpeg 4x3 aspect ratio?
[07:47:55 CEST] <fa0> http://dpaste.com/3NHBTPA
[07:48:05 CEST] <fa0> me too, not sure hehe
[07:49:04 CEST] <wfbarksdale> yeah,video size reduces to 4x3
[07:49:31 CEST] <fa0> hmm some hack; http://www.undercut.org/msmpeg4/
[07:49:33 CEST] <wfbarksdale> erm
[07:50:31 CEST] <fa0> It's an old TV show Allo Allo; https://en.wikipedia.org/wiki/%27Allo_%27Allo!
[07:50:57 CEST] <wfbarksdale> so like whats your status now?
[07:51:13 CEST] <fa0> so the rips are quite old avi 600x400 rez LOL
[07:51:27 CEST] <wfbarksdale> you converted the container to mp4, and then then labeling the audio stream (eng) worked with your commands?
[07:51:30 CEST] <wfbarksdale> are you done then?
[07:51:32 CEST] <fa0> status? Yeah it works showing eng
[07:51:42 CEST] <wfbarksdale> noice!
[07:51:51 CEST] <fa0> If you look at line 11 on that dpaste.com
[07:51:57 CEST] <fa0> Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 114 kb/s (default)
[07:52:15 CEST] <fa0> yeah all good now
[07:52:24 CEST] <wfbarksdale> awesome
[07:52:29 CEST] <wfbarksdale> yeah, so it just copied the codec
[07:52:42 CEST] <fa0> SO I guess in the future, someone comes asking, convert avi to mp4 and use in your cmds;
[07:52:49 CEST] <fa0> -map 0 -metadata:s:a:0 language=eng
[07:53:20 CEST] <wfbarksdale> yeah, not sure if its required for your use case, but I would re-encode the video to h264
[07:53:35 CEST] <fa0> I just ran this cmd one time is all to do everything;
[07:53:37 CEST] <fa0> urxvt -g 120x32 -e ffmpeg -i "$i" -map 0 -c:v copy -c:a copy -metadata:s:a:0 language=eng "$OUTPUT/${i%.*}.mp4"
[07:54:04 CEST] <fa0> Hmm h264, well I've played the videos on the computer ok, and ran on the TV too
[07:54:25 CEST] <fa0> IF in the future won't play, I'll convert then,,, thanks
[07:55:12 CEST] <wfbarksdale> ^ makes sense, gl hf, your drunk friend  - wfbarks
[07:55:54 CEST] <fa0> wfbarksdale: hey, in case you want a simple way to run ffmpeg from a term and also batch do a lot of videos at once;
[07:55:56 CEST] <fa0> http://dpaste.com/0YSJ09R
[07:56:23 CEST] <fa0> I just got this simple little script and I run all my various cmds in it, to do all the rips/encodes, etc...
[07:56:40 CEST] <fa0> uncomment one cmd, then comment out another and away ya go... :P
[07:56:41 CEST] <wfbarksdale> ahh cool
[07:56:43 CEST] <wfbarksdale> thanks!
[07:57:12 CEST] <wfbarksdale> only worked with videos that play on the interwebs and in apps, so mp4 + h264 is my jam
[07:57:53 CEST] <fa0> The other day, got these Babylon 5 rips, but they are all h265, won't play on the TV, so I converted them all h264, put like 22 files in the Video directory, ran the script and sat back while it converted them all
[07:57:53 CEST] <fa0> hehe
[07:58:24 CEST] <fa0> just be sure to make like ffmpeg.sh script and make executable...
[07:58:55 CEST] <fa0> I set it up with my term as; urxvt -g 120x32 so it pops up on the desktop and I can see it running...
[07:59:44 CEST] <fa0> I have it also setup as a Menu launcher LOL
[08:00:15 CEST] <fa0> I just click ffmpeg in my menu and away she goes...
[08:10:39 CEST] <fa0> wfbarksdale: h264 with mp3 LOL
[08:10:55 CEST] <fa0> mp3 seemed to be the order of the day many many years ago....
[08:11:41 CEST] <wfbarksdale> mp4 container
[08:11:44 CEST] <wfbarksdale> not mp3 audio
[08:12:05 CEST] <wfbarksdale> AAC audio
[08:12:28 CEST] <wfbarksdale> outside of those things i'm a n00b
[08:12:55 CEST] <fa0> I was just saying, these old avi are using mp3 :P
[08:13:02 CEST] <wfbarksdale> oh yeah
[08:13:05 CEST] <wfbarksdale> i saw that
[08:13:13 CEST] <wfbarksdale> definitely some hackery haha
[08:13:16 CEST] <fa0> divx and mp3 baby WoOt
[08:13:18 CEST] <fa0> lol
[08:13:24 CEST] <wfbarksdale> some old MPEG codec and MP3
[08:13:36 CEST] <fa0> I've never seen before
[10:03:12 CEST] <vlt> Hello. Is there a way to reduce latency when running "ffmpeg -i /dev/video0 -c:v copy -f nup tcp://..."?
[10:53:23 CEST] <Brian_> hi guys, i successfully compiled ffmpeg 3.4.1 for Android. But when I try with ffmpeg 4.0.0 i suddenly get <library> not found using pkg-config errors. logfile: https://pastebin.com/eF7N0xaq
[10:53:54 CEST] <Brian_> did anything change in ffmpeg 4.0 regarding compilation?
[10:57:27 CEST] <poutine> looks to me like you don't have a libvorbis compiled for android
[11:01:03 CEST] <Brian_> well I did, if i replace ffmpeg folder with the version of 3.4.1 it works perfectly
[11:16:29 CEST] <JEEB> I don't build libvorbis, but I do build FFmpeg for android often and it WorksForMe
[11:16:42 CEST] <JEEB> ah, you're building static
[11:17:22 CEST] <JEEB> a static library doesn't contain information on what shared dependencies it bases upon, unfortunately
[11:17:53 CEST] <JEEB> also those extra cxxflags look really weird, generally you get those from pkg-config after you set PKG_CONFIG_LIBDIR to your build root(s)' lib/pkgconfig
[11:18:22 CEST] <JEEB> ah, so the error is during configure
[11:19:25 CEST] <JEEB> oh
[11:20:04 CEST] <JEEB> Brian_: it has most likely been working by accident, 4.0 does have IIRC a lot of improvements in how dependencies are handled in the configure script
[11:20:45 CEST] <JEEB> PKG_CONFIG_LIBDIR=/root/bravobit/ffmpeg-android/toolchain-android/lib/pkgconfig if that is where you have installed various libraries
[11:21:23 CEST] <JEEB> also if you're using static libraries you need --pkg-config-flags="--static"
[11:22:30 CEST] <JEEB> basically what's happening in that vorbis check is that you have -logg already manually added, and vorbisenc.a is found by something. but nothing points that you also need the generic vorbis lib that provides vorbis_info_clear
[11:23:42 CEST] <JEEB> you could brute force it as well but rather use pkg-config for flags
[11:24:43 CEST] <JEEB> I actually wonder why my build txt file still adds my build prefix's include/lib manually to the search paths, need to check why I do that after work
[11:25:17 CEST] <JEEB> ah, that might be because of my hacked gnutls :P
[11:32:40 CEST] <Brian_> JEEB thanks i'll check it out :)
[12:58:57 CEST] <TarquinWJ> Hi, I am trying to set the with metadata for a video to the wrong value, to see if our video player can play it with the correct or wrong size (I understand that this sounds insane, but I am making tests for edge cases).
[12:58:58 CEST] <TarquinWJ> This replicates an old bug in XMedia Recode (FFMpeg front-end), where if you transposed a video, it would always specify the original dimensions in the metadata instead of the new dimensions.
[12:58:58 CEST] <TarquinWJ> However, I am a little unfamiliar with setting metadata, and I am not sure if I am doing the right thing. My attempts to set the width to the wrong value seem to be being ignored.
[12:58:58 CEST] <TarquinWJ> This works:
[12:58:58 CEST] <TarquinWJ> ffmpeg -i original.mp4 -c:v copy -write_tmcd 0 -metadata:s:v:0 rotate=90 rotated.mp4
[12:58:59 CEST] <TarquinWJ> This does not:
[12:59:00 CEST] <TarquinWJ> ffmpeg -i original.mp4 -c:v copy -write_tmcd 0 -metadata:s:v:0 width=100 wrongsize.mp4
[12:59:29 CEST] <TarquinWJ> can it be done?
[14:20:52 CEST] <th3_v0ice> Hello guys. I have a problem while encoding a video with API. My packet duration changes from 256 to 512, does anyone know why this is happening?
[15:16:58 CEST] <weker> Hey just updated ffmpeg und saw that ffserver was removed. Has anybody a recommendation for a replacement? I heard something about SRS. Looking into it now.
[15:19:23 CEST] <Mavrik> weker: nginx-rtmp-module was one of the better supported and easy to setup things I've seen
[15:22:30 CEST] <weker> Mavrik: Thanks! will look into it.
[15:23:49 CEST] <Mavrik> (It supports HLS and DASH as well IIRC even though the name implies otherwise :) )
[16:01:15 CEST] <SpeakerToMeat> Sorry to ask this here but you guiy are all very knowledgeable. do you know anyu cli/oss program that would ocr burned in subtitles off a video file? (linux), I'm more interested at getting the exitence of subtitles plus their time in out rather than text accuracy.
[16:02:02 CEST] <JEEB> subtitle edit is one thing I know that has OCR features and is IIRC OSS
[16:06:10 CEST] <SpeakerToMeat> Subtitle edit is the best editor but so far all the ocr i've seen it have works with dedicated subtitle streams (vob) not any file.
[16:07:10 CEST] <JEEB> I'd still say I prefer Aegisub as an editor, but for OCR only subtitle edit has the feature. you might want to check the Subtitle Edit community since the application can load up videos IIRC
[16:21:17 CEST] <vlt> Hello. Is there a way to reduce latency when running "ffmpeg -i /dev/video0 -c:v copy -f nup tcp://..."?
[16:31:04 CEST] <SpeakerToMeat> Hmmm yeah subtitle edit needs a special type of file to ocr subs
[16:41:39 CEST] <weker> Is there something more lightweight than nginx-rtmp-module? I never really worked with nginx, just served some static pages with it. I only need to stream audio with relatively low latency.
[17:01:51 CEST] <kepstin> nginx isn't particularly heavyweight, really :)
[17:02:12 CEST] <kepstin> what kind of player are you trying to stream to? That's the main thing that determines the server you want to use...
[17:03:55 CEST] <weker> yes you are probably right, just a bit of a mess to configure...
[17:04:08 CEST] <weker> What do you mean what player? In what respect?
[17:06:04 CEST] <kepstin> what software is the person playing the stream/listening going to be using?
[17:06:24 CEST] <weker> Ohh I have full controll over the stream consumer
[17:06:26 CEST] <kepstin> which determines what streaming protocol do you want to use
[17:06:50 CEST] <kepstin> multiple clients or just one?
[17:06:59 CEST] <weker> multiple clients
[17:07:31 CEST] <kepstin> hmm. nginx-rtmp might not be the best choice if you want low latency then, it's intended mostly for streaming to web browsers
[17:07:51 CEST] Action: kepstin isn't really familiar with what *would* be the best option, tho
[17:10:56 CEST] <furq> weker: if you just want audio then use icecast
[17:20:23 CEST] <grady> does anyone have any ideas for a strategy for writing a complex filter that combinesfor instancethree 5-second video clips with one 15-second audio clip? Preferably without having to split the audio file into three 5-second clips
[17:28:25 CEST] <Shadowsan> Hi, I was wondering whether anyone has tried to compile ffmpeg latest using CUDA 9.2 and can steer me in the right direction?
[17:28:44 CEST] <Shadowsan> I can't seem to get the configure to recognise hardware acceleration
[17:29:31 CEST] <furq> grady: -i video1 -i video2 -i video3 -i audio -lavfi concat=n=3 out.mp4
[17:30:22 CEST] <furq> or `-i video1 -i video2 -i video3 -i audio -lavfi "concat=n=3[out]" -map "[out]" -map 3:a out.mp4` if the video clips contain audio
[17:34:17 CEST] <Shadowsan> ./configure --enable-nonfree --enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64   "ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec"
[17:34:39 CEST] <Shadowsan> But definitely got the nv codecs on there
[17:35:18 CEST] <Shadowsan> Also tried to specify via adding the location as an extra cflag and via the PKG_CONFIG_PATH variable
[17:35:26 CEST] <th3_v0ice> Shadowsan: Can you try and run sudo ldconfig?
[17:36:49 CEST] <Shadowsan> Sure - and then run again?
[17:37:33 CEST] <th3_v0ice> Yep
[17:40:46 CEST] <Shadowsan> No dice - same issue
[17:42:27 CEST] <th3_v0ice> If you havent changed the default package config path, you could also try this. "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" Replace with the one that you have if you changed it.
[17:46:45 CEST] <Shadowsan> Nope - still dead
[17:46:48 CEST] <Shadowsan>  [root at min01 ffmpeg]# PKG_CONFIG_PATH=/usr/lib64/pkgconfig ./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec
[17:47:22 CEST] <Shadowsan> and /usr/lib64/pkgconfig has all the cuda and other libs in there
[17:47:28 CEST] <Shadowsan> including ffnvcodec.pc
[17:50:10 CEST] <th3_v0ice> Shadowsan: I had the same problem but while including x265, previous command that I posted fixed my problem.
[17:53:17 CEST] <Shadowsan> It's weird. If I specify no flags, configure completes but no hw_accel
[17:53:35 CEST] <Shadowsan> As soon as I specify cuda, it blows up
[17:57:13 CEST] <Matador> bloody heck
[17:57:55 CEST] <Matador> got an issue after Intel + Win 10 updates with h264_qsv
[18:00:04 CEST] <Matador> [h264_qsv @ 0000000004f208c0] Error initializing the encoder: failed to allocate memory (-4)
[18:02:24 CEST] <grady> Shadowsan: Thanks for the help. What if i am trying to use the audio from a video file but combine it with a blank color screen like `ffmpeg -y -f lavfi -t 5 -i "color=0xED223F at 1:s=1920x1080" -ss 0 -t 10 -i video.mp4 -filter_complex "filtering..." ` where the audio plays from the beginning of the 5 second color screen and then continues once the color screen goes away and the video plays
[18:03:14 CEST] <Shadowsan> Think I might be onto something
[18:42:15 CEST] <weker> Icecast was even more clunky then nginx-rtmp. So I went back to nginx. Now I get spammed with errors from ffmpeg :/
[18:42:26 CEST] <weker> Application provided invalid, non monotonically increasing dts to muxer in stream 0:
[18:42:35 CEST] <weker> with: ffmpeg -f pulse -i 0 -c:a libmp3lame -b:a 320k -f mp3 'rtmp://127.0.0.1/live/test'
[20:15:34 CEST] <MSafroshkin> hello, guys! How do I submit a bug about ffmpeg? just send an e mail?
[20:18:14 CEST] <JEEB> trac.ffmpeg.org is the issue tracker
[20:37:00 CEST] <MSafroshkin> Has anyone meet the memory leak with rtsp stream. Memory leak is caused by avcodec 58 and avutil 56 (according to my visual studio heap profiler)
[21:42:22 CEST] <edgar_> Hi there. Does anybody know why my livestream doesnt loop the audio file? After first play of the .mp3 it seems like youtube stops the streaming connection. there are no errors in the console, (just if the stream goes on, but it doesnt) https://pastebin.com/wvbH3MAy
[21:43:40 CEST] <edgar_> its like.. first play..everything ok, 2nd play, youtube stops the stream. in console ffmpeg is running without errors
[21:51:41 CEST] <BtbN> You seem to be missing the -re option
[21:52:10 CEST] <BtbN> This will currently just hammer output to YouTube as fast as it can, not in real-time for a stream
[21:52:27 CEST] <BtbN> But your video device might already limit you to realtime
[21:56:04 CEST] <kepstin> yeah, the muxer should take care of it, if you have a live input you should avoid -re.
[21:56:11 CEST] <kepstin> i wonder if it's a timestamp problem
[21:56:56 CEST] <kepstin> when stream_loop does the loop, do the timestamps jump back to 0, maybe?
[22:06:39 CEST] <wfbarksdale> I have a rendering pipeline using ffmpeg (c API) for demuxing / decoding, and in some cases it may be necessary to duplicate frames at the decoder part or the pipeline. I was wondering if its possible to send the same packet for decoding again?
[22:06:42 CEST] <edgar_> mhh im realy new with ffmpeg and still have to understand how it works -.- can you give me an example of how to use the -re ?
[22:06:51 CEST] <wfbarksdale> when i try this i get this output:
[22:07:01 CEST] <wfbarksdale> [h264 @ 0x10300da00] mmco: unref short failure
[22:07:01 CEST] <wfbarksdale> [h264 @ 0x10300da00] illegal short term buffer state detected
[22:07:21 CEST] <wfbarksdale> i'm using using avcodec_send_packet and avcodec_receive_frame
[22:07:27 CEST] <wfbarksdale> and just sending the same packet again
[22:07:31 CEST] <kepstin> wfbarksdale: if you need to duplicate frames, do it after decoding. Sending dup frames into the decoder is, as you can see, invalid.
[22:08:16 CEST] <kepstin> (although it might work in some codecs or with keyframes, ymmv)
[22:08:17 CEST] <wfbarksdale> argh
[22:08:56 CEST] <wfbarksdale> Problem is that this would mean i need to copy every frame, as the decoder won't necessarily know when it will need to serve a duplicate frame
[22:09:20 CEST] <wfbarksdale> and upstream may want to modify the buffer
[22:09:31 CEST] <kepstin> note that ffmpeg avframes let you have multiple frames with a shared reference buffer, this is all handled for you by the framework
[22:09:47 CEST] <kepstin> it'll only copy if needed to handle modifying buffers
[22:14:51 CEST] <wfbarksdale> i see
[22:15:41 CEST] <wfbarksdale> so I basically need to do copy on write for the whole pipeline
[22:16:02 CEST] <edgar_> how do you guys got your ffmpeg skills? just reading documentation? id like to have a good tutorial for staters. does anybody know if something like thats exists? xD
[22:16:27 CEST] <kepstin> yeah, ffmpeg's designed for that. Anything that wants to write to an avframe is supposed to call av_frame_make_writable() before modifying that, and that  function copies the frame data if there's a shared reference existing.
[22:17:02 CEST] <wfbarksdale> i see, thats helpful man thanks
[22:18:01 CEST] <wfbarksdale> its kind of a shortcoming of my design i guess, because the buffer will always have to be copied since the decoder always has to hold onto the frame it just decoded
[22:19:35 CEST] <kepstin> wfbarksdale: depends on exact timing of the other stuff and whether any modification is actually needed, but perhaps.
[22:20:22 CEST] <wfbarksdale> in most cases conversion from YUV -> RGB will be needed
[22:20:22 CEST] <kepstin> note that it's safe to pass an AVFrame between threads, which is sometimes useful.
[22:20:48 CEST] <wfbarksdale> which i guess is always a copy anyways
[22:20:54 CEST] <kepstin> YUV->RGB conversion doesn't modify the source buffer tho, you'll always be allocating a new buffer for that
[22:22:05 CEST] <kepstin> assuming that's the first thing you do after decoding, this design won't add any additional buffer copies
[22:22:23 CEST] <wfbarksdale> thats good, probably workable for me
[22:22:28 CEST] <wfbarksdale> "good"
[22:23:42 CEST] <wfbarksdale> my architecture works as sort of a pull based thing, where whatever is downstream (display, encoder, streamer, whatever) just requests some output for a given time. so it might be advancing at 60fps or 30fps or whatever. But unfortunately I didn't create a way to tell downstream the next output that will be requested :/
[22:24:12 CEST] <wfbarksdale> so not seeing a simple way to avoid this copy
[22:24:48 CEST] <wfbarksdale> kepstin: thanks for the help, as always
[22:25:18 CEST] <kepstin> right, so each time you decode a frame, just deref the previous frame and store the new one - and when you receive a request for the frame from downstream, use av_frame_clone to make it a new avframe that shares the data
[22:25:21 CEST] <kepstin> should work great
[22:26:50 CEST] <kepstin> note that it is safe to pass AVFrame between threads (the reference-counting stuff is atomic)
[22:32:00 CEST] <wfbarksdale> maybe I could add like a "next frame hint" to the request structure
[22:32:50 CEST] <wfbarksdale> <- (mumbles to himself)
[22:33:58 CEST] <kepstin> note that this "store a frame reference then generate cloned frames sharing refs on demand" is actually how a lot of ffmpeg filters are internally implemented - particularly ones which need to sync multiple inputs.
[22:34:17 CEST] <kepstin> fps filter basically works like that too
[22:42:17 CEST] <wfbarksdale> gotchya
[00:00:00 CEST] --- Wed May 23 2018



More information about the Ffmpeg-devel-irc mailing list