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

burek burek021 at gmail.com
Mon May 21 03:05:01 EEST 2018


[03:46:39 CEST] <nicolas17> downscaling a video to 1/8th size, 500fps
[03:46:41 CEST] <nicolas17> tried decoding with vaapi, 400fps
[03:46:57 CEST] <nicolas17> tried decoding *and* downscaling with vaapi, 1500fps <3
[04:13:27 CEST] <Djfe> How can I convert dvb_subtitles to dvd_subtitles and scale them at the same time from 1280x720 to dvd resolution (PAL, 720x576 anamorph)? (I don't want to burn them in)
[04:15:05 CEST] <Djfe> The only thing I found so far was the filter scale2ref, but as far as I can tell this filter only applies when burning subtitles into the video (but I might be wrong)
[04:16:36 CEST] <Djfe> For the conversion itself I use -c:s dvdsub so far.
[04:24:17 CEST] <nicolas17> how do I extract eg. one frame per minute into image files, but keep the original frame numbers in the filenames?
[04:32:19 CEST] <furq> nicolas17: you can't
[04:32:30 CEST] <furq> the closest you can get is -frame_pts 1 which gives the original pts in the filename
[04:32:51 CEST] <nicolas17> I don't see that in the manpage :o
[04:32:59 CEST] <furq> !muxer image2 @nicolas17
[04:32:59 CEST] <nfobot> nicolas17: http://ffmpeg.org/ffmpeg-formats.html#image2-2
[04:33:25 CEST] <nicolas17> oh great, ancient version
[04:33:31 CEST] <furq> Djfe: i'm pretty sure you can just use -vf scale on image subtitle formats
[04:44:45 CEST] <Djfe> @furq Hi, that seems to have worked, thx! :)
[04:45:02 CEST] <Djfe> I'll report back once the encode finished
[04:48:48 CEST] <ariyasu> lots of broadcast sources will also have text based subs in the ts also Djfe
[04:49:03 CEST] <ariyasu> which are easy to demux/remux
[04:51:28 CEST] <Djfe> Thx @ariyasu, the problem I have is of another nature though ^^
[04:51:30 CEST] <Djfe> I'm burning a dvd for my father, source is a tv recording
[04:51:56 CEST] <ariyasu> yeah, it might have 888 subs
[04:52:37 CEST] <Djfe> it actually has both: dvb and teletext subs, only the dvb has color though
[04:52:50 CEST] <Djfe> I actually have an .srt file (created by OCR with tesseract) from the file (with color and everything)
[04:53:19 CEST] <Djfe> and alternative would be creating new idx/sub files from the .srt file, but at least subtitle edit sucks at that
[04:53:45 CEST] <ariyasu> yeah
[04:54:00 CEST] <ariyasu> i like to just demux the teletext subs, then remux into the encode
[04:54:17 CEST] <ariyasu> if no teletext subs exist i will use subtitle edit / ocr
[04:54:23 CEST] <ariyasu> but that's quite a pain to do
[04:54:30 CEST] <Djfe> I need idx/sub anyways for dvd, so my thought was: let's keep the subtitles as original as possibel :)
[04:55:40 CEST] <nicolas17> I need to manually label intervals of a video with a 'scene type'... I'm thinking label one frame per minute or so, and then do binary search (take frames between two adjacent labeled frames with different labels)
[04:56:47 CEST] <Djfe> I use another (commercial) tool for OCR (with tesseract build-in), it works automatically
[04:57:01 CEST] <Djfe> but I'm unsure, whether naming that would be ok here; let's just say creating .srt files is actually no problem for me
[04:57:01 CEST] <ariyasu> tsdoctor?
[04:57:08 CEST] <Djfe> nvm
[04:57:13 CEST] <Djfe> you said it ^^
[04:57:31 CEST] <ariyasu> the problem with it, is it doesn't prompt you when it's unsure of stuff
[04:57:36 CEST] <ariyasu> so you get errors in the output
[04:59:50 CEST] <Djfe> it's not as nice as ffmpeg for advanced users, but it handles DVB Transportstreams better in certain regards, because ffmpeg was never optimised for that, I think
[05:00:17 CEST] <ariyasu> i use it to cut with when vrd has errors
[05:00:31 CEST] <ariyasu> also for hevc broadcasts and 4:2:2 stuff that vrd won't touch
[05:00:43 CEST] <ariyasu> then feed all my cut stuff through ffmpeg
[05:01:04 CEST] <nicolas17> I wonder if there is anything automatic (scene change detection) I can use to make this easier
[05:03:15 CEST] <Djfe> @nicolas17 ah, so you want something like chapters roughly every minute, that start on a frame that have a harsh cut? (black image)
[05:04:53 CEST] <nicolas17> Djfe: I have a gaming video (downloaded from Twitch) and I want to label in game match vs in game lobby vs full screen streamer's camera
[05:05:33 CEST] <Djfe> do you want to burn those labels into the image or create metadata from that info?
[05:05:34 CEST] <nicolas17> the plan is to train machine learning to detect those, but I need a sane way to manually label one video to use as training data
[05:06:00 CEST] <nicolas17> scrolling frame by frame would drive me crazy before I get to the ML part
[05:08:04 CEST] <Djfe> I'm not sure whether ML is the easiest way
[05:08:14 CEST] <TheAMM> Same
[05:08:15 CEST] <Djfe> my suggestion: use OpenCV and Python ;)
[05:08:28 CEST] <nicolas17> with 'scene change detection' I meant dividing the video at points where there's too much difference from one frame to the next
[05:08:42 CEST] <nicolas17> then manually label the resulting sections
[05:08:42 CEST] <Djfe> yeah, you don't need ML for that
[05:08:48 CEST] <TheAMM> It may make it more flexible but last time I did something simular (find transitions in AMV Hell videos), I just looked at a few pixels and compared colors
[05:08:51 CEST] <Djfe> it's actually easier without ML
[05:09:35 CEST] <TheAMM> Pretty sure there's a filter for dumping scene changes, though
[05:10:01 CEST] <Djfe> I once used an approach to find changes in a screen capture: (slide changes); in that case it was enough to load frames and subtract them, but I looked further into it at first
[05:10:05 CEST] <TheAMM> Could be wrong but when I looked at blackframedetect I think I passed something similar
[05:10:27 CEST] <Djfe> I found something, but I'm not sure if it works already: https://pyscenedetect.readthedocs.io/en/latest/
[05:12:14 CEST] <Djfe> https://github.com/Breakthrough/PySceneDetect
[05:16:53 CEST] <Djfe> Feature detection might be worth looking into: https://www.youtube.com/watch?v=kL7WdG90tws
[05:18:00 CEST] <Djfe> You could open a video and find out whether the current frame looks similar enough to the lobby/has elements of the lobby; you can detect several parts of the lobby
[05:18:39 CEST] <Djfe> then save that stuff into a file and load it the next time you want to edit a similar video (same game), so you don't have to do it again
[05:19:25 CEST] <Djfe> After that you only have to figure out what you want to do with the video, if you got the data where the scene changed
[05:19:42 CEST] <Djfe> as you can see in the video: you don't have to do it frame by frame
[05:20:37 CEST] <Djfe> it's heuristics/algorithms; since your game lobby doesn't change they are superior to ML (because you can create them faster with the existing libraries and they are more reliable)
[05:34:12 CEST] <Djfe> @furq I currently use the following command:
[05:34:37 CEST] <Djfe> ffmpeg -i input.ts -vf scale=1024:576,setd ar=4:3,setsar=1:1 -c:v mpeg2video -q:v 5 -target pal-dvd -r 25 -c:a copy -c:s dvdsub output.vob
[05:35:22 CEST] <Djfe> and I'm currently seeing this: https://i.imgur.com/iwhX6nX.png
[05:35:44 CEST] <Djfe> looks to me like vfscale isn't applied to dvd_subtitle
[05:36:15 CEST] <Djfe> the output suggests the correct resolution though: "Stream #0:2(deu): Subtitle: dvd_subtitle (dvdsub), 720x576 (hearing impaired)"
[05:36:38 CEST] <furq> i assume you want something like -filter_complex [0:v]scale=1024:576,setdar=4:3,setsar=1:1[v0];[v0][0:s]scale2ref
[05:36:47 CEST] <furq> except probably with more quotes
[05:37:03 CEST] <Djfe> thx!! :)
[05:37:09 CEST] <furq> actually you probably need explicit mapping there
[05:37:48 CEST] <furq> -filter_complex "[0:v]scale=1024:576,setdar=4:3,setsar=1:1[v0];[v0][0:s]scale2ref[s0]" -map "[v0]" -map "0:a" -map "[s0]"
[05:37:51 CEST] <furq> something like that
[05:53:06 CEST] <Djfe> -filter_complex "[0:v]scale=1024:576,setdar=4:3,setsar=1:1[v0];[v0][0:s]scale2ref[s0][v0]" -map "[v0]" -map "0:a" -map "[s0]"
[05:53:29 CEST] <Djfe> worked, I needed to add [v0] to be able to map it afterwards
[05:53:44 CEST] <Djfe> the problem: this created an mpeg2videostream from my subtitles ^^
[05:54:25 CEST] <Djfe> https://i.imgur.com/gml82g5.png
[06:01:36 CEST] <Djfe> I'm not the only one: https://stackoverflow.com/questions/41818276/in-ffmpeg-how-do-i-scale-dvdsub-subtitles-to-match-video-size-using-scale2ref
[06:04:13 CEST] <Djfe> but canvas_size 720x576 doesn't work
[06:04:22 CEST] <Djfe> it doesn't change anything
[06:12:08 CEST] <Djfe> I will it leave it like this, ffmpeg only seems to be good at burning in subtitles at the moment. Maybe I'll find another solution for scaling bitmap subtitles at some point
[06:13:26 CEST] <Djfe> @furq again, I'm greatful for your help. Bye
[17:03:24 CEST] <otyugh> I've got a naive question ; why " -movflags faststart" isn't a default ?
[17:03:33 CEST] <otyugh> It doesn't seem to inflate the video or anything
[17:03:55 CEST] <otyugh> is there any backdraw to this ?
[17:04:46 CEST] <furq> the drawback is that it has to write the file twice
[17:06:03 CEST] <otyugh> I'm not sure I understand what you mean
[17:06:41 CEST] <otyugh> the encoding didn't seem slower to me
[17:06:49 CEST] <kepstin> it writes the file, then when it's done it goes back and re-reads the file, copying it to a temp file, with the moov moved to the start.
[17:06:54 CEST] <furq> right
[17:07:02 CEST] <furq> the moov isn't fixed size and its contents aren't known until you're done encoding
[17:07:23 CEST] <kepstin> on small files, unnoticable, but it does only work if you're writing to a filesystem where it can make extra files and rename them
[17:07:36 CEST] <furq> it's very noticeable on large files
[17:07:36 CEST] <kepstin> and on big files, there's a long wait at the end for the io for the rewrite
[17:07:57 CEST] <furq> especially if you have a fancy script that remuxes lots of large files in parallel on a hard disk
[17:09:13 CEST] <otyugh> I'm doing this with small video files. Guess it's adapted to me. As I want to access it throught web. Same deal for audio files ?
[17:11:36 CEST] <otyugh> Mhm. And as I went hastly encoding stuff without fastart, is there a way to apply only the movlfags thing without reencoding ?
[17:12:30 CEST] <otyugh> I don't even know how to know if the flag is up. Gotta watch some doc.
[17:12:52 CEST] <otyugh> thanks anyway :)
[17:36:00 CEST] <kepstin> you can use -c copy with -movflags faststart to do it without re-encoding
[17:38:02 CEST] <BtbN> Or just qt-faststart if that's all you want to do
[18:39:29 CEST] <edgar_> hi there. im new with ffmpeg. i wonder  if someone can help me ? i want to stream to youtube.  i have suddenly found a snippet, that works good. But i want to change the audio input from microphone to a specified mp3 file. Can someone help me?
[18:39:51 CEST] <edgar_> Thats my code: ffmpeg -ar 44100 -ac 2 -f alsa -i hw:1,0 -f v4l2 -codec:v h264 -framerate 30 -video_size 1920x1080
[18:39:51 CEST] <edgar_> -itsoffset 0.5 -i /dev/video0 -copyinkf -codec:v copy -codec:a aac -ab 128k -g 10 -f
[18:39:51 CEST] <edgar_> flv rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx
[18:53:28 CEST] <ladders> im having trouble making a webm from a set of jpegs.  they arent in numeric order so i cant use -i foo%02d.jpg.  how/can i specify multiple inputs?
[19:14:49 CEST] <klaxa> ladders: cat file1.jpg, file2.jpg filewhatever.jpg | ffmpeg -f image2pipe -i - [...]
[19:15:08 CEST] <klaxa> ah, mind the ',' that's wrong :P
[19:15:26 CEST] <edgar_> ^^ klaxa, do you have a solution for my request? X)
[19:16:16 CEST] <ladders> pretty sure i tried it but i will again
[19:16:24 CEST] <klaxa> just replace "-ar 44100 -ac 2 -f alsa -i hw:1,0" with "-i my_cool.mp3"
[19:18:14 CEST] <edgar_> hmm. something went wrong. it says " Failed to read frame size: Could not seek to 22764"
[19:18:42 CEST] <ladders> klaxa: thanks it's working but i dont get the last jpg/frame in the output webm
[19:19:36 CEST] <klaxa> hmm... "something something frames have no duration" maybe add a black frame after the last image? players usually exit after the last image was rendered and thus it doesn't stay visible for long (or something like that)
[19:20:06 CEST] <klaxa> edgar_: that sounds too generic to make any judgement, pastebin the complete output of ffmpeg (on pastebin or something)
[19:22:27 CEST] <edgar_> https://pastebin.com/jeWA87AG
[19:23:27 CEST] <edgar_> im very beginner to linux and ffmpeg, thanks a lot so far
[19:24:12 CEST] <klaxa> looks like your mp3 is broken? can you play it?
[19:25:02 CEST] <edgar_> mhh ill try it out...
[19:26:33 CEST] <klaxa> brb laundry...
[19:31:10 CEST] <edgar_> klaxa. the audio was broken :/. thank you so much xD i took me 2h to check the audio file....
[19:32:46 CEST] <klaxa> heh
[19:41:51 CEST] <edgar_> is there a method to loop the audio all the time?
[19:43:22 CEST] <otyugh> Ahm. I'm confused. I wanted to compare a online loading of a video encoded without +fastart and with. And they basically do the same : I can jump within the file without it being entirely loaded. I'm confused.
[19:43:46 CEST] <otyugh> +a video
[19:44:02 CEST] <otyugh> I will rephrase that
[19:45:36 CEST] <otyugh> I compared two same video, one with +faststart one without. The two seem seekable without entire downloading. Using mkv/h264.
[19:46:52 CEST] <klaxa> edgar_: try ffmpeg -stream_loop -1 -i input.mp3 [...]
[19:46:56 CEST] <otyugh> maybe modern players are smart enought to request the end of a file first ?
[19:47:32 CEST] <klaxa> mkv just supports that, i think faststart is mostly useful with mp4?
[19:47:57 CEST] <otyugh> Wow. Great then o/
[19:54:02 CEST] <edgar_> klaxa: it plays 1st time but after it the stream close
[19:54:48 CEST] <klaxa> weird, does it throw an error?
[19:55:10 CEST] <edgar_> but i can achieve similar result with something like "ffmpeg -f concat -i list.txt ".. and in the list i list the file multiple times. lol
[19:56:18 CEST] <edgar_> hmm ffmpeg itself doesnt throw an error, but the livestream cancel after the first play off. (youtube stream)
[19:57:44 CEST] <kepstin> otyugh: if you use a player & server that can do http byte range requests, it will generally try to seek in the file and load the MOOV from the end of the file, yeah, but faststart is still a bit better because it avoids the extra request
[20:10:03 CEST] <edgar_> i have one more question ^^ is it possible to change the video output ( from device0 to device1) in real time ?
[20:11:15 CEST] <JEEB> if you make your own thing, yes
[20:11:26 CEST] <JEEB> ffmpeg.c as an API client is very, very static
[20:11:51 CEST] <JEEB> so if you need dynamic, you start building your own from the FFmpeg building blocks (from which ffmpeg.c is made as well)
[20:13:10 CEST] <edgar_> sounds good. i think it 'll take some time to understand how to do this xD
[20:13:26 CEST] <JEEB> there's some examples for various things in the doc/examples directory
[20:13:45 CEST] <JEEB> I think the transcoding example is not perfect, but it does indeed utilize some of the not-ancient APIs
[20:13:53 CEST] <JEEB> also it doesn't try to do file reading manually I think
[20:24:45 CEST] <blayze> hello
[20:25:30 CEST] <blayze> im new to ffmpeg .. does libaom download with ffmpeg or do i have to dl it seperately
[20:25:45 CEST] <JEEB> libaom is a separate project for which there is a wrapper in FFmpeg
[20:25:54 CEST] <JEEB> so you need to download, build and install libaom
[20:26:00 CEST] <JEEB> then FFmpeg with libaom enabled
[20:27:14 CEST] <blayze> thank you jeeb
[20:28:19 CEST] <JEEB> install doesn't mean into your general sysroot of course, you can install into some home directory prefix or so with --prefix and then use PKG_CONFIG_PATH to guide FFmpeg's configure to that location
[20:28:27 CEST] <JEEB> (101 in *nix build systems)
[20:34:38 CEST] <SpeakerToMeat> I'm trying to cut a piece from time X to the end with -ss but I want/need to be more precise than seconds, yet I'm trying from -ss 00:01:33.1 to -ss 00:01:33.9 as an input and it seems to make no difference on the output.... any idea why? and if I can use a more frame-specific format (not easy considering source is 23.976)
[20:35:23 CEST] <kepstin> SpeakerToMeat: are you using -c copy? if so, it can only cut at keyframes
[20:36:38 CEST] <SpeakerToMeat> kepstin: AH! makes sense
[20:36:48 CEST] <SpeakerToMeat> kepstin: Thank you
[00:00:00 CEST] --- Mon May 21 2018


More information about the Ffmpeg-devel-irc mailing list