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

burek burek021 at gmail.com
Sat Dec 10 02:05:01 CET 2011


[00:00] <sacarasc> [libx264 @ 0xa041f90]use an encoding preset (vpre)
[00:01] <sacarasc> Old, and you're using a rather old version, ffmpeg needs a -vpre or it just cries.
[00:03] <gdoteof> where do i add the -vpre?
[00:03] <gdoteof> everywhere i put it i get a different error
[00:04] <gdoteof> it looks to be looking for a 'file for preset'
[00:05] <gdoteof> sacarasc: i am looking for a preset file
[00:05] <sacarasc> They should be named blah.ffpreset
[00:06] <gdoteof> hrm i installed ffmpeg from a repo; the source doesn't seem to be in the repo
[00:06] <gdoteof> i should just pull a copy of the source i guess
[00:06] <sacarasc> Also, you're using Libav, not ffmpeg...
[00:07] <gdoteof> sacarasc: ?  idk.  i am def running ffmpeg =D
[00:08] <gdoteof> i honestly (and clearly) have no idea what i am doing.  just trying to make this one video file small
[00:08] <sacarasc> Nope, you're using the fork which is the default on Ubuntu these days.
[00:08] <gdoteof> sacarasc: gotcha
[00:08] Action: gdoteof cloning git repo
[00:08] <sacarasc> There's a guide for compiling ffmpeg on Ubuntu in the topic.
[00:10] <gdoteof> sacarasc: i am getting File for preset '/home/g/src/ffmpeg/ffpresets/libvpx-720p.ffpreset' not found
[00:10] <gdoteof> but; that file is def there
[00:11] <gdoteof> got to it with tab complete
[00:12] <sacarasc> -vpre is an installed preset, -fpre is if you want to point to the preset. But the libx264 presets have been removed from git as they're no longer used.
[00:12] <gdoteof> http://pastebin.com/cHDX0Lt4
[00:12] <gdoteof> ugh
[00:13] <gdoteof> i change to fpre and get an unknown flag 'quality'
[00:13] <gdoteof> what do you recommend for tryign to turn this 680M 3:24 .mov quicktime file into something manageable
[00:14] <gdoteof> strongly prefer not compling ffmpeg from source if i canmake do in anyway with what i've got
[00:15] <sacarasc> Upgrade ffmpeg!
[00:16] <pasteeater> gdoteof: ffmpeg -i input -vcodec libx264 -vpre medium -crf 24 -threads 0 -acodec libfaac -aq 100 output.mp4
[00:16] <pasteeater> it will probably complain about libfaac
[00:17] <pasteeater> if it does, see option C here: http://ubuntuforums.org/showthread.php?t=1117283
[00:18] <gdoteof> pasteeater: thanks i will tyr; i think i already got libfaac; i have ffmpeg frm the medibuntu repo
[00:18] <gdoteof> pasteeater: its doing something!  thanks
[00:19] <pasteeater> crf is the quality option. choose the highest crf value that still gives you an acceptible quality.
[00:19] <gdoteof> pasteeater: meaning higher crf means lower quality?
[00:19] <pasteeater> yes
[00:19] <gdoteof> k
[00:20] <pasteeater> and you don't have to encode the whole clip to get an idea. just choose some random sections with the -ss and -t options as output options.
[00:20] <pasteeater> ffmpeg -i input -ss 30 -t 60 -vcodec libx264 ...
[00:20] <gdoteof> pasteeater: thanks for the tip; really really appreciate it.
[00:20] <gdoteof> is ss and t for seconds or frames?
[00:21] <pasteeater> will make a 60 second output and skip the first 30 secs of input
[00:21] <gdoteof> gotcha
[00:21] <gdoteof> tyvm
[00:21] <pasteeater> once you have a crf you like then choose the slowest preset you have patience for.
[00:22] <pasteeater> i think your version can emulate the following presets: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow
[00:22] <gdoteof> pasteeater: ok that makes sense
[00:23] <pasteeater> a fast preset encodes faster, but is less efficient at compression
[00:27] <gdoteof> pasteeater: so there is no harm in testing the quality via crf values and using ultrafast
[00:27] <gdoteof> then upping the compression for the final
[00:31] <pasteeater> different presets can have an effect on the quality, because different presets can affect how quality is measured in x264
[00:31] <janitor61> i am not getting this whole -vf pad=0:0:0:0 change
[00:33] <pasteeater> gdoteof: but the difference probably won't be noticeable
[00:36] <janitor61> when I have  -f image2 -s 150x100 -vf pad=150:100:10:0:black I get Input area 10:0:160:100 not within the padded area 0:0:150:100 or zero-sized
[00:36] <janitor61> it was so easy before with the -padbottom args
[00:38] <ubitux> i'm not sure -s works; try with -vf scale=150:100,pad=...
[00:38] <ubitux> or at least work as you expect
[00:39] <janitor61> does the new version re-support the -padXXX tags or is that gone forever?
[00:40] <ubitux> it's been replaced with a far better filter
[00:40] <ubitux> just learn how to use it
[00:40] <ubitux> the documentation is pretty explicit about the usage
[01:11] <janitor61> how do I make a very low quality transcode of a video? ffmpeg doesn't seem to respect my -b:v 100k, the final product has a bitrate of 554k
[01:13] <teratorn> anyone have a clue about this memory leak inside libavformat? valgrind output: http://codepad.org/wIgKypR6 I AM calling av_close_input_file() on the format context... is there something else I'm missing?
[01:15] <janitor61> is there a hidden minimum bitrate for FLV format?
[01:20] <janitor61> i used -qscale 31 thanks guys
[01:20] <janitor61> i want to make a tech support channel that just has bots that cheer you on and give you words of support as you google your problem
[01:25] <teratorn> sweet idea
[01:36] <ZacS123> hi
[01:37] <kcm1700> http://lists.ethernal.org/oldarchives/cantlug-0211/msg00174.html instead making a bot, maybe rubber duck can help solving problems.
[01:37] <ZacS123> im having some issues with frame rate conversion. I am using ffmpeg -i 24FPS.mp4 -vcodec libx264 -r 12 12FPS.mp4
[01:38] <ZacS123> but it only starts dropping every second frame after about 4 frames
[01:55] <burek> ZacS123, can you first explain your goal
[01:57] <ZacS123> I have 24fps input video, and I want ffmpeg to output 12 fps, so I expect it to drop every 2nd frame
[01:58] <ZacS123> but it only starts dropping every 2nd frame after it has output the first 4 or so frames
[01:58] <Freakshow> so... 'contrained baseline'? I'm setting -profile baseline -preset medium, but ffprobe sees it as something slightly less
[01:58] <Freakshow>     Stream #0.0: Video: h264 (Constrained Baseline), yuv420p, 720x480 [PAR 8:9 DAR 4:3], 30 tbr, 1k tbn, 60 tbc
[02:12] <ZacS123> burek: as far as I can tell there is something wrong with ffmpegs calculating which frames to drop
[02:13] <burek> ZacS123
[02:13] <burek> can you please use pastebin.com, to show your command line and its output?
[02:22] <ZacS123> burek: http://pastebin.com/44KWupBx
[10:34] <sam1> hi guys, 
[10:35] <sam1> i want to watermark a movie ,what's command?
[12:00] <zap0> ffmpeg --do-teh-watermark,-bitch...-like-now!
[14:03] <Guest46584> hi
[17:56] <qjcg> is there a command i can use to see the list of audio codec available for use with -acodec ?
[18:03] <impulze> ffmpeg(1) DECODERS [...] The option "-codecs" of the ff* tools will display the list of enabled decoders. [...]
[18:04] <JEEB> I think it had some kind of a tag for audio stuff
[18:04] <JEEB> so you could grep the output of -codecs for it
[18:04] <JEEB> :)
[18:34] <Compn> should make -acodec help 
[18:34] <Compn> like mencoder/mplayer has :P
[18:56] <echelon> hi, how do i resample an ac3 with 6 channels to pcm_s16le with 2 channels
[18:58] <Compn> with the pan audio filter
[18:58] <Compn> there should be an example in the ffmpeg documentation
[18:58] <Compn> but not in the manual
[19:00] <ubitux> sounds overkill to use pan
[19:01] <ubitux> -ac 2 -acodec pcm_s16le should be enough
[19:05] <Compn> ffmpeg has built in downsampler now i think
[19:05] <Compn> are you sure ubitux ?
[19:06] <ubitux> sure
[19:06] <ubitux> actually, there is at least 3 in the codebase now :p
[19:06] <ubitux> the old audio api, libswresample and now the filters (see aconvert/aresample/...) :p
[19:07] <echelon> i'm on slackware
[19:07] <echelon> ffmpeg-0.6.1
[19:07] <ubitux> this one is pretty old, i don't know
[19:17] <echelon> is it possible to do it with mencoder?
[19:18] <Compn> mencoder yes
[19:18] <Compn> using mencoder -af hrtf or -af pan (example in the docs)
[19:18] <Compn> at least i think hrtf does it
[19:25] <ubitux> mplayer has an automatic downmix too (using pan)
[19:25] <ubitux> i'm not sure if it is effective in mencoder
[19:25] <ubitux> also, it's relatively recent
[19:27] <WindowsNT> question : I 'm trying to extract only video from an avi. ffmpeg -i 1.avi -an and other video options. However the output 2.avi still has the audio. 
[19:28] <Compn> ubitux : hrtf is recent, but pan has been around for years
[19:29] <Compn> recent being last 2-3 years of course :D
[19:29] <Compn> pan being 5-7
[19:29] <ubitux> hrtf isn't a "common" downmix btw
[19:29] <ubitux> better use a custom pan
[19:29] <Compn> thats true
[19:30] <Compn> WindowsNT : put -an before -i
[19:30] <Compn> i think...
[19:34] <qjcg> JEEB: thanks! (w later...)
[19:36] <WindowsNT> Compn : thx a lot
[19:36] <WindowsNT> worked
[19:36] <WindowsNT> :)
[20:10] <hackeron> hey, I'm trying to pull audio+video from my ip camera - I'm doing ffmpeg -t 60 -acodec copy -vcodec copy -f mjpeg -i ${URL}mjpeg.cgi -i ${URL}audio.cgi -ar 16000 -r 25 $filename.avi -- it seems to get to frame number 818 (32.72 seconds) and freeze :/ - in the resulting video the video is ahead of audio -- any ideas?
[20:23] <echelon> looks like neroaacenc is capable of resampling from 6ch to 2ch
[20:23] <echelon> oh wait
[20:25] <echelon> it's still in 48000Hz, 5.1 surround sound
[20:26] <echelon> don't see the number of channels
[20:29] <Compn> 5.1 = 6 channels
[20:36] <echelon> oh
[20:57] <hackeron> anyone? - I'm trying to pull audio+video from my ip camera - I'm doing ffmpeg -acodec copy -vcodec copy -f mjpeg -i ${URL}mjpeg.cgi -i ${URL}audio.cgi -ar 16000 $filename.avi -- it seems to get to frame number 818 (32.72 seconds) and freeze :/ - in the resulting video the video is ahead of audio -- any ideas?
[21:01] <JodaZ> hackeron, why no use wget or smth ?
[21:02] <JodaZ> if you get a/v from two live sources like that its likely to be async anyways
[21:02] <sacarasc> hackeron: That line is all messed up... ffmpeg [input options] -i input [output options] output
[21:08] <hackeron> sacarasc: what's messed up about that line?
[21:08] <hackeron> JodaZ: because mjpeg is variable rate
[21:11] <sacarasc> hackeron: You put output options in the input options part and you tried to copy the audio and change it at the same time.
[21:14] <hackeron> sacarasc: ok, I changed it to ffmpeg -f mjpeg -i ${URL}mjpeg.cgi -i ${URL}audio.cgi -acodec copy -vcodec copy $filename.avi -- it still freezes at 818 frames
[21:15] <JodaZ> try without -f mjpeg ?
[21:16] <hackeron> JodaZ: then it says http://admin:@192.168.0.108/mjpeg.cgi: could not find codec parameters and quits
[21:16] <JodaZ> hmm
[21:16] <JodaZ> hmm, so that freeze, does it also stop sending data ?
[21:16] <hackeron> yes
[21:16] <JodaZ> does it also happen with wget ?
[21:16] <hackeron> no
[21:16] <JodaZ> so ffmpeg stops reading ?
[21:16] <JodaZ> hmm
[21:17] <JodaZ> i don't like freezes, they are so hard to debug
[21:17] <JodaZ> what happens if you use -ss 100 ?
[21:17] <hackeron> JodaZ: it seems the fps fluctuates from the camera, but the audio is stable - my guess is there are not enough frames to match the fps that ffmpeg decides for itself?
[21:18] <JodaZ> might wana try another output container then ?
[21:18] <hackeron> trying flv
[21:18] <JodaZ> try .ts or something
[21:19] <hackeron> trying
[21:19] <hackeron> erm, it didn't like that, heh - http://pastie.org/2992823
[21:20] <JodaZ> ew at library mismatch
[21:21] <JodaZ> well, seems there is no way to get any kind of temporal info for the motion jpeg stuff ?
[21:22] <hackeron> temporal info? - it's just a series of jpeg images, it looks like: --video boundary--^M
[21:22] <hackeron> Content-length: 34708^M
[21:22] <hackeron> Date: 01-01-2010 02:13:04 AM IO_00000000_PT_000_000^M
[21:22] <hackeron> Content-type: image/jpeg^M
[21:23] <JodaZ> that, then image data in a loop ?
[21:23] <hackeron> yep
[21:23] <JodaZ> well, it seems to guess a audio duration of 32.76 seconds
[21:23] <JodaZ> why would it do that
[21:25] <hackeron> good question :/
[21:25] <hackeron> it's just a live pcm stream
[21:25] <JodaZ> so what kinda header data does pcm have ?
[21:26] <JodaZ> what happens if you wget both streams for a minute and then feed them into ffmpeg like that
[21:29] <hackeron> JodaZ: wild de-sync naturally - mjpeg fluctuates between 3 fps and 30 fps depending on the amount of ambient light
[21:30] <hackeron> JodaZ: that's why I need something to handle that - otherwise I'd just wget both streams separately
[21:31] <JodaZ> hackeron, just a shot in the dark but i just read someone mentioning -analyzeduration 0
[21:33] <hackeron> JodaZ: no change, it's still detecting the duration for the audio of 32.76 seconds :/
[21:34] <JodaZ> well, a wav/riff header actually has a size specification
[21:34] <pasteeater> my ISP is annoying...
[21:35] <JodaZ> hackeron, so it might be starting a new wav after 32secs (wav header: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ )
[21:36] <JodaZ> hackeron, how does the data look when you wget it, hd -n 16 data.wav ?
[21:36] <hackeron> JodaZ: maybe it is, but it doesn't stop the curl or wget process - and I'm not sure how to tell ffmpeg that this is ok for it to do that :)
[21:36] <hackeron> JodaZ: # hd -n 16 audio.cgi 
[21:36] <hackeron> 00000000  52 49 46 46 00 00 10 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
[21:36] <hackeron> 00000010
[21:36] <freeminds> is there a way to let ffmpeg output on stdout?
[21:37] <freeminds> and errors on stderr?
[21:38] <JodaZ> 00 00 10 00 in little endian, thats 1048576 bytes = 1024x1024 bytes
[21:38] <hackeron> JodaZ: let me try to capture for longer than the 32.76 seconds - maybe it does start a new wav
[21:39] <JodaZ> 1mbyte at your bitrate of 256kbit/s is actually ~31 seconds
[21:40] <JodaZ> so it likely does start a new wav
[21:40] <JodaZ> so the most imidiate problem is picking up that new wav
[21:41] <hackeron> JodaZ: captured for a little over 2 minutes - the first RIFF or WAVE is the only one matched in the captured file, hmm
[21:42] <JodaZ> ? captured with wget and only the first wav is visible in the file ?
[21:42] <JodaZ> hd -s 1048576 -n 15 audio.cgi
[21:42] <hackeron> 00100000  d8 f4 d8 f4 d8 f4 d8 f4  0c f4 d8 f4 d8 f4 d8     |...............|
[21:42] <hackeron> 0010000f
[21:43] <JodaZ> huh, thats strange
[21:43] <JodaZ> ah, hmm, sec
[21:44] <JodaZ> hd -s 1048592 -n 15 audio.cgi
[21:45] <JodaZ> or maybe do some binary search in the file for a second ocurrence of "RIFF" or "WAVE"
[21:45] <JodaZ> otherwise its lying about its size in the header
[21:47] <hackeron> # hd -s 1048592 -n 15 audio.cgi
[21:47] <hackeron> 00100010  d8 f4 0c f4 0c f4 0c f4  0c f4 0c f4 0c f4 0c     |...............|
[21:47] <hackeron> 0010001f
[21:47] <hackeron> # grep -ao RIFF audio.cgi 
[21:47] <hackeron> RIFF
[21:48] <JodaZ> only once ?
[21:48] <hackeron> yep
[21:48] <hackeron> and WAVE is only once too
[21:48] <JodaZ> hmm
[21:48] <hackeron> this is a dlink ip camera btw
[21:48] <JodaZ> so it lies in its header about its size >_>
[21:49] <hackeron> heh, probably
[21:49] <hackeron> seems a bit broken - it doesn't even have a boundary in the multipart mjpeg header :/
[21:49] <hackeron> gstreamer won't recognise the multipart at all - ffmpeg works somehow, heh
[21:50] <JodaZ> so does the stuff go out of sync in those 30 seconds ? or is it just out of sync and stays that way ?
[21:51] <hackeron> hmm, not entirely sure - but if I record just video, it seems ffmpeg records 76 seconds when I'm asking it to record 60 seconds :/
[21:51] <hackeron> it seems to just go by the number of frames, not by the frame timestamps
[21:51] <JodaZ> there are frame timestamps ?
[21:51] <hackeron> and the framerate fluctuates
[21:51] <hackeron> yeh, e.g. Content-length: 34708^M
[21:51] <hackeron> Date: 01-01-2010 02:13:04 AM IO_00000000_PT_000_000^M
[21:51] <hackeron> Content-type: image/jpeg^M
[21:51] <JodaZ> thats the mjpeg standard ?
[21:51] <JodaZ> i kinda doubt that
[21:52] <hackeron> yeh, it's just jpeg images encapsulated in multipart http
[21:52] <JodaZ> with timestamps like that ?
[21:52] <hackeron> yeh, he
[21:52] <hackeron> heh*
[21:53] <hackeron> but is there anyway to tell ffmpeg that the framerate isn't constant and each frame it gets is right now?
[21:53] <JodaZ> good question, lets wait for someone competent to come here
[21:54] <hackeron> heh
[21:54] <JodaZ> you would definitely need that
[21:56] <JodaZ> and you'd need something that tells the duration estimation to back off and just accept unlimited length, if thats not possible, i am sure that can be changed in the code easily enough
[21:57] <hackeron> well, if I can record the mjpeg multipart in a way that tells ffmpeg it is a live stream and not a file, that's all I need really - I can mux later
[21:57] <hackeron> but ffmpeg seems to think 1 frame is 1/25 of a second - but in reality it is anything from 3fps to 25fps depending on the ambient light
[22:11] <hi117> can i use ffmpeg to creat gifs?
[22:11] <hi117> create*
[22:11] <hi117> from video files
[22:13] <JodaZ> hi117, yes, you can google how
[22:15] <JodaZ> hackeron, "-re Read input at native frame rate. Mainly used to simulate a grab device." what you think ?
[22:16] <hackeron> JodaZ: there is no native frame rate - it fluctuates, it's just a series of images
[22:16] <JodaZ> that could mean native framerate, you know...
[22:16] <hackeron> heh, doesn't hurt to try I guess :) - lets see
[22:18] <JodaZ> it won't fix the 30 second limit, but if it goes sync thats good
[22:18] <hackeron> I'm trying video only
[22:19] <hackeron> I added -t 60
[22:19] <hackeron> it's still recorded 1500 frames which is 2 minutes and 8 seconds of video :/
[22:19] <hackeron> (this is with -re)
[22:19] <JodaZ> did you try -re before and after -i ?
[22:19] <JodaZ> and do you know the resulting video is 2 minutes ?
[22:20] <hackeron> yeh
[22:20] <hackeron> time ffmpeg -re -y -t 60 -f mjpeg -i ${URL}mjpeg.cgi -acodec copy -vcodec copy output.avi
[22:20] <JodaZ> and after the -i ?
[22:20] <JodaZ> also, do use .ts and try -vsync 1 and 2
[22:20] <hackeron> trying
[22:21] <hi117> JodaZ the image quality is bad, my hunch is it is related to yuv -> rgb conversion
[22:23] <hackeron> JodaZ: time ffmpeg -re -vsync 1 -y -t 30 -f mjpeg -i ${URL}mjpeg.cgi -vcodec copy -vsync 1 -re output.ts -- records 42 seconds of video
[22:23] <hackeron> and exactly 750 frames
[22:23] <hackeron> it's still using number of frames and not time :(
[22:30] <JodaZ> hackeron, did you check if you can tell the cam to just feed you a constant framerate ?
[22:30] <hackeron> JodaZ: yeh, and I can but the framerate is responsible for the shutter speed - if I don't let the camera slow down the shutter speed I get horrible low light performance
[22:31] <JodaZ> hmm, well, in theory the data isn't lost tho, you could just average over a few frames in the video to get light intensity back ?
[22:32] <hackeron> JodaZ: erm, no - if you take a camera and set it to fire at 1/25 seconds in low light, you get a really dark image - then you adjust it to fire at 1/8 seconds, you get more motion blur but a much brighter image, right?
[22:34] <JodaZ> yes, but if you take 3 to 4 pictures (25/8 = 3,125) and add their intensitys up, you should have a bright image back
[22:34] <hackeron> huh?
[22:35] <hackeron> so are you saying you can take 1,000 pitch black images taken at night, you add them together and you get the same image as setting the exposure to 1,000 seconds?
[22:35] <JodaZ> no, but it would most likely work with 4 250 second images
[22:36] <hackeron> JodaZ: if it doesn't work with 1,000 images, why would it work with 4?
[22:38] <JodaZ> because you loose the time when it reads the sensor or/and shutters, and because when there is really little light you are in an area where the light that arrives does not have a linear effect on the signal of the sensor
[22:38] <JodaZ> tho, for one second shutter time it would work, but meh
[22:38] <hackeron> either way, fine, how do I get ffmpeg to automatically adjust and add add images to bring back light intensity of a darker image?
[22:39] <hackeron> sounds like a harder problem than getting ffmpeg to use fariable frame rate input
[22:39] <hackeron> variable*
[22:40] <JodaZ> hackeron, as a further resource, maybe you could check out those peoples irc channel http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide
[22:40] <JodaZ> if they have one that is...
[22:42] <hackeron> JodaZ: I use that - it doesn't handle fluctuating fps either
[22:43] <JodaZ> hackeron, you code ?
[22:43] <hackeron> JodaZ: not in C, heh
[22:43] <hackeron> JodaZ: but I contributed code to Motion, the project you linked to :)
[22:44] <JodaZ> maybe you could read the mjpeg decoder and see where it gets timestamps from, then modify that to be able to also do your format or just get current time as timestamp
[22:45] <hackeron> I just want to use the current time as a timestamp - whatever frame I get is happening right now
[22:45] <JodaZ> i couldn't find a option regarding that in the manual tho
[22:46] <hackeron> me neither
[22:47] <hackeron> maybe setpts, hmm
[22:50] <cbsrobot> JodaZ: if you want to see what you get try: ffmpeg  -f mjpeg -i ${URL}mjpeg.cgi -vf showinfo -f null -y /dev/null
[22:51] <JodaZ> hackeron, do what cbsrobot says
[22:51] <cbsrobot> ah sorry mixup
[22:52] <hackeron> trying
[22:52] <hackeron> No such filter: 'showinfo'
[22:52] <cbsrobot> hackeron: update your ffmpeg
[22:54] <hackeron> cbsrobot: ok, updated: http://pastie.org/2993249
[22:57] <hackeron> cbsrobot: it seems ffmpeg doesn't care what the input fps is - I tell it to record 30 seconds of video, it records exactly 750 frames which is anything from 30 seconds and over a minute of video depending on the ambient light
[22:57] <TomCat2> hey guys - I'm trying to track down some odd colorspace conversion issues using swscaler.  My source images are in a DirectX originated format X8R8G8B8...  I'm using PIX_FMT_RGB4_BYTE as my source pixel format - but this is for some reason swapping my red and blue channels
[22:58] <TomCat2> I'm guessing maybe PIX_FMT_RGB4_BYTE is not equal to X8R8G8B8 - if not something wrong with my source - can someone help me clear this up?
[23:03] <JodaZ> hackeron, -timestamp now ?
[23:03] <JodaZ> as seen in http://ffmpeg.org/pipermail/ffmpeg-devel/2009-February/064077.html
[23:05] <hackeron> JodaZ: time ffmpeg -timestamp now -y -t 30 -f mjpeg -i ${URL}mjpeg.cgi -vcodec copy -timestamp now output.mp4 -- nope, -t 30 records exactly 750 frames which is over a minute of video :/
[23:05] <JodaZ> try the -timestamp now after the -i
[23:05] <cbsrobot> hackeron: nice issue
[23:05] <hackeron> JodaZ: it's there :)
[23:06] <JodaZ> its there twice tho
[23:06] <JodaZ> remove the first one >_>
[23:06] <hackeron> ok, removed - lets see
[23:06] <JodaZ> try either or
[23:06] <JodaZ> not both
[23:06] <hackeron> cbsrobot: thanks :) - any solution?
[23:07] <hackeron> JodaZ: 750 frames after -i
[23:07] <JodaZ> and only before ?
[23:07] <hackeron> waiting :)
[23:07] <JodaZ> also, -vf showinfo again
[23:08] <cbsrobot> hackeron: try: ffmpeg  -f mjpeg -i ${URL}mjpeg.cgi -f mpeg pipe:1 | cat > test.mpeg
[23:08] <hackeron> JodaZ: 750 frames before -i (and over a minute of video)
[23:09] <JodaZ> what if before and with -re ?
[23:09] <JodaZ> cbsrobot, why the pipe ?
[23:10] <hackeron> cbsrobot: trying the pipe - appears to be no difference - the seconds are still counting up in slow motion and still 750 frames when it shows 30 seconds of video (in reality it's like a minute of video)
[23:10] <hackeron> JodaZ: like this? < time ffmpeg -timestamp now -re -y -t 30 -f mjpeg -i ${URL}mjpeg.cgi -vcodec copy output.mp4
[23:10] <cbsrobot> JodaZ: well just a wild guess
[23:11] <JodaZ> hackeron, yeh
[23:11] <hackeron> JodaZ: no change - recorded 1 minute 6 seconds of video despite me asking for 30 seconds, heh
[23:12] <JodaZ> well, as long as its sync
[23:12] <JodaZ> i mean the time is right
[23:13] <hackeron> JodaZ: well, no, that's the problem, the time isn't right :(
[23:13] <hackeron> JodaZ: the camera changes it's fps dynamically, so I can't seek to say 3 hours - it could be 3 hours, it could be 6 hours - depending on the ambient light
[23:14] <hackeron> JodaZ: and ffmpeg just counts frames which is not very helpful at all
[23:14] <hackeron> playing the recorded video, it is 30 seconds in duration despite the real world duration being over a minute
[23:14] <hackeron> (light is off in the room right now)
[23:16] <hackeron> it just seems ffmpeg tries to detect the framerate (which it detects as 25) or uses 25 as the default - and just blindly counts how many frames it is expecting, not how many frames actually exist :/
[23:27] <JodaZ> well
[23:27] <JodaZ> yes
[23:29] <hackeron> well, what I want it to do is fill in the gaps with duplicate frames, or set the timestamp on the frames so the decoder knows when to play them
[23:30] <hackeron> like what -vsync 1 should do - but it seems to not do anything :(
[23:31] <JodaZ> naw, why would -vsync care for the current time
[23:31] <hackeron> JodaZ: it says: "Frames will be duplicated and dropped to achieve exactly the requested constant framerate."
[23:31] <hackeron> but no frames are added or dropped
[23:31] <JodaZ> yup, source is 25fps
[23:32] <hackeron> source is not 25fps - I donno where ffmpeg is getting that :/
[23:32] <JodaZ> it doesn't have any info on framerate so it guesses
[23:33] <hackeron> no, it just blindly sets it to 25 by default for any source - and I guess ffmpeg just doesn't support variable framerate :(
[23:34] <JodaZ> well, not without timestamps it can't
[23:34] <hackeron> jpeg doesn't have timestamps, it needs to generate them itself
[23:34] <JodaZ> this is barely possible btw
[23:34] <JodaZ> even if you set timestamps to current time, the accuracy will depend on socket buffers and network latency
[23:35] <hackeron> that's fine
[23:35] <hackeron> this is local network 0.1ms latency
[23:35] <JodaZ> which is propably why mjpeg is usually served at constant fps
[23:35] <hackeron> even if I set constant framerate, it is not constant framerate from this camera
[23:36] <hackeron> anyway, so it looks like -timestamp now doesn't work with this source?
[23:38] <hackeron> if I set a constant framerate of 20 on the camera, I get anywhere from 16 to 19fps - if I use -timestamp now -r 10 - I get a fast motion video - no timestamps appear to be set
[23:40] <hackeron> in gstreamer you can ask it to generate it's own pts, but it won't parse the multipart from this D-Link camera :(
[23:41] <JodaZ> write a proxy that converts the multipart
[23:49] <hackeron> just a shame ffmpeg can't record mjpeg from ip cameras in any usable way :(
[23:50] <JodaZ> quite specialized application
[23:50] <hackeron> ip cameras?
[23:51] <JodaZ> variable framerate without timestamps for a video transcoder that has little to do with live streaming
[23:51] <JodaZ> and even less as a stream client
[23:51] <hackeron> well, that's most ip cameras on the market for you :(
[23:52] <JodaZ> propably have mpeg with timestamps then
[23:53] <hackeron> nope, most cameras have mjpeg only :( - this is the only source for this and many other cameras
[23:53] <JodaZ> with static framerate then
[23:53] <JodaZ> i mean can any program decode this ?
[23:53] <hackeron> static framerate means nothing with mjpeg - every camera I've tested does not meet it's advertised or static framerate
[23:54] <hackeron> well, it's just a series of jpeg images
[23:57] <hackeron> gstreamer has an option do-timestamp=true - which creates timestamps for a live http source - wonder if I can pipe from gstreamer into ffmpeg
[23:58] <JodaZ> why wouldn't you
[23:59] <JodaZ> but didn't you say gstreamer didn't do the mjpeg you had ?
[23:59] <hackeron> JodaZ: no, gstreamer didn't parse the http multipart - I filed a bug report
[00:00] --- Sat Dec 10 2011


More information about the Ffmpeg-devel-irc mailing list