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

burek burek021 at gmail.com
Thu Mar 15 03:05:01 EET 2018


[02:29:38 CET] <logicWEB> hi :-) I have a video in an MPEG-2 TS file (I think -- it's a raw stream dump from DVD playback), and it's at 25fps. I want to reinterpret it as being at 23.976fps. I tried this: ffmpeg -y -r 24000/1001 -i 25fps.m2ts -c copy 23.976fps.m2ts
[02:29:49 CET] <logicWEB> ...and it produced a second copy of the stream that plays fine, but it still plays at 25fps
[02:30:11 CET] <kepstin> logicWEB: off a dvd, it'll be mpeg-ps (vob), but close enough.
[02:30:20 CET] <furq> if it's m2ts then it's off a bluray
[02:30:23 CET] <logicWEB> ah okay, thanks :-) I'll rename my files ;-)
[02:30:37 CET] <logicWEB> the ffmpeg output includes this line: Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 23.98 tbc
[02:30:44 CET] <furq> that will actually be a vob then yeah
[02:30:54 CET] <furq> but i guess it could have been ripped to a ts
[02:31:07 CET] <furq> either way ffmpeg reads it and you're about to get rid of it so it doesn't matter
[02:31:14 CET] <logicWEB> yeah :-)
[02:31:30 CET] <logicWEB> so in that line of output, I notice that the codec's timebase has changed to 23.976, but the fps is still 25 fps
[02:31:39 CET] <furq> yeah you can't change the framerate with -c copy
[02:31:53 CET] <furq> i don't know if this is possible in ffmpeg with m2v
[02:32:00 CET] <furq> mkvmerge or something like that should be able to do it though
[02:32:05 CET] <furq> assuming you want an mkv at the end
[02:32:07 CET] <ayum> Hi, I known that ffmpeg provide CBR and VBR control, by using -b:v, -maxrate and -bufsize options. but I found a strange bitrate problem, even I set CBR mode and 2000kbps bitrate, but VLC show me the input bitrate is not very stable, it will get 4000kbps suddenly sometimes. any idea?
[02:32:11 CET] <logicWEB> oh? that's interesting, I found someone advising _exactly_ this use in a Stack Overflow article. I guess they were wrong :-P
[02:32:33 CET] <furq> a pretty high percentage of things written on blogs and SO about ffmpeg are wrong
[02:32:41 CET] <furq> and let's not forget forum posts
[02:33:25 CET] <kepstin> ayum: not really enough details there. With a sufficiently large bufsize, you could certainly hit short-term bitrate maxes that high.
[02:33:41 CET] <logicWEB> hmm, that complicates matters, because I'm hardsubbing this file for an event, and the subtitle timings are all based on the 23.976 version of the video. the reason I have a 25fps version is that the U.S. release got letterboxed when broadcast to 4:3 TV, and then inexplicably windowboxed when transferred to DVD instead of just filling the frame -- but the U.K. release, which appears to be exactly the same video, _is_ full frame.
[02:33:54 CET] <logicWEB> but, to deal with the different framerate, they literally just sped the entire thing up, video and audio
[02:34:03 CET] <furq> yeah that's the usual thing that happens on pal dvd
[02:34:13 CET] <logicWEB> so if I want to avoid multiple transcoding passes, then I'll have to convert the subtitle timings by that same factor
[02:34:13 CET] <ayum> @kepstin, my example bitrate command: -c:v h264_nvenc -b:v 2000k -maxrate:v 2000k -bufsize:v 4000k
[02:34:31 CET] <logicWEB> then ffmpeg can subtitle it at 25fps and then the hardsubbed result can be slowed down by mkvmerge?
[02:34:32 CET] <furq> you should be able to retime the video stream but idk if ffmpeg can do it without reencoding
[02:34:49 CET] <furq> you can also rebase the timestamps, but changing the video framerate is the correct thing to do here
[02:34:50 CET] <kepstin> ayum: oh, nvenc, I don't know exactly how that behaves with vbv controls
[02:34:58 CET] <furq> especially if the audio from the ntsc version lines up
[02:35:04 CET] <furq> er, rebase the subtitles
[02:35:12 CET] <ayum> @kepstin, If I can decrease the bufsize to the half of maxrate, will that help generate more stable bitrate?
[02:35:33 CET] <logicWEB> I haven't had it in my possession yet long enough to thoroughly check it, but it is my understanding that, yeah, it's exactly the same video and audio stream, just played faster in the UK version
[02:35:37 CET] <kepstin> logicWEB: the logical thing to do is just do the framerate adjustment in the same command as when you burn in the subtitles.
[02:35:49 CET] <ayum> @kepstin, thanks, I remember nvenc provide some cbr and vbr options, I will test it later to
[02:35:57 CET] <kepstin> logicWEB: then ffmpeg will respect the -r input option, since it's re-encoding anyways
[02:35:58 CET] <logicWEB> kepstin: ah, so it can be applied _before_ the application of the subtitles?
[02:36:00 CET] <furq> oh hey i guess i should have read that
[02:36:06 CET] <furq> you would do it in the same command
[02:36:16 CET] <logicWEB> so the -r happens before the video gets processed by the other items in the chain
[02:36:23 CET] <logicWEB> okay, that could work :-) I'll have to experiment
[02:36:25 CET] <logicWEB> thanks very much :-)
[02:36:51 CET] <furq> -vf setpts=25025/24000,subtitles=foo.srt
[02:36:53 CET] <kepstin> logicWEB: there's other ways to change the framerate when encoding, such as (for this use case) the settb and setpts filters.
[02:37:10 CET] <furq> and then you'll either need -af atempo or source the audio from the ntsc release
[02:37:10 CET] <kepstin> logicWEB: then you can specify exactly when you want it to happen
[02:37:15 CET] <furq> the latter is preferable if it lines up correctly
[02:38:28 CET] <furq> also yeah don't use -r
[02:38:45 CET] <furq> that will just drop frames to meet the new framerate with the same duration
[02:40:00 CET] <furq> oh
[02:40:06 CET] <furq> kepstin: does -r as an input option work with mpegts
[02:40:15 CET] <furq> i didn't think that worked with any containers
[02:40:27 CET] <kepstin> i don't see why it wouldn't
[02:40:34 CET] <kepstin> i thought it was container-agnostic
[02:40:42 CET] <kepstin> (but applied after decoding)
[02:40:43 CET] <furq> i'm pretty sure it only works with elementary streams
[02:40:52 CET] <furq> but maybe that's just when copying
[02:41:07 CET] <kepstin> don't get it confused with the -framerate option
[02:41:21 CET] <kepstin> which is completely different, and used by various elementary streams and input devices
[02:41:37 CET] <kepstin> and raw formats, etc.
[02:44:23 CET] <furq> that actually sort of works if you ignore that mpc-hc thinks the duration is 64 minutes instead of 6 seconds
[02:44:35 CET] <furq> and also the audio stream is too long now
[02:46:11 CET] <furq> i guess that's not a big issue because you wouldn't normally use asetpts anyway
[03:02:32 CET] <hate5six> wondering if there's a clean solution for this problem: i'd like to trim a long video (using -c copy to avoid re-encoding) and then apply a watermark to the trimmed video. when i try the following i get errors because copy is an 'unknown decoder'. i've also tried piping the output of the trim to a second ffmpeg operation to do the overlay, but that also failed.
[03:02:34 CET] <hate5six> ffmpeg -i input.mp4 -ss 600 -t 10 -c copy -i ../watermark.png -filter_complex "overlay=x=(main_w-overlay_w-25):y=(main_h-overlay_h-25)" output.mp4
[03:08:34 CET] <furq> -c copy goes after the input filename, but you can't apply filters without reencoding
[03:08:59 CET] <hendry> astonishing in my vaapi encoding tests, it takes as much time as software encoding
[09:00:11 CET] <dragm_> Does mp4 support PCM officially? It works in the later versions of ffmpeg, but i cannot seem to find any reference to supporting it officially
[09:01:09 CET] <dragm_> My reasoning for asking is that we are designing an internal archiving format to get the storage costs down by using CRF-8, 10bit, 422 + keeping all PCM tracks + DXFP subs for all prores masters
[10:02:40 CET] <Spico> what do you type after ./configure to get ffmpeg to compile?
[10:08:09 CET] <JEEB> make -jN
[10:08:20 CET] <JEEB> where N is the amount of things you want to get done at once
[10:08:27 CET] <JEEB> (cores + 1, for example)
[10:12:23 CET] <Spico> -bash: make: command not found
[10:14:20 CET] <JEEB> I'd say your configuration step then quite likely failed
[10:14:34 CET] <JEEB> because if you don't have make you quite likely don't have most other development related things
[10:15:01 CET] <JEEB> also this is at which point generic help no longer works and you need to know what OS you're using to help you at all :P
[10:15:13 CET] <JEEB> (aka "what package do you install to get the base development tools")
[10:18:45 CET] <SuperCuber> This is a long message so I pastebinned it, the question is about using ffmpeg to downscale a twitch stream: https://pastebin.com/SwvRdn6s
[10:19:18 CET] <charlymp> Hi, i'm trying to use the prompeg protocol to send an already muxed (with an another software) mpegts file with rtp/fec. When i analyze the output file, it appears that ffmpeg remux the ts and I d'ont whant that? How to use prompeg to send my ts in "passthrough" (juste adding rtp/fec headers) ? https://pastebin.com/sZDck6T4
[10:26:07 CET] <SuperCuber> (please ping me if you want to answer my question)
[10:35:41 CET] <sfan5> SuperCuber: you're outputting h264 without a container, replace -f h264 with -f mpegts
[10:35:50 CET] <sfan5> also pastebinning a questio
[10:36:00 CET] <sfan5> n sucks since most people won't bother to look at it
[10:36:55 CET] <SuperCuber> sfan5: vthanks it works now!
[10:39:50 CET] <SuperCuber> sfan5: so vlc can use the url and get the stream however a html5 video player doesnt seem to be able to, do you maybe know why?
[10:40:29 CET] <sfan5> "the url"? you mean the twitch.tv/channelname one?
[10:40:50 CET] <SuperCuber> no the url after I pipe ffmpeg's output back to streamlink and use my server's ip
[10:41:33 CET] <sfan5> no idea, ask the devs of that html5 player
[10:41:44 CET] <SuperCuber> i mean its just a <video> tag
[10:42:20 CET] <sfan5> you're probably using either RT(S)P or HLS which <video> tags don't play natively
[10:43:28 CET] <SuperCuber> hm, any idea how twitch does it then? they use <video webkit-playsinline="" playsinline="" src="blob:https://www.twitch.tv/e7cfbfbc-d538-45d1-b10a-127de292fd47"></video>
[10:45:11 CET] <sfan5> blob: means there is some javascript "behind" it that assembles the video stream
[10:45:48 CET] <SuperCuber> changing the twitch url to my server's url doesn't work though so I assume they do something differently than me
[10:48:07 CET] <SuperCuber> this is probably getting off topic for this chat tho :/
[12:16:09 CET] <SuperCuber> is ffserver on topic here?
[12:19:05 CET] <SuperCuber> im trying to use ffserver and ffmpeg to get a twitch stream, downscale and then restream it to them open a browser. I use this pipeline: https://pastebin.com/x9s0rnd6 and this config: https://pastebin.com/9E4vSdVx
[12:19:23 CET] <SuperCuber> The error I get is av_interleaved_write_frame(): Connection reset by peer
[12:26:06 CET] <BtbN> ffserver is dead, don't use it.
[12:26:13 CET] <kepstin> ffserver has been dropped from ffmpeg, and you're unlikely to find anyone who can help you with it
[12:26:51 CET] <SuperCuber> hm. any other software I can use to make a browser-able stream?
[12:27:03 CET] <BtbN> browser-able?
[12:27:22 CET] <SuperCuber> openable with a browser, preferrably somehow using a <video> tag or something simple like that
[12:27:35 CET] <kepstin> SuperCuber: a live stream specifically?
[12:27:39 CET] <SuperCuber> yes
[12:27:56 CET] <kepstin> can't be done without a javascript player extension, you need a player that can load hls or dash
[12:28:20 CET] <kepstin> ffmpeg or nginx-rtmp can make the hls stream once you've sorted out the player
[12:28:48 CET] <SuperCuber> how can ffmpeg make the stream? I want to make a stream first to be able to test a player
[12:29:41 CET] <kepstin> https://www.ffmpeg.org/ffmpeg-formats.html#hls-2
[12:30:00 CET] <kepstin> it creates a bunch of files that just have to be served up by any regular web server
[12:30:44 CET] <SuperCuber> wouldn't that mean it will save the whole stream?
[12:31:08 CET] <kepstin> for a live stream you'd configure it to automatically delete old segment files
[12:32:32 CET] <SuperCuber> previously I used streamlink to serve its stdin over http, can I pipe hls directly out of ffmpeg into streamlink somehow?
[12:32:59 CET] <kepstin> hls isn't a single stream, so no.
[12:33:06 CET] <sfan5> why do you want to force streamlink into this anyway?
[12:33:30 CET] <kepstin> i thought your problem is that the browser couldn't play back whatever streamlink was doing
[12:33:34 CET] <SuperCuber> i mean if im using it to receive the stream might as well use it to output the stream
[12:33:54 CET] <SuperCuber> but since hls isnt a single stream it won't work
[12:36:09 CET] <SuperCuber> oh no, I have to set up a webserver :(
[12:38:09 CET] <sfan5> also you don't even need streamlink to read a twitch stream with ffmpeg
[12:38:20 CET] <sfan5> ffmpeg -i "$(youtube-dl -g 'https://www.twitch.tv/channelname')" works just as well
[13:03:12 CET] <SuperCuber> so I tried to publish to local nginx-rtmp server using this command https://pastebin.com/ArrFvdk8 and this config https://pastebin.com/VTJENg7m however I get the following error: https://pastebin.com/KCv7pATG
[13:03:16 CET] <SuperCuber> any ideas sfan5 kepstin ?
[13:03:58 CET] <sfan5> -c:v copy
[13:04:21 CET] <kepstin> SuperCuber: the error says [flv @ 0x29e24a0] closed gop with scene change detection are not supported yet
[13:04:27 CET] <SuperCuber> where exactly? am noob
[13:04:30 CET] <kepstin> which means that your -flags +cgop is what's causing the error
[13:04:40 CET] <SuperCuber> before c:a copy?
[13:04:45 CET] <kepstin> SuperCuber: but yeah, you'll want to just copy the video rather than re-encoding
[13:05:47 CET] <SuperCuber> the whole point of the thing is to downscale the stream so don't I need to reencode?
[13:07:12 CET] <sfan5> then add -c:v libx264 instead
[13:07:30 CET] <kepstin> and remove that -flags +cgop option
[13:08:11 CET] <kepstin> oh wait no, that's not the issue
[13:08:18 CET] <kepstin> just set -c:v libx264 that's all
[13:08:29 CET] <kepstin> i didn't see that it had picked the wrong codec
[13:08:34 CET] <SuperCuber> ok had to add something to fix malformed audio and it seems to work now
[13:09:02 CET] <SuperCuber> second line is now "'-vf:v scale=-1:$quality -preset ultrafast -c:a copy -bsf:a aac_adtstoasc -c:v libx264 \" and looks like it works
[13:09:16 CET] <SuperCuber> now to do the webserver
[13:09:43 CET] <kepstin> note that in the scale command line you want to use -2 instead of -1, incase you get some vertical resolution that would round the width to an odd number
[13:10:39 CET] <SuperCuber> so now nginx-rtmp gives me 404 on that url :/
[13:11:39 CET] <kepstin> you haven't set up nginx-rtmp to give hls output
[13:12:29 CET] <kepstin> https://github.com/arut/nginx-rtmp-module/wiki/Directives#hls - need to tell nginx to write the hls files to a temp directory, and add an http location block to actually serve them up.
[13:16:24 CET] <SuperCuber> ok that gives me 403 forbidden
[13:20:34 CET] <SuperCuber> maybe it doesnt like that its in /tmp?
[13:21:26 CET] <SuperCuber> oh nvm /tmp/hls was owned by root for some reason
[13:22:02 CET] <SuperCuber> ctually nope its still the same
[13:24:15 CET] <SuperCuber> this is the config http://paste.ubuntu.com/p/v58R2VWZmG/
[13:29:15 CET] <SuperCuber> actually nvm accessing /hls/mystream.m3u8 works, now how do I view that?
[13:29:47 CET] <BtbN> open it with any hls compatible player
[13:31:54 CET] <SuperCuber> looks like https://video-dev.github.io/hls.js/demo/ doesnt want to open it
[13:32:30 CET] <SuperCuber> actually http://hlstester.com/ says cross domain access denied
[13:33:31 CET] <SuperCuber> even tho nginx.conf has add_header Access-Control-Allow-Origin *
[13:34:55 CET] <SuperCuber> oh i just had to add http? wait what
[13:38:03 CET] <SuperCuber> ok now there is the problem of if I don't watch the stream it just saves up the old footage. I want it to jump to live footage as soon as I open the stream in the browser. is that possible?
[13:38:22 CET] <furq> are you using ffmpeg's hls output or nginx-rtmp
[13:38:27 CET] <furq> if it's the former then -list_size
[13:38:35 CET] <furq> or -hls_list_size rather
[13:38:37 CET] <furq> !muxer hls
[13:38:37 CET] <nfobot> furq: http://ffmpeg.org/ffmpeg-formats.html#hls-2
[13:38:52 CET] <SuperCuber> using ffmpeg into nginx-rtmp
[13:39:15 CET] <SuperCuber> https://pastebin.com/ArrFvdk8
[13:39:42 CET] <furq> https://github.com/arut/nginx-rtmp-module/wiki/Directives#hls_playlist_length
[13:40:09 CET] <SuperCuber> so if I set it to the length of one segment (which I think is 5s from what I observed) it will be almost live?
[13:40:55 CET] <furq> no
[13:41:05 CET] <furq> hls has inherent latency issues
[13:41:14 CET] <furq> most players will always buffer at least two full segments
[13:41:28 CET] <SuperCuber> ok 10 seconds is fine, I just don't want it to be like 5 minutes
[13:41:36 CET] <furq> yeah it won't be that bad
[13:41:42 CET] <furq> it'll be 15-20 seconds with 5 second segments
[13:41:53 CET] <furq> you can drop the segment size but then you obviously increase the risk of buffering issues
[13:42:23 CET] <DHE> this is basically the infamous "twitch lag" (twitch.tv)
[13:42:57 CET] <furq> does twitch still offer up rtmp streams
[13:43:14 CET] <furq> if it does then you should make sure youtube-dl is fetching that url
[13:44:21 CET] <SuperCuber> so now that I set up my server, time to set up a client
[13:44:23 CET] <furq> you probably also want to use larger gops
[13:44:32 CET] <furq> it should really match your segment time
[13:44:49 CET] <SuperCuber> ideally I want to edit twitch's html to use my server as a source for seamless usage
[13:45:11 CET] <SuperCuber> how much should I use for the gops?
[13:45:21 CET] <furq> if you have 5-second segments then fps*5
[13:45:50 CET] <SuperCuber> oh yeah that reminds me, fps flag is -r right? and I put it after -preset in my case?
[13:46:04 CET] <furq> -vf fps=30,scale=-1:$quality
[13:46:22 CET] <furq> otherwise it'll scale before dropping frames and waste a bunch of cpu time
[13:47:05 CET] <SuperCuber> ok so gop = 150
[13:47:08 CET] <furq> right
[13:47:12 CET] <furq> you should also use -preset superfast if you can afford to
[13:47:40 CET] <SuperCuber> its the minimal digitalocean vps but i think it should keep up so yeah
[17:55:59 CET] <classict> Hi, everybody
[17:56:12 CET] <classict> Is possible set timeout on rtmp input??
[17:56:23 CET] <ZexaronS> hello
[17:56:33 CET] <ZexaronS> so oh it's a mpv question
[17:56:38 CET] <ZexaronS> nevermind,
[17:57:08 CET] <classict> I get this error when rtmp when consume rtmp---- RTMP_ReadPacket, failed to read RTMP packet header
[17:57:16 CET] <classict> and ffmpeg get stuck 100% of cpu
[17:57:42 CET] <classict> and never exit, so...is possible exit on that exception?
[18:09:38 CET] <alexpigment> classict, if you're capable of editing the source code and recompiling, then yes, you should be able to exit on that exception
[18:10:03 CET] <alexpigment> aside from that, i'm not sure
[21:16:06 CET] <a-l-e> hi... i'm trying to put a (transparent) png on top of a webm video...
[21:16:38 CET] <a-l-e> i'm trying to follow https://superuser.com/a/714705
[21:17:09 CET] <a-l-e> and https://ffmpeg.org/ffmpeg-filters.html#overlay-1 but i cannot come to a solution that does something.
[21:17:39 CET] <a-l-e> the command i try "works", but the resulting webm does not contain the overlay.
[21:17:52 CET] <a-l-e> ffmpeg -i input.webm -i text.png -filter_complex "overlay=0:0:enable='between(t,1,4)'" output-text.webm
[21:18:10 CET] <a-l-e> the png has the same size as the webm and it should cover it...
[21:18:40 CET] <durandal_1707> check input.webm timestamps, they should start from 0
[21:18:51 CET] <a-l-e> (well, not cover, but put its non transparent part (a text) on top of the movie.
[21:19:07 CET] <durandal_1707> is input.webm duration bigger than 1 second?
[21:19:14 CET] <a-l-e> yes
[21:19:53 CET] <a-l-e> but the webm itself is created from PNGs with a "duration"...
[21:20:19 CET] <a-l-e> let me try with a "normal" webm.
[21:20:44 CET] <a-l-e> ok, on a normal webm i get the text...
[21:20:52 CET] <a-l-e> so, the question is a bit different : - )
[21:21:15 CET] <a-l-e> ffmpeg -f concat -i input.txt -vsync vfr -pix_fmt yuv420p output.webm
[21:21:58 CET] <a-l-e> from https://trac.ffmpeg.org/wiki/Slideshow
[21:22:16 CET] <a-l-e> what should i do to get a "normal" webm? : - )
[21:22:55 CET] <durandal_1707> why you need -vsync vfr ?
[21:23:24 CET] <durandal_1707> normal webm should be cfr
[21:23:50 CET] <durandal_1707> so i dunno what really happens with webm with which overlay does not work
[21:24:14 CET] <durandal_1707> perhaps it have huge pts gaps?
[21:25:21 CET] <a-l-e> that was it!
[21:25:43 CET] <a-l-e> i guess that the vfr was for minimizing the size of the file...
[21:26:12 CET] <durandal_1707> yes, but that would mess up with your overlay usecase
[21:27:15 CET] <a-l-e> ok, i normally don't need to add an overlay... so i can keep both.
[21:27:20 CET] <a-l-e> thanks for you input!
[22:29:25 CET] <gh0st3d> Hey guys, I'm trying to combine two video files and replace the audio with a different audio file that needs to be trimmed & have a fade out added... I've got a list of all the separate commands I can run to handle this, but was curious if there's anyway to combine them into one?
[22:29:45 CET] <gh0st3d> This is the issue I encounter when I try to add the trim/fade out to the audio: Filtergraph 'afade=t=out:st=65:d=5' was defined for audio output stream 0:1 but codec copy was selected. Filtering and streamcopy cannot be used together.
[22:30:10 CET] <gh0st3d> So I'm not sure if it's just not possible as one command, or if I can rearrange the command to make it work
[22:33:58 CET] <furq> the error message is pretty clear
[22:34:03 CET] <furq> you can only run filters when reencoding
[23:09:51 CET] <trg[m]> hey all, I'm recording desktop w/pulse audio and the resulting audio/video seem to be out of sync in many cases, wondering if anybody could lend a hand. here is the command I'm running --
[23:09:51 CET] <trg[m]> ffmpeg -f pulse -ac 2 -channel_layout stereo -i default -video_size 1920x1080 -framerate 30 -f x11grab -draw_mouse 0 -i :99 -c:v libx264 -crf 0 -preset ultrafast lossless.mkv
[23:10:47 CET] <sfan5> try throwing -vsync 0 in there
[23:10:53 CET] <trg[m]> I get lots of "Non-monotonous DTS in output stream" and "Queue input is backward" warnings while capturing the streams, usually doesn't have a noticeable effect though
[00:00:00 CET] --- Thu Mar 15 2018


More information about the Ffmpeg-devel-irc mailing list