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

burek burek021 at gmail.com
Wed Mar 27 02:05:02 CET 2013


[02:02] <FergyA> I'm having trouble capturing video from my webcam in raspbian (debian) linux. I'm running the capture on a raspberry pi so I need to capture the raw mjpeg, but whenever I use the copy codec I get buffer underflows about 30 seconds in and the cap dies. I'm using ffmpeg-f video4linux2 -input_format mjpeg -i /dev/video0 -vcodec copy out.mpeg
[02:02] <FergyA> anyone able to give any advice?
[02:50] <FergyA> I'm using ffmpeg on arch linux to capture a mjpeg stream from a webcam, but for some reason while I'm recording I'm constantly getting "libv4l2: error dequeuing buf: Resource temporarily unavailable" and the video output is choppy. Is there any way to fix this? The command I'm using is ffmpeg -f video4linux2 -input_format mjpeg -r 15 -s 854x480 -i /dev/video0 -vcodec copy out.avi
[02:51] <FergyA> one moment
[02:53] <ubitux> also, could you compile current git head without "--enable-libv4l2" and try again?
[02:54] <FergyA> ummm, if compiling didnt take like 15 hours sure
[02:54] <FergyA> im running on a raspberry pi, and crosscompiling is a royal pain
[02:54] <ubitux> it will take a while if you're compiling on the r-pi :p
[02:55] <ubitux> maybe you can just test:
[02:55] <FergyA> and give me a bit longer on the pastebin... my ssh client doesnt have a big enough buffer thanks to all the spam
[02:55] <ubitux> forget the pastebin; try with one of the static build here
[02:55] <ubitux> iirc they're not build with libv4l2
[02:55] <FergyA> kk
[02:56] <FergyA> how would i go about checking what kernel version im running?
[02:56] <ubitux> uname -a
[02:56] <ubitux> it seems you hit this issue: https://ffmpeg.org/trac/ffmpeg/ticket/2367
[02:56] <FergyA> perfect, ty
[02:57] <ubitux> i wonder if you can not just drop the -input_format mjpeg etc
[02:57] <ubitux> also, what's your current ffmpeg version?
[02:57] <FergyA> ffmpeg version 1.1.3
[02:58] <FergyA> built on Feb 27 2013 01:35:10 with gcc 4.7.2 (GCC)
[02:58] <FergyA> and unfortunately those static builds probably wont work for me since im on ARM
[02:58] <ubitux> oh, true
[02:58] <ubitux> mmh
[02:58] <FergyA> let me try a copy of ffmpeg i compiled yesterday...
[02:59] <FergyA> from the git
[02:59] <FergyA> that was for raspbian, but maybe itll work
[02:59] <ubitux> btw, does it work if you remove -input_format mjpeg?
[03:00] <FergyA> i get a libv4l2: error allocating conversion buffer
[03:00] <FergyA> [video4linux2,v4l2 @ 0xa1d090] mmap: Cannot allocate memory
[03:00] <FergyA> /dev/video0: Cannot allocate memory
[03:00] <FergyA> if i drop it
[03:00] <ubitux> not good
[03:00] <ubitux> :P
[03:01] <ubitux> well try to upgrade anyway
[03:01] <FergyA> yeah, unfortunately im stuck capping in mjpeg as YUV requires encoding
[03:01] <ubitux> also, removing --enable-libv4l2 certainly helps
[03:01] <FergyA> which a 700mhz arm just cant do on the fly
[03:01] <ubitux> check the trac bug issue i pointed out, and feel free to comment here
[03:02] <FergyA> will do, thanks
[03:03] <FergyA> looks like the updated version works, shame im only getting 1fps
[03:03] <FergyA> and I guess my cross compiler toolchain must work ^^
[03:05] <ubitux> are you sure a scale filter is not inserted?
[03:05] <ubitux> you should use -video_size to set the input size
[03:05] <ubitux> not -s
[03:05] <ubitux> -s might be inserting a filter (check with -v verbose)
[03:05] <FergyA> _fractually hold up
[03:06] <FergyA> i just threw the input format back in
[03:06] <FergyA> and im getting 15 fps now
[03:06] <ubitux> do you need to set the rate too?
[03:06] <ubitux> ffmpeg -f v4l2 -i /dev/video0 should work fine out of the box
[03:07] <ubitux> then you can play with the input v4l2 config options listed in ffmpeg -help full
[03:07] <FergyA> yeah, doing a straight output does work, it just totally kills the cpu :P
[03:08] <FergyA> since its doing encoding
[03:08] <ubitux> what's your cmd line?
[03:08] <ubitux> you can still use -c:v copy
[03:08] <FergyA> just ffmpeg -f v4l2 -i /dev/video0
[03:08] <FergyA>  test.avi
[03:08] <ubitux> what about ffmpeg -f v4l2 -i /dev/video0 -c:v copy test.avi?
[03:09] <FergyA> hmm, can i change formats in v4l2?
[03:09] <ubitux> with -input_format as input option i guess
[03:10] <ubitux> mmh lavd options are not listed in the help, that sucks a bit
[03:10] <FergyA> yeah, soon as i throw the copy option in it goes nuts
[03:10] <FergyA> I start getting messages like [avi @ 0x15606e0] st:0 PTS: 1318 DTS: 1318 < 1373 invalid, clipping
[03:10] <ubitux> what about using test.mjpeg as output instead of avi?
[03:10] <FergyA> let me give it a try
[03:11] <FergyA> seems okay so far
[03:11] <ubitux> ok, with avi, does it help with -fflags +genpts?
[03:12] <ubitux> (as output option)
[03:12] <ubitux> oh no
[03:12] <ubitux> there is an option
[03:13] <ubitux> try for example  ffmpeg -f v4l2 -ts abs -i /dev/video0 -c:v copy out.avi
[03:13] <ubitux> maybe
[03:13] <ubitux> :p
[03:13] <FergyA> with -fflags +genpts it dies after about 25s
[03:13] <ubitux> you also can try -ts mono2abs
[03:13] <FergyA> from skipped frams
[03:13] <ubitux> or stuff like that
[03:13] <ubitux> also, maybe try to play with the -framerate option (it's v4l2 option as well, so as input option)
[03:14] <ubitux> (both -framerate and -ts are)
[03:14] <FergyA> i think if i just avoid avi ill be good tbh
[03:14] <ubitux> :)
[03:15] <FergyA> the mjpeg works, its just got a really high bit rate
[03:15] <FergyA> so ill just have to do some tweaking there i think
[03:24] <FergyA> yeah, i dont know what it is about 30 seconds in, but it doesnt seem to matter what format i use (besides mjpeg) it has issues
[03:25] <FergyA> and actually mjpeg just did it too :/
[03:25] <FergyA> so picky heh
[04:47] <chouwa> is there a simple way to overlay video timestamps (i.e. running time, like ffms2's ffinfo) w/ ffmpeg?
[04:55] <chouwa> ah, nvm
[11:51] <RSDRSDRSD> how can i make a video faststart?
[11:52] <ubitux> -movflags +faststart
[12:36] <RSDRSDRSD> is this flag as good as native qt-faststart
[12:36] <RSDRSDRSD> or the python script
[12:46] <durandal_1707> RSDRSDRSD: what flag?
[12:47] <RSDRSDRSD> -movflags +faststart
[12:47] <durandal_1707> it does same as other scripts
[12:47] <durandal_1707> point of flag is to not depend on 3rd stuff
[13:19] <RSDRSDRSD> http://www.stoimen.com/blog/2010/11/12/how-to-make-mp4-progressive-with-qt-faststart/
[13:19] <RSDRSDRSD> if you read the last paragraph
[13:20] <RSDRSDRSD> does ffmpeg also have this problem?
[13:20] <RSDRSDRSD> last two paragraphs
[13:20] <ubitux> with -movflags +faststart, the mov/mp4 muxer will move it itself reliably
[13:21] <ubitux> qt-faststart is an old tool distributed by ffmpeg
[13:21] <ubitux> because doing a 2nd pass inside the muxer was not easy
[13:21] <ubitux> qt-faststart basically is a hack (notably to look for some atoms)
[13:21] <ubitux> now ffmpeg has a "native" support to move the header on top
[13:22] <ubitux> it should be more reliable
[13:22] <ubitux> but OTOH it's more recent, and thus less tested
[13:22] <ubitux> try it yourself.
[13:26] <RSDRSDRSD> ok thanks for the answer
[13:26] <RSDRSDRSD> ill use the native one ;-)
[13:41] <rob_> hi
[13:42] <rob_> im trying to stream a v4l webcam and embed the stream in a webpage served by the local computer - it's my understanding that webm is the best format to use but im having some trouble
[13:42] <rob_> here is the line im using: avconv -f video4linux2 -r 10 -s 640x360 -i /dev/video1 stream.webm
[13:43] <ubitux> rob_: please use a recent ffmpeg and pastebin command line and output, or ask support to the fork you are using
[13:44] <rob_> avconv is ffmpeg isnt it?
[13:44] <ubitux> no it's not, it's a fork
[13:44] <ubitux> see ^
[13:44] Action: rob_ goes to read
[13:46] <rob_> ah.
[13:49] Action: rob_ installs actual ffmpeg
[13:56] <rob_> i've taken the example from the docs and this is the result: http://pastebin.com/D0f3xiHv
[13:59] <ubitux> ok so, various things:
[14:00] <ubitux> 1) you don't need to run ffmpeg as root (operation not permitted errors generally are due to a return -1 somewhere in the code)
[14:00] <ubitux> 2) ffmpeg 0.10 is very old
[14:00] <ubitux> we are in ffmpeg 1.2 now
[14:00] <ubitux> try these ^
[14:01] <ubitux> rob_: and the name is "video4linux2" or "v4l2"
[14:01] <ubitux> unless you want to use the old v4l?
[14:01] <ubitux> (iirc that's not supported anymore)
[14:01] <rob_> no i dont think so
[14:01] <ubitux> so use -f v4l2
[14:01] <rob_> ok, i'll the static lib from dropbox
[14:07] <rob_> ok that seems to work, thanks ubitux
[14:07] <rob_> i have another problem but im not sure whether it's ffmpeg related..
[14:07] <rob_> when i embed the webm in a web page, it only displays the first frame - http://rw.wtf.im/
[14:08] <rob_> is this because im using the wrong sort of file format?
[14:09] <ubitux> opening directly your webm file works
[14:09] <ubitux> maybe your http server has a problem
[14:09] <ubitux> like mime-types or such
[14:11] <rob_> the mime type is set to video/webm which is correct
[14:16] <ubitux> http://rw.wtf.im/stream.webm
[14:16] <ubitux> this works here
[14:16] <ubitux> so maybe something is wrong in your html
[14:16] <rob_> yeah think it's not autoplaying
[14:16] <rob_> anyway thanks for the help! i really appreciate it :)
[14:19] <rob_> oh, one more question
[14:19] <rob_> so with ffmpeg im writing this file and ive got it embedded in my web page
[14:19] <rob_> but i'd like it to be a live stream
[14:19] <rob_> can ffmpeg do that?
[14:20] <rob_> at the moment whenever i open the web page it starts the stream from the beginning
[14:21] <ubitux> live streaming is a bit different; you might need to use ffserver
[14:22] <rob_> ahh ok
[14:22] <rob_> will look into that
[14:22] <rob_> thanks
[16:15] <foonix> when using twice -ss (seek and decode) then -to gets tricked by seek time, is it a bug or do i miss something?
[16:16] <foonix> (on version 1.2)
[16:20] <foonix> i can use -t or -vframes but this would be easier
[16:33] <rob_> ubitux: ended up having to compile ffmpeg from source to get ffserver support - now everything works perfectly :)
[16:33] <rob_> ubitux: pretty bad that the packages people are distributing are that broken
[16:34] <ubitux> rob_: complain to you distro :p
[16:35] <ubitux> foonix: that might be a bug
[16:37] <rob_> ubitux: from that thread it sounds like the maintainer of libav has taken over the ffmpeg name in ubuntu?
[16:37] <xentrac> rob_: correct
[16:38] <rob_> that is ridiculous :)
[16:38] <ubitux> complain to your distro :)
[17:12] <cbsrobot_> foonix: can you show me your command line ?
[17:27] <xentrac> rob_: there are project forks that were better handled
[18:07] <foonix> cbsrobot_: http://pastebin.com/AXP6GeQE
[20:11] <josetorn> ffmpeg is no longer able to connect to shoutcast servers starting from version 1.9.9beta, any ideas? Something is probably changed but i don't know what is that.. Because, VLC fails too.
[20:18] <saste> josetorn, version 1.9.9beta -> doesn't exist
[20:19] <saste> or is that the version of the server?
[20:19] <josetorn> version of the server
[20:20] <josetorn> i can give you example stream addresses
[20:21] <josetorn> http://38.96.148.39:8746
[21:53] <cbsrobot_> foonix: well the first -ss is ignored becase -ss is an output option
[22:13] <foonix> cbsrobot_: so seeking should not work with -to ?
[22:13] <cbsrobot_> no
[22:13] <cbsrobot_> it's rather the second -ss overwrites the first -ss
[22:13] <foonix> in this combination quick+accurate .. i think doing just quick seek it will work ok
[22:14] <foonix> accurate = decoded
[22:14] <cbsrobot_> try it
[22:14] <cbsrobot_> you'll see
[22:15] <`WarpKat> is -filter:v the same as -vf  and will having both on the same line conflict?
[22:16] Action: cbsrobot_ always uses -vf
[22:19] <foonix> cbsrobot_: if its just -ss before input it seeks to position but starts from there as it is 00:00:00
[22:19] <`WarpKat> i'm assuming i can do something like this, then:  -vf 'scale=960:-1;yadif'
[22:19] <`WarpKat> ???
[22:21] <foonix> cbsrobot_: my idea is to avoid decoding as much as possible, ie start from 1h5min -ss 01:04:00 -i some_input -ss 00:01:00 ...
[22:21] <cbsrobot_> foonix: if i remeber the code wel it's rather -ss bofore the firs input will be used as an output option for it, but if you define -ss again I guess it will be overwritten
[22:24] <cbsrobot_> foonix: the commit message states: there is a corner case: if -ss is specified in front of the input file
[22:24] <cbsrobot_> then -to will behave like -t.
[22:24] <foonix> oh thanks
[22:25] <foonix> i didnt check that for sure
[22:25] <cbsrobot_> np
[22:35] <mark4o> `WarpKat: -vf & -filter:v are the same, use only one; syntax would be -vf scale=960:-1,yadif
[22:35] <`WarpKat> thanks, mark4o - kinda figured it out when it complained about my ;...lol  is yadif the only deinterlacing option for 1.2?
[22:35] <`WarpKat> the old one seemed to work much better, imho
[22:37] <mark4o> I think the old one was thought to be worse and was removed.  I've never used the old one so I can't say.
[22:38] <mark4o> actually you probably want to deinterlace before scaling so it would be -vf yadif,scale=...
[22:39] <`WarpKat> so the order makes that much of a difference, eh?
[22:39] <mark4o> yes
[22:40] <mark4o> well if you were doing vertical scaling it would anyway
[22:41] <mark4o> I don't know your source dimensions
[22:42] <`WarpKat> the scale is variable depending on a condition, but in this case, doesn't matter - but your suggestion worked to my liking - thanks for your help
[22:59] <Eric___> Kind of very interesting question Which one is better to use and why for HTTP Live streaming ffmpeg or Gstreamer?
[23:01] <JEEB> I have no idea which is simpler to use for that exact use case because while ffmpeg is nice to use in general, for HTTP stuff you have to use something called ffserver, and that is one undocumented mess. GStreamer just generally sucks so welp
[23:02] <Eric___> @<JEEB> thats true, thats why thought taking expert opinions before putting lot of time on it....
[23:02] <Eric___> ffmpeg is very simple to implement
[23:03] <Eric___> gstreamer's Plugin-based architecture -> too many shared libraries to add
[23:04] <Eric___> any other good suggestions
[23:05] <JEEB> just streaming f.ex. mpeg-ts into a http port? VLC
[23:06] <Eric___> use mpegts and use it for hls
[23:10] <JEEB> oh
[23:10] <JEEB> I think ffmpeg itself could do hls
[23:10] <JEEB> although you need a web server to serve the files IIRC
[23:10] <JEEB> there's -f hls methinks
[23:11] <Eric___> thanks JEEB
[00:00] --- Wed Mar 27 2013


More information about the Ffmpeg-devel-irc mailing list