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

burek burek021 at gmail.com
Sun Aug 6 03:05:01 EEST 2017


[05:21:37 CEST] <Ch3ck> Is there any ffmpeg go library?
[05:22:03 CEST] <Ch3ck> I"m working on a video downloader, so I'll need some video processing and conversions to mp3 format
[05:22:11 CEST] <Ch3ck> I think ffmpeg will be a good choice here
[05:25:19 CEST] <furq> not really
[05:31:07 CEST] <Ch3ck> furq, what do you mean?
[05:31:14 CEST] <Ch3ck> Tell me more
[05:31:48 CEST] <furq> i mean there isn't any ffmpeg go library
[05:32:03 CEST] <furq> all the ones that i know of are incomplete and/or abandoned
[05:32:13 CEST] <furq> like most (all?) ffmpeg bindings
[05:33:05 CEST] <furq> i expect anyone doing video processing stuff is just invoking ffmpeg or just binding the specific lavc/lavf functions that they need
[05:33:30 CEST] <Ch3ck> furq, I see
[05:33:44 CEST] <Ch3ck> Just found some stuff on github, but like you said they're no longer maintained
[05:33:53 CEST] <furq> yeah and the api changes a lot
[05:34:07 CEST] <furq> granted you'd probably want to static link that and ship binaries
[05:34:07 CEST] <Ch3ck> Guess I might have to use 'cgo' in this case
[05:34:17 CEST] <furq> does this video downloader do anything that youtube-dl doesn't
[05:34:29 CEST] <Ch3ck> I just want to write something in native Go
[05:34:37 CEST] <Ch3ck> furq, youtube-dl is python
[05:34:53 CEST] <furq> if you're just doing it as a learning exercise then just invoke ffmpeg
[05:34:58 CEST] Action: Ch3ck  python sucks!
[05:35:08 CEST] <furq> it does suck, but youtube-dl is good
[05:35:27 CEST] <Ch3ck> furq, Yeah, I'm just experimenting implementing something like that in Go
[05:35:36 CEST] <furq> youtube-dl invokes ffmpeg
[05:35:41 CEST] <Ch3ck> besides "youtube-dl" is a seemingly old project
[05:35:48 CEST] <furq> nah it's still pretty active
[05:35:54 CEST] <furq> that's the gold standard really
[05:36:01 CEST] <Ch3ck> Yeah, so I've hard
[05:36:04 CEST] <Ch3ck> *heard*
[05:36:29 CEST] Action: Ch3ck is thinking of may be starting a go binary support for ffmpeg
[05:36:42 CEST] <Ch3ck> *binding* support for ffmpeg
[05:36:49 CEST] <furq> for a lot of videos (hls/dash) ytdl just finds the playlist/manifest url and and invokes ffmpeg
[05:36:53 CEST] <furq> it doesn't even download the video itself
[05:37:22 CEST] <Ch3ck> furq,  I have no experience with ffmpeg
[05:37:24 CEST] <furq> most of the hard work is taking a video page url and figuring out where the video is
[05:37:37 CEST] <Ch3ck> yeah, I guess so
[05:37:48 CEST] <Ch3ck> But it'll be a learning experience for sure
[05:38:07 CEST] <furq> not to discourage you from writing bindings, because i'd like to see some decent ones
[05:38:11 CEST] <Ch3ck> furq, any links to some beginner docs
[05:38:15 CEST] <furq> for ffmpeg?
[05:38:20 CEST] <furq> not really
[05:38:24 CEST] <Ch3ck> Yep
[05:38:30 CEST] <Ch3ck> For ffmpeg
[05:38:30 CEST] <DHE> seconding youtube-dl being awesome
[05:38:40 CEST] <furq> https://ffmpeg.org/ffmpeg-all.html
[05:38:44 CEST] <furq> nothing more beginner-friendly than that
[05:38:47 CEST] <Ch3ck> lol
[05:38:52 CEST] Action: Ch3ck opens link
[05:39:01 CEST] <furq> https://ffmpeg.org/documentation.html
[05:39:11 CEST] <furq> you probably want the split version on there
[05:39:15 CEST] <DHE> ffmpeg-all is great for being able to just CTRL+F for anything you need...
[05:39:17 CEST] <furq> yeah
[05:40:15 CEST] <Ch3ck> I'll take a look at this tomorrow
[05:40:20 CEST] <Ch3ck> It's been a long day coding
[05:40:40 CEST] <Ch3ck> Just need something to do the hard work of decoding and stuff for me
[05:40:47 CEST] <Ch3ck> ffmpeg should work fine
[08:02:31 CEST] <xacktm> hey guys, I'm having trouble with nvenc on my gtx 1060 - get a "Cannot init CUDA" for latest HEAD source - any ideas?  https://bpaste.net/show/b6dc126a1354
[08:57:16 CEST] <xacktm> this forum post looks like the same issue as me, but no leads  https://devtalk.nvidia.com/default/topic/740805/linux/nvenc-h-264-encoder-initialization-failed/2
[11:12:38 CEST] <PaoloP> Given an audio stream sampled at 44100, mono, which is the minimum playback latency (alsa)?
[11:12:44 CEST] <PaoloP> (non-realtime)
[12:51:01 CEST] <DavidGG> hello, i have a command like this to inject 2 image as watermark to video : /usr/bin/ffmpeg -i ori.mp4 -y -i 1.png -i 2.png -filter_complex "[0:v][1:v]overlay=20:20[bkg];[bkg][2:v]overlay=(main_w-overlay_w)-20:(main_h-overlay_h)-20" -codec:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -c:a aac -strict -2 out.mp4  it work great on large width video. problem  come when the video size is 320x240. the watermark is large as half of video
[12:52:10 CEST] <DavidGG> https://pastebin.com/jkx0Vx99
[12:52:41 CEST] <BtbN> so, scale the watermark first
[12:53:26 CEST] <DavidGG> how to scale
[12:53:31 CEST] <BtbN> with the scale filter.
[12:53:58 CEST] <BtbN> Or any image editing program of your choice beforehand
[13:37:31 CEST] <DavidGG> found scale2ref but no idea how to get it work with above command
[14:07:03 CEST] <DavidGG> any help?
[14:08:34 CEST] <DavidGG> https://stackoverflow.com/questions/45521436/ffmpeg-scale-logo-size-according-to-video-size
[14:38:43 CEST] <luc4> Hello! Im experimenting with h264_videotoolbox but I see it is not possible to set a crf option. What would be a good way to set the quality of the result?
[14:39:55 CEST] <JEEB> crf is something that comes out of the libx264 encoder, so naturally nothing else really has it
[14:40:17 CEST] <luc4> JEEB: I see, but isnt there anything equivalent?
[14:40:25 CEST] <JEEB> no idea, check the available AVOptions
[14:40:49 CEST] <luc4> JEEB: I cannot find a list. Can I get it somehow?
[14:40:57 CEST] <BtbN> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/videotoolboxenc.c#L938
[14:41:06 CEST] <BtbN> it seems to be hardcoded into ABR mode
[14:41:08 CEST] <JEEB> there was a help option to list them
[14:41:17 CEST] <JEEB> but I don't remember how it went :P
[14:41:22 CEST] <JEEB> but yea, looking at the code is also fast
[14:41:36 CEST] <BtbN> it uses the normal bitrate and max_rate options
[14:41:46 CEST] <BtbN> That seems to be all the control over the bitrate it gives you
[14:42:37 CEST] <luc4> BtbN: so I should see what bitrate decides libx264 for a specific crf and set the same with h264_videotoolbox?
[14:42:53 CEST] <BtbN> libx264 does not decide on a bitrate in crf mode.
[14:43:02 CEST] <BtbN> vtenc does not have a constant quality mode
[14:44:03 CEST] <JEEB> also different encoders have completely different compression ratios
[14:44:35 CEST] <JEEB> so you will not get the same quality with the same bit rate with VTB
[14:44:39 CEST] <luc4> JEEB: which means& the only way I have is to set a random bitrate?
[14:44:59 CEST] <JEEB> you come up with a bullshit bit rate and get a bullshit result
[14:45:37 CEST] <luc4> JEEB: no bitrate set -> result horrible
[14:45:51 CEST] <luc4> JEEB: maybe I can try with a higher bitrate?
[14:47:52 CEST] <JEEB> I think the libavcodec default is like 200kbps :P
[14:49:47 CEST] <luc4> JEEB: similar video with crf 22 is around 12000kbps
[14:50:29 CEST] <luc4> Ill try something like that
[19:14:02 CEST] <leeaandrob> hello, so I have a little question, it's possible transcode two files on same time with only a single core processor?
[19:14:13 CEST] <npn> Hi. I have a series of mp4 training videos. I would like to serve them up to our users, but dynamically watermark each one with the user's login name. The best I can come up with right now is that each time a new user subscribes, we encode the entire list of mp4s with the watermark and store them for some period to serve him - that doesn't seem ideal. Would rather do it dynamically and live. Any ideas?
[19:27:56 CEST] <iive> npn waited whole 10 minutes....
[19:30:44 CEST] <amey> npn: The videos you are serving are for download or to watch online only?
[19:32:09 CEST] <iive> either way, if he wants a watermark that cannot be easily removed, he has to embed  it into the video
[19:32:24 CEST] <iive> and this means recoding for each user.
[19:37:50 CEST] <andai> so I'm adding -strict -2 but i keep getting the message that I need to add -strict -2
[19:38:45 CEST] <andai> oh i see. needs to be before last argument
[19:38:47 CEST] <durandal_1707> andai: order is important
[19:38:52 CEST] <andai> is there any reason for that
[19:49:08 CEST] <leeaandrob> hello, so I have a little question, it's possible transcode two files on same time with only a single core processor?
[19:52:23 CEST] <JodaZ> of course, speed will be a little bit under half for each of the two transcodes if you run them at the same time
[19:56:19 CEST] <leeaandrob> How is calculate the time from a transcoder? If i have a single core how many threads can i use? @JodaZ?
[19:57:47 CEST] <JodaZ> leeaandrob, you can use as many threads or processes as you want, but you will not gain any advantage from using more than one
[19:58:45 CEST] <leeaandrob> hmmm understood.. I am building a Sass to transcoder and streaming videos on demand using hls but my pain it's how i will transcoder the files..
[19:58:50 CEST] <leeaandrob> @JodaZ
[19:59:23 CEST] <JodaZ> saas?
[20:04:32 CEST] <JodaZ> producing on demand hls segments is a unsolved problem as of now
[20:08:27 CEST] <JEEB> not really, there are vendors doing that
[20:08:38 CEST] <JEEB> in OSS even there's a base for that
[20:08:42 CEST] <leeaandrob> yes.. hls is it good for solve problems videos on demand?
[20:08:59 CEST] <JEEB> nginx-rtmp contains on-demand HLS and DASH conversion from a live stream
[20:09:24 CEST] <leeaandrob> I am building a product for the ead but are will used on Brazil :)
[20:09:26 CEST] <JEEB> so in theory as a problem it's solved, it's just that nobody has wanted to make their thing open source
[20:09:37 CEST] <JodaZ> JEEB, continuous segmenting is trivial, issue is if you want to seek
[20:09:51 CEST] <JEEB> JodaZ: you have an index of the segments
[20:09:59 CEST] <JEEB> then convert to Annex B/AVCc as needed
[20:10:04 CEST] <leeaandrob> I am working and I made a partner on area EAD and Together We will building a product Sass to solve the problem of the on demand.
[20:10:07 CEST] <JEEB> and mux into isobmff or hls
[20:10:37 CEST] <JodaZ> JEEB, in theory its not difficult, in practice there is no software that allows you to live transcode just "segment 5" of some source video
[20:10:57 CEST] <JEEB> transcode, no. we're talking about segmenting into formats of an already available video stream
[20:11:10 CEST] <JEEB> serving media and transcoding are two separate things IMHO
[20:11:38 CEST] <JodaZ> segmenting is just seeking to the nearest ts boundary
[20:12:11 CEST] <JEEB> yes, as long as you have a database of segments and their start timestamp you should be a-OK
[20:12:12 CEST] <leeaandrob> I will use AWS solutions,
[20:12:45 CEST] <leeaandrob> I was using Elastic transcoder but the same was expensive :(
[20:13:34 CEST] <JodaZ> i wish there was a all in one solution to transcode and segment in one
[20:17:07 CEST] <JEEB> I really think it's worth separating those two
[20:18:29 CEST] <JodaZ> well, if you could you'd finally have live transcoding with seeking natively in most browsers
[20:19:00 CEST] <JEEB> live transcoding is something you generally only want to do for live sources
[20:19:20 CEST] <JEEB> and then you feed that transcoded stuff into a thing that will package as required to actual watchers
[20:19:33 CEST] <JodaZ> in professional broadcasting, yes, but if you want to access your own dvd library on your homeserver...
[20:20:06 CEST] <JEEB> in that case you might almost just be remuxing and pushing to client
[20:20:18 CEST] <JodaZ> often enough, yes
[20:20:18 CEST] <JEEB> and in that case you would have the things already on your server and indexed
[20:20:39 CEST] <JodaZ> aac audio isn't supported by most browsers tho
[20:20:49 CEST] <JEEB> that's actually most supported I think now :P
[20:21:12 CEST] <JEEB> firefox does it with either MF, macos framework or libavcodec, chromium does it with libffmpeg.so, mobiles do it
[20:21:31 CEST] <JodaZ> hmm, one of the codecs i encounter typically isn't supported
[20:21:42 CEST] <JEEB> mp3 in mp4 might not be supported often
[20:21:45 CEST] <JEEB> or something like that
[20:21:46 CEST] <JodaZ> whats bluray use again?
[20:21:58 CEST] <JEEB> raw PCM often, TrueHD/DTS are the other ones
[20:23:06 CEST] <JodaZ> oh yeah, DTS is the one
[20:23:30 CEST] <furq> you're probably thinking of ac3
[20:23:36 CEST] <JodaZ> or that
[20:23:46 CEST] <JodaZ> example i just hit had DTS
[20:23:49 CEST] <furq> ac3 is what you almost always get on dvds
[20:25:54 CEST] <leeaandrob> so hls is not a good solution?
[20:26:08 CEST] <leeaandrob> for the streaming on browsers?
[20:26:29 CEST] <leeaandrob> I a builded a solution using, elastic transcoder, s3 and cloud front on aws.
[20:27:18 CEST] <DHE> are you also dealing with multiple bitrates/qualities?
[20:27:37 CEST] <furq> hls is the only real solution for livestreaming on browsers
[20:27:59 CEST] <furq> but for vod you might as well just use a single mp4
[20:28:23 CEST] <furq> the big sites only use hls/dash for vod because it makes it easier to use a cdn
[20:32:45 CEST] <JodaZ> leeaandrob, no, the issue is only that you have to transcode in advance
[20:32:54 CEST] <JodaZ> leeaandrob, if you do that, its all trivial
[20:33:14 CEST] <JodaZ> you just have to loadbalance the transcoding and do cdn
[20:33:25 CEST] <leeaandrob> yes, thats the ideai JodaZ
[20:33:37 CEST] <leeaandrob> but what do your opinion about other codecs?
[20:33:43 CEST] <leeaandrob> exists other solutions better that hls?
[20:34:47 CEST] <JodaZ> no, as furq said, hls/dash are the de-facto solution
[20:36:08 CEST] <leeaandrob> thanks JodaZ :) I will start mabye monday the development and I will bring news here :)
[21:31:39 CEST] <Tzimmo> How to find out which subtitle formats ffmpeg can convert to which other format? Is that documented somewhere? I haven't been able to find such information.
[21:32:51 CEST] <JEEB> generally subtitles (text based) are converted into ASS as internal format, and then that internal format gets converted to some other subtitle (text) format, and then finally the muxers support certain avcodec values
[21:33:28 CEST] <JEEB> so easiest to see the end result is by checking the list of supported a/v/s formats for that container in the code (I don't think there's an interface yet to list the supported things for a container format)
[21:33:45 CEST] <JEEB> using the API you should be able to create such lists and check against them
[21:34:04 CEST] <Tzimmo> So basically mostly text->text? And very restricted (if almost any) bitmap->bitmap?
[21:34:57 CEST] <JEEB> yea, I don't think people have tested/thought too much of bitmap to bitmap
[21:35:00 CEST] <Tzimmo> $ ffmpeg -i outdir/00800.track_4608.sub -map 0:0 -scodec dvbsub foo.sub
[21:35:06 CEST] <Tzimmo> Stream mapping: Stream #0:0 -> #0:0 (dvd_subtitle (dvdsub) -> dvb_subtitle (dvbsub))
[21:35:09 CEST] <Tzimmo> Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
[21:35:29 CEST] <JEEB> yup, and the actual error is somewhere up from that last message
[21:35:38 CEST] <Tzimmo> it looks so good and quite simple operation because there is dvbsub encoder and dvdsub decoder but still... or which extension should I use?
[21:36:07 CEST] <Tzimmo> [microdvd @ 0x2c71020] Exactly one MicroDVD stream is needed.
[21:36:23 CEST] <Tzimmo> mmm... did I provide more than one?
[21:36:29 CEST] <JEEB> no, probably none
[21:36:49 CEST] <JEEB> I mean, you want dvbsub but it picked the "container" as MicroDVD subtitles which is a text format thing
[21:36:58 CEST] <JEEB> it probably probed that the input is dvdsub
[21:37:01 CEST] <Tzimmo> Ah, true, so extension is wrong...
[21:37:19 CEST] <Tzimmo> Any idea which extension (if any) could be used for dvbsub?
[21:37:19 CEST] <JEEB> I'm not sure if you can even write dvb subs into a separate file :P
[21:37:24 CEST] <JEEB> I'd just put them into mpeg-ts or something
[21:37:37 CEST] <JEEB> since that's how you usually use DVB subtitles
[21:37:47 CEST] <Tzimmo> true... -> foo.m2ts did something
[21:38:07 CEST] <Tzimmo> I have written software to OCR dvb subtitles and it works perfectly.
[21:38:44 CEST] <Tzimmo> I was trying to avoid writing dvd subtitle or bd subtitle reader to it if I could just convert dvd subtitle into dvb subtitle and just use what I already have.
[21:39:11 CEST] <JEEB> yea, there's no in-built stuff like that. usually what you'd do in an API client is that you'd use libavcodec to decode to a subpicture, and then you OCR and write a subtitle "frame" out of the result
[21:39:40 CEST] <JEEB> also wasn't DVD/DVB/teletext subtitle stuff "fun" in the way that you don't necessarily know the duration of the subtitle - you just need to wait until the next packet in that case
[21:40:45 CEST] <Tzimmo> Could be... I have usually used projectx to extract DVB subtitles into .son format (better than the other alternative there) and then I read that format and do OCR there.
[21:41:13 CEST] <Tzimmo> But projectx cannot handle HD formats or BD so it doesn't work too well there.
[21:41:29 CEST] <JEEB> I think subtitle edit had some OCR capabilities built-in?
[21:41:37 CEST] <Tzimmo> Is it command line tool?
[21:41:37 CEST] <JEEB> for DVD/BD
[21:41:44 CEST] <JEEB> not sure if it had an interface for that
[21:41:51 CEST] <Tzimmo> I know some GUI tools but I want this to be repeatable process easily.
[21:42:02 CEST] <JEEB> yea I get that :)
[21:42:48 CEST] <JEEB> but yea, dealing with files where you can go through the whole thing is nice
[21:42:54 CEST] <Tzimmo> I was actually loading subtitleedit web page while asking these questions because there was some network lag but now it opened.
[21:42:57 CEST] <JEEB> live input tends to be a bit less simple
[21:43:13 CEST] <JEEB> esp. if the subtitle format doesn't have the duration field necessarily
[21:43:26 CEST] <JEEB> (and you want to OCR/use the text from that subtitle to convert into text)
[21:44:19 CEST] <Tzimmo> subtitleedit looks like Windows-only tool...?
[21:44:35 CEST] <JEEB> could be, I didn't check if they ran on mono
[21:44:38 CEST] <Tzimmo> "Note: SE requires Microsoft .NET Framework Version 4.0 or later"
[21:45:41 CEST] <Tzimmo> My TV fails with most bitmap based subtitles every now and then... like when watching m2ts bluray format, it shows like 60% of the subtitles but loses about half.
[21:45:46 CEST] <Tzimmo> At random. :(
[21:45:56 CEST] <JEEB> mine fails at mp4 timed text
[21:46:04 CEST] <Tzimmo> So when you watch it again, you may see different subtitles being showed and omitted.
[21:46:05 CEST] <JEEB> I can randomly get some random memory locations
[21:46:07 CEST] <JEEB> on the screen
[21:46:55 CEST] <Tzimmo> And for dvb subtitles it shows usually the first line there but the second line is below the screen... only topmost pixels of the second line fit on screen. :(
[21:47:19 CEST] <JEEB> sounds like you cropped the video ;)
[21:47:23 CEST] <Tzimmo> Using mplayer or mpv or vlc or anything on computer shows those subtitles fine, but TV fails with their position somehow.
[21:47:38 CEST] <JEEB> because image based subtitles usually have the canvas size there
[21:47:53 CEST] <JEEB> usually happens with blu-ray subtitles when people download random 720p or whatever rips
[21:48:10 CEST] <JEEB> so the location of the subpictures is 100% correct but the canvas size is larger than video size
[21:48:21 CEST] <Tzimmo> The video doesn't seem to lose anything. Just the TV renders the subtitle in DVB format (unless I burn them to the picture) too low.
[21:49:16 CEST] <Tzimmo> The source for those DVB subtitles comes from the official TV channels.
[21:49:33 CEST] <JEEB> yes, but if you've then poked the video to mismatch the canvas
[21:49:33 CEST] <Tzimmo> I have to convert them to DVD subtitles in order to make them fit on screen.
[21:49:58 CEST] <Tzimmo> I don't touch video or audio.
[21:50:03 CEST] <JEEB> (of course there can be other bugs in plastic toys but generally it's a canvas mismatch when such things happen
[21:50:30 CEST] <Tzimmo> Or even subtitles when I just try to use the original file. But after subtitle conversion (without touching video or audio) to DVD subtitles they are visible on screen.
[21:51:11 CEST] <JEEB> yea, what I mean is that if you downloaded some blu-ray rip with 1920x8xx resolution for example. and then the subpictures that come with it of course are planned to be shown on a 1920x1080 canvas
[21:51:25 CEST] <JEEB> and since usually the canvas in a lot of renderers starts from top left corner
[21:51:34 CEST] <JEEB> you can often get stuff out of the screen at the bottom :P
[21:52:13 CEST] <JEEB> of course if it's your original sources then that's not it
[21:52:30 CEST] Action: JEEB has just seen way too many of those mismatching things on the internet
[21:52:44 CEST] <Tzimmo> I haven't downloaded any from any unofficial sources.
[21:52:59 CEST] <Tzimmo> Just from DVB-T/DVB-T2, Bluray discs or DVDs.
[21:53:32 CEST] <Tzimmo> So at least some of the originals should be correctly done.
[21:54:28 CEST] <durandal_1707> you are doing illegal stuff
[21:54:57 CEST] <Tzimmo> But it seems that if I want to automate this, I have to read/parse HDMV PGS and/or DVD subtitles myself.
[21:55:10 CEST] <JEEB> you can use libavformat/libavcodec for that
[21:55:21 CEST] <JEEB> then you get RGB subpictures with timing
[21:55:26 CEST] <Tzimmo> durandal_1707: Yes, decrypting DVD/BD can be seen illegal.
[21:55:42 CEST] <JEEB> then the subpicture I would probably push to some OCR library
[21:57:27 CEST] <Tzimmo> I tried to use gocr for those bitmaps but I got too bad results with it. It didn't understand a "line" of text, so some "'" in the lower line became "," for the upper line, it didn't always support scandinavian characters too well, and even when I tried to restrict the character set to use
[21:57:32 CEST] <Tzimmo>  -c string - list of chars (_ = not recognized chars, debug)
[21:57:34 CEST] <Tzimmo>  -C string - char filter (ex. hexdigits: 0-9A-Fx, only ASCII)
[21:57:58 CEST] <Tzimmo> to restrict the character set, it still gives me for example í (i + '), á (a + '), etc
[21:58:05 CEST] <durandal_1707> tesseract?
[21:58:17 CEST] <Tzimmo> so it combines the "," from the upper line with "aeiou" from the lower line.
[21:58:45 CEST] <Tzimmo> What is tesseract?
[21:58:56 CEST] <durandal_1707> ocr lib
[21:59:58 CEST] <Tzimmo> durandal_1707: Thanks, haven't tried that out...
[00:00:00 CEST] --- Sun Aug  6 2017


More information about the Ffmpeg-devel-irc mailing list