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

burek burek021 at gmail.com
Sat Feb 14 02:05:02 CET 2015

[00:00] <qxt> ofc that makes sense
[00:00] <kepstin-laptop> just too many variables for a single fps value to have any meaning whatsoever.
[00:31] <qxt> this is the official site right?  ffmpeg.mplayerhq.hu
[00:32] <qxt> not www.ffmpeg.org ?
[00:37] <c_14> afaik they're both official
[00:38] <c_14> ffmpeg.org is hosted by mplayer
[00:55] <ac_slater_> hey all. I'm generating some video from an external encoder. I need to suck up the video and mux it to mpegts. I'm struggling to understand generating PTS/DTS. Is there a solid guide for this?
[01:18] <pmarques> Hi
[01:19] <pmarques> I'm using ffprobe to parse metatags but it don't let me catch multiple genres
[01:20] <pmarques> anyone know if there is some thoughts about support it?
[01:27] <DayDreamer> gnight
[03:00] <k_sze[work]> Is it normal that when decoding packets from a .nut file containing H.264 video, the frames can come out of sequence (and duplicate from time to time)?
[07:38] <ac_slater> hey all. I'm trying to manually fill some AVFrame structures. What's the allocation scheme? The docs say av_frame_alloc() is just for the structure, but how do I allocate the actual buffers?
[07:41] <ac_slater> ah nevermind, apparently `av_frame_get_buffer()`
[07:41] <ac_slater> though, that's really confusing
[08:31] <k_sze[work]> Has anybody run into a weird problem with encoding or decoding where frame times start getting out of sequence after about 2^20 frames (about 9:42:32.53333 in terms of length, at 30 fps)? (I'm getting this with only a YUV422 video stream encoded as H.264, no audio, no subtitle, in a .nut file)
[10:46] <Lirk> hi all
[10:46] <Lirk> how I can to capture file with timestamp and then reencode it?
[10:48] <Lirk> in one step
[11:28] <Ders> Anyone here that can help me with something?
[11:30] <iive> Ders: nobody can help you,
[11:30] <iive> until you ask your question. (don't ask to ask, just ask)
[11:32] <iive> and be patient... people are not jumping to read the channel on every new message.
[11:32] <Ders> Well, I wanted to know if people were online
[11:33] <Ders> So, I have raw audio data in s16le format and I want to it to be written to a file that I can listen to
[11:33] <Ders> http://pastebin.com/P4JdMKgj
[11:33] <Ders> that is my command I'm using
[11:33] <Ders> now, I'm using stdin to write the data to the input
[11:34] <Ders> this is how I write the data: http://pastebin.com/XCbRXyZj
[11:35] <Ders> But when it has created the file it's really small and I can't play it with VLC
[11:35] <iive> pcm is not small, -ac 1 means mono, so 88kBytes/s
[11:36] <iive> can ffplay play it back?
[11:36] <Ders> I haven't tried that and I don't think I have ffplay at hand. I'm only given the ffmpeg.exe
[11:37] <iive> oh, windows
[11:37] <Ders> yeah
[11:37] <iive> ok, first think I find troubling is that you have 2 acodec's
[11:37] <iive> i'm not sure that's how you specify the input format.
[11:37] <Ders> which one do I have to remove? I guess the Pcm_s16le one?
[11:38] <Ders> the input format is -f s16le
[11:38] <Ders> it's a list of samples as short ints
[11:41] <iive> -f s16le is correct.
[11:42] <Ders> Yeah that's what I'm most confident of as well
[11:44] <iive> well, the double acodec doesn't seem to cause any problem.
[11:44] <iive> you line seems to work fine with existing wav file
[11:45] <Ders> yeah, I tried that as well.
[11:45] <Ders> That's why it's so weird that it's not working with manually stdin data
[11:49] <Ders> I don't know if it's of any help but I tried writing the values to a .s16le file
[11:49] <Ders> this is the result: http://pastebin.com/ydCsGT3y
[11:49] <Ders> Normally it should only be numbers
[11:49] <Ders> Maybe that's the problem?
[11:53] <iive> Ders: this looks like hexadecimal humbers
[11:55] <Ders> Yeah, I noticed that too. Let me post the code I used to generate those numbers
[11:56] <Ders> http://pastebin.com/35mBxD6j
[11:57] <Ders> oh, and I'm using fstream to write it to a file atm
[11:57] <iive> bbl
[13:36] <synthecy1her> How do I stop ffmpeg creating 'ffmpeg2pass-0.log' and 'ffmpeg2pass-0.log.mbtree' while doing two pass encoding?
[13:38] <Mavrik> By not doing twopass encoding.
[13:39] <Mavrik> Those files are kinda the integral point of 2-pass.
[13:49] <hta> TEPMPDIR=$(mktemp -d); pushd $TEMPDIR; <encode>; popd; rm -rf $TEMPDIR
[13:50] <hta> I guess...
[16:40] <Ders> Does anyone know that when I do the following command, my output file doesn't have audio?
[16:40] <Ders> http://pastebin.com/89PraDtG
[16:41] <c_14> try -map 0 -map 1
[16:41] <Ders> will do
[16:42] <kepstin-laptop> and you shouldn't need to set the format, codec, channels, etc. on a wav; ffmpeg will read that from the header.
[16:42] <kepstin-laptop> (in fact, with those settings you'll get a brief bit of noise at the start as the wave header is interpreted as audio)
[16:43] <Ders> oh ok, Well, the -map doesn't change anything
[16:43] <Ders> for some reason VLC can't even find an audio stream
[16:43] <kepstin-laptop> Ders: pastebin the ffmpeg output?
[16:44] <Ders> I'll try. Normally I can't select the data from the output I have
[16:48] <Ders> I can't copy it but I get lots of "packet too large, ignoring buffer limits to mux it" and "buffer underflow st=1 bufi=3939 size=4096"
[16:48] <Ders> that's all I get
[16:54] <Ders> Is it possible that I have to reencode my audio? I tried with pcm_alaw and that didn't give any errors but I still don't have sound
[16:55] <kepstin-laptop> Ders: I'm interested in what ffmpeg prints out about the stream mapping at the start of the encode.
[16:56] <Ders> yeah, I can see that now it doesn't from thousands of errors. Five me a second
[17:00] <Ders> It's an image: http://i.imgur.com/15emTe5.png
[17:00] <Ders> I couldn't copy the output to Pastebin
[17:03] <durandal_1707> Ders: have you chacked that maybe it is VLC fault
[17:05] <Ders> How would I do that? By the way. I read that the encoding of my wav file (s16le) isn't available to encode to an mpeg file? Is that right? Maybe I should reencode my audio first
[17:05] <kepstin-laptop> Ders: your audio file and video file have vastly different lengths, which is what's causing the buffer underflow errors, and could cause playback errors
[17:06] <kepstin-laptop> says you have a minute of audio and only 14 seconds of video
[17:06] <Ders> So do I have to add the -shortest command?
[17:07] <kepstin-laptop> yeah, try something like ffmpeg -i VIDEO_INPUT_FILE.mpeg  -y -i AUDIO_INPUT_FILE.wav -vcodec copy -acodec pcm_s16le OUTPUT_FILE.mpeg
[17:07] <kepstin-laptop> with -shortest as well
[17:08] <Ders> ok. trying now
[17:11] <Ders> nope. The properties of the file do say that there are 2 channels (although the original file is encoded for one channel) and that its audio sample rate is 44khz
[17:15] <kepstin-laptop> Ders: are you getting output like "[mpeg @ 0x1bef080] packet too large, ignoring buffer limits to mux it" ?
[17:15] <Ders> yeah
[17:15] <kepstin-laptop> if so, then the output file is useless junk :/
[17:16] <Ders> haha :D and how do I solve that?
[17:16] <smo_> hi, i use nodejs to pipe http video links thru ffmpeg, sometimes it play directly and sometimes i need like 10% of the file downloaded before the stream start start playing an idear why ?
[17:16] <Ders> Oh I got it working :D
[17:16] <Ders> hold on I'll post the commands
[17:16] <kepstin-laptop> Ders: the issue is just that the unencoded audio looks like it's too big. encode it with mp3 or something.
[17:17] <Ders> So, I had to reencode my pcm audio with -f vob to another .wav file. that was actually the problem
[17:17] <Ders> That's everything :)
[17:17] <kepstin-laptop> umm. the sentence you just wrote makes no sense. if you use -f vob, it's not a wav file
[17:19] <kepstin-laptop> (it looks like unless you specify otherwise, ffmpeg encodes to mp2 audio when you use vob output)
[17:19] <kepstin-laptop> and mp2 makes the sound packets small enough that they would fit.
[17:24] <kepstin-laptop> your original command would have worked if you'd simply dropped the "-c:a" option completely (no copy, no pcm_whatever), since ffmpeg would have defaulted to mp2 audio then.
[17:24] <Ders> Well. I create a wav file in the s16le format. But mpeg doesn't like that. So I had to first reencode the original audio file to another format
[17:24] <Ders> and I did that by outputting the file with the -f vob command
[17:24] <kepstin-laptop> no, ffmpeg could read the input fine. the issue was that it didn't fit into the output file unless encoded to a different format
[17:24] <Ders> oh
[17:25] <Ders> well, the -shortest command does not help with that. It still threw those errors of overflow when it wasn't reencoded
[17:25] <kepstin-laptop> so either you have to encode the audio with something like ac3, mp3, mp3 - or use a different output container, like mkv
[17:25] <Ders> ok! I'll keep that in mind! Thank you very much for the information :)
[17:26] <kepstin-laptop> the shortest command would not help with that, no, the issue is that with pcm audio formats, each individual audio packet was bigger than the max size in the mpg format.
[17:28] <Ders> oh ok. I understand now :)
[17:30] <kepstin-laptop> and next time you run into issues, please figure out how to copy/paste text from the terminal window. It is possible to do in windows...
[17:30] <Ders> yeah I know, I'll ask how to do it in the office (I can't use the regular Mark -> select -> Enter method)
[17:31] <kepstin-laptop> it's weird tho, because I know that dvds (which use an mpeg format) can have pcm audio.
[17:32] <Ders> Maybe I have to resize my buffer?
[17:32] <kepstin-laptop> i dunno.
[17:33] <kepstin-laptop> looks like ffmpeg does have a special codec 'pcm_dvd' for dvds, but it doesn't support encoding to it.
[17:33] <Ders> Well, the buffer for the video encoding is set to some value. Maybe it's something to do with that
[17:33] <Ders> hmm
[17:42] <kepstin-laptop> i wonder if the ffmpeg mpeg muxer just doesn't support outputting pcm audio at all?
[17:42] <kepstin-laptop> seems silly that it lets you try, but I guess ffmpeg lets you do lots of silly things.
[17:43] <Ders> Yeah, that's what I was thinking as well. Problem is now that I'm creating two files. Could it be possible to reencode the original file while it's an input stream?
[17:43] <Ders> ffmpeg is one silly beast. But when you got it working, man... so fast
[17:44] <kepstin-laptop> hmm? there's no reason to create two files...
[17:44] <kepstin-laptop> just drop the "-c:a copy" from your original command and ffmpeg will autoselect a working audio codec (probably mp2)
[17:45] <kepstin-laptop> or you can manually pick libmp3lame or ac3 or whatever.
[17:46] <Ders> I'll do some tests. At the moment it's not working at least.
[17:46] <kepstin-laptop> or, if you don't really need mpg, switch to matroska (mkv) or something, which has more codec compatibility.
[17:47] <Ders> ok! Thanks for all the help! Gotta go
[17:47] <Ders> cya
[17:50] <smo_> hi, i use nodejs to pipe http video links thru ffmpeg, sometimes it play directly and sometimes i need like 10% of the file downloaded before the stream start start playing an idear why ?
[17:58] <c_14> mp4?
[17:58] <smo_> me c_14 ?
[17:58] <c_14> yes
[17:59] <smo_> could be any type of files...
[17:59] <smo_> mkv avi mp4 ts ...
[17:59] <smo_> think it s related but not sure
[18:00] <c_14> If it happens with mp4 files it's probably tho MOOV atom.
[18:01] <smo_> i convert all the files in live so can i add it to all videos?
[18:01] <c_14> hmm?
[18:01] <smo_> the moov atom ? ( i convert with libx264)
[18:02] <smo_> a avi files for exemple do not have atom right ?
[18:03] <c_14> yes
[19:23] <spaam> is there a standard yet for storing hevc/h265 in .mp4 yet ?
[19:25] <jdsanders1> Hi folks - I converted a .mov file to .mp3, and ffmpeg reports the duration I expect, but when I play the file in itunes or quicktime player, the duration is doubled, and the second half is just dead air
[19:25] <jdsanders1> does anybody know what's going on there?
[19:26] <spaam> how did you do it? what is the commandline for ffmpeg
[19:26] <JEEB> spaam, for about a year now
[19:26] <JEEB> or actually almost two
[19:27] <JEEB> FDIS is from around sept 2013 in my archives
[19:27] <jdsanders1> spaam: as naively as possible: ffmpeg -i foo.mov foo.mp3
[19:29] <jdsanders1> just tried it with manually setting the duration to what i expect
[19:29] <jdsanders1> with the same behavior
[19:30] <spaam> JEEB: great
[19:31] <spaam> jdsanders1: what does the output from ffmpeg say when you run that? pastebin the output
[19:31] <JEEB> I made a post on matroska-devel back then to basically "standardize" the same kind of thing there
[19:31] <datajerk> hi, looking for advice or searchable terms to help myself.  I'd like to in a video at specific times highlight a circular region of the screen by dimming the rest.  It would also be nice to fade the effect in and out
[19:32] <spaam> JEEB: ahh nice :D
[19:32] <JEEB> http://permalink.gmane.org/gmane.comp.multimedia.matroska.devel/4771
[19:32] <jdsanders1> spaam: thanks for your help! here's the output: http://pastebin.com/y9mytk2J
[19:32] <saste> datajerk, at the moment this doesn't look possible directly, but you may found a clever combination of a pre-generated overlay background+overlay
[19:33] <saste> datajerk, for overlay I mean the filter
[19:34] <datajerk> yeah i can create a b/w image ahead of time and can overlay on the image, i do that now with inserting PPTX slides into my videos, just need to know what filters to look at to support some type of transparency and fade in/out of the image
[19:40] <ac_slater> hey all I'm struggling to understand the relationship between PTS and DTS. Are there any good guides out there?
[19:40] <JEEB> PTS is the Presentation Time Stamp
[19:40] <Mavrik> well, there's bunch of documentation
[19:40] <JEEB> and DTS is the Decoding Time Stamp
[19:41] <Mavrik> but those really aren't that hard to get :)
[19:41] <ac_slater> right, I get what they mean - by definition. I've read the FFMPEG docs 100 times. There are too many varying cases to really grasp it from nothing.
[19:42] <ac_slater> So I guess my questions really come up when generating PTS and DTS
[19:43] <ac_slater> I've seen a lot of things say "just set them to 0" ... and I dont get that
[19:43] <Mavrik> uh
[19:43] <Mavrik> you probably shouldn't generate them.
[19:44] <Mavrik> PTS and DTS should be set by your encoder.
[19:44] <ac_slater> ah right. Well, I have an encoder that doesnt really generate them for me
[19:44] <Mavrik> You never should generate both unless you're doing something more advanced, but then I guess you'd get that.
[19:44] <BtbN> well, at some point they have to gen generated. The encoder just passes them through.
[19:44] <Mavrik> I somehow doubt you have an encoder that doesn't generate timestamps.
[19:44] <Mavrik> BtbN, no, the encoder takes the timestamp of the frame
[19:45] <Mavrik> BtbN, and sets PTS and DTS of output encoded content
[19:45] <ac_slater> Mavrik: it's a homegrown h.264 encoder that lives in an FPGA. I have the full source and there is no timestamp (PTS or DTS) generation
[19:45] <BtbN> so it passes the timestamp though.
[19:45] <Mavrik> DTS is a concept that is relevant only for some formats.
[19:45] <Mavrik> ac_slater, ok, does it have a delay/buffer? Or do you get encoded frame back immediately?
[19:46] <Mavrik> ac_slater, which profile does it encode to? Does it use B-frames?
[19:46] <ac_slater> I know it runs at a certain rate
[19:46] <ac_slater> yea, b-frames and p-frames, and baseline
[19:46] <ac_slater> level 3.1
[19:46] <JEEB> do you actually do it so that the decoded order is not the presentation order?
[19:46] <JEEB> which is what is possible with b-pictures
[19:47] <ac_slater> oh right. I remember now why DTS is important
[19:47] <ac_slater> JEEB: reminded me
[19:47] <ac_slater> thanks
[19:47] <Mavrik> ac_slater, um
[19:47] <Mavrik> Baseline does not allow B-frames.
[19:47] <Mavrik> So it's either one or the other.
[19:48] <ac_slater> interesting. one moment
[19:48] <Mavrik> Again, you CANNOT do what you want before knowing how your encoder works.
[19:48] <ac_slater> that makes sense
[19:48] <JEEB> well usually you get pictures from the encoder in the decoding order, and then the encoder should somehow mark them with the coded picture's presentation timestamp
[19:48] <Mavrik> Also, if your encoder doesn't give you timestamps of encoded content, you NEED to know how much delay it has :)
[19:48] <Mavrik> mhm
[19:49] <Mavrik> JEEB, either that or his encoder is so simple it doesn't generate B-frames and immediately returns a coded frame - and you just stamp it with same PTS/DTS
[19:49] <Mavrik> but I haven't seen that around yet O.o
[19:50] <ac_slater> this encoder isnt simple sadly - it's very huge haha. But yea, it has different modes. Currently I get it in `Main 3.1` with bframes
[19:50] <Mavrik> well, for B-frames the encoder really has to tell you at least PTS
[19:50] <ac_slater> and if it doesnt?
[19:50] <JEEB> then you make it do so
[19:51] <ac_slater> well thanks for the advice guys
[19:51] <ac_slater> it's really helpfu
[19:51] <ac_slater> helpful *
[19:51] <Mavrik> ac_slater, well, you can't guess what's he giving you out
[19:51] <Mavrik> ac_slater, so "it's not" is really not an option
[19:51] <Mavrik> I guess you're missing part of API or somethin :)
[19:52] <ac_slater> Mavrik: I guess so. I'll report back with that.
[19:52] <JEEB> if it's with a constant frame rate all the time I guess in theory you could stick an annex b demuxer after it and try to have it generate something
[19:52] <Mavrik> mhm
[19:52] <Mavrik> but that kind of encoder design would be non-sensical really
[19:53] <ac_slater> you're right it does give me PTS
[19:53] <ac_slater> via wall clock :(
[19:53] <Mavrik> that's ok then :)
[19:55] <ac_slater> so I guess I get really confused when dealing with PTS on multiple levels... the source (encoder), and the muxer, in my case mpegts
[19:58] <ac_slater> So assuming the encoder gives me a proper PTS. What if it has B-frames but doesnt give me DTS?
[19:59] <JEEB> well as long as the decoder outputs things in decoding order you can just put a monotonically increasing DTS there
[19:59] <ac_slater> with any start point?
[20:00] <ac_slater> ie - non-relational to the PTS?
[20:00] <JEEB> yup
[20:00] <ac_slater> awesome
[20:02] <Mavrik> ac_slater, yeah, the player only cares about difference of PTS/DTS not absolute values
[20:02] <Mavrik> it only needs to know how long to wait until it has to display a frame or audio sample
[20:02] <ac_slater> i seeee
[20:02] <ac_slater> thanks guys
[20:02] <Mavrik> that's why your PTS/DTS can wrap
[20:03] <Mavrik> do make sure you handle that case ;)
[20:03] Action: Mavrik grumbles something about half of ffmpeg not handling that case.
[20:03] <ac_slater> Mavrik: I remember you telling me that last time. I made a note of it and realized that ffmpeg/libavformat has mechanisms to deal with that
[20:04] <ac_slater> interesting
[20:04] <ac_slater> how *do* you handle that?
[20:05] <Mavrik> um, you just carry on :P
[20:05] <ac_slater> ah ok :D
[20:05] <Mavrik> but if you do stuff like reorder packets or something
[20:05] <Mavrik> then it's nice to know that sometimes going from 33 bits -> 0 is OK ;)
[20:06] <ac_slater> I see. Well damn.
[20:06] <ac_slater> I'll deal with that when the time comes ;)
[20:08] <ac_slater> so while I have you guys here. I'm trying to mux a mpegts container with multiple streams. These streams are strictly data and I wrote  the encoder for the data. FFMPEG supports the type and the mpegts muxer recognizes it. It's KLVA. But since there is no ffmpeg encoder, I'm writing one. When creating an AVStream for this, how does one pick an arbitrary timebase for both the codec and stream?
[20:10] <ac_slater> maybe a simple runnable code snippet is in order for this
[20:13] <ac_slater> I guess this question can be summed up with: How do you pick a timebase?
[20:13] <Mavrik> ac_slater, I'm pretty sure MPEG-TS wants all timebases to be 1/90000
[20:13] <Mavrik> that really depends on the format
[20:13] <Mavrik> for some of them it can actually be arbitrary
[20:14] <ac_slater> Mavrik: you're right about the 1/90000
[20:14] <Mavrik> but otherwise, people just use timebase so their PTS can go += 1 for each frame
[20:14] <Mavrik> e.g. 1/25 for 25fps video, 1/44100 for 44100Hz audio, etc.
[20:15] <ac_slater> interesting. I saw that too. But then I realized there are 2 timebases... one for the AVStream, and another for the output format
[20:16] <Mavrik> yep
[20:16] <Mavrik> that makes sense in a way :)
[20:16] <ac_slater> it does really
[20:16] <ac_slater> but when creating AVPackets to write, I cant tell how to scale the timebase
[20:17] <Mavrik> um, I 'm 80% sure that av_write_packet expects the PTS and DTS to be in stream time_base
[20:19] <ac_slater> ah ok. Interesting.
[20:19] <Mavrik> and JEEB will slap me if I'm wrong :P
[20:19] <ac_slater> this is actually pretty simple
[20:20] <ac_slater> Mavrik: the docs for av_write_frame dont explicitly say
[20:59] <ac_slater> last thing for bit. Most encoders take some estimated bitrate as an initialization argument. In my case, I'm determining how to set AVStream->codec->bitrate for something that is non-constant like h.264. Do you just sorta pick the upperbound?
[21:05] <JEEB> ac_slater, I'm pretty sure the bit rate doesn't matter jack shit after the stuff has been encoded
[21:05] <JEEB> only maxrate/bufsize should matter in case of mpeg-ts
[21:06] <ac_slater> interesting. Thanks for the input
[21:33] <ac_slater> JEEB: a bit ago you said ".. he could stick an annex b muxer in there to generate timestamps". Does this account for a case where the encoder is spitting out an annexb bitstream with no timestamps?
[21:37] <ac_slater> JEEB: also, what exactly did you mean with maxrate/bufsize? Are these properties of avformatcontext?
[23:00] <YaMoonSun> If I wanted to copy a raw .aac file into a .m4a file, what command would you recommend?
[23:02] <YaMoonSun> http://pastebin.com/fbSZWAUS
[23:11] Action: YaMoonSun waits patiently
[23:12] <c_14> Did you try adding -bsf:a aac_adtstoasc ?
[23:13] <YaMoonSun> Nope, what's that do?
[23:13] <c_14> Shuffles some stuff around so that tha aac is mp4 compliant
[23:14] <YaMoonSun> It came from an m4a, and I'm trying to put the same aac stream into another m4a without loss
[23:15] <c_14> The filter should be lossless
[23:17] <YaMoonSun> Oh? Nice, will give it a shot =/
[23:18] <YaMoonSun> Very nice, thank you very much =)
[23:20] Action: YaMoonSun tips hat to c_14
[23:50] <YaMoonSun> Is it possible to convert an entire directory using one command withing making a .bat file?
[23:54] <JEEBsv> you can possibly do a one-liner in cmd.exe but that would be the same as making a goddamn batch file
[23:54] <JEEBsv> and would be much less readable
[23:55] <YaMoonSun> Well fuck
[23:55] <YaMoonSun> Cheers anyways
[00:00] --- Sat Feb 14 2015

More information about the Ffmpeg-devel-irc mailing list