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

burek burek021 at gmail.com
Sat Nov 8 02:05:01 CET 2014


[06:08] <relaxed> edakiri: you can split by frames using mkvmerge
[06:09] <relaxed> look at --split in `man mkvmerge`
[10:40] <Mayumi> hi
[10:40] <Mayumi> i'm trying to generate animated gifs from 10 second preview videos, the resulting outputs are like 19mb
[10:40] <Mayumi> does anyone know how to shrink the size down a bit?
[10:50] <Mayumi> ffmpeg -i input.mp4 output.gif
[10:51] <Mayumi> fairly simple
[11:01] <ubitux> Mayumi: "and the COMPLETE console output"
[11:01] <ubitux> i need to check which version you're using and which pix format it's using, etc
[11:02] <Mayumi> ubitux: http://dpaste.com/0E0Y9QW
[11:04] <ubitux> Mayumi: does -gifflags -transdiff helps?
[11:04] <Mayumi> i don't know of those arguments
[11:05] <ubitux> just add that as output option
[11:05] <ubitux> also, you might want to try different dithering
[11:05] <Mayumi> i'm trying it out
[11:06] <ubitux> like, with -vf scale=sws_dither=a_dither or something
[11:06] <ubitux> not sure how it will affect compression
[11:08] <Mayumi> -vf scale=sws_dither=a_dither reduced by 2mb
[11:08] <Mayumi> these are for web and they really need to be like, hundreds of kb, not mb, so i'm really not sure what i'm going to do to compress that much.
[11:09] <ubitux> try reducing framerate, scale it down, ...
[11:09] <ubitux> gif never was a good "video" format anyway
[11:09] <Mayumi> what's a good frame rate for gifs anyways?
[11:09] <ubitux> dunno, 15 fps might do it
[11:09] <Mayumi> ok
[11:10] <ubitux> ffmpeg is not the best "gif" encoder out there
[11:10] <Mayumi> yeah
[11:10] <ubitux> it's just decent enough depending on the input
[11:10] <Mayumi> i tried outputting as png frames
[11:10] <Mayumi> then piping those to imagemagick
[11:10] <Mayumi> but the gif was liek 50mb so idkk
[11:11] <Mayumi> yeah
[11:11] <ubitux> there are all kind of techniques possible
[11:11] <ubitux> the problem is that it's really hard to predict a good method
[11:11] <ubitux> gif really is shitty :)
[11:11] <Mayumi> i kno
[11:11] <ubitux> you generally have to try different method and pick the best
[11:11] <Mayumi> but like, these ultimately need to show up on tumlr dashboard
[11:11] <Mayumi> yeah
[11:12] <Mayumi> dropping the frame rate to 10 reduced to 8mb so thats something
[11:12] <Mayumi> i think these have to be under 512k
[11:12] <Mayumi> no idea how i'm going to do that
[11:12] <ubitux> scale it down
[11:12] <Mayumi> yeah
[11:12] <Mayumi> whats the arg to scale down?
[11:12] <Mayumi> its like
[11:12] <Mayumi> -vf something i think
[11:12] <ubitux> -vf scale=320:240:sws_dither=a_dither
[11:13] <ubitux> you might want to try different dithering
[11:13] <ubitux> like x_dither maybe
[11:13] <ubitux> and pick the one that looks less like shit
[11:14] <Mayumi> ok so reduced to 320:-1 (maintaining aspect ratio with -1?) it seems to be 1.3mb
[11:15] <Mayumi> doesn't look too horribly bad
[11:18] <Mayumi> damnit it has to be under 1mb for tumblr
[11:18] <ubitux> haha
[11:18] <Mayumi> is there a way to skip frames?
[11:18] <Mayumi> or something
[11:18] <ubitux> is it really 10 seconds?
[11:18] <Mayumi> every nth frame?
[11:18] <Mayumi> yeah
[11:18] <ubitux> yeah well that's what fps should do
[11:18] <Mayumi> and its 1.3mb
[11:19] <Mayumi> yeah i guess it should
[11:19] <Mayumi> eh i wonder if i drop it more how bad it will look
[11:19] <ubitux> can you provide the avi?
[11:20] <Mayumi> http://dii87kfw16t1x.cloudfront.net/videos/erotic/test-sp.mp4
[11:22] <ubitux> yeah hardly compressible, let me check
[11:22] <Mayumi> i kno
[11:23] <Mayumi> a lot going on in the video
[11:23] <ubitux> so what's your current cmdline?
[11:23] <ubitux> your best setings
[11:24] <Mayumi> well i got it to 752kb using 5fps (terrible) and a max width of 300px
[11:24] <ubitux> just show me the complete cmd line
[11:24] <Mayumi> ffmpeg -i in.mp4 -vf scale=320:-1:sws_dither=a_dither -r 5 out.gif
[11:24] <Mayumi> er, 320px not 300
[11:25] <ubitux> -rw-r--r-- 1 ux ux 1005K Nov  7 11:25 out.gif
[11:25] <ubitux> damn
[11:25] <Mayumi> yeahh
[11:25] <ubitux> ffmpeg -i test-sp.mp4 -vf scale=300:-1:sws_dither=a_dither,fps=8 -gifflags -transdiff -y out.gif
[11:25] <Mayumi> idk how everyone else is making gifs so small
[11:25] <ubitux> i'm using this
[11:26] <ubitux> they use better encoders :p
[11:26] <Mayumi> lol
[11:26] <ubitux> 8 fps looks like shit though
[11:26] <Mayumi> when i tried making it from png frames it looked like crap
[11:26] <Mayumi> er
[11:26] <Mayumi> it looked good,
[11:26] <iive> dither makes encoding worse
[11:26] <Mayumi> it was like
[11:26] <Mayumi> 50mb
[11:27] <ubitux> it would probably be better with a few smart palette changes and no dithering
[11:27] <ubitux> but we don't support that yet
[11:28] <relaxed> give ImageMagick's `convert` a whirl
[11:28] <Mayumi> i tried it
[11:28] <Mayumi> it was like 50mb
[11:28] <Mayumi> idk
[11:28] <relaxed> oh :)
[11:29] <Mayumi> http://dtbaker.net/random-linux-posts/convert-video-avi-mpeg-mp4-to-a-gif-animation-on-linux/
[11:29] <Mayumi> hmm
[11:35] <Mayumi> it's getting late, i'm going to have to mess with this more tomorrow
[11:35] <Mayumi> thank you guys for your help i appreciate it, at least i got it dropped down quite a bit.
[13:50] <maui> hello @ all! how can i see the parameters any filter needs? like a -h or man pages ?
[14:49] <scoofy> hi. what would be the best command to encode video at 29.97 fps? (ntsc)
[15:01] <scoofy> to answer my question, -r 30000/1001 seems good
[15:14] <Wireless> Could someone here explain the difference between the new API modes? with and without reference counting.
[15:27] <BlackDream> Hello guys i have a very strange HLS stream that ffmpeg can not restream. It's HLS, in my vlc it works perfectly. Here is thje log: http://pastebin.com/XtyUsyf2
[15:27] <BlackDream> I also don't understand why it says to enter -bsf:v h264_mp4toannexb filter because the 2 containers are exactly the same
[15:27] <BlackDream> but even if you enter the filter, the restream doesnt start
[15:28] <BlackDream> The stream is public so do any tests you may want
[15:53] <BlackDream> c_14 : i think you can help on this one :P
[15:54] <c_14> I found a way of going around the issue...
[15:56] <c_14> Use one ffmpeg process with -codec copy and -f matroska, pipe the output into a second ffmpeg process with -codec copy -bsf:v h264_mp4toannexb -f mpegts test.ts
[15:56] <c_14> Don't ask me why that helps, but it does.
[15:57] <c_14> In short, this: ffmpeg -i "url" -c:a copy -c:v copy -f matroska pipe:1 | ffmpeg -i - -c copy -bsf:v h264_mp4toannexb -f mpegts test.ts
[15:58] <BlackDream> Yeah but it isnt a bug?
[15:58] <BlackDream> should i report it?
[15:58] <c_14> If the same issue occurs with a recent git build, it's probably a bug, yes.
[15:59] <BlackDream> ok i will download the latest static build from git and i will try
[15:59] <BlackDream> wait a moment
[16:01] <BlackDream> Yeah doesnt work either
[16:03] <c_14> In that case it's probably a bug.
[16:08] <c_14> If you're going to make a bug report, be sure to mention that remuxing to matroska inbetween allows you to mux to mpegts with the bitstream filter.
[16:12] <BlackDream> ok the bug its for avcodec component?
[16:20] <c_14> You can just leave it unset, someone will come around and set it once they've looked into it.
[16:24] <BlackDream> c_14: https://trac.ffmpeg.org/ticket/4091#ticket
[16:40] <triune> hello, I would like to test out the new webp support that was added yesterday : https://trac.ffmpeg.org/ticket/3760#comment:7
[16:40] <triune> however, when I try to transcode a video to a webp file, I get the error : Encoder (codec webp) not found for output stream #0:0
[16:41] <triune> is there some compile option I must use to build in this encoder because from what I can tell in the compile spam, its already there....?
[16:41] <kepstin-laptop> triune: does it work if you use -c:v libwebp ?
[16:42] <triune> kepstin-laptop: nope, different error : Unknown encoder 'libwebp'
[16:42] <kepstin-laptop> hmm, I may have gotten that wrong :)
[16:42] <relaxed> triune: if not, try http://johnvansickle.com/ffmpeg/
[16:43] <triune> I don't mind compiling myself... what's the option to enable libwebp ??
[16:43] <kepstin-laptop> no, the encoder name is 'libwebp', that error means that your ffmpeg wasn't compiled with libwebp support
[16:44] <triune> sorry, figured that out myself... --enable-libwebp will give it one more go after it compiles ;)
[16:45] <kepstin-laptop> huh, I would have thought that would be autodetected if you have the pkgconfig files present
[16:47] <kepstin-laptop> ... i guess not.
[16:48] <triune> you got me kepstin-laptop :)
[16:55] <triune> a new era in animated images for the internet has begun! goodbye animated gif!
[16:55] <triune> https://386dce635fec2a779f110d9c778f9acf6f7bde64.googledrive.com/host/0B7-WGlkadL3zcVRGSTFLRFZBQWM/other/u5.webp
[16:55] <triune> works beautifully :)
[16:56] <triune> hmm, I guess I have to figure out how to get it to loop now in the webp
[16:59] Action: kepstin-laptop is unclear what benefit an animated webp provides over a webm
[17:02] <triune> many sites like Google+ support having webp images auto-play like gifs in posts
[17:03] <triune> ffmpeg -h encoder=webp
[17:04] <triune> looks like there is no encoder option to loop :(
[17:04] <kepstin-laptop> it would be an option on the muxer, not the encoder
[17:04] <kepstin-laptop> presumably looping is just some flag in the container
[17:04] <triune> webp doesn't have a muxer tho like gif does...?
[17:04] <triune> at least not in what I just compiled
[17:05] <triune> ffmpeg -h demuxer=gif
[17:05] <triune> shows me gif muxer options
[17:05] <triune> ffmpeg -h demuxer=webp
[17:06] <triune> says unknown format
[17:06] Action: triune slaps self across face
[17:06] <triune> sorry, its there in the muxer options
[17:06] <triune> ffmpeg -h muxer=webp
[17:09] <triune> and now it loops
[17:09] <triune> https://386dce635fec2a779f110d9c778f9acf6f7bde64.googledrive.com/host/0B7-WGlkadL3zcVRGSTFLRFZBQWM/other/u5.webp
[17:09] Action: triune is a happy camper
[17:11] <triune> thanks for the help guys
[17:44] <BlackDream> Question: I read a lot of LGPL & GPL and now i want to ask something. It clearly says that if an app is using GPL libraries i must provide the source code. I use FFmpeg in a commercial program. What happened in this case? GPL asks me to release my source code or the ffmpeeg source code since the ffmpeg uses the libraries?
[17:44] <BlackDream> it may be a dump question but i'm really confused
[17:45] <kepstin-laptop> BlackDream: it depends on whether your application is linking to ffmpeg or could otherwise be considered to derive from ffmpeg.
[17:45] <BlackDream> i'm just using a static build of ffmpeg
[17:46] <BlackDream> i only use the ffmpeg from command line
[17:47] <kepstin-laptop> in that case, you usually only need to do the ffmpeg source code. But consult a lawyer if unsure, of course.
[17:49] <kepstin-laptop> BlackDream: do also read through https://www.gnu.org/licenses/gpl-faq.html
[17:49] <kepstin-laptop> (in particular, the "Distribution of programs..." section)
[18:08] <dv8inpp> I need some help getting my timestamps to be accurate, currently they appear to be 2.54 times real time speed. Any suggestions for resources
[18:08] <c_14> As in the video is playing too fast?
[18:10] <dv8inpp> Im using the following command to recored a timestamp onto a video. The timestamp seems to record to fast. ffmpeg -i testinput.mp4 -vf "drawtext=expansion=strftime:fontfile=arial.ttf:text='%a %d\.%m\.%Y %H\:%M\:%S': r=29.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000 at 1"  -y out1.mp4
[18:15] <c_14> try with text=%{localtime\:%a %d\.%m\.%Y %H\:%M\:%S} and without expansion=strftime
[18:18] <c_14> And get rid of the r=29.976
[18:32] <dv8inpp> I'm using windows version of ffmpeg. Tried this "ffmpeg -i testinput.mp4 -vf "drawtext=:fontfile=arial.ttf:text={localtime\: %a %d\.%m\.%Y %H\:%M\:%S}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000 at 1"  -y out1.mp4but no text on output
[18:54] <c_14> Get rid of the : before fontfile
[18:54] <c_14> and you need a % in front of {
[18:54] <c_14> *{localtime
[19:05] <dv8inpp> Got the syntax right now "ffmpeg -i testinput.mp4 -vf "drawtext=expansion=normal:fontfile=arial.ttf:text=%{localtime}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000 at 1"  -y out1.mp4" Output still not correct when outputing to a file but when to the screen it is ok.
[19:10] <dv8inpp> Watching the console output of ffmpeg the first few seconds are longer than 1 seconds, framerate is high, then as framerate drops seconds get shorter than 1 second
[19:10] <c_14> Yeah, I just noticed a flaw in that command.
[19:15] <kepstin-laptop> if that drawing the system realtime? If so, it will depend entirely on how fast the video encoder is. If the video encoder is faster than realtime, then the timestamps will be "slow" in the final video
[19:16] <c_14> Yes, that's the problem with the command...
[19:16] <c_14> I'm trying to wrap my head around the timecode thing.
[19:16] <c_14> s/thing/option
[19:18] <c_14> dv8inpp: You want to apply the current timestamp to the file and then increase the timestamp by 1s per second of video?
[19:18] <dv8inpp> yes. I want to record a timestamp over a webcam/ IP cam input
[19:19] <c_14> If you're using a realtime input, then the command I gave you will work.
[19:19] <c_14> It just won't work if you get content faster than realtime.
[19:19] <c_14> You can add -re as an input option to test with a file if you want to.
[19:19] <c_14> s/I gave you//
[19:59] <dv8inpp> Thanks for that. I might have solved the problem another way by using an IP camera with timestamping built in.
[20:09] <maui> hey all, any ideas how i cant get the frei0r plugins working?
[21:57] <tsester> hi, i'm trying to cut a portion of a video and i managed to do so with -ss and -t. How can i merge the subtitles i have in sub/idx ?
[22:01] <c_14> You have the subs in a separate file?
[22:15] <tsester> yes i have both the sub and idx files
[22:16] <c_14> And you've already cut the video?
[22:16] <tsester> yes
[22:17] <c_14> ffmpeg -i video -ss seek_time -t duration -i subfile -c copy -c:s srt outvideo
[22:17] <c_14> I'm pretty sure ffmpeg can seek in subtitles anyway.
[22:20] <tsester> i got : "Subtitle streams other than DivX XSUB are not supported by the AVI muxer." , i also used a slitly different position for the -ss and -t options : " ffmpeg -ss 1958 -i \[10\]\ Zatoichis.Revenge.1965.DVDRip.DivX.avi -i \[10\]\ Zatoichis.Revenge.1965.DVDRip.DivX.sub -c:s srt -codec copy -t 25 tragoudi-miso-a.avi "
[22:21] <c_14> You need the ss either before the sub file or after the last input file.
[22:21] <c_14> And don't use avi...
[22:21] <c_14> Just going to throw that one out there.
[22:23] <tsester> what should i use instead of avi?
[22:23] <c_14> Depends, with what are you planning on playing the file?
[22:23] <tsester> i plan to upload it to facebook
[22:24] <c_14> ugh, just use mp4
[22:24] <tsester> ok
[22:24] <kepstin-laptop> upload to facebook? you might need to burn the subs in then (hardsub with the 'subtitle' video filter)
[22:25] <kepstin-laptop> er, 'subtitles' filter
[22:26] <tsester> " https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo " says subtitles video filter is for srt while picture-based subtitles should use the overlay video filter
[22:27] <c_14> wasn't sub/idx text?
[22:27] <kepstin-laptop> huh, interesting. I didn't realize they showed up as a video stream
[22:27] <kepstin-laptop> no, sub/idx is vobsub - dvd subtitles
[22:28] <c_14> meh, there are too many subtitle formats
[22:28] <c_14> tsester: yeah, then use the overlay filter
[22:29] <c_14> just with 2 inputs,and [0:v][1:s] (assuming the second input is the subtitle file.
[22:33] <Kip> how do I extract   dvd_subtitle   to a .idx/.sub?
[22:38] <kepstin-laptop> Kip: doesn't look like ffmpeg can do that, but you should be able to e.g. stream copy them to an mkv
[22:41] <tsester> c_14: can you help me some more? i tried " ffmpeg -ss 1958 -i \[10\]\ Zatoichis.Revenge.1965.DVDRip.DivX.avi -i \[10\]\ Zatoichis.Revenge.1965.DVDRip.DivX.sub -filter_complex "[0:v][1:s]overlay" -codec copy -t 25 tragoudi-miso-a.mp4 " but got the error " Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together."
[22:42] <kepstin-laptop> tsester: that error message tells you exactly what the problem is
[22:42] <tsester> i'm way over my leage
[22:42] <c_14> you have to get rid of the -codec copy and reencode the video
[22:43] <tsester> ok
[22:43] <c_14> Also, move the -ss, you're seeking the video not the subtitles
[22:50] <Kip> kepstin-laptop, ffmpeg.exe -y -i h.mp4 -map 0:4 -c copy sub.mkv       gives     Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
[22:51] <kepstin-laptop> Kip: I have no idea what you're doing, but if your input is an mp4 then you certainly don't have dvd image subtitles in it.
[22:53] <c_14> I think nero can/used to actually mux mp4s with vobsubs...
[22:54] <tsester> hmm
[22:54] <kepstin-laptop> ... could anything other than nero software actually play them?
[22:55] <Kip> vlc & mpc-hc plays my mp4 with vodsub inside
[22:56] <kepstin-laptop> Kip: huh. Well, you could try using -codec dvdsub
[22:57] <Kip> kepstin-laptop, haha that did it!
[22:58] <Kip> thanks
[22:58] <Kip> is extracting .sup still broken?
[22:59] <c_14> I remember pgs muxer patches...
[23:01] <c_14> Hmm, doesn't look like they've hit the tree yet.
[23:02] <c_14> You could probably apply the patch from the ML if you need it.
[23:03] <Kip> c_14, I've had bad luck whenever I compile myself ;P
[23:05] <Kip> what's the codec called for .sup?
[23:06] <sacarasc> What's .sup? (Nothing much, what's up with you?)
[23:06] <Kip> :)
[23:07] <c_14> Presentation Graphic Stream iirc
[23:09] <tsester> c_14, i didn't manage to hardcode the subs,. any idea? , http://pastebin.com/raw.php?i=2gtXfcA8
[23:10] <c_14> Didn't you want to seek the subtitles to the correct position?
[23:11] <tsester> yes, but i tried to put the -ss after the first input file but the output was from the beginning of the movie
[23:11] <c_14> ffmpeg -i video -ss time -i .sub -filter ?
[23:13] <tsester> no, this plays the video from the beginning to "time"
[23:14] <c_14> Is time > or < 25 ?
[23:14] <tsester> 25
[23:14] <tsester> but
[23:14] <tsester> i want to play from 1958 to 1983 i think
[23:18] <c_14> And if you leave off the -ss the subs don't show up at all?
[23:18] <tsester> neither with -ss or without
[23:20] <tsester> now i also have a new problem, i tried to cut the video from 1958 onward but the video is out of sync with the audio:(
[23:30] <c_14> Hmm, looks like ffmpeg doesn't like seeking in dvd subtitle streams...
[23:32] <tsester> hmm
[23:33] <c_14> The only thing I can think of off the top of my head would be to burn the subtitles in for everything from 0 to the final time you want, use -t or -to to stop there, and then cut the beginning part you don't want in a separate step.
[23:34] <tsester> but even without the -ss option i didn't manage to hardcode the subtitles
[23:36] <Kip> c_14, can you please link me the .sup bug tracker?
[23:42] <c_14> Kip: The only ticket I can find is this one: https://trac.ffmpeg.org/ticket/2208 . But if you mean the patches, this would be the latest iteration https://ffmpeg.org/pipermail/ffmpeg-devel/2014-September/163398.html
[23:44] <Kip> c_14, thanks!
[23:52] <tsester> here's the video without subtitles : https://drive.google.com/file/d/0B-7D6SNJJCcuNjRtQjU3TVNNSW8/view
[23:52] <tsester> bye bye
[23:52] Action: c_14 is currently testing on one of his own videos. Will report if I get something working.
[00:00] --- Sat Nov  8 2014


More information about the Ffmpeg-devel-irc mailing list