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

burek burek021 at gmail.com
Sun Feb 11 03:05:01 EET 2018


[01:11:57 CET] <n0xlf> @furq (or others), not sure if you are around but any thoughts on this command isn't producing good results?  ffmpeg -i 1.mkv -itsoffset 208 -i 2.mkv -itsoffset 2025 -i 3.mkv -filter_complex "hstack=inputs=3;amix=inputs=3" -c:v libx264 -preset ultrafast -profile:v high -level 4.1 -crf 23 -c:a aac -b:a 128k -ac 2 video.mkv - VLC is audio only with all 3 streams starting simultaneously.  Win 10 media player has mostly frozen video, but n
[01:12:10 CET] <n0xlf> Audio is the same as VLC, all starting simultaneously.
[01:12:53 CET] <n0xlf> And sorry, that is with mp4 output - mkv is totally unusable with either player.
[01:13:30 CET] <n0xlf> Not sure if dev would be interested in this as well, but that command is requiring 30GB of memory with low quality 720p videos.
[01:14:16 CET] <n0xlf>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND 24042 root      20   0 29.195g 0.024t  14284 R 553.1 52.6  67:24.89 ffmpeg
[01:14:31 CET] <n0xlf>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
[01:14:31 CET] <n0xlf> 24042 root      20   0 29.195g 0.024t  14284 R 553.1 52.6  67:24.89 ffmpeg
[01:14:34 CET] <n0xlf> That's better..
[01:15:31 CET] <n0xlf> This is with FFMPEG from GIT - Release vers don't work at all and give a buffer overflow error
[01:16:16 CET] <furq> i wonder if itsoffset is causing a ton of frames to be buffered
[01:16:45 CET] <furq> if it works without that then you'll have to find a different way to delay things
[01:16:48 CET] <furq> maybe setpts
[01:22:04 CET] <n0xlf> I knew you'd have some ideas!  I'll try it without the offsets at all just to see if I can get acceptable output...
[01:27:01 CET] <n0xlf> 340k of mem with no offset :)
[01:32:27 CET] <n0xlf> Would I add setpts=PTS+208/TB, asetpts=PTS+208/TB, setpts=PTS+2025/TB, asetpts=PTS+2025/TB ?  Trying to figure out what the command would look like..
[01:35:51 CET] <furq> 208/TB would be 208 seconds
[01:39:23 CET] <n0xlf> A starting position of that, correct?  That's what I want...
[01:39:29 CET] <n0xlf> For that particular vid at least
[01:41:03 CET] <furq> that doesn't actually work well
[01:41:21 CET] <furq> and by well i mean at all
[01:41:53 CET] <furq> for video you'd probably want something like -f lavfi -i color=d=208 and then concat your actual video stream onto that
[01:42:07 CET] <furq> for the audio streams you can just use adelay
[01:45:58 CET] <n0xlf> Yikes, can you give me a sample of what that would look like?  Replacing the itsoffset with that...
[01:45:58 CET] <n0xlf> ffmpeg -i 1.mkv -itsoffset 208 -i 2.mkv -itsoffset 2025 -i 3.mkv -filter_complex "hstack=inputs=3;amix=inputs=3" -c:v libx264 -preset ultrafast -profile:v high -level 4.1 -crf 23 -c:a aac -b:a 128k -ac 2 video.mkv
[01:46:41 CET] <furq> http://vpaste.net/FYZv3
[01:46:43 CET] <furq> something like that
[01:47:30 CET] <n0xlf> Thanks - I'll see if my non-offset test even produces something that works..If not then I think I'm out of luck..It's almost done
[01:49:47 CET] <furq> http://vpaste.net/3wjlq
[01:49:51 CET] <furq> same thing but with the stream order fixed
[01:49:55 CET] <furq> if you hadn't noticed that
[01:50:19 CET] <furq> er
[01:50:27 CET] <furq> http://vpaste.net/wvSfr
[01:52:57 CET] <furq> also that should be color=black:d=208:s=123x456
[01:53:09 CET] <furq> with the resolution of the inputs
[01:53:16 CET] <furq> otherwise it'll be 320x240
[01:53:32 CET] <furq> it feels like there should be an easier way to do this but i can't think of one right now
[01:59:09 CET] <n0xlf> Yeah, this has been quite an experience - I've used ffmpeg for all kinds of things but this is among the most difficult I've worked with.
[01:59:46 CET] <n0xlf> The non-offset video works perfectly!  That's encouraging...
[01:59:49 CET] <n0xlf> I'll try your command now
[02:47:22 CET] <n0xlf> All of the audio starts at the beginning but it looks like the video may be correct...
[02:57:03 CET] <n0xlf> I left "-ac 2" - That may have been causing it.  Re-encoding now...
[02:57:33 CET] <n0xlf> @furq, check your msg window too..
[10:03:13 CET] <snadge> how would one set the frame rate for the vectorscope filter? it seems to be defaulting to 25fps for some reason
[11:24:59 CET] <halfgaar> Hello. Question: when using swr_convert to convert to a channel layout with more channels than the source, are the missing channels just zero-filled? This is what I need
[14:33:57 CET] <arinov_> hi guys
[14:34:29 CET] <arinov_> is there a way to mark video by it's date and timer? documentary
[16:20:49 CET] <xrandr> Hello. I am using CentOS 6.8. I have tried multiple versions of ffmpeg. I cannot get FFMpeg to encode a video higher than 20 or 30 mb. Any ideas on what I can check?
[16:21:49 CET] <xrandr> there is more than enough disk space
[16:26:55 CET] <xrandr> any other details i can provide, please ask
[16:28:24 CET] <xrandr> https://pastebin.com/hvKBNA3s
[16:30:31 CET] <sfan5> and the output?
[16:30:53 CET] <xrandr> im re-running it.
[16:31:19 CET] <relaxed> and are you running this on the command line or is it php?
[16:31:27 CET] <xrandr> both actually
[16:31:44 CET] <xrandr> right now i am running command line as the php developer said he did it on the command line as a test and it failed
[16:32:45 CET] <xrandr> is there a known php issue with ffmpeg?
[16:33:37 CET] <relaxed> well, I've seen people in here who have a working command in their terminal but not when running it via php
[16:34:06 CET] <relaxed> but it's mostly because they don't know php :)
[16:34:11 CET] <xrandr> so far it seems to be doing fine with command line
[16:34:21 CET] <xrandr> id hate to jinx it lol
[16:34:53 CET] <sfan5> random guess: you're not reading ffmpeg output from PHP and it eventually dies from SIGPIPE since the buffer is full
[16:37:38 CET] <xrandr> sfan5: so a temporary fix would be to increase the buffer size. The permenant fix could be to make sure the developer is asking php to read the ffmpeg output
[16:37:57 CET] <sfan5> assuming that actually is the issue, yes
[16:40:07 CET] <xrandr> hmm, i also wonder if the fact that so far this has been running over 20 minutes on the command line&.. wonder if max execution time is causing a problem
[16:41:46 CET] <relaxed> does php not log these types of issues?
[16:42:57 CET] <xrandr> I need to check the log level
[16:43:43 CET] <sfan5> better design would be to have a background daemon that manages the encoding jobs. then php would ask that daemon to run a job, get it's status, wait for completion, etc.
[16:44:05 CET] <JEEB> yea, running long-running jobs synchronously is a Bad Idea
[16:44:30 CET] <JEEB> (also if you are taking in files from 3rd parties you will always want to airgap that stuff as much as possible)
[16:44:57 CET] <xrandr> what do you mean by air gap?
[16:46:29 CET] <xrandr> sfan5: Ill bring that up with the developer.
[16:48:00 CET] <sfan5> what kind of media are you processing anyway that -preset veryfast takes upwards 20 minutes?
[16:48:46 CET] <xrandr> its an mp4 file. 500mb
[16:48:53 CET] <xrandr> and right now, its going on 40 minutes
[16:49:07 CET] <xrandr> and it finished
[16:49:22 CET] <xrandr> wait&that was the video time that it was processing
[16:49:23 CET] <relaxed> your ffmpeg command looks a little dated. which version are you using?
[16:50:01 CET] <xrandr> ffmpeg version N-63893-gc69defd
[16:51:00 CET] <sfan5> >11 Jun 2014
[16:51:00 CET] <sfan5> heh
[16:51:13 CET] <relaxed> xrandr: https://www.johnvansickle.com/ffmpeg/
[16:53:42 CET] <relaxed> the 3.4.1 release ^^ supports linux 2.6.32, by the way
[16:53:59 CET] <xrandr> ok, ill try that
[16:55:35 CET] <relaxed> which kernel does centos 6.8 use?
[16:55:59 CET] <xrandr> 2.6.32-642.13.1.el6.x86_64
[16:57:18 CET] <xrandr> i have a copy of that ffmpeg on the server as well. Ill use that. I also increased the max execution time and the output buffering
[16:57:19 CET] <xrandr> will test
[16:58:12 CET] <relaxed> I'm going to bombarded with complaints when the next stable static build requires 3.2.0
[16:59:38 CET] <furq> your site already says that doesn't it
[16:59:46 CET] <furq> you should probably just leave the 3.4.1 build for 2.6 up
[16:59:53 CET] <DHE> unless you're dealing with hardware-specific stuff, any 64bit kernel should be good for ffmpeg... right?
[17:00:03 CET] <furq> alongside the newer builds for newer kernels
[17:00:24 CET] <relaxed> DHE: no
[17:01:18 CET] <xrandr> running test through php now
[17:01:23 CET] <relaxed> yeah, I'll stash 3.4.1 somewhere and point people to it
[17:01:30 CET] <DHE> relaxed: how so?
[17:01:44 CET] <xrandr> gonna go shower. will check on its progress when i get back
[17:02:05 CET] <relaxed> DHE: run, file `which ffmpeg`
[17:02:10 CET] <furq> relaxed: out of interest, is there some reason you don't have a -dev archive with the static libs
[17:02:18 CET] <furq> other than that it would be additional effort and nobody's asked for it
[17:03:59 CET] <relaxed> DHE: it will show you the minimum version of the linux kernel needed to run said binary
[17:07:03 CET] <relaxed> sorry, -dev archive with the static libs ?
[17:09:07 CET] <relaxed> furq: ^^^
[17:15:40 CET] <DHE> relaxed: not shown on statically linked binaries
[17:24:58 CET] <relaxed> huh? I see, ffmpeg-git-20180208-64bit-static/ffmpeg: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=49b34467f17cd1d5eaef093d43fb1682c6b6fbd8, stripped
[17:37:18 CET] <DHE> interesting, some executables have that and some don't
[17:49:12 CET] <relaxed> because it's statically linked to glibc
[17:50:18 CET] <BtbN> glibc is never truely static
[17:52:58 CET] <relaxed> right, the next version might prompt me to move to musl
[18:17:00 CET] <utack> does vlc use any other hdr tone mapping than mpv? or are they both straight out of ffmpeg?
[18:19:33 CET] <JEEB> utack: vlc 3.0 started to use libplacebo by hanna who developed tone mapping for mpv's renderer as well
[18:19:54 CET] <JEEB> FFmpeg's tonemap filter was a port of the mpv stuff by koda
[18:20:01 CET] <utack> aah
[18:20:06 CET] <utack> so it should look the same
[18:20:23 CET] <JEEB> I'm just not sure on which environments libplacebo is currently utilized
[18:20:30 CET] <JEEB> but it should be the thing used for tone mapping @ vlc
[18:20:52 CET] <JEEB> and hanna recently back-ported the changes from libplacebo to mpv's gpu renderer
[18:20:58 CET] <JEEB> so currently they should be quite similar
[18:21:09 CET] <JEEB> (FFmpeg's tonemap filter is probably the one with the old behavior)
[18:22:34 CET] <hanna> VLC doesn't use peak detection though
[18:22:39 CET] <hanna> which is the killer feature of the libplacebo algorithm
[18:23:05 CET] <hanna> and it's used for OpenGL
[18:23:14 CET] <hanna> i.e. on windows you get the native windows HDMI passthrough shit only
[18:23:22 CET] <hanna> and DXGI swapchain HDR whatever
[18:23:28 CET] <utack> any way to verify peak detection works? i have a feeling the compute peak option in mpv does nothing
[18:23:47 CET] <hanna> utack: it's on by default
[18:23:50 CET] <hanna> (as of git master)
[18:24:04 CET] <hanna> to verify it works, you could intentionally mis-tag the peak
[18:26:37 CET] <hanna> try comparing e.g. --vf=format:sig-peak=1000 --tone-mapping=linear with HDR peak detection on vs off
[18:27:40 CET] <utack> will do, thanks
[18:27:56 CET] <utack> i guess i shoudl get mpv git first
[18:28:09 CET] <hanna> incidentally, we could probably try doing scene change detection as well
[20:04:53 CET] <prelude2004c> hey everyone.. still dealing with the damn de-interlace issue :(
[20:05:04 CET] <dystopia_> bobbing?
[20:05:04 CET] <prelude2004c> anyone here familiar with cuvid and how it works ?
[20:05:14 CET] <prelude2004c> damn thing wont bob
[20:05:29 CET] <dystopia_> can you upload like a 30s sample of the video somwhere
[20:05:39 CET] <furq> it's not an issue with the video
[20:05:55 CET] <furq> cuvid/nvdec apparently isn't outputting double framerate with -deint bob
[20:05:59 CET] <prelude2004c> ${ffmpeg} -hwaccel cuvid -hwaccel_device $gpuenc  -c:v mpeg2_cuvid -deint 2 -resize 1280x720 -vsync 1 -i  ...
[20:06:01 CET] <dystopia_> well it's possible the content can't be bobbed and is true 25fps or whatever
[20:06:04 CET] <prelude2004c> i tried deint 2 , i tried bob
[20:06:19 CET] <dystopia_> -vf yadif=1:0
[20:06:24 CET] <furq> yeah no
[20:06:34 CET] <prelude2004c> my problem is that the video coming is interlaced.. i checked with --show-frames |grep deinter
[20:06:36 CET] <prelude2004c> and they are ther.e
[20:06:43 CET] <prelude2004c> yadif kills my cpu :(
[20:06:45 CET] <furq> he specifically wants nvdec deint
[20:06:50 CET] <furq> or cuvid or whatever it's called today
[20:06:59 CET] <dystopia_> all yours then furq, i can't help with cuvid
[20:07:06 CET] <furq> i have no idea either
[20:07:10 CET] <furq> this has just been going on for some time lol
[20:07:10 CET] <dystopia_> :(
[20:07:20 CET] <JEEB> are you sure the deint goes after input? it sounds like a decoder option if the decoder is supposed to do random things?
[20:07:25 CET] <prelude2004c> i know.. F%%F me sideways.. i'm really stuck
[20:07:27 CET] <furq> that's before the input
[20:07:32 CET] <JEEB> oh
[20:07:41 CET] <JEEB> misread :P
[20:07:54 CET] <furq> i remember reading it's some issue with ffmpeg not expecting a decoder to double the framerate
[20:08:03 CET] <furq> which i guess makes sense
[20:08:12 CET] <JEEB> probably a case of the timebase or so :P
[20:08:24 CET] <JEEB> outputting more than one per input packet is a-OK with the new API
[20:08:27 CET] <prelude2004c> well i did the -r 6000/1001 or whatever ... and you know what it doubled it.. but then my sound sync is off
[20:08:53 CET] <furq> if that worked then just add a separate -i foo.mp4 -map 0:v -map 1:a
[20:08:54 CET] <prelude2004c> who wants to help me fix this.... i will pay for it.. i can't waste more time on this.. if so message me
[20:10:02 CET] <JEEB> I do agree that it's a rather special case since it's trying to do filtering within the "decoder"
[20:10:23 CET] <furq> i don't have an nvidia card or else i could at least try this stuff out
[20:10:31 CET] <JEEB> anyways, no idea since I don't have too much care about this hwdec :P
[20:10:33 CET] <prelude2004c> furq i do.. and remote access
[20:10:33 CET] <furq> and info on this online is pretty sketchy
[20:10:41 CET] <prelude2004c> teamviewer anytime
[20:11:37 CET] <furq> well yeah try the thing i said about adding the input twice and taking the audio from the second one
[20:12:18 CET] <prelude2004c> you mean because of audio sync ?
[20:12:22 CET] <furq> yeah
[20:12:36 CET] <prelude2004c> ok trying
[20:13:36 CET] <prelude2004c> ehh i already map stuff
[20:13:37 CET] <prelude2004c> "i:0x1e1" "-map i:0x1e2 -map i:0x1e7"
[20:14:24 CET] <prelude2004c> furq, i sent you a PM
[20:15:10 CET] <furq> it's better to ask in here, i don't really know much about nvenc/cuvid
[20:15:23 CET] <furq> i also don't know how mapping from a pid works with multiple inputs
[20:15:29 CET] <saucecode> How do I reduce the speed of an audio conversion? Say, if I only wanted ffmpeg to output to file at 64kB/s. Are -bufsize and -maxrate the only options? Are there others?
[20:15:46 CET] <furq> saucecode: if you want to output it in realtime add -re before -i
[20:16:43 CET] <furq> prelude2004c: maybe -map 0:i:0x1e1 -map 1:i:0x1e2
[20:16:48 CET] <furq> video stream from 0, audio stream from 1
[20:16:58 CET] <furq> it's not entirely clear from the docs if that works
[20:17:27 CET] <prelude2004c> well the way i have ti setup or trying to setup is :
[20:17:51 CET] <prelude2004c> 1. deinterlace , decode ... 2. transcode back to h265 with nvenc
[20:18:31 CET] <prelude2004c> so its all supposed to just happen.. but decode is stuck at 29.97... if -r 60/1.001 audio is out of sync
[20:18:41 CET] <prelude2004c> i have not even checked if closed caption is still in tact
[20:19:07 CET] <prelude2004c> do -vf work on the input side?
[20:19:11 CET] <furq> no
[20:19:48 CET] <prelude2004c> becaue it would be nice to.... split out the audio/ video/ a53 data... then deinterlace video... transcode it to h265 and then add a53 & audio back in
[20:20:37 CET] <prelude2004c> i was using a custom version that did that before.. .-vf 'a53_split,fps=29.97,a53_combine=ratio=5,scale_npp=w=1280:h=720'
[20:21:03 CET] <prelude2004c> but that version doesn't have mpeg2_cuvid
[20:21:13 CET] <JEEB> if you have US-based closed captions those most likely won't live through a filter chain - although I have no idea what those a53_{split,combine} filters are
[20:21:52 CET] <prelude2004c> well that was supposed to take out the cc data before the video is changed to 30fps .. then put it back after transcoding it
[20:21:55 CET] <prelude2004c> it works well.
[20:22:04 CET] <prelude2004c> but deinterlacing now is not sooo easy
[20:22:14 CET] <prelude2004c> more custom work.. and i don't know how to do it :( need someone to write some code
[20:22:16 CET] <JEEB> not after transcoding, but rather within that filter chain after another filter
[20:22:27 CET] <JEEB> if I guess right what those filters do :P
[20:22:41 CET] <prelude2004c> you think i know ? i didn't write it haha
[20:22:44 CET] <prelude2004c> it just works
[20:22:57 CET] <JEEB> anyways, your prime issue is that you're suddenly changing the time base of the decoder
[20:23:03 CET] <JEEB> or something related to that
[20:23:04 CET] <prelude2004c> now i need someone who can write filters and code
[20:23:18 CET] Action: JEEB remembers BtbN or so talking about it
[20:24:25 CET] <JEEB> I think if you had your own API client you might be able to handle it better
[20:24:33 CET] <saucecode> furq: Good suggestion, but it doesn't seem to have helped >.<
[20:24:38 CET] <prelude2004c> JEEB, you know how to write that stuff?
[20:24:43 CET] <prelude2004c> I don't code myeslf
[20:25:10 CET] <tester> it might be off topic, but i need an easy way to cut some .ts file into smaller files before i actually bother to encode it
[20:25:24 CET] <tester> i thought about virtualdub, but it cant handle ts files for some reason
[20:25:34 CET] <JEEB> tester: so you need the locations of the packets with random access points. after that you can just cut at 188 byte boundaries
[20:25:46 CET] <JEEB> you can use ffprobe to get the byte offsets I think?
[20:26:05 CET] <JEEB> something like ffprobe -of json -show_streams -show_packets input.ts
[20:26:14 CET] <JEEB> (that will output a whole crapload of JSON which you can parse)
[20:26:43 CET] <saucecode> I've got an audio file that's being downloaded to, and I want to convert it while the download is still going. But ffmpeg is stopping before the download finishes, I suspect because its reading the 'end' of the file that's being downloaded into. What do I do?
[20:26:47 CET] <tester> JEEB im really looking for some easier and more intuitive way
[20:26:57 CET] <tester> JEEB visual way that is
[20:27:25 CET] <JEEB> then you might want to try out something like murdoccutter
[20:27:45 CET] <JEEB> that's what I used to utilize for mpeg-ts cutting. it tends to actually change some data in the thing, though if I recall correctly
[20:27:52 CET] <JEEB> (like stripping EPG data)
[20:28:28 CET] <tester> google doesnt bring up anything for that name?
[20:28:43 CET] <JEEB> http://itsadirect.site90.com/M_cut.html
[20:29:05 CET] <JEEB> I think the files are corrupted by the PHP, but if you clear the error from it it's a valid ZIP file
[20:29:15 CET] <JEEB> also the UI is in Japanese, but it's the least bad app of that type that I know
[20:29:23 CET] <tester> looks fishy af
[20:29:32 CET] <JEEB> :D
[20:29:53 CET] <JEEB> yea, it's quite a fail with the developer
[20:29:55 CET] <JEEB> or well, it's hoster
[20:29:57 CET] <JEEB> *its hoster
[20:30:34 CET] <JEEB> in theory you could make your own thing with the FFmpeg APIs, but I've just been lazy :P
[20:30:43 CET] <BtbN> JEEB, hm?
[20:31:02 CET] <JEEB> BtbN: there was a discussion about the cuvid (?) decoder doing bobbing and the whole time base problem
[20:31:23 CET] <BtbN> cuvid does bob and adaptive deinterlacing, yes
[20:31:29 CET] <BtbN> but not if used as native hwaccel called nvdec
[20:31:35 CET] <JEEB> yup
[20:31:47 CET] <prelude2004c> what am i missing here..
[20:31:49 CET] <BtbN> and the cuvid decoders do not support and side data
[20:31:57 CET] <JEEB> someone just had issues with ffmpeg.c trying to utilize the bobbing and I guessed it was about the time base :P
[20:32:06 CET] <prelude2004c> so i need a filter to split out the data before doing anything to it right?
[20:32:09 CET] <tester> any idea how to make vitualdub work with ts files?
[20:32:18 CET] <JEEB> tester: not going to work, it's based on AVI
[20:32:56 CET] <JEEB> there's a few mpegts cutting apps around but I'm totally not sure how much they change the input
[20:33:15 CET] <JEEB> because in theory when you want to cut mpeg-ts losslessly you want to do minimal changes
[20:33:45 CET] <tester> well it's low quality video from some vhs
[20:34:24 CET] <furq> if it's not broadcast shit that you want to keep intact then just use avidemux
[20:34:31 CET] <prelude2004c> interesting...  -vf 'a53_split,fps=59.94,a53_combine=ratio=5,scale_npp=w=1280:h=720' this doesn't deinterlace it seems but it seems to go up to 60fps
[20:34:35 CET] <prelude2004c> but over time audio drifts
[20:34:55 CET] <prelude2004c> also, if content is interlaced, doesn't it mean there is more data for transcode.. i'm loosing quality
[20:35:07 CET] <prelude2004c> maybe i should just drop all de-interlaced frames
[20:35:13 CET] <prelude2004c> sorry interlaced
[20:35:36 CET] <prelude2004c> could i not just drop all the interlaced frames.. and then just double up frame rates and somehow keep audio in sync
[20:36:07 CET] <JEEB> you're forcibly changing the frame rate so how the flying hell do you think that's not going to affect things
[20:36:10 CET] <furq> does hevc support interlaced encoding
[20:36:14 CET] <JEEB> it does
[20:36:15 CET] <JEEB> field-based
[20:36:17 CET] <furq> if it does then you could just leave it interlaced
[20:36:28 CET] <furq> probably just add -flags +ildct+ilme
[20:36:52 CET] <JEEB> basically you feed it 60/1.001 and tell it it's field-based (either top or bottom field)
[20:37:02 CET] <JEEB> of course I have no idea how well libx265 handles that
[20:37:04 CET] <JEEB> :P
[20:37:10 CET] <furq> well this is nvenc
[20:37:12 CET] <prelude2004c> my code right now looks like this.
[20:37:15 CET] <JEEB> even better
[20:37:19 CET] <furq> lol
[20:37:19 CET] <furq> yeah
[20:37:42 CET] <furq> if nothing else someone on the nvidia forums seems to have got it working with ffmpeg and nvenc h264
[20:37:59 CET] <prelude2004c> ${ffmpeg} -name ${CHN} -hwaccel cuvid -hwaccel_device $gpuenc -max_alloc 100000000 -threads 1 -vsync 0 -fflags +discardcorrupt -skip_tei 1 -i "$stream" -map $6 $mapping -copyts -start_at_zero -vf 'a53_split,fps=59.94,a53_combine=ratio=5,scale_npp=w=1280:h=720' -c:v hevc_nvenc -profile:v main -2pass 1 -b:v 3500k -preset llhq -minrate 1k -maxrate 5500k -bufsize 3500k -qmin 21 -qmax 32 -refs 4
[20:37:59 CET] <prelude2004c> -bf 0 -g 90 -force_key_frames "expr:gte(t,n_forced*3)" -af "volume=10dB" $audio -avoid_negative_ts 1 -hls_time 6 -hls_flags delete_segments -start_number $start -hls_list_size 5 -hls_key_info_file /tmp/key-${rantmp}/file.keyinfo ${HLS_PATH}/${CHN}/${CHN}.m3u8
[20:38:12 CET] <furq> hevc in hls?
[20:38:14 CET] <furq> is that a thing
[20:38:15 CET] <tester> JEEB so any non-fishy app you can recommend?
[20:38:34 CET] <JEEB> if you only support devices with HEVC capabilities it sure is a thing
[20:38:44 CET] <furq> fun
[20:38:46 CET] <JEEB> tester: I haven't had to look at other apps since murdoccutter works for me
[20:38:53 CET] <furq> tester: avidemux
[20:38:59 CET] <furq> or just ffmpeg
[20:39:12 CET] <JEEB> he wanted a GUI and I guessed he also wanted basic cutting
[20:39:18 CET] <JEEB> as in, no remux
[20:39:19 CET] <furq> ffmpeg will probably do a better job but avidemux will give you a not-terrible (and also not-japanese) gui
[20:39:19 CET] <aphirst> i'm kind of surprised that it isnt the chinese cartoons at the forefont of HEVC uptake
[20:39:20 CET] <tester> ffmpeg isnt an option because it's all cli
[20:39:21 CET] <JEEB> if remux is OK
[20:39:24 CET] <tester> i really want to select what to cut and stuf
[20:39:36 CET] <furq> if it's a vhsrip then i assume remuxing isn't an issue
[20:39:41 CET] <JEEB> sure
[20:39:44 CET] <JEEB> then avidemux is OK
[20:39:56 CET] <JEEB> aphirst: fagsubbing is 99% dead and x265 never got really good
[20:40:07 CET] <aphirst> it kind of is tbh
[20:40:08 CET] <JEEB> I was one of those who couldn't wait for HEVC to get standardized
[20:40:36 CET] <JEEB> but at this point x265 seems to only be significantly better in low bit rate scenarios
[20:40:38 CET] <aphirst> all hail or new horriblesubs overlords
[20:40:39 CET] <JEEB> as in, where both look bad
[20:41:16 CET] <aphirst> well not necessarily
[20:41:20 CET] <aphirst> but i know what you mean
[20:41:28 CET] <JEEB> basically detail retention takes a real hit with x265
[20:41:35 CET] <JEEB> maybe it gets better with disabling features, but seriously
[20:41:46 CET] <JEEB> if you have to actively DISABLE features to improve output - you're fscked
[20:41:53 CET] <JEEB> (unless the encoder does that for you)
[20:41:58 CET] <aphirst> i'm sure(tm) it'll get better
[20:42:15 CET] <JEEB> I don't see a community around it, unlike x264
[20:42:24 CET] <JEEB> it's multicoreware
[20:42:27 CET] <JEEB> and that's it
[20:43:01 CET] <JEEB> I mean, sure. a miracle *can* happen
[20:43:19 CET] <JEEB> and my last tests are now more than a year+ old
[20:43:39 CET] <prelude2004c> hey question.. maybe i'm not understanding this.. if i'm transcoding an interlaced file vs a deinterlaced file.. would quality of deinterlaced file be better at say 5Mbit/s because there is less data ?
[20:43:43 CET] <prelude2004c> or would it be the sam?
[20:43:46 CET] <jkqxz> Detail retention?  But, but, PSNR is the One True Metric!
[20:44:43 CET] <JEEB> prelude2004c: I think you are so confused about things that I won't even start explaining things to you at this point :P
[20:44:55 CET] <prelude2004c> OK.. i must be
[20:45:05 CET] <prelude2004c> i'm missing that lightbulb moment
[20:53:17 CET] <tester> so when i cut with avidemux, like 50% of the later part of the sound is gone
[20:53:18 CET] <tester> :o
[20:53:37 CET] <JEEB> yea, fun things that try to do a full re-mux
[20:53:37 CET] <prelude2004c> JEEB, you could could just say YES or NO
[20:54:21 CET] <tester> im not really understanding the terms and everything.. what am i supposed to do?
[20:54:28 CET] <tester> encode all of it in one piece and then work on it?
[20:54:39 CET] <tester> but i really want to just delete large parts
[20:54:41 CET] <JEEB> just find yourself a cutter if murdoccutter didn't cut it
[20:54:59 CET] <tester> murdoccutter cant be even downloaded
[20:54:59 CET] <JEEB> if you just search for mpegts cutting apps you will get quite a few English apps
[20:55:04 CET] <JEEB> oh it can
[20:55:05 CET] <tester> just stripping the php errors and html doesnt fix it
[20:55:10 CET] <JEEB> oh, huh
[20:55:14 CET] <JEEB> I remember fixing it before
[20:55:17 CET] <JEEB> weird
[20:55:22 CET] <JEEB> let me see if I have it on my server
[20:58:37 CET] <JEEB> I have two old versions of it on my home pc
[20:58:42 CET] <JEEB> f1 and f3
[20:58:49 CET] <tester> dont bother, this thing looks far too fishy
[20:58:54 CET] <JEEB> lol
[20:58:55 CET] <JEEB> it isn't
[20:59:02 CET] <JEEB> it's in Japanese, yes
[20:59:09 CET] <JEEB> which might be a problem :P
[20:59:32 CET] <tester> lol
[20:59:35 CET] <JEEB> oh, g1
[20:59:39 CET] <JEEB> actually had it around
[20:59:39 CET] <JEEB> lul
[20:59:49 CET] <tester> if i encode the whole thing with ffmpeg and then use vdub to cut parts, will that work properly?
[21:00:27 CET] <JEEB> in AVI, quite likely. but you'd want to keep to a format without B-frames and having a VFW decoder
[21:01:34 CET] <tester> isn't avi a container?
[21:01:37 CET] <JEEB> yes
[21:01:45 CET] <JEEB> I meant, "in the AVI container"
[21:01:59 CET] <JEEB> it doesn't support proper timestamps which is why I said "in a video format that contains no B-frames"
[21:02:09 CET] <tester> im kind of losing you here
[21:02:10 CET] <JEEB> and "that has a VFW decoder"
[21:02:30 CET] <JEEB> basically don't use MPEG-4 Part 2 or H.264 with b-frames :P
[21:02:38 CET] <JEEB> since you will get problems with those in AVI
[21:02:40 CET] <JEEB> if you want to cut
[21:02:57 CET] <JEEB> I would probably recommend Ut Video as it has a VFW module
[21:03:00 CET] <tester> i have 1 ts file.i want to have multiple mkv files with whatever encoding
[21:03:04 CET] <JEEB> it will get huge as it's a simple lossless :P
[21:03:10 CET] <tester> each mkv will have part of the original .ts file
[21:03:11 CET] <JEEB> yes, but you just said you wanted to cut with vdub
[21:03:12 CET] <JEEB> goddamnit
[21:03:18 CET] <JEEB> vdub only supports AVI
[21:03:22 CET] <tester> man i dont care what to cut it with
[21:03:31 CET] <tester> i need to cut it with some visual tool
[21:03:35 CET] <tester> select start, select stop, cut
[21:03:38 CET] <JEEB> "and then use vdub to cut parts"
[21:03:44 CET] <JEEB> that's why I was giving hintso n how to get it done
[21:03:52 CET] <tester> let's start over..
[21:04:16 CET] <tester> i have 1 .ts file with various clips inside. i want to cut the clips into separate mkv files.
[21:04:37 CET] <tester> i want to do it with some gui that you can select start and end points.
[21:04:43 CET] <tester> what do you recommend?
[21:07:31 CET] <JEEB> tester: I would probably use https://kuroko.fushizen.eu/random/MurdocCutter19g1.zip
[21:07:36 CET] <JEEB> to visually cut mpeg-ts
[21:07:55 CET] <JEEB> granted I have not tried it with non-NTSC stuff, but it seemed to do relatively minor changes to the input so it /should/ work
[21:08:09 CET] <tester> unexpected end of data. it cannot be extracted.
[21:08:20 CET] <JEEB> 7zip says all OK
[21:08:40 CET] <JEEB> I specifically used the "test archive" feature in it before
[21:09:21 CET] <tester> try to extract it. 7zip gives that error.
[21:09:52 CET] <JEEB> still seems to extract
[21:10:22 CET] <JEEB> oh wow
[21:10:28 CET] <JEEB> didn't remember the UI was this funky
[21:11:15 CET] <tester> anyways it doesnt work
[21:11:18 CET] <tester> it wont play anything
[21:11:21 CET] <tester> nevermind cutting
[21:11:33 CET] <JEEB> worked for me
[21:11:48 CET] <tester> whatever, this isnt going to solve it.
[21:11:50 CET] <JEEB> in the input thing I added an MPEG-TS file, then pressed "Get GOP"
[21:12:00 CET] <JEEB> then waited for it to index the 2.5GiB file I fed to it
[21:12:34 CET] <JEEB> but sure, it could have issues with your input vOv
[21:12:36 CET] <JEEB> too bad
[21:13:54 CET] <JEEB> too bad that there's no real nice OSS app for this :P
[21:14:05 CET] <JEEB> since it isn't /too hard/ in theory
[21:15:52 CET] <JEEB> tester: just to prove that I didn't recommend it for nothing :P https://kuroko.fushizen.eu/screenshots/murdoccutter/works_for_me.png
[21:16:03 CET] <JEEB> (as in, I was not trying to fool you or anything)
[21:17:16 CET] <JEEB> tester: we can try doing it in a roundabout way btw
[21:17:37 CET] <JEEB> 1) remux to matroska 2) open the file with vapoursynth using ffms2 or so in Vapoursynth Editor
[21:17:48 CET] <JEEB> then use ffmpeg to cut with the timestamps that you get from the ffms2 input
[21:20:40 CET] <tester> JEEB like i mentioned, i need the short way
[21:20:53 CET] <tester> im not familiar enough with all of these things
[21:21:57 CET] <JEEB> alright then, then I'm officially out of alternatives. the last thing I recommended was using something that has a preview to get the timestamps, and then cutting according to them with ffmpeg or mkvmerge(gui)
[21:22:51 CET] <JEEB> mostly because I just don't know of any other mpeg-ts cutters that I trust
[21:23:07 CET] <JEEB> since avidemux is open source I kind of could recommend it, but it seems to have not worked
[21:23:14 CET] <JEEB> sorry
[21:23:29 CET] <tester> okay, lets say i can go through finding the positions
[21:23:37 CET] <tester> how do i cut a certain part out using ffmpeg
[21:23:44 CET] <JEEB> -t and -ss
[21:23:58 CET] <JEEB> although I must remind you that you will want to remux the input into a seekable container first
[21:24:03 CET] <JEEB> mpeg-ts is not going to cut it
[21:24:16 CET] <JEEB> so ffmpeg -i input.ts -c copy out.mkv
[21:24:17 CET] <JEEB> first
[21:24:27 CET] <JEEB> which will remux the data streams from MPEG-TS to matroska
[21:24:29 CET] <JEEB> which is seekable
[21:24:40 CET] <tester> what does ffmpeg -i -c do?
[21:24:45 CET] <JEEB> -i INPUT
[21:24:46 CET] <JEEB> is input
[21:24:55 CET] <JEEB> -c is "codec" (after -i so ENCODER)
[21:25:07 CET] <JEEB> copy is a special thing in ffmpeg.c which tells it to stream copy
[21:25:12 CET] <tester> so it converts the ts to an mkv but doesn't change the data whatsoever?
[21:25:28 CET] <JEEB> or in a minimal way required for the destination container
[21:25:35 CET] <JEEB> no re-encoding
[21:25:37 CET] <tester> aka lossless?
[21:25:40 CET] <JEEB> yup
[21:26:10 CET] <JEEB> it's like MPEG-TS has 0x00 00 00 01 <DATA> in MPEG-TS, while matroska and mp4 want <LENGTH><data>
[21:26:22 CET] <JEEB> first is called Annex B style H.264
[21:26:27 CET] <JEEB> and the second is called AVCc
[21:26:41 CET] <JEEB> same actual data, but the way it's contained is a bit different
[21:26:44 CET] <JEEB> (in the container)
[21:28:10 CET] <JEEB> tester: also just -c applies it to all selected streams (by default ffmpeg.c selects one video, audio and subtitle stream)
[21:28:19 CET] <JEEB> -c:v would have applied the option specifically to video, for example
[21:28:24 CET] <tester> okay i have the mkv now
[21:28:47 CET] <JEEB> alright, time to use something to preview it. avisynth, vapoursynth, aegisub - whatever pickles your fancy
[21:29:23 CET] <JEEB> or heck, even a video player would be OK, I guess? like mpv
[21:29:56 CET] <prelude2004c> hey guys.. is there a transcoding filter that i can use to cleanup edges on words ? showing a lot of pixels around the words.
[21:30:01 CET] <prelude2004c> any way to clean those things up?
[21:30:05 CET] <tester> great. so the first part i want to save to a separate file is 00:00:00 to 00:04:55
[21:30:23 CET] <JEEB> ok, so from the start?
[21:30:30 CET] <tester> yes
[21:30:51 CET] <JEEB> then just -t somewhere after input with the amount of seconds
[21:31:05 CET] <JEEB> it can also take in a timestamp, but I am lazy
[21:31:15 CET] <tester> ffmpeg -i file.mkv -t 00:04:55 new_file.mkv ?
[21:31:29 CET] <JEEB> that might work as well with quotes around the timestamp
[21:31:45 CET] <JEEB> also don't forget the -c copy
[21:31:48 CET] <JEEB> otherwise it will re-encode :P
[21:32:41 CET] <JEEB> basically you will always want to set the 1) encoder and 2) the rate control whenever you actually want to re-encode
[21:32:43 CET] <tester> takes quite some time, i think its not working
[21:32:59 CET] <JEEB> did you forget -c copy from it?
[21:33:12 CET] <JEEB> also I usually use -t with just amount of seconds
[21:33:17 CET] <JEEB> which would be 4*60+55
[21:33:26 CET] <tester> i used ffmpeg -i ll.mkv -t "00:04:55" ll_1.mkv
[21:33:30 CET] <JEEB> yea
[21:33:33 CET] <JEEB> that will re-encode
[21:33:37 CET] <JEEB> which is why it's taking time most likely
[21:33:39 CET] <tester> what does that mean
[21:33:44 CET] <tester> oh because i didnt copy
[21:33:46 CET] <JEEB> yes
[21:33:47 CET] <furq> yes
[21:33:53 CET] <JEEB> defaults are *something*
[21:34:04 CET] <JEEB> never trust default encoding settings
[21:34:20 CET] <JEEB> always at the very least specify the encoder you want
[21:34:28 CET] <furq> defaults are x264 crf 23 preset medium
[21:34:30 CET] <tester> okay great now i have this file
[21:34:33 CET] <furq> and vorbis audio for some reason
[21:34:45 CET] <furq> you'd think that'd be aac since that has a not-shit builtin encoder
[21:35:06 CET] <JEEB> yea, AAC or opus if the opus one is Good Enough
[21:35:13 CET] <JEEB> since the vorbis encoder internally is LOL
[21:35:14 CET] <tester> where do i select the encoder?!
[21:35:21 CET] <furq> you don't
[21:35:23 CET] <tester> -c h264 instead of -c copy?
[21:35:24 CET] <JEEB> if you set -c copy that is setting th encoder
[21:35:27 CET] <furq> yes
[21:35:37 CET] <tester> i want lossless encoding.
[21:35:40 CET] <JEEB> also h264 is not an encoder, but will most likely pick you a random H.264 encoder
[21:35:41 CET] <furq> but you already have h264 so you want -c copy
[21:35:42 CET] <tester> what do i use?
[21:35:47 CET] <furq> that copies the input stream
[21:35:59 CET] <tester> oh, okay
[21:36:16 CET] <tester> so my file is already encoded.. it cant be reasonably smaller without losing quality?
[21:36:25 CET] <furq> no
[21:36:35 CET] <furq> it could potentially be smaller without losing an amount of quality that you'd notice
[21:36:39 CET] <furq> that's impossible to say without looking at it
[21:36:46 CET] <furq> but it will definitely lose quality
[21:37:01 CET] <tester> ill keep it like this then
[21:37:30 CET] <furq> that's ignoring filters etc which might make stuff look better in specific cases
[21:38:19 CET] <tester> okay, now to cut a part from 00:06:07 up to whatever, do i use -ss "00:06:07" -t "00:10:00" ?
[21:38:42 CET] <JEEB> yes
[21:39:09 CET] <kepstin> that will take 10 minutes of video starting at 6 minutes and 7 seconds in, yes.
[21:40:16 CET] <tester> oh
[21:40:27 CET] <tester> can i tell it to cut from 6:07 to 10:00, as in 3 mins 53 secs?
[21:40:42 CET] <tester> as in start and end stop, instead of start and duration?
[21:40:52 CET] <JEEB> no
[21:41:21 CET] <relaxed> https://trac.ffmpeg.org/wiki/Seeking
[21:41:26 CET] <furq> tester: -to 00:10:00
[21:41:34 CET] <JEEB> oh
[21:41:40 CET] <JEEB> completely forgot about -to :P
[21:41:41 CET] <furq> -t is relative, -to is absolute
[21:41:47 CET] <tester> thanks
[21:46:58 CET] <saucecode> I have been all over the place today trying to figure this out, and now I'm back here.
[21:47:33 CET] <saucecode> Should this work like I think it should? $ cat original.m4a | ffmpeg -i - audio.mp3
[21:48:02 CET] <furq> er
[21:48:17 CET] <furq> i assume that's a contrived example and you know you can just do -i original.m4qa
[21:48:20 CET] <furq> 0q
[21:48:20 CET] <furq> -q
[21:48:56 CET] <furq> also mp4/m4a often has the moov atom at the end which means you need to be able to seek to the end before you can do anything
[21:49:04 CET] <furq> so piping it doesn't work well
[21:49:33 CET] <saucecode> Wait, -q ?
[21:49:41 CET] <furq> m4a, not m4qa
[21:50:27 CET] <saucecode> Right
[21:50:48 CET] <saucecode> So piping should *definitely not* work with m4a files?
[21:51:01 CET] <furq> idk about definitely but it probably won't work if the moov atom is at the end
[21:51:01 CET] <JEEB> fragmented isobmff can work, but most files are not fragmented
[21:51:05 CET] <JEEB> and thus you have an index at the end
[21:51:17 CET] <JEEB> mostly because you can only write the index after you've written the whole file
[21:51:30 CET] <furq> i assume piping into ffmpeg will work if the moov atom is at the start
[21:51:40 CET] <furq> but like i said, i hope this is a contrived example
[21:51:41 CET] <JEEB> more likely at least
[21:51:52 CET] <saucecode> This explains so much, thank you!!
[22:31:43 CET] <tester> can ffmpeg hardcode some simple text watermark at any of the corners of the video?
[22:31:48 CET] <tester> preferably 50%  transparent
[22:31:58 CET] <tester> like a single word or something
[22:33:30 CET] <JEEB> sure
[22:33:40 CET] <JEEB> https://www.ffmpeg.org/ffmpeg-all.html
[22:33:49 CET] <JEEB> drawtext is one thing
[22:33:55 CET] <JEEB> https://www.ffmpeg.org/ffmpeg-all.html#Examples-89
[22:53:37 CET] <tester> ffmpeg -i "source.mkv" -vf "drawtext=fontfile=C\\:/Windows/Fonts/Arial.ttf: text='test': fontcolor=black: fontsize=12: x=w-tw-10: y=h-th-10" destination.mkv
[22:53:45 CET] <tester> any reason why this doesnt put anything whatsoever on the file?
[22:53:53 CET] <furq> is it throwing an error
[22:54:04 CET] <furq> i never had any luck at all trying to get absolute paths working in filters on windows
[22:54:12 CET] <tester> nope
[22:54:13 CET] <furq> i always just gave up and put the font in the working directory
[22:54:18 CET] <tester> ill try that
[22:54:23 CET] <tester> i also dont really care which fontto use
[22:54:29 CET] <tester> but if i dont set anything it will error out
[22:55:23 CET] <tester> anyways placing it in the same directory and using fontfile=font.ttf doesnt work either
[22:55:35 CET] <tester> its encoding but no text whatsoever
[22:56:30 CET] <tester> okay larger font works
[22:56:31 CET] <tester> weird. sorry.
[22:57:20 CET] <tester> one last question please
[22:57:46 CET] <tester> oh i think i got it sorry again lol
[23:01:29 CET] <saucecode> Ok this is really upsetting me. furq do you know python?
[23:19:40 CET] <hanna> 18:28 <hanna> incidentally, we could probably try doing scene change detection as well <- done
[23:19:43 CET] <hanna> really helps, too
[23:19:58 CET] <hanna> btw, does ffmpeg have scene change detection?
[23:20:07 CET] <hanna> just doing it based on average frame brightness is pretty suboptimal
[23:20:16 CET] <hanna> I mean ideally I would just literally check for e.g. a histogram
[23:41:53 CET] <c_14> the select filter has a scene variable, so probably
[23:42:32 CET] <JEEB> wouldn't be too sure about that
[23:42:52 CET] <JEEB> it might just be using the keyframe flag from input, although I'm not 100% sure it gets passed into filters
[23:43:18 CET] <JEEB> ayup
[23:43:23 CET] <JEEB> select='eq(pict_type\,I)'
[23:43:30 CET] <JEEB> it has picture types etc available to it
[23:43:39 CET] <JEEB> so it can most likely get the keyframe flag
[23:44:10 CET] <JEEB> hanna: the "classic" way of keyframe detection was to use libxvid's keyframe selection algo for it :D
[23:44:22 CET] <JEEB> whatever that command line app for it was
[23:44:25 CET] <c_14> There's a bunch of filters with a scene change threshhold though so I hope it doesn't use that
[23:45:26 CET] <JEEB> ah, scxvid was the command line app :D
[23:45:35 CET] <JEEB> which contained the keyframe selection algo from xvid IIRC
[23:45:44 CET] <JEEB> man, I haven't done subtitling in quite a while and it shows, lol
[23:45:58 CET] <saucecode> I'm trying to pipe in a file to ffmpeg programmatically but ffmpeg keeps saying "pipe:: Invalid data found when processing input"
[23:46:54 CET] <JEEB> hanna: https://github.com/soyokaze/SCXvid-standalone
[23:46:58 CET] <JEEB> see the C file :D
[23:47:15 CET] <JEEB> oh, it uses libxvidcore
[23:47:16 CET] <JEEB> wow
[23:47:29 CET] <JEEB> I didn't even think it actually utilized its core lib
[23:47:50 CET] <JEEB> (funny enough x264's RAP selection was found to be less "scenechange'y" so it was never utilized as much
[00:00:00 CET] --- Sun Feb 11 2018



More information about the Ffmpeg-devel-irc mailing list