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

burek burek021 at gmail.com
Thu Apr 10 02:05:01 CEST 2014


[01:10] <synth_> is there a way to add a watermark to a file i'm generating? if so, how would I alter my current command http://pastebin.com/Bs8vUykw  ?
[01:59] <klaxa> synth_: see the overlay filter and/or google for: ffmpeg watermark
[01:59] <klaxa> there are lots of guides
[02:18] <synth_> yeah i tried a couple but i couldn't figure out how to do a watermark + text
[02:22] <Moussekateer> hi guys. Can someone help me with this issue http://pastie.org/pastes/9009983/text?key=cn8uvmwuelt3laypinhpyq
[02:23] <Moussekateer> I see lots of google results for it but all the solutions seem to be of the form 'keep trying different encoding bitrates'
[02:25] <Moussekateer> the scripts I'm using have ffmpeg as a dependancy, so it would be nice to find a solution that doesn't require me to rewrite everything
[02:31] <c_14> Can you try adding a -loglevel debug?
[02:32] <synth_> is it possible to run multiple -vf commands?
[02:33] <c_14> Just separate them with commas, or use a -filter_complex
[02:33] <c_14> Or read the guide: https://trac.ffmpeg.org/wiki/FilteringGuide
[02:46] <Moussekateer> c_14: http://pastie.org/pastes/9011364/text?key=e4zt0p92kfcjpvu5inrlg
[02:48] <klaxa> >[mp4 @ 00000000057d87e0] pts (6016) < dts (6704) in stream 0
[02:48] <klaxa> your input is broken
[02:49] <synth_> c_14 http://pastebin.com/7z9xVQXf i'm getting a "[AVFilterGraph @ 0x2ed40e0] Too many inputs specified for the "movie" filter." error
[02:50] <Moussekateer> klaxa: Broken in what sense?
[02:51] <Moussekateer> I'm not sure exactly what that statement means
[02:51] <Moussekateer> the pts < dts one
[02:51] <klaxa> ah wait a sec...
[02:51] <klaxa> the... output is broken?
[02:52] <klaxa> can you remux to mkv? just to see if it's the container
[02:52] <klaxa> dts means decoding timestamp, pts means presentation timestamp
[02:52] <klaxa> in that case the presentation timestamp is smaller than the decoding timestamp
[02:52] <klaxa> meaning the frame would have to be displayed before it has been decoded which is impossible
[02:54] <c_14> synth_: I'm pretty sure your quoting is off somewhere.
[02:54] <Moussekateer> klaxa: Same issue http://pastie.org/pastes/9011775/text?key=uwyazobx1auf5rabrykyq
[02:55] <klaxa> can you play back the file without errors?
[02:57] <Moussekateer> klaxa: The original? Yes, it plays fine
[02:57] <synth_> i'm confused now
[02:57] <Moussekateer> seeking and all
[02:58] <klaxa> that is weird
[03:01] <synth_> http://ffmpeg.org/ffmpeg-filters.html#drawtext-1 for drawtext shows -vf drawtext="params here"; but if i wanted to also do movie params; other sites are showing me to do -vf "movie=params here" (http://www.idude.net/index.php/how-to-watermark-a-video-using-ffmpeg/). is that incorrect?
[03:01] <synth_> i'm using their code for placing the watermark on the bottom right
[03:02] <synth_> like: -vf drawtext="draw text params here","movie=watermark params here"
[03:02] <synth_> since you guys said i could separate the -vf commands with a comma
[03:03] <c_14> The problem is that your first "" pair is quoting 1 filter. Your second "" pair is quoting the movie filter _and_ some other stuff.
[03:07] <c_14> Try this: http://sprunge.us/SFCe
[03:07] <synth_> i got the movie filter from: http://www.idude.net/index.php/how-to-watermark-a-video-using-ffmpeg/ under the "Bottom right corner"; is his example incorrect? i basically just copied that and repathed to my watermark image
[03:07] <c_14> I don't see it doing anything with the video I tested it on, but at least it didn't error.
[03:08] <synth_> ok one second
[03:08] <c_14> synth_: You can either quote each filter individually or the whole filterblock at once, he quoted the whole block, while you quoted the first filter individually _and_ quoted the rest as a block.
[03:09] <c_14> You might need to get rid of either the first or the second [in], I'm not sure there are supposed to be two of them.
[03:10] <synth_> still getting an error using your example
[03:10] <synth_> i tried quoting the whole filterblock for the first as well
[03:11] <c_14> Try this one: http://sprunge.us/ibJL
[03:11] <c_14> And if that doesn't work, pastebin the result so I can see the error msg.
[03:15] <synth_> it worked!
[03:15] Action: synth_ flails
[03:18] <synth_> thank you so much
[03:18] <c_14> No problem.
[03:18] <synth_> i owe you a beer
[03:33] <synth_> is there a way to show the file frame number versus the frame number starting from 0? (i'm using: Frame: %{n})
[03:34] <synth_> sometimes we start our frame ranges at other numbers like 1001 instead of 0001
[03:40] <klaxa> synth_: see: http://ffmpeg.org/ffmpeg-filters.html#drawtext-1
[03:40] <klaxa> >start_number      The starting frame number for the n/frame_num variable. The default value is "0".
[03:40] <synth_> ahh okay
[03:41] <synth_> thank you!
[03:41] <klaxa> incidentally i used the drawtext filter today too :)
[03:42] <klaxa> it's easier to draw frame count/pts with drawtext than to write a script to generate a subtitle file
[03:48] <Moussekateer> klaxa: Is there any fix I can carry out then, other than resorting to other software?
[03:49] <klaxa> none that i know of
[03:56] <Moussekateer> mboo
[06:41] <orgy> hello?
[06:42] <orgy> i want to ask
[07:42] <llogan> synth_: you don't need movie filter for overlays
[07:49] <ScottSteiner_> klaxa: I tried using that guide to hardcode the subs, but it didnt work
[16:08] <quup> How do I resize a movie to fixed height and width by first scaling to fit the height and then cropping sides in one go?
[16:08] <quup> without any stretching that is
[16:09] <klaxa|work> quup: use the scale and then the crop video filter
[16:11] <klaxa|work> i.e.: -vf scale=-1:480,crop=w=640
[16:11] <quup> klaxa|work: so like -vf scale=-1:480,crop=w=480
[16:11] <quup> :D thanks!
[16:11] <klaxa|work> i think that should work, i have not tested it
[16:11] <quup> I'll give it a try
[16:15] <quup> klaxa|work: works great, thanks
[16:17] <klaxa|work> if you want to crop centered you will have to do some math though
[16:18] <klaxa|work> like (i_w-400)/2 for the left side and i_w-((i_w-400)/2) for the right side
[16:18] <klaxa|work> maybe
[17:10] <ronlut> Hey guys, I'm building an android application, and I need to use some ffmpeg commands. I've got a source video and I need to edit it: 1) Cut only the last 7 seconds. 2) Add a watermark(logo) on the top left side of the video.(00:00-00:07) 3) Add a video inside the source video on the bottom right side of the video.(00:00-00:07) 4) Add another video to the edited video from steps 1-3 (00:07-00:10) Can I do it in one ffmpeg command?
[17:10] <ronlut> The commands I used so far are: http://pastebin.com/nPuuuHh7 But I have a problem with it: I hear the sound of the video in step 3 instead of the main video.  Thanks a lot!
[17:26] <deni> .close
[19:02] <synth_> is it possible when using the movie= -vf filter to add a semitransparent png overlay to a video? it looks like the transparent png i'm using is fully opaque and not antialiased around the edges
[19:24] <llogan> synth_: why are you using movie?
[19:35] <synth_> c_14 helped me set it up lsat night
[19:35] <synth_> llogan
[19:36] <synth_> yes i know i was just preparing it for you
[19:36] <synth_> everything works fine
[19:36] <synth_> llogan http://pastebin.com/kn4D2Y2s
[19:37] <synth_> no errors
[19:37] <llogan> you forgot the console output
[19:42] <synth_> llogan http://pastebin.com/dfUZ6EpF
[19:42] <llogan> thanks
[19:42] <llogan> can you provide your png file?
[19:43] <synth_> the watermark png file?
[19:43] <llogan> yes
[19:44] <llogan> you have two instances of "-s 1280x720" outside of your filtergraph. what is the purpose of the "-s 1280x720"?
[19:44] <synth_> http://mellow.me/tmp/bigblock_watermark.png
[19:44] <synth_> i thought the first -s was the input resolution and last -s was the output resolution
[19:46] <synth_> example of the output mov file it generated: http://mellow.me/tmp/Club_Fracture_V4_.mov
[19:47] <llogan> your main input is already  1280x720 and the output will inherit that same size
[19:47] <synth_> i still need to implement the start_number parameter to get the frame number part working
[19:47] <synth_> oh okay
[19:47] <synth_> i'll remove the second one then
[19:47] <llogan> you don't need either of them
[19:48] <synth_> so if the input was 1080, and someone wanted to render out a 720, could i implement them?
[19:48] <synth_> or would the source frames need to be 720
[19:49] <llogan> you can scale any input. i'll make an example once i finish something
[19:49] <synth_> ok
[19:49] <synth_> thanks man
[19:50] <llogan> also, you can use the glob pattern instead of -start_number. might be easier for you
[19:50] <llogan> example: http://ffmpeg.org/ffmpeg-formats.html#Examples-3
[19:51] <synth_> okay i didn't know about that
[19:51] <synth_> thanks
[19:55] <llogan> -vendor is ignored because it's a provate option for the prores_ks encoder only, AFAIK
[19:56] <llogan> *private
[20:04] <llogan> synth_: http://pastebin.com/XpPVjkT5
[20:04] <llogan> i'm not sure if you needed that probesize
[20:04] <llogan> the scale in the first filterchain shows that you can scale any input at any time in the filtergraph
[20:05] <llogan> the overlay filter needed its format option because by default it uses yuv420: http://ffmpeg.org/ffmpeg-filters.html#overlay
[20:06] <llogan> (it is not the same thing as the format filter used at the end)
[20:07] <llogan> but you won't need "scale=1280:-1,". it's just there as an example
[20:25] <synth_> i was reading somewhere that probesize is good for frame by frame scrubbing using arrow keys
[20:27] <llogan> it's used to "probe" the input to get stream information
[20:28] <llogan> what you're probably referring to is "-g", but i don't think it does anything with mjpeg
[20:30] <synth_> i'm not sure, it's on https://trac.ffmpeg.org/wiki/vfxEncodingGuide
[20:30] <synth_> for vfx related ffmpeg renders
[20:31] <llogan> that's using an encoder that uses "group of pictures", but mjpeg is just a series of images, and therefore does not need, nor can not use -g
[20:32] <llogan> i suppose i should read that verbose wiki page someday
[20:32] <llogan> so many words
[20:32] <synth_> yeah i've just been skimming over it
[20:35] <llogan> did my example fix the shitty looking png overlay?
[20:37] <synth_> let me see if i can restructure my code without breaking anything...
[20:37] <synth_> the pattern glob portion isn't going to be easy to fix
[20:37] <synth_> so i'll have to leave that part out
[20:38] <synth_> we have some renders that have very identical names but are different passes all dumped into one directory
[20:38] <synth_> s/very/almost
[20:40] <llogan> you can still use glob: -i "foo*.png"
[20:57] <brontosaurusrex> hi ~
[20:58] <synth_> llogan i think your example has an issue with quotes
[21:00] <synth_> llogan this is what i'm getting: http://pastebin.com/PzDfhK9j
[21:00] <synth_> i refactored your code to fit into what i already had and it looks like encapsulating the quotes within quotes for the -filter_complex for the draw_text parameter messed things up
[21:11] <llogan> synth_: s/drawtext="fontfile/drawtext=fontfile and s/10"[bg]/10[bg]
[21:16] <synth_> llogan new error: http://pastebin.com/sG7D14au
[21:22] <llogan> synth_: i forgot to add -map "[out]" in the example
[21:22] <llogan> as an output option
[21:22] <synth_> oh okay, does that come after the -filter_complex ?
[21:25] <synth_> wait nevermind
[21:25] <llogan> you can probably place it anywhere as long as it is an output option, but for humans it would make more sense to place it after the filtering
[21:26] <synth_> ok so just rendered out another test and the png doesn't look any better, same as before.
[21:27] <llogan> you could remove [out] from the filtergraph and then omit -map "[out]", but i prefer to explicitly llabel things so i know exactly what is going on instead of relying on defaults.
[21:27] <synth_> wait a second
[21:27] <synth_> it looks better as long as black isn't behind the png
[21:27] <synth_> let me upload an example...
[21:30] <synth_> llogan : http://mellow.me/tmp/3000_0010_lgt_scenestate1_v0001.mov so the logo now is jagged over black, but as soon as color starts coming in, it looks as expected
[21:31] <llogan> weird
[21:31] <llogan> i can't duplicate the issue, but i don't have similar inputs
[21:32] <synth_> i could upload the frames, and watermark if you'd like?
[21:32] <llogan> what is the file size for each typical frame?
[21:33] <synth_> can range from a 2-10mb to 200-300mb per frame
[21:34] <synth_> these frames max around 9-10mb
[21:35] <llogan> i guess the first ~48 will suffice
[21:35] <llogan> maybe even just ~38-48
[21:36] <synth_> ah crap sorry just uploaded all of the frames lol
[21:37] <synth_> ~340mb
[21:37] <synth_> want me to redo it?
[21:37] <synth_> er ~370mb
[21:38] <llogan> no, i'll download it while i'm taking my break
[21:40] <synth_> ok http://mellow.me/tmp/9999_testproject_3000_0010_lgt_cam003_v0001__frames.zip
[21:40] <synth_> do you work for ffmpeg?
[21:43] <llogan> FFmpeg is made up of volunteers. i work for a small media business where i use ffmpeg very often.
[21:44] <llogan> i'll be back in about an hour
[21:48] <synth_> okay
[22:40] <ronlut> Hey guys, I'm building an android application, and I need to use some ffmpeg commands. I've got a source video and I need to edit it: 1) Cut only the last 7 seconds. 2) Add a watermark(logo) on the top left side of the video.(00:00-00:07) 3) Add a video inside the source video on the bottom right side of the video.(00:00-00:07) 4) Add another video to the edited video from steps 1-3 (00:07-00:10) Can I do it in one ffmpeg command?
[22:40] <ronlut> The commands I used so far are: http://pastebin.com/nPuuuHh7 But I have a problem with it: I hear the sound of the video in step 3 instead of the main video.  Thanks a lot!
[22:56] <groundnuty> hey, I'm having trouble with ffmpeg ffmpeg -pattern_type glob -i '*.png' $MOVIE
[22:56] <groundnuty> it takes files like ls would print them
[22:56] <groundnuty> and I would pref it would take them as ls -v would print thme
[22:56] <groundnuty> I would not like to reneme them all
[22:57] <groundnuty> i a concat option an answer here?
[22:57] <quup> groundnuty: what's the difference between ls and ls -v in this case?
[22:57] <quup> oh numerical sort
[22:59] <quup> groundnuty: if you replace "-pattern_type glob -i '*.png'" with just -i '%d.png' does that give correct order?
[22:59] <groundnuty> quup: no, the numbers are crazy
[23:00] <groundnuty> quup: tried play with %d
[23:00] <groundnuty> but they are like prefix.timestamp.soemthing
[23:00] <groundnuty> prefix.timestamp.soemthing.png ;p
[23:00] <groundnuty> I thought that glob worked till prfix was in range of 0-9
[23:01] <groundnuty> when 10 apeared it was taken after 1
[23:01] <quup> groundnuty: maybe there is an option to read input filenames from a file
[23:01] <quup> so you could just ls -v  > input_files.txt and then ffmpeg --magic-thingy=input_files.txt
[23:01] <sacarasc> groundnuty learns the importance of leading zeros.
[23:02] <groundnuty> sacarasc: I wont comment on those filenames - not my program generates them :(
[23:03] <groundnuty> I dont see the option that would read input files from external file
[23:03] <groundnuty> sacarasc, quup am I missign something?
[23:04] <quup> groundnuty: don't think so, can't find any such option either
[23:05] <quup> I guess I shouldn't be too surprised ffmpeg doesn't have a -playlist option :D
[23:06] <quup> groundnuty: oh! it exists, -f concat -i thefilenamesinthisone.txt
[23:06] <quup> groundnuty: http://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files
[23:06] <groundnuty> quup: I'm reading about it
[23:06] <groundnuty> I'm just not sure because its all about wav
[23:06] <groundnuty> in my case I have png and output mp4
[23:07] <quup> it's only getting the input files in order that matters
[23:07] <quup> rest is just throwing them at the right filters
[23:08] <quup> or maybe I missunderstand concat...
[23:08] <quup> oh well
[23:32] <llogan> synth_: try changing format in overlay from rgb to yuv422. also that maked the last format filter redundant.
[23:33] <llogan> *makes
[23:34] <llogan> ronlut: without the complete console output helping you will be challenging
[23:41] <synth_> llogan: cool! that worked!
[23:41] <synth_> thank you!
[00:00] --- Thu Apr 10 2014


More information about the Ffmpeg-devel-irc mailing list