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

burek burek at teamnet.rs
Wed Aug 21 03:05:04 EEST 2019


[00:00:40 CEST] <Aerroon> maybe you have to reencode the video part
[00:05:41 CEST] <cehoyos> Just add "-stream_loop -1" to your original command line, "-c copy" does not work with overlay
[00:07:20 CEST] <rocktop> cehoyos: so should be ffmpeg -i video3.mp4 -stream_loop -1 -i title.mov -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -shortest   output.mp4
[00:07:37 CEST] <cehoyos> Does it work?
[00:08:31 CEST] <rocktop> cehoyos: yes it does Thank you very much
[00:08:59 CEST] <rocktop> Aerroon: thank you for your help  really you saved my time
[00:09:39 CEST] <rocktop> cehoyos: it is working with  -codec:a copy
[00:09:41 CEST] <Aerroon> nice, i'm glad it helped
[00:09:58 CEST] <cehoyos> Yes, it should
[00:38:02 CEST] <rocktop> how canI add 1.jpg as thumbnail to output video in the command above ?
[00:38:08 CEST] <fred1807> I want to overlay-loop video B on video A, but I want  Video A duration. So Video B overlay will loop until the end of Video A...
[00:39:52 CEST] <rocktop> fred1807: try this ffmpeg -i video3.mp4 -stream_loop -1 -i title.mov -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -shortest   output2.mp4
[00:40:05 CEST] <cehoyos> rocktop: Two overlays?
[00:41:00 CEST] <rocktop> cehoyos: I want tthe first frame in the output video to be an image like thumbnail
[00:41:41 CEST] <cehoyos> There is a concat filter that you should be able to use
[00:42:07 CEST] <cehoyos> Or the concat demuxer
[00:42:41 CEST] <fred1807> rocktop: Ill try
[00:42:42 CEST] <fred1807> th
[00:42:44 CEST] <fred1807> x
[00:43:31 CEST] <rocktop> cehoyos: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output
[00:43:48 CEST] <cehoyos> No
[00:44:06 CEST] <rocktop> but how can I combine this two command into one ?
[00:44:16 CEST] <cehoyos> ffmpeg -f concat -i mylist.txt -stream_loop -1 -i title.mov -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -shortest   output2.mp4
[00:44:35 CEST] <cehoyos> ffmpeg -f concat -i mylist.txt -stream_loop -1 -i title.mov -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -shortest  -acodec copy output2.mp4
[00:45:40 CEST] <rocktop> cehoyos: is not possile to have the content of mylist.txt in same line in the commant?
[00:45:44 CEST] <rocktop> command*
[00:46:07 CEST] <cehoyos> You suggested the concat demuxer instead of the concat filter
[00:53:17 CEST] <rocktop> cehoyos: [0:0][0:1] is this mean that (video=0 audio=1) for input 0?
[00:54:20 CEST] <cehoyos> No, first and second stream of the first input file but please understand that I generally only understand complete command lines including complete, uncut console output
[00:55:39 CEST] <rocktop> so I will try to use this then ffmpeg -f concat -i mylist.txt -stream_loop -1 -i title.mov -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -shortest  -acodec copy output2.mp4
[01:08:33 CEST] <rocktop> cehoyos: I test this and other option but nothing work with me
[01:08:59 CEST] <cehoyos> Please provide the commane line you tested together with the complete, uncut console output
[01:12:01 CEST] <rocktop> cehoyos: https://bpaste.net/show/6a1i
[01:12:24 CEST] <cehoyos> There is something wrong with your binary, sorry!
[01:13:36 CEST] <cehoyos> The first line of the console output is always "ffmpeg version" for a working binary
[01:16:25 CEST] <rocktop> cehoyos: full outoput https://bpaste.net/show/Erqi
[01:17:15 CEST] <cehoyos> Sorry, the concat demuxer doesn't work in your case, you have to use the concat filter
[01:17:44 CEST] <cehoyos> Start with ffmpeg -i 1.jpg -i video3.mp4 -filter_complex concat out.mp4
[01:18:25 CEST] <rocktop> cehoyos: so 2 command ?
[01:18:50 CEST] <cehoyos> No, but I don't use the concat filter regularly so some tests are necessary
[01:20:33 CEST] <cehoyos> Especially since above may lead to desync, so you definitely have to run a few tests
[01:22:04 CEST] <cehoyos> In the end, you should use something like ffmpeg -i 1.jpg -i video3.mp4 -stream_loop -1 title.mov -filter_complex concat[c],[c][2:0]overlay=shortest output.mp4
[01:22:14 CEST] <cehoyos> But please test the concat syntax first
[01:22:53 CEST] <rocktop> cehoyos: Invalid file index 2 in filtergraph description concat[c],[c][2:0]overlay=shortest.
[01:23:36 CEST] <cehoyos> Wow, the concat filter already works for you? That's cool, then you don't need my help
[01:25:02 CEST] <rocktop> cehoyos: hmmm I dont know what I should to do here
[01:25:49 CEST] <cehoyos> You could test the command line above (without overlay) and tell me if it works as expected.
[01:26:03 CEST] <cehoyos> For example, you didn't say how long the image should be displayed.
[01:26:38 CEST] <cehoyos> And I have a suspicion that the output file will be missing audio
[01:27:17 CEST] <rocktop> cehoyos: I need the image to be the thumbnail so 1 frame is enough
[01:27:34 CEST] <cehoyos> Does the output file contain audio?
[01:27:42 CEST] <rocktop> yes
[01:27:56 CEST] <rocktop> should be with audio
[01:28:06 CEST] <rocktop> video3.mp4 audio
[01:28:09 CEST] <cehoyos> Then add the missing "-i" in front of "title.mov" in the second command line and test
[01:28:33 CEST] <cehoyos> I did not ask if the output file is supposed to contain audio but if your test produced an output file with audio
[01:30:44 CEST] <rocktop> cehoyos: https://bpaste.net/show/AyfX
[01:31:57 CEST] <cehoyos> Try "overlay=shortest=1"
[01:32:10 CEST] <cehoyos> Are you sure that the concat filter already works as expected?
[01:36:56 CEST] <rocktop> cehoyos: really you are the best person in the world , Thank you very much
[01:38:04 CEST] <rocktop> it is working like a charm
[02:11:52 CEST] <rocktop> is it possible to reduce scale instead of video quality in two pass method ?
[02:14:26 CEST] <DHE> like given a bitratem how set the resolution based on a fixed CRF value?
[08:17:47 CEST] <pk08> hi guys
[08:18:44 CEST] <pk08> i kept running this command (https://pastebin.com/Vcnmamp6) overnight
[08:19:15 CEST] <pk08> for same source twice and i show today that one video is almost 1.5 mins behind
[08:19:37 CEST] <pk08> can any one please tell me what can be wrong?
[08:19:44 CEST] <pk08> and how to fix this?
[08:35:38 CEST] <durandal_1707> udp is problematic
[08:37:04 CEST] <pk08> yes, may be
[08:37:14 CEST] <pk08> by mistake i lost logs
[08:37:26 CEST] <pk08> otherwise we can know for sure...
[08:38:14 CEST] <pk08> thanks
[09:43:23 CEST] <snooky> hi all
[09:44:11 CEST] <snooky> how can I create an overlay on the screen with ffmpeg? like a navi I want to create an OSD. how do i play this on the screen? and how do I say where which text should be?
[09:56:28 CEST] <durandal_1707> drawtext filter
[10:11:04 CEST] <snooky> thats all?
[10:12:05 CEST] <durandal_1707> there is as always documentation you can consult
[10:29:17 CEST] <storchi> hi friends
[10:32:16 CEST] <storchi> i run: /usr/local/bin/ffmpeg -loglevel info -i udp://@239.192.50.1:1234 -vcodec copy -acodec copy /run/test.ts to test my local isp iptv.
[10:32:53 CEST] <storchi> and it takes 5s to tune. "message from ffmpeg: [mpegts @ 0x1dcd1e0] Could not find codec parameters for stream 0 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec"
[10:34:24 CEST] <storchi> how to decrease this?
[10:35:41 CEST] <storchi> complete ts stream looks like: Input #0, mpegts, from 'udp://@239.192.50.1:1234':
[10:35:42 CEST] <storchi> <cs_>   Duration: N/A, start: 64898.318411, bitrate: N/A
[10:35:42 CEST] <storchi> <cs_>   Program 1400
[10:35:42 CEST] <storchi> <cs_>     Metadata:
[10:35:42 CEST] <storchi> <cs_>       service_name    : Das Erste HD
[10:35:42 CEST] <storchi> <cs_>       service_provider: ARD
[10:35:42 CEST] <storchi> <cs_>     Stream #0:0[0x57e]: Unknown: none ([5][0][0][0] / 0x0005)
[10:35:42 CEST] <storchi> <cs_>     Stream #0:1[0x57f]: Unknown: none ([12][0][0][0] / 0x000C)
[10:35:42 CEST] <storchi> <cs_>     Stream #0:2[0x580]: Unknown: none ([11][0][0][0] / 0x000B)
[10:35:43 CEST] <storchi> <cs_>     Stream #0:3[0x579]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
[10:35:46 CEST] <storchi> <cs_>     Stream #0:4[0x57c](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s
[10:35:48 CEST] <storchi> <cs_>     Stream #0:5[0x57d](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s (visual impaired) (descriptions)
[10:35:51 CEST] <w1kl4s> oh no
[10:35:53 CEST] <storchi> <cs_>     Stream #0:6[0x57a](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
[10:35:55 CEST] <storchi> <cs_>     Stream #0:7[0x57b](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
[10:36:08 CEST] <storchi> <cs_>     Stream #0:8[0x581](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s
[10:36:08 CEST] <storchi> <cs_>     Stream #0:9[0x582]: Data: bin_data ([6][0][0][0] / 0x0006)
[10:36:08 CEST] <storchi> <cs_>     Stream #0:10[0x583]: Unknown: none ([11][0][0][0] / 0x000B)
[10:36:08 CEST] <storchi> <cs_> Output #0, mpegts, to '/run/test.ts':
[10:42:13 CEST] <durandal_1707> please use pastebin
[10:43:02 CEST] <storchi> ok
[10:43:07 CEST] <storchi> next time
[10:44:37 CEST] <w1kl4s> storchi you can try selecting just the streams you want
[10:45:22 CEST] <w1kl4s> so i would assume 3 and 8
[10:45:50 CEST] <storchi> good idea. i have 40 channels. much work
[10:46:30 CEST] <storchi> how can i select stream 3?
[10:46:45 CEST] <w1kl4s> https://trac.ffmpeg.org/wiki/Map
[10:48:29 CEST] <storchi> yeah rtfm
[10:53:07 CEST] <w1kl4s> i mean it explains pretty well what do you need to do
[10:53:12 CEST] <w1kl4s> with decent examples
[10:55:28 CEST] <storchi> i did a test with: /usr/local/bin/ffmpeg -loglevel info -i udp://@239.192.50.1:1234 -map 0:3 -map 0:8 -vcodec copy -acodec copy /run/test.ts
[10:56:05 CEST] <storchi> takes the same time uncluding: "[mpegts @ 0x220b210] Could not find codec parameters for stream 0 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
[10:56:06 CEST] <storchi> Consider increasing the value for the 'analyzeduration' and 'probesize' options"
[10:58:01 CEST] <storchi> with or without mapping it tries to analyze every stream
[10:59:04 CEST] <durandal_1707> reduce probesize and analyzeduration
[10:59:59 CEST] <storchi> thats another good idea. it has effect. what is a good value? key frame interval?
[12:38:10 CEST] <Accord> hey guys
[12:38:58 CEST] <Accord> I'm running this command inside a google cloud machine with 8 cores and 20GB of ram but it hardly uses more than 40% from every core, is there any option to further speed up transcoding?
[12:38:59 CEST] <Accord> 'ffmpeg -y -t 2555.722 -i /tmp/compose/31/4.mp4 -s 1280x720 -c:v libx264 -preset ultrafast -crf 25 -pix_fmt yuv420p -r 25.0 -c:a aac -ar 48000 -ac 2 -af aresample=async=1 out1.mp4'
[12:39:11 CEST] <Alina-malina> hey guyse what video editing software would you recommend to start learning?
[12:39:58 CEST] <cehoyos> Accord: Decoding may be the limiting factor
[12:40:20 CEST] <cehoyos> And scaling even more so
[12:41:50 CEST] <Accord> cehoyos: removing scaling does indeed cause more CPU utilisation but the overall transcoding time will be longer
[12:42:12 CEST] <Accord> I suspect transcoding a 1080p frame takes longer than scaling + transcoding 720p
[12:42:13 CEST] <cehoyos> That indicates that scaling is the limiting factor
[12:42:25 CEST] <cehoyos> That sounds possible
[12:42:35 CEST] <Accord> still only 60% utilisation per core
[12:43:05 CEST] <cehoyos> Multithreaded decoding does not scale well, this is generally unavoidable
[12:43:19 CEST] <cehoyos> Encoding also only scales to some degree
[12:43:52 CEST] <Accord> so not much I can do then?
[12:44:06 CEST] <JEEB> of course you'd need to do proper performance checking to see what's actually taking the most time and what could be best spent optimizing
[12:44:23 CEST] <JEEB> too bad I never really got nice output from any of the profiling tools :/
[12:45:12 CEST] <JEEB> but yea, profiling is the only way to figure out what's taking most of the time :P
[12:45:40 CEST] <JEEB> and if you can do something about it
[12:46:04 CEST] <Accord> is there any input format which would decode faster than mp4+h264?
[12:46:15 CEST] <Accord> and wouldn't take huge amounts of space
[12:46:37 CEST] <w1kl4s> >decode faster than h264
[12:46:46 CEST] <JEEB> H.264 decoder is quite optimized while not perfect, f.ex. I still think the MPEG-4 Part 2 decoder is actually slower than the H.264 one
[12:46:56 CEST] <JEEB> Accord: but please do check the profiling first
[12:47:07 CEST] <w1kl4s> isnt h264 straight up fastest these days?
[12:47:12 CEST] <JEEB> if you're ending up optimizing something that isn't your bottleneck you're just throwing stuff into the wind
[12:47:33 CEST] <Accord> alright, I was hoping there would be something obvious I could try
[12:47:37 CEST] <durandal_1707> on linux use perf tool
[12:47:50 CEST] <Accord> instead of going through the rabbit hole of profiling
[12:48:06 CEST] <JEEB> of course you can encode with -tune fastdecode if you're creating the input file :P
[12:48:37 CEST] <w1kl4s> Accord most popular besides h264 is prolly vp8 and h265, which are like a order of magnitude slower
[12:48:38 CEST] <JEEB> but that will worsen compression (and more bits actually means more bits to read, which might or might not cause it to be slower than better compression mechanisms)
[12:48:50 CEST] <JEEB> VP9 is another that is fast
[12:48:56 CEST] <JEEB> like, if you have AVX2
[12:49:00 CEST] <JEEB> the VP9 decoder is <3
[12:49:11 CEST] <JEEB> of course encoding that is another problem due to libvpx etc
[12:49:12 CEST] <w1kl4s> are there open source encoders that actually perform well with vp9?
[12:49:26 CEST] <JEEB> that's not decoding ;)
[12:49:32 CEST] <JEEB> and I mnetioned the encoding problem
[12:49:42 CEST] <w1kl4s> yeah, sent too late :P
[12:50:31 CEST] <durandal_1707> use ffvhuff
[13:14:14 CEST] <MoziM> for some reason i cannot parse the output of ffprobe, running ffprobe video.mp4 | grep ffprobe returns the entire output of ffprobe... anyone else experiencing this?
[13:14:29 CEST] <MoziM> i've never encountered something like this before either so i'm curious what the cause could be :o
[13:14:51 CEST] <JEEB> by default the output goes to stderr, you need to specify an output format (-of json f.ex.) for it to go to stdout
[13:15:04 CEST] <JEEB> and then you need -show_XXX as well
[13:15:16 CEST] <JEEB> programs, streams, format, packets, frames I think
[13:15:24 CEST] <JEEB> were the options, you should be able to look at ffprobe's docs
[13:23:52 CEST] <MoziM> hmmm... didn't know about this thanks!
[13:24:35 CEST] <MoziM> ffprobe -i video.mp4 >/tmp/ffprobe.txt 2>&1 fixed it for me
[13:24:42 CEST] <JEEB> yea but that's not parse'able
[13:24:51 CEST] <JEEB> you can get ini/xml/json out of ffprobe
[13:24:53 CEST] <MoziM> the file is though
[13:25:12 CEST] <JEEB> no I mean the default format is not made to be parsed by machines :P
[13:25:36 CEST] <JEEB> so if you want to actaully parse values I recommend you just utilize one of the machine parse'able output formats
[13:28:21 CEST] <th3_v0ice> Where can I find some documentation about using hardware acceleration? I am trying to use the API but following the hw_decode.c it doesnt seem that GPU is doing the decoding part. hwaccel context is null after opening the decoder.
[13:29:22 CEST] <MoziM> JEEB: gotcha
[13:58:13 CEST] <khairulimam> Hi everyone, I am new to ffmpeg. And currently having an idea to install the lib on android as dependency. I just tried the lib as CLI tool on my mac and its pretty stright forward. My question, when I use the lib on Android is the interface same with like CLI?
[13:58:46 CEST] <JEEB> CLI is just a CLI tool which utilizes the APIs in the background. the APIs let you do a lot more stuff
[13:58:53 CEST] <JEEB> there is no API that is literlaly just the CLI :P
[14:01:26 CEST] <rocktop> is it possible to reduce scale instead of video quality in two pass method ?
[14:02:41 CEST] <DHE> like given a bitrate, set the resolution based on a fixed CRF value to meet the bitrate requirement?
[14:03:28 CEST] <rocktop> DHE: maybe
[14:09:09 CEST] <rocktop> DHE: let me give you an example : for example I have a video 1080p with 1hour in its duration to have maximum quality possible  and file size is under 64MBI I need to  adjust the scale to be 304x171 to achieve the target
[14:11:33 CEST] <rocktop> in other word: is it possible to calculate the scale based on bitrate ?
[14:12:24 CEST] <BtbN> Since you cannot calculate "maximum quality", no
[14:12:44 CEST] <rocktop> BtbN: what is the solution here ?
[14:12:55 CEST] <BtbN> I'd go for a bisect-like trial and error approach
[14:17:30 CEST] <DHE> I'd do some weighting under the assumption that each pixel needs a fixed (fractional) number of bits and that said number probably won't change on rescaling...
[14:17:57 CEST] <DHE> also 1080p for 1 hour at 64 megabytes? dude unless you've upscaled Super Mario Bros on the NES I don't think that's happening
[14:32:04 CEST] <MoziM> so i'm using cat /tmp/ffprobe.txt | grep -Eo '[[:digit:]]*[^\,]*fps' | cut -d ' ' -f1 to get the fps, but is it possible for regex to select the number without piping it to another utility?
[14:33:25 CEST] <durandal_1707> you are doing it wrong way
[14:34:16 CEST] <DHE> you can just ask ffprobe to provide it way more directly
[14:35:29 CEST] <rocktop> DHE: I already do this with handbrake
[14:36:25 CEST] <DHE> rocktop: a fixed bitrate/target file size is easy. but image quality is the output variable there
[14:37:23 CEST] <rocktop> DHE: image quality I want to achieve maximum it is not  important thing
[14:37:36 CEST] <BtbN> Even an hour of 480p in less than 64MB is gonna look seriously bad
[14:38:11 CEST] <BtbN> so bad it's pretty much not recognizeable as what it originally was.
[14:38:21 CEST] <BtbN> Unless it's chess or something and you use infinite gop length
[14:38:31 CEST] <rocktop> DHE: the final goal is to have file size is 64MB and maximum scale and image quality possible
[14:39:29 CEST] <DHE> this isn't even a "pick 2" scenario
[14:40:04 CEST] <BtbN> You're gonna have to go 144p with 6 FPS or something to even have a chance
[14:41:12 CEST] <rocktop> DHE: fps should be 25
[14:41:30 CEST] <DHE> objection, I didn't say anything about fps
[14:41:45 CEST] <rocktop> sorry I mean BtbN
[14:42:02 CEST] <BtbN> good luck. I'd say you might as well generate pink noise on the other end and get a similar result
[14:42:23 CEST] <rocktop> it is easy to do that with handbrake
[14:42:40 CEST] <BtbN> an hour long video in less than 64MB? I highly doubt that.
[14:42:54 CEST] <rocktop> BtbN: yes
[14:43:08 CEST] <BtbN> That's gonna be a pixel mush beyond recognition
[14:43:42 CEST] <rocktop> scale was 304x171 and quality about 30 and sound bitrate 64kbps
[14:43:57 CEST] <pink_mist> oh god you want sound too
[14:44:15 CEST] <pink_mist> why even do you want to do this awful awful awful thing?
[14:44:30 CEST] <rocktop> pink_mist: for whatsapp
[14:46:04 CEST] <pink_mist> I would suggest just sending some form of link to a bigger file instead
[14:58:45 CEST] <DHE> I suggest an unlisted youtube video or something...
[14:59:40 CEST] <DHE> geez, the NES has more pixels than that...
[17:22:03 CEST] <rocktop> is there a way to make ffmpeg to use all pc resources ?
[17:22:54 CEST] <pink_mist> if you mean "make it multithreaded"? afaik, no
[17:22:59 CEST] <rocktop> because it is fixing in frame=  197 fps= 24 q=28.0 size=
[17:23:09 CEST] <rocktop> pink_mist: yes
[17:23:17 CEST] <pink_mist> then afaik: no
[17:27:54 CEST] <rocktop> so no way to speedup ffmpeg processing ?
[17:28:14 CEST] <th3_v0ice> Why arent there options for nvenc to return psnr and ssim values of the individual frames it encodes?
[17:32:11 CEST] <Thomas_J> .
[17:33:13 CEST] <BtbN> How would nvenc know these values?
[17:33:36 CEST] <BtbN> rocktop, most encoders and filters will by default use as many threads as they can
[17:40:42 CEST] <th3_v0ice> BtbN: same as the x264 encoder does?
[17:41:17 CEST] <BtbN> x264 returns psnr values?
[17:48:03 CEST] <nyuszika7h> does anyone have an idea why ffmpeg would suddenly decide to use an insanely high verbosity level by default (including printing a hexdump of the file)?
[17:48:25 CEST] <nyuszika7h> ['ffmpeg', '-i', 'temp/foo.mp4', '-c', 'copy', 'temp/bar.mp4']
[17:48:31 CEST] <nyuszika7h> ffmpeg version 4.1.4-1~deb10u1
[17:49:46 CEST] <nyuszika7h> ok wait looks like my shell script is messed up for some reason, somehow it's passing extra stuff which ends up on the stdin of ffmpeg or something
[17:50:17 CEST] <kepstin> if you don't want to use the stdin control stuff, run ffmpeg with -nostdin
[17:50:28 CEST] <kepstin> (or use `</dev/null` or something)
[18:11:02 CEST] <gamelaster> Hi, I'm using AVIOContext for buffering streamed data, the problem is, sometimes there is no data, and when I multiple times pass no packets, context will stop with "EOF", but that's non-sense, it should wait for another data. How to do it? I have been looking everywhere, but out of luck. Thanks
[18:13:22 CEST] <rocktop> I have 3 inputes with different resolution is it possible to scale all videos to match first input resolution ?
[18:19:56 CEST] <rocktop> anyidea?
[18:20:32 CEST] <rocktop> this my command: ffmpeg -y -i a.jpg -i a.mp4 -stream_loop -1 -i 480p.mov -filter_complex concat[c],[c][2:0]overlay=shortest=1   -cpu-used 100 output.mp4
[18:21:15 CEST] <rocktop> I have  a.jpg is 720p and others are 480p how can I scale a.jpg to be 480p instead of 720p in same above cmd ?
[18:22:22 CEST] <furq> rocktop: scale2ref,concat
[18:24:41 CEST] <rocktop> yes I know but what parameters I can use ?
[18:26:11 CEST] <rocktop> BtbN: yes you already told me and I include it in above cmd by mistakes
[18:26:40 CEST] <rocktop> BtbN: err sorry
[19:14:50 CEST] <rocktop> anyidea how to resolve this issue https://bpaste.net/show/AXK7 ?
[19:22:50 CEST] <rocktop> anyidea?
[19:29:52 CEST] <kepstin> rocktop: add a "setsar=1" filter that applies to the first input
[19:29:53 CEST] <saml> rocktop, using concat filter, try to set n argument. https://www.ffmpeg.org/ffmpeg-filters.html#concat   if you're concatting more than 2 streams
[19:30:15 CEST] <saml> never mind. i'm wrong again
[19:30:32 CEST] <kepstin> looks like there was a rounding error when downscaling the image that resulted in the sar being not quite 1:1
[19:33:56 CEST] <rocktop> kepstin: all inputes are with same resolution
[19:34:21 CEST] <kepstin> yes, they are. that's not the problem.
[19:35:37 CEST] <rocktop> kepstin: so where can I add "setsar=1" in my cmd ?
[19:41:05 CEST] <rocktop> anyidea?
[19:46:36 CEST] <another> after scale?
[19:54:33 CEST] <rocktop> kepstin: ffmpeg -y -i a.jpg -i a.mp4 -stream_loop -1 -i 480p.mov -filter_complex concat[c] setsar=1 ,[c][2:0]overlay=shortest=1 output.mp4
[19:58:41 CEST] <rocktop> any idea please ?
[20:13:38 CEST] <wedmisten> Hello everyone!
[20:14:38 CEST] <wedmisten> I was wondering if anyone knew how to mux a data stream into a MPEG-TS video
[20:25:11 CEST] <another> i guess it should be straight forward
[20:25:15 CEST] <another> ffmpeg -i foo.ts
[20:25:27 CEST] <another> ffmpeg -i foo.ts -i data.bin -map 0 -map 1 -c copy out.ts
[20:25:42 CEST] <another> although i can be wrong
[20:35:53 CEST] <wedmisten> thank you!
[21:02:29 CEST] <th3_v0ice> BtbN: Yes, it does, when you request it with ssim=1:psnr=1. It will return psnr and ssim values for individual frames.
[21:04:09 CEST] <BtbN> You're gonna have to ask nvidia to implement the same then. Cause nowhere in the API such a feature would be exposed.
[21:09:49 CEST] <kepstin> x264 probably only implements those options because it has specific encoder tuning to optimize for psnr or ssim
[21:09:55 CEST] <th3_v0ice> Why would it not be exposed? Why is it exposed in the x264? I am clearly missing something.
[21:11:37 CEST] <furq> because they're two different pieces of software
[21:13:08 CEST] <kepstin> note that x264's psnr and ssim calculation is implemented inside x264 itself, this isn't something that ffmpeg provides.
[21:23:31 CEST] <JEEB> th3_v0ice: there is a filter for ssim etc in FFmpeg if you want to compare things to a reference
[21:24:21 CEST] <kepstin> can't really be done in a single encode command in ffmpeg tho, since it requires decoding the video to compare
[21:24:51 CEST] <kepstin> (note that i assume that enabling the option in x264 slows down the encode a bit, since it has to do a full decode and the similarity calculation)
[21:25:59 CEST] <JEEB> the decode part I think should be done anyways since you need the decoded representation for reference usage
[21:26:22 CEST] <JEEB> but yes, it'd be extra calculation and if you don't actually tune for those metrics it's not really that useful
[21:26:33 CEST] <kepstin> hm, i think it skips it for frames that it knows won't be referenced, but yeah.
[21:28:24 CEST] <kepstin> but yeah - x264 has three encoding settings. the default is perceptual (psy) optimization, which is designed to look good to people at the expense of psnr and ssim. Then it has psnr tuning, which may make the video look worse and might reduce ssim. And there's ssim tuning, which may make the video look worse and might reduce psnr.
[21:28:57 CEST] <kepstin> (although if you encode in the faster modes, I assume these settings have less effect)
[21:39:14 CEST] <th3_v0ice> JEEB: Filter for ssim?
[21:39:42 CEST] <JEEB> yes?
[21:39:53 CEST] <JEEB> https://www.ffmpeg.org/ffmpeg-all.html#ssim
[21:40:01 CEST] <JEEB> even has examples n' all
[21:55:28 CEST] <rocktop> I will try to install ffmpeg in linux is there a precompiled version ?
[21:56:24 CEST] <furq> there's one in your package manager
[22:16:17 CEST] <Hello71> joke's on you, I use LFS
[22:17:19 CEST] <another> then you probably don't want precompiled stuff ;)
[22:18:34 CEST] <furq> if you use lfs then the joke is definitely not on me
[22:30:01 CEST] <MoziM> are pngs prefered when extracting images losslessly?
[22:30:28 CEST] <durandal_1707> only if rgb
[22:32:06 CEST] <MoziM> i mean... can an image extracted from a video even have rgba?
[22:32:43 CEST] <ring0> hey, could you recommend any books for general video compression concepts (h264/h265)?
[22:34:34 CEST] <kepstin> MoziM: vp9 and some classic flash video formats could have alpha channels. But they're typically yuv not rgb.
[22:34:57 CEST] <kepstin> er, vp9? vp8? one of those, i forget which
[22:35:51 CEST] <MoziM> but for movies extracting all frames as jpg with ffmpeg -i input.mp4 -r 1 -q:v 1 -qmin 1 -qmax 1 output_%01d.jpg is the same as .png?
[22:36:04 CEST] <nicolas17> jpg is not lossless
[22:37:14 CEST] <MoziM> but if the quality is max then is it not the same quality as a png?
[22:37:18 CEST] <furq> no
[22:37:20 CEST] <MoziM> or will a jpg always have slight compression?
[22:37:22 CEST] <MoziM> oh?
[22:37:26 CEST] <furq> it's always compressed
[22:37:53 CEST] <furq> there are lossless extensions but they're not widely supported
[22:38:25 CEST] <nicolas17> "Lossless JPEG uses a completely different technique from the lossy JPEG standard", and I don't know if ffmpeg supports it
[22:38:31 CEST] <furq> right
[22:39:56 CEST] <another> .EVI.S ljpeg                Lossless JPEG
[22:40:15 CEST] <furq> no decoding support though
[22:40:27 CEST] <furq> MoziM: tif supports yuv so i'd probably go with that
[22:40:53 CEST] <nicolas17> do you need one file per frame?
[22:42:25 CEST] <MoziM> yes
[22:42:58 CEST] <MoziM> i'm extracting raw frames + audio -> denoising them -> creating a new video
[22:43:33 CEST] <kepstin> what are you denoising them with? that would determine which formats you can use :/
[22:43:45 CEST] <nicolas17> and ffmpeg's denoising filters aren't good enough for your needs?
[22:43:54 CEST] <another> furq: there's other jpeg en-/decoders as well
[22:44:02 CEST] <kepstin> (if you are denoising them with ffmpeg, don't bother with the whole "extracting to separate frames" step, that's just a waste of time and disk space)
[22:45:06 CEST] <furq> another: tif is probably going to play nicer with external tools than nonstandard jpeg extensions
[22:45:32 CEST] <kepstin> also consider jpeg2000 which can be encoded losslessly and has reasonable application support.
[22:46:32 CEST] <furq> i thought the j2k encoder didn't support lossless
[22:46:39 CEST] <furq> but then i also thought it was called "j2k" so i'm probably way out of date
[22:46:44 CEST] <kepstin> says it does in the docs
[22:46:53 CEST] <furq> yeah it looks like i'm living in the past
[22:47:03 CEST] <another> furq: sure. just saying it's apparently possible
[22:47:06 CEST] <furq> i don't immediately see how you set that though
[22:47:12 CEST] <pink_mist> why in the world would you bother with jpeg2000 when png exists?
[22:47:18 CEST] <furq> to avoid the yuv to rgb conversion
[22:47:19 CEST] <kepstin> png doesn't support yuv
[22:47:49 CEST] <MoziM> kepstin: it's an opencv program that saves the file as whatever it originally was
[22:48:07 CEST] <kepstin> MoziM: sure, but what formats does it support opening/saving?
[22:48:18 CEST] <nicolas17> there's an opencv library to read from video files using ffmpeg :P
[22:48:22 CEST] <kepstin> and also iirc opencv has ffmpeg interop, so it should be able to open the video directly
[22:48:30 CEST] <furq> apparently opencv supports j2k and tiff natively
[22:49:06 CEST] <furq> also webp which does lossless yuv iirc
[22:49:06 CEST] <nicolas17> a "denoise image" program won't necessarily support video inputs, but if it uses opencv it wouldn't be hard to *modify* so that it does
[22:49:18 CEST] <kepstin> also ffmpeg has some opencv interop, so you might be able to do the opencv denoise inside an ffmpeg filter chain?
[22:52:28 CEST] <pink_mist> wasn't there someone recently complaining that latest opencv got rid of the C api, so ffmpeg won't build against it anymore?
[22:52:51 CEST] <pink_mist> (so you'd need an older opencv if I remember right)
[22:53:05 CEST] <MoziM> kepstin: hadn't thought of that...
[22:57:37 CEST] <kepstin> that said, it doesn't look like anything other than the imgproc image filters can be used from in ffmpeg, and i have no idea what you're actually doing :)
[23:02:48 CEST] <MoziM> me neither
[23:02:55 CEST] <MoziM> *no idea what i'm doing
[23:03:23 CEST] <kepstin> looks like the main denoising filter people use with opencv is nlmeans, and ffmpeg has a native nlmeans filter
[23:03:48 CEST] <MoziM> i'm still scratching my head on a bunch of concepts but i'm getting good results so far... but i can't help but feel it's woefully unoptimized
[00:00:00 CEST] --- Wed Aug 21 2019


More information about the Ffmpeg-devel-irc mailing list