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

burek burek021 at gmail.com
Fri Jan 25 02:05:02 CET 2013


[00:24] <antonello> hi, i would like to modify the sample decoding_encoding. I want to transcode a file. this is my code http://pastebin.com/23xbZ3gV
[00:25] <antonello> the step of code are 1) decode file in raw format , 2) convert the sample format 3) encoding in final format
[00:26] <antonello> at this time the conversion  sample_format fail
[00:26] <antonello> can you help me ?
[00:32] <llogan> antonello: not many API users here. might want to try libav-user mailing list http://ffmpeg.org/mailman/listinfo/libav-user
[00:32] <llogan> although durandal_1707 occasionally answers API stuff here
[00:36] <antonello> ook thanks . i post my problem in mailing list..... i try chat way because tomorrow I'll have 'a meeting for my thesis but my program does not work
[00:37] <llogan> then i hope you find an answer and don't fail your thesis like i did
[00:37] <llogan> actually i just never finished that one
[00:39] <llogan> alternatively you can wow them with a mandelbrot: ffplay -f lavfi mandelbrot
[00:43] <antonello> I would like to surprise with a transcoding :P
[00:51] <teratorn> antonello: "does not work" is uselessly vague
[00:54] <teratorn> antonello:  c= NULL; ?????
[00:54] <antonello> it's vague because , the sample_format convertion fail and I haven't any error code
[00:54] <teratorn> i don't see how audio_encode could *not* segfault, if you're even getting that far
[00:55] <teratorn> you're overwriting your passed in `c' variable to NULL in several functions - i fail to see how this has any hope of working
[00:57] <teratorn> antonello: you're using fread() manually to read an audio file... why? use ffmpeg to read audio files
[00:59] <antonello> I'm modify the decoding_encode example
[00:59] <teratorn> antonello: it's just a huge amout of messy code
[01:01] <teratorn> antonello: you should learn about avio* functions and AVFormatContext objects
[01:01] <antonello> I can't find documentation about library , I wrote this code by looking at the examples
[01:02] <teratorn> antonello: the documentation is in the header files and the source code :)
[01:02] <teratorn> antonello: there aren't very many good examples
[01:03] <antonello> I saw :(
[01:04] <antonello> do you think my code can work ?
[01:05] <teratorn> antonello: sure
[01:05] <teratorn> antonello: if you fix all the bugs
[01:05] <teratorn> >;)
[01:07] <teratorn> antonello: I would probably try making it work with data that does not require SRC first
[01:08] <teratorn> e.g. raw -> aac keeping the same sample rate, same number of channels (mono!)
[01:08] <teratorn> start with the simplest possible transcode and work your way up from there
[01:09] <antonello> the sample encode without src is che encode example !
[01:14] <Demon_Fox> Anyone have some decent test files for testing audio?
[01:43] <juanmabc> lol, mplayer "]" speed up
[01:45] <llogan> Demon_Fox: testing it in what way?
[01:47] <Demon_Fox> Variety of sounds for audio codec comparison at different bitrates
[01:48] <Demon_Fox> Then I will write a little C program to generate a bash script for 100 test files
[01:50] <llogan> http://www.rarewares.org/test_samples/
[01:50] <llogan> http://tech.ebu.ch/publications/sqamcd
[01:51] <Demon_Fox> thanks
[01:51] <llogan> http://wiki.hydrogenaudio.org/index.php?title=ABX
[01:51] <Demon_Fox> What is a ww file?
[01:52] <llogan> wavpack
[01:52] <llogan> lossless audio format
[01:53] <llogan> what encoder(s) are you testing?
[01:59] <Demon_Fox> ffmpeg
[01:59] <Demon_Fox> then
[01:59] <Demon_Fox> oops
[01:59] <Demon_Fox> I mean
[01:59] <Demon_Fox> libvorbis
[01:59] <Demon_Fox> speex
[01:59] <Demon_Fox> nero aac
[01:59] <Demon_Fox> faac
[02:00] <Demon_Fox> lame
[02:00] <Demon_Fox> ac3
[02:00] <Demon_Fox> And then all of those at 5kb/s steps from 10-95kb/s per channel
[02:02] <Demon_Fox> maybe even flaac (even though it is lossless) for size comparisons
[02:22] <llogan> Demon_Fox: see http://d.hatena.ne.jp/kamedo2/
[02:23] <Demon_Fox> Are you from japan?
[02:23] <llogan> no, and i don't speak/read japanese.
[02:23] <Demon_Fox> Also what is qaac?
[02:24] <llogan> https://sites.google.com/site/qaacpage/
[02:24] <llogan> don't forget to try fdk-aac
[02:25] <llogan> see https://ffmpeg.org/trac/ffmpeg/wiki/AACEncodingGuide
[02:25] Action: llogan is afk for a while
[02:28] <Demon_Fox> Wonder why this is the first time I have ever heard of fdk aac?
[02:28] <klaxa> you don't idle in #ffmpeg enough
[03:22] <Demon_Fox> Are there any places to get free instrumental?
[03:23] <klaxa> http://www.jamendo.com/en/ ?
[03:30] <burek> morgan.freenode.net
[03:30] <burek> Morgan Freenode :)
[03:31] <Demon_Fox> klaxa, Is it legal?
[03:35] <llogan> Demon_Fox: did you even look at the site?
[03:35] <Demon_Fox> yes
[03:35] <Demon_Fox> It said for private use
[03:38] <llogan> check the license for each track. all that i looked at are creative commons licenses.
[03:40] <llogan> you can also license tracks if your usage does not correlate to free usage according to each license
[03:56] <Demon_Fox> ok
[04:47] <John__> Hi
[04:48] <John__> I'm trying to record an embedded video on a webpage using ffmpeg with the command: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s 712x366 -i :0.0+229,186 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0  output.mkv
[04:49] <John__> But it has an error: http://pastebin.com/X3N2Mvbn
[04:50] <John__> I'm not sure what's the problem may be but it's having trouble recording a certain region of my computer screen.
[04:51] <John__> If I have to take a guess, it would be that ffmpeg was not compiled and I'm using an older version so this function might not work properly.
[04:57] <John__> It also could mean that the ffmpeg doesn't understand the coordinate or the window is not there and it can't simply record.
[04:59] <John__> I've tried to mimic the size of the player embedded using another window to cover the width/height. Then I closed the window. This might cause some issue in regards recognizing the window being closed.
[04:59] <John__> I haven't taken any approach on trying to debug this problem because there's little known causes base on the error it found.
[05:01] <John__> An alternative would be using ffcast2, but I didn't met the requirements.
[12:23] <Diogo> hi this is possible using ffmpeg hide Encoding settings  from video metadata..?
[12:24] <Diogo> ?
[13:08] <samek_> Hi, I've got several parts of the same video, how can i "glue" them together ? I tried with multiple -i  for example ffmpeg -i part01.ts -i part02.ts out.mp4 but the out.mp4 only holds first part
[13:11] <gartral> hey all, I'm trying to get ffmpeg to record a game with the game A/V and my voice, i am not having any luck with this at all, I'm on Ubuntu Studio 12.10 with ffmpec/avconv 0.8.4. using the script from https://docs.google.com/file/d/0B7JCjpvY2cExVEFqX1Uxcjl3ZWM/edit along withh the insights from http://www.linux.com/learn/tutorials/367395-weekend-project-record-from-skype-calls-and-other-apps-on-linux any ideas? upon recording my video is grea
[13:20] Action: gartral is off to make coffee while he waits for a response
[13:21] <JEEB> gartral, ubuntu uses a fork of ffmpeg called libav so you'd probably want to poke #libav with it before someone starts telling this same thing to you in other words :) Also your text cut in the middle because of IRC line length limitations
[13:22] <JEEB> (some people like to just ramble about it or so)
[13:22] <gartral> JEEB: oh, thanks, I'll crop the post and repost here and in #libav
[13:24] <durandal_1707> gartral: or deinstal libav and install ffmpeg and ask here :)
[13:24] <JEEB> I wish it was as easy like that :/
[13:25] <durandal_1707> there are binaries one can install
[13:25] <JEEB> yes, but you can't exactly "uninstall libav"
[13:25] <gartral> durandal_1707: already explored that route, if I remove libav it wants to remove quite literally half the OS
[13:25] <JEEB> unless you want to lose everything that depends on libav*
[13:25] <JEEB> the libraries
[13:25] <durandal_1707> just because ubuntu does not have ffmpeg package does not mean one is disallowed to use ffmpeg
[13:26] <JEEB> yes, but you just said "uninstall libav", which would mean uninstalling all of the things it installs
[13:26] <JEEB> which means a lot of libraires
[13:26] <JEEB> which are depended upon
[13:26] <JEEB> libav-tools package might be remove'able
[13:26] <JEEB> as it contains avconv/the old ffmpeg/avprobe/avserver/avplay methinks?
[13:27] <JEEB> and yes, you can just use an ffmpeg binary naturally, or build one yourself
[13:27] <durandal_1707> ok you are free to use static binary and leave libav to exist on your hdd
[13:27] <JEEB> although to be honest we don't even know his problem yet :D
[13:27] <JEEB> since his line cut off
[13:27] <gartral> lol
[13:28] <gartral> hang on, I'm working it.. irssi doesn't like editing posts
[13:28] <JEEB> yeah, irssi is known for just either sending a long message and it gets truncated on the server side, or it truncates it itself without telling to you
[13:29] <gartral> x.x
[13:30] <gartral> my issue is that I'm trying to record game AV and my mic, using a script from https://docs.google.com/file/d/0B7JCjpvY2cExVEFqX1Uxcjl3ZWM/edit and insight from http://www.linux.com/learn/tutorials/367395
[13:31] <JEEB> and the actual issue is..?
[13:31] <JEEB> as in terminal log and so forth?
[13:31] <gartral> that my sound is non-existant.
[13:32] <gartral> and here's the terminal output http://paste.ubuntu.com/1565915/
[13:36] <JEEB> you should use the avconv command with libav
[13:36] <JEEB> the ffmpeg binary in there was left to rot
[13:36] <JEEB> when elenril rewrote parts of it
[13:36] <gartral> how much of the script am i going to have to change?
[13:37] <JEEB> no idea, but try just switching from 'ffmpeg' to 'avconv' first of all
[13:37] <JEEB> and you'd have to make the other changes in any case because since ffmpeg's parts were rewritten those updates are in both ffmpeg's ffmpeg and libav's avconv
[13:38] <gryffus> what are the legal problems about implementing ffmpeg in commercial HTPC built on mythtv please? I live in middle europe and couldn't find any information about it on google
[13:39] <JEEB> from ffmpeg's side the only problem is the software license, which is either LGPL or GPL depending on which you pick during configuration when compiling
[13:40] <JEEB> you'd have to abide the software license that you need depending on the configuration you need/select
[13:43] <gryffus> JEEB: i am curious more about the codec licences...
[13:43] <JEEB> that is why I said 'from ffmpeg's side"
[13:44] <gryffus> so we can't be sued that we implemented ffmpeg in our commercial player? I was told that i need to buy licences for codecs...
[13:44] <JEEB> ugh, don't misread me. Also IANAL
[13:45] <gryffus> oh, i see...
[13:45] <JEEB> ffmpeg only has a software license. Distributing binaries that implement possible things that might need to be licensed to distribute is a whole separate issue
[13:45] <gryffus> JEEB: ok, that's i wanted to know. Let's do more searching
[13:45] <gryffus> thanks :)
[13:46] <JEEB> check with a lawyer if you're really worried
[13:46] <JEEB> that's all I can say
[13:47] <JEEB> also Dolby does not license open source, and as far as I know neither does DTS
[13:47] <JEEB> so getting a license for formats by those people might be a hard task :P
[13:47] <gryffus> JEEB: here in czech republic we have not many lawyers specialised on software/IP licensing
[14:22] <fling> how to join 2 mono waves into single stereo flac?
[14:22] <fling> I have left.wav and right.wav and I need stereo.flac :p
[14:23] <JEEB> there was a filter for that
[14:23] <JEEB> if I recall correctly
[14:24] <saste> fling, amix/apad
[14:25] <fling> saste: why apad?
[14:26] <saste> fling, because i was confused
[14:26] <saste> i meant "amerge"
[14:27] Action: fling is reading
[14:30] <fling> saste: is this right? > ffmpeg -i "amovie=left.wav [l] ; amovie=right.wav [r] ; [l] [r] amerge" stereo.flac
[14:30] <saste> fling, looks so
[14:30] <fling> great! thanks
[14:30] <saste> uhm wait
[14:31] Action: fling is waiting
[14:31] <saste> you should either use filter_complex, or use -f lavfi
[14:31] <saste> the first option seems simpler
[14:31] <Diogo> hi this is possible using ffmpeg hide Encoding settings  from video metadata..?
[14:32] <Diogo> this string : Encoding settings                        : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=50 / scenecut=40 / intra_r
[14:32] <Diogo> efresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=200 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=300 / vbv_bufsize=300 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
[14:32] <fling> saste: ? ffmpeg -filter_complex -i "amovie &
[14:32] <fling> Diogo: pipe output to second ffmpeg
[14:32] <saste> fling, ffmpeg -i left.wav -i right.wav -filter_complex "[0:a][1:a]amerge" OUT
[14:33] <fling> saste: oh! thanks :D
[14:33] <Diogo> fling: i don't understand?
[14:33] <Diogo> pipe output?
[14:33] <saste> or with -f lavfi: ffmpeg -f lavfi -i "amovie=left.wav [l] ; amovie=right.wav [r] ; [l] [r] amerge" OUT
[14:34] <JEEB> Diogo, no
[14:35] <JEEB> also I still don't understand people who want to remove those settings
[14:35] <relaxed> it's their secret sauce!
[14:35] <fling> saste: Unrecognized option 'filter_complex'
[14:35] <fling> saste: do I need a configure option or upgrade?
[14:36] <saste> fling, upgrade I think
[14:36] <fling> saste: I have 0.10.3
[14:36] <fling> ok
[14:36] <saste> audio filters are recent addition
[14:36] <fling> to 1.1.1?
[14:36] <relaxed> latest git version is always recommended.
[14:37] <fling> relaxed: ok
[14:37] <saste> >= 0.11 should be fine
[14:37] <fling> is it just always stable in master?
[14:37] <JEEB> ffmpeg is never stable
[14:37] <fling> hehe
[14:37] <JEEB> most multimedia projects are never stable
[14:38] <durandal_1707> dead multimedia projects are stable
[14:38] <fling> durandal_1707: which ones?
[14:38] <saste> JEEB: because they don't want to make people know which components are using for the streaming
[14:38] <JEEB> saste, d'uh
[14:39] <JEEB> if you're worried about that you have problems with something else :P
[14:39] <JEEB> not to mention it'd only tell them that libx264 was used somewhere along the road
[14:39] <rajeev> is latest ffmpeg comes with multiple threading enabled for libx264 or not?
[14:39] <JEEB> if you have built both with threading enabled, yes
[14:40] <JEEB> libx264 by default has threading and so does ffmpeg's libx264.c encoder
[14:40] <LexSfX> hello.  i'm trying to do this: ( ffmsindex.exe "Wow-64 2013-01-22 22-12-35-69.avi" ) where "Wow-64 2013-01-22 22-12-35-69.avi" is a 402GB file.  according to Process Explorer, disk I/O seems to be running consistently >100MB/s, and has been running for a couple hours now.  however, the ffmsindex progress output in the command console is still 0%.  will this ever reach 1%?  according to my
[14:40] <LexSfX> calculations, 1% of the file (~4GB) should be done every ~40 seconds.
[14:41] <rajeev>  am using ffmpeg for my trans coding and see some beard behavior, If with the previous versions of ffmpeg and libx264 i do transcoding it takes x FPS to complete it. when with the latest ffmpeg which has lot of assembler modifications should improve my trans coding time together with FPS. I did see my FPS goes about 30% better compared to the previous trancode but Throughput which is (MBPS per CPU percentage) goes higher by 45%. which is
[14:41] <rajeev> Could someone suggest me the reason behind it? Looking forward for the response. He is my ffmpeg command line with new and old ffmpeg+libx264
[14:41] <JEEB> LexSfX, that's a problem for ffms2/ffmpegsource project rather than here :)
[14:41] <rajeev> #ffmpeg -y -i 3G1PFLuTrgM.flv -vcodec libx264 -coder 0 -flags +loop -cmp +chroma -me_method epzs -subq 2 -me_range 16 -bf 0 -refs 2 -trellis 0 -x264opts no-mixed-refs:no-8x8dct:no-mbtree:weightp=0:b-adapt=0:no-deblock=0:partitions=i8x8,i4x4:no-weightb:ipratio=1.41 -threads 1 -wpredp 0 -rc_lookahead 0   -g 250 -keyint_min 25  -sc_threshold 40  -i_qfactor 0.71  -b_strategy 1  -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -crf 28 /tmp/test1.flv&
[14:42] <LexSfX> JEEB: where should i ask that, specifically?  sorry
[14:42] <rajeev> frame= 5085 fps= 38 q=26.0 Lsize=16394kB time=00:03:32.08 bitrate= 633.2kbits/s     video:16294kB audio:0kB global headers:0kB muxing overhead 0.612624% [libx264 @ 0x24ceb40] frame I:147   Avg QP:24.76  size:  8813 [libx264 @ 0x24ceb40] frame P:4938  Avg QP:30.46  size:  3116 [libx264 @ 0x24ceb40] mb I  I16..4: 58.7%  0.0% 41.3%
[14:42] <rajeev> Results with Old ffmpeg+libx264 trancode (10 concurrent Trancode per session)
[14:42] <rajeev> frame= 5085 fps= 32 q=26.0 Lsize=   16140kB time=00:03:32.08 bitrate= 623.4kbits/s     video:16040kB audio:0kB global headers:0kB muxing overhead 0.622325% [libx264 @ 0x3297b40] frame I:147   Avg QP:24.76  size:  8813 [libx264 @ 0x3297b40] frame P:4938  Avg QP:30.59  size:  3064 [libx264 @ 0x3297b40] mb I  I16..4: 58.7%  0.0% 41.3%
[14:45] <rajeev> ok give me  a sec
[14:47] <rajeev> can u see it?
[14:47] <durandal_1707> :) no
[14:47] <durandal_1707> post link
[14:47] <rajeev> i pasted it at www.pastie.org
[14:47] <durandal_1707> post link to it
[14:48] <rajeev> http://pastie.org/5847181
[14:48] <rajeev> this is output of single transcode
[14:50] <rajeev> can u see now?
[14:56] <rajeev> @fflogger can you see now?
[14:56] <rajeev> any suggestions please
[14:57] <rajeev> when i try to grab threads i could see encoding thread is using maximum cpu but there are some other threads those are taking lot of cpu
[14:57] <rajeev> as well
[14:57] <rajeev> i started looking at the jstack trace and couldn't find those threads
[14:58] <rajeev> in stack trace
[15:01] <rajeev> any suggestions @ <JEEB>
[15:31] <EricAhn>  did ffserver support from HLS(means that using ffmpeg input) to rtp(H264/AAC)?  (I asked "ffmpeg-devel" channel, I think do correct in "ffmpeg" channel ,)
[16:02] <Diogo> hi i don't know the difference between  -keyint_min 50 and  -movflags faststart ??
[16:02] <Diogo> key_int but information about the video every 5 seconds right?
[16:52] <LukaszF> Hello, can anybody help me? I have some RAW AAC frame(s) and have trouble to decode it.
[16:52] <LukaszF> I mean by calling avcodec_decode_audio4 from libav
[16:53] <LukaszF> Frame itself was captured from IP Camera AAC 128kbps, 2 channels,  44100kHz
[16:54] <LukaszF> thats all i know, after this i have some bitstream with tag aac adnd approx size of 400bytes
[16:55] <LukaszF> no matter what i do return value is -1 and  got_frame_ptr from avcodec_decode_audio4 is 0...
[16:55] <LukaszF> any idea how to understand what is going wrong?
[16:57] <LukaszF> developing on windows with libavcodec     54. 77.100 / 54. 77.100
[16:57] <LukaszF> and using AV_CODEC_ID_AAC and avcodec_find_decoder
[16:58] <durandal_1707> you dont get any error message ?
[16:58] <LukaszF> actualy i have
[16:58] <LukaszF> [aac @ 0ef3f640] Number of bands (11) exceeds limit (3).
[16:59] <durandal_1707> does same sample works with ffmpeg?
[16:59] <LukaszF> you mean with ffmpegcmd  application?
[17:00] <durandal_1707> yes
[17:00] <LukaszF> dont know how to check it?
[17:02] <durandal_1707> i dont have sample...
[17:02] <LukaszF> i can provide you with one frame, from that camera
[17:02] <durandal_1707> LukaszF: can other app read it?
[17:02] <LukaszF> actualy i have recorded it to separete files
[17:03] <durandal_1707> each frame in separate file or?
[17:03] <LukaszF> it is RAW frame, i am not even able to tell what it really is
[17:03] <LukaszF> it isn;t contained in any container
[17:04] <LukaszF> all i know that we have set camera to capture sound in aac format, and from our server we have stream of such frames
[17:04] <LukaszF> beginning with four random bytes, and AAC tag after it
[17:05] <EricAhn> what does "AAC with no global headers is currently not supported." mean in ffserver?
[17:05] <durandal_1707> that it is not supported
[17:06] <durandal_1707> LukaszF: upload one such frame
[17:06] <durandal_1707> and give me link
[17:06] <LukaszF> okey, give me a sec
[17:08] <LukaszF> should i paste link here?
[17:16] <durandal_1707> LukaszF: looks like it have some kind of extra header
[17:16] <LukaszF> if i remove this header can it be decoded?
[17:17] <durandal_1707> try skipping first 8 bytes
[17:17] <LukaszF> ok
[17:27] <LukaszF> now i got strange result
[17:27] <LukaszF> error string
[17:27] <LukaszF> [aac @ 0e95f620] Reserved bit set.
[17:27] <LukaszF> but what is more strange return value from decode function is very big negative value
[17:28] <LukaszF> like -1094995529...
[17:29] <LukaszF> i am was trying with and without adding FF_INPUT_BUFFER_PADDING_SIZE to allocated buffer size for data
[17:29] <LukaszF> i wonnder if it is important to add FF_INPUT_BUFFER_PADDING_SIZE to data buffer...
[17:30] <LukaszF> any way result is the same
[17:33] <durandal_1707> for decoding single frame?
[17:34] <LukaszF> yes
[17:34] <durandal_1707> just keep skipping +4 bytes
[17:34] <LukaszF> hm ok i try that
[17:34] <durandal_1707> or +1
[17:34] <LukaszF> hm ok
[17:34] <shahriman> guys I have been trying to set psy-trellis for libx264 encoder from command line, but the specified format, i.e. -x264opts ...:psy-rd="1.5:0.2":... is not working
[17:35] <LukaszF> actualy just tried -4 ;)
[17:35] <shahriman> i.e. ffmpeg fails to set the option
[17:35] <durandal_1707> and error is?
[17:35] <shahriman> from code it looks like it's just a string that's passed to libx264, but ffmpeg considers that ":" to be a param seperator
[17:36] <shahriman> [libx264 @ 0x15da960] bad option '0.2': '1'
[17:36] <durandal_1707> and you cant escape it
[17:36] <brontosaurusrex> shahriman: whats your exact command line?
[17:36] <shahriman> i tried escaping it
[17:36] <shahriman> doesn't help
[17:36] <durandal_1707> it could be regression
[17:37] <durandal_1707> saste: ^
[17:37] <shahriman> ffmpeg -y -copyts -i input -pix_fmt yuv420p -map 0:0 -vcodec libx264 -b:v 2810000 -preset medium -x264opts min-keyint=24:keyint=72:vbv-bufsize=12500:vbv-maxrate=3750:qpmin=5:psy-rd="1.5:0.2":aq-strength=1.5 -level 3.1 -profile:v high -pass 2 -passlogfile passlog -r 2997/125 -vframes 5000 -f mov output.mov
[17:38] <beastd> shahriman: :psy-rd="1.5\:0.2":  <- not working?
[17:38] <shahriman> no
[17:38] <EricAhn> durandal_1707 :  did not implemented  RTSP(H.264, AAC) in ffserver?
[17:38] <beastd> i mean with both the "" and the \ inside
[17:38] <shahriman> beastd: hey man how are you? remember me?
[17:38] <shahriman> beastd: doesn't help
[17:38] <beastd> shahriman: yes, i do! long time no see :)
[17:39] <shahriman> was there a time that this was working?
[17:39] <saste> shahriman, it's a known issue, and we have a workaround for that
[17:39] <shahriman> Sashmo: what's that?
[17:39] <shahriman> saste: ^
[17:40] <saste> shahriman, In filter and psy-rd options that use ":" as a separator themselves, use "," instead. They accept it as well since long ago but this is kept undocumented for some reason.
[17:41] <shahriman> ok, trying
[17:41] <saste> this is from the libx264 docs in ffmpeg-codecs(1)
[17:45] <brontosaurusrex> hm, iam not even using -x264opts ...
[17:45] <shahriman> saste: awesome. works. thanks a lot.
[17:45] <shahriman> that's why you are brontosaurusrex
[17:45] <shahriman> modernize of go extinct :P
[17:46] <brontosaurusrex> no, no, its a double - fake animal, you missed the point completely
[17:46] <beastd> saste: i am sure i am missing something but i would have expected the string is parsed using av_get_token
[17:47] <saste> beastd, i raised the point when the patch was published on ML
[17:47] <saste> but then for whatever reason michaelni preferred to push that variant
[17:47] <beastd> saste: must be some reason
[17:47] <saste> note that libav is working on a similar option right now (but - of course - with a different name)
[17:47] <saste> that will make use of escaping
[17:47] <beastd> av_get_token escaping or sth else?
[17:48] <saste> beastd, yes
[17:49] <brontosaurusrex> actually core x264 presets was my idea, so without me you would still be writing 7 line long silly command lines
[17:50] <brontosaurusrex> so ....
[17:54] <brontosaurusrex> :P
[17:54] <stephanedev> hi everybody. i have been studying the ffmpeg API examples and i don't really understand how frame->pts is computed. my understanding was that frame->pts is in codec_ctx->time_base unit, but in the example it is rescaled using the stream time base. why is that?
[17:56] <stephanedev> i am talking about the muxing.c example (http://ffmpeg.org/doxygen/trunk/doc_2examples_2muxing_8c-example.html)
[17:58] <stephanedev> the line is: frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base);
[17:58] <durandal_1707> EricAhn: rtsp should be supported....
[17:59] <stephanedev> if the intended frame rate is 25 fps, i thought setting the codec_ctx->time_base to {1, 25} and incrementing frame->pts by 1 for every frame was the way to go, but it seems it's not
[18:01] <stephanedev> shouldn't the timestamp rescaling occur on the packet timestamp before writing it to the stream?
[18:02] <LukaszF> durandal_1707: I have skipped 16 first bytes
[18:03] <LukaszF> after that i have return value of avcodec_decode_audio4 == 1...sigh that means 1 byte does it?
[18:03] <LukaszF> any way got_frame_ptr is still 0....
[18:03] <LukaszF> i lost hope to decode this...
[18:06] <durandal_1707> hmm, ask camera guys how is aac saved..
[18:06] <LukaszF> already done it, but may wait a while for answer
[18:06] <durandal_1707> EricAhn: there is no example on google how to stream rtsp with ffmpeg?
[18:07] <EricAhn> duradal_1707 : there is no perfect sample.
[18:07] <LukaszF> thanks for your time
[18:08] <LukaszF> but maybe i can do one more thing, waht could be command for ffmepg to extract aac stream from mpeg4 container?
[18:08] <EricAhn> durandal_1707 : referenced http://ffmpeg.org/trac/ffmpeg/wiki/StreamingGuide
[18:08] <LukaszF> because our cameras can record to ordinary container, maybe i could compare those outputs
[18:09] <durandal_1707> good idea
[18:10] <durandal_1707> -vn -c copy -f u8 file could save just "raw" frames
[18:10] <LukaszF> ok i try that
[18:12] <LukaszF> wait file in your command means output or input file?
[18:16] <durandal_1707> output
[18:17] <durandal_1707> -i input -vn ...
[18:17] <LukaszF> ye got it
[18:18] <LukaszF> yes it hasn't got any aac tags or such...
[18:18] <LukaszF> is it possible to write single frame?
[18:19] <durandal_1707> add -frames 1
[18:19] <LukaszF> perfect thanks
[18:20] <LukaszF> now i can test my decoding function maybe i fucked up something else
[18:22] <EricAhn> durandal_1707 : It's my ffmpeg "./ffmpeg -i http://qthttp.akamai.com.edgesuite.net/iphone_demo/Video_Content/npr/blindpilot_hdv_bug/all.m3u8 -vcodec copy -acodec copy http://10.10.250.122:8090/feed1.ffm"
[18:30] <LukaszF> Strange i am unable to decode those aac frame extracted form mp4 container.
[18:30] <LukaszF> If i understand right aac frames ARE in fact independent ( no like frames in mpeg4 )?
[18:31] <LukaszF> And it should be possible to decode just one?
[18:31] <LukaszF> or am i in woods totally?
[18:38] <durandal_1707> LukaszF: even first frame?
[18:38] <durandal_1707> have you checked with other player that mp4 file plays fine?
[18:39] <LukaszF> mp4 file works just fine in media player classic
[18:39] <LukaszF> after that i extracted whole aac stream, and it works in winamp
[18:40] <LukaszF> I thought that aac frames even first one are the same
[18:40] <durandal_1707> you also need parser iirc
[18:41] <LukaszF> So those frames are not actually binary packed sound data?
[18:41] <LukaszF> but has some meta information?
[18:42] <durandal_1707> parser is for spliting packets
[18:43] <durandal_1707> but maybe in your case frame are just in some weird container
[18:46] <LukaszF> no, it came from ordinary mpeg4 container
[18:46] <LukaszF> i have something like mp4Explorer from codeplex
[18:46] <LukaszF> and it recognize 2 trak just fine
[18:47] <LukaszF> one for video and one for audio
[18:47] <LukaszF> i Don actualy get that idea with parser
[18:48] <LukaszF> If i got one frame from ffmpeg called on extracted aac stream, i shouldn't need any parser?
[18:55] <durandal_1707> you should be able to decode aac from mp4 using lavf to demux acc from mp4 and lavc to decode aac into pcm
[19:00] <LukaszF> I was wondering, what is difference between ffmpeg - i test.mp4 -vn -c copy -f u8 test.aac
[19:00] <LukaszF> and
[19:01] <LukaszF> ffmpeg -i test.mp4 -vn -acodec copy test.aac
[19:01] <LukaszF> because result are strange i both case i have playable aac file
[19:02] <LukaszF> but first one is on some default options and is recognized as mono 128kbps
[19:02] <LukaszF> and second one is playing normally as should in stereo and such
[19:02] <durandal_1707> the last have actual header at start. the first whan in just extracted frames
[19:03] <LukaszF> ow i thought so
[19:03] <durandal_1707> -f u8 is actualy muxer for raw unsigned 8byte pcm
[19:05] <LukaszF> so in first case in test.aac there are pcm frames?
[19:05] <durandal_1707> no
[19:05] <durandal_1707> aac frames are copied
[19:19] <LukaszF> got damn
[19:19] <LukaszF> i miscalculated some bytes
[19:19] <LukaszF> just decoded that stupid frame from ffmpeg extracted stream
[19:20] <LukaszF> now i have such question
[19:20] <LukaszF> that decoded frame was from ffmpeg -i test.mp4 -vn -acodec copy -frames 1 test.aac
[19:20] <LukaszF> wich means that i had necessary data to initialize ffmeg structures
[19:21] <LukaszF> i suspect that those raw frames from camera may not have such information as in ffmpeg - i test.mp4 -vn -c copy -f u8 -frames 1 test.aac , what can i do then...
[19:22] <durandal_1707> guess them? dunno because i dont have camera here.....
[19:23] <LukaszF> ok thank you for your help, i try to tinker with it until i receive some information from camera manufacturer
[19:34] <Guest17813> is the current ffmpeg is better CPU intensive compared to old version?
[19:53] Last message repeated 1 time(s).
[21:00] <stephanedev> could anyone explain why in the ffmpeg muxing.c example (http://ffmpeg.org/doxygen/trunk/doc_2examples_2muxing_8c-example.html) the frame pts is scaled from codec time base to stream time base (i.e. before going through the encoder)? i thought this conversion should happen for the packet pts before writing it to the stream.
[21:13] <teratorn> stephanedev: yes, i believe usually you are correct
[21:14] <stephanedev> teratorn: thank you. do you have any idea why it's done differently in muxing.c?
[21:14] <teratorn> stephanedev: i only see one call to av_rescale_q() in there, and it's not converting the timestamps
[21:14] <teratorn> its incrementing
[21:14] <teratorn> by a constant
[21:14] <stephanedev> a constant (1) scaled from codec time base to stream time base
[21:14] <teratorn> correct
[21:15] <stephanedev> why is it scaled at the frame level (before encoding) instead of at the packet level (after encoding and before muxing)?
[21:16] <Mavrik> because encoder can buffer frames and reorder them when creating B-frames
[21:16] <teratorn> the pts aren't being scaled, they're being incremented by a constant
[21:16] <Mavrik> so you really want to pass the correct frame PTS to the encoder
[21:16] <teratorn> equivalent to 1 codec time unit
[21:16] <Mavrik> so it returns you proper DTS/PTS pair
[21:17] <teratorn> stephanedev: so im unsure if that example is correct or not. it produces good output for you?
[21:17] <stephanedev> thank you both teratorn and Mavrik for your help. i am still not sure to understand though
[21:18] <stephanedev> the line is: rame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base);
[21:18] <stephanedev> if i understand correctly, it scales the frame pts from codec time base to stream time base
[21:19] <stephanedev> why would the encoder care about the stream time base?
[21:19] <teratorn> no, it doesn't scale the pts, it increments by a constant
[21:19] <stephanedev> doesn't it use only the codec time base?
[21:19] <teratorn> i don't know what is hard to understand about this
[21:19] <Mavrik> encoder doesn't care about time base
[21:19] <Mavrik> whoever passes the frames to encoder and gets them back from it does though
[21:19] <teratorn> pts = av_rescale_pts(pts, codec_time_base, stream_time_base) would scale the pts
[21:19] <Mavrik> instead of focusing on that line
[21:20] <Mavrik> rather figure out WHY is that even done
[21:20] <Mavrik> it's not the rescaling that's the key
[21:20] <stephanedev> sorry if i'm unclear, i will try to explain more
[21:20] <teratorn> you're not unclear, you're simply wrong
[21:20] <teratorn> :)
[21:20] <teratorn> adding a constant isn't the same as scaling according to a ratio
[21:20] <teratorn> ok?
[21:21] <stephanedev> but why not adding 1? why does it have to be dependent on the stream time base?
[21:21] <teratorn> because the pts values are copied on to the pkt, and will be correct for the stream they are going to be written to, I guess
[21:21] <teratorn> normally I scale pkt pts values after encoding, but I guess that is not a requirement (?)
[21:22] <teratorn> according to what Mavrik is saying
[21:22] <Mavrik> nope
[21:22] <Mavrik> the encoder doesn't really do anything with PTS
[21:22] <Mavrik> except to remember them
[21:22] <stephanedev> that's how i thought it works too, i.e. the call to rescale is done on the packet
[21:22] <Mavrik> so it can correctly set PTS/DTS
[21:23] <stephanedev> ok i see
[21:23] <Mavrik> I usually scale before encoding though, less messy
[21:23] <Mavrik> also, I only have to scale PTS and not bother with DTS (since frames before encode don't have DTS)
[21:23] <stephanedev> let me run my test again, but it seems there is a difference in the generated video though
[21:23] <Mavrik> matter or preference :)
[21:23] <stephanedev> yes it's simpler
[21:25] <stephanedev> i found a difference in the video size depending on where i do the scaling, but i may have done something wrong, i will try again
[21:26] <stephanedev> in case you leave before i am back, i just want to thank you very much for your help and explanations Mavrik and teratorn
[21:26] <teratorn> stephanedev: np :)
[21:27] <teratorn> timestamps are a bitch
[21:27] <Mavrik> yeah :\
[21:38] <stephanedev> i ran a simple test program and still have a difference in the generated video depending on where i do the scaling. both videos play, but the one with scaling on frame pts is 24 MB whereas the one with scaling on packet.pts and packet.dts is 1.67 MB
[21:40] <stephanedev> the test consists in loading a set of images (frames from the big buck bunny video) and encoding them at 25 fps with H264 and writing them to mkv file
[21:42] <stephanedev> the first test configuration is similar to muxing.c: frame pts initialized to zero and incremented by av_rescale_q(1, videostream->codec->time_base, videostream->time_base); for every frame
[21:44] <stephanedev> second test configuration is based on the same code as first configuration. the 2 differences are that frame pts is incremented by one for every frame and packet pts and dts are scaled before writing to the file as follows: packet.pts = av_rescale_q(packet.pts, codec_context->time_base, videostream->time_base);
[21:46] <stephanedev> do you have any clue as to why the generated videos are different and especially why one is so much bigger than the other?
[21:47] <Mavrik> that looks like something goes very wrong with encoding
[21:47] <Mavrik> either your quality settings are wierd
[21:47] <Mavrik> or encoder is dropping your frames
[21:48] <stephanedev> Mavrik: thank you. i didn't set any codec specific option
[21:49] <stephanedev> there are 804 frames at 25fps, and both generated videos are 32s long
[21:49] <Mavrik> did you actually LOOK at them?
[21:50] <stephanedev> yes, they play fine
[21:50] <stephanedev> both with vlc and ffplay
[21:50] <Mavrik> quality?
[21:51] <stephanedev> the quality is similar as far as i can tell
[21:51] <stephanedev> i don't see any obvious difference
[21:51] <Mavrik> then obviously you're either looking at wrong file
[21:51] <Mavrik> writing to wrong file
[21:52] <Mavrik> or looking at source file
[21:52] <Mavrik> or not writing output at all
[21:52] <Mavrik> :P
[21:52] <stephanedev> i checked the file timestamps
[21:52] <Mavrik> having two files with 10x size difference
[21:52] <stephanedev> yeah, that's weird
[21:52] <Mavrik> with "similar quality" is rather impossible
[21:52] <llogan> maybe it would be more obvious if you show the console output of "ffmpeg -i input1 -i input2"
[21:53] <llogan> (via pastebin.com or similar)
[21:53] <stephanedev> llogan: thanks, i'll do that right away
[21:57] <stephanedev> everything is the same but the bitrate: 436 kb/s for the small file, 6266 kb/s for the large file. but in both test configurations, i set the codec context bit rate to 400 kb/s
[21:58] <stephanedev> so it looks like scaling the frame pts to the stream time base before encoding somehow affects the bitrate?
[22:02] <stephanedev> in case you want to check the full output of the command you suggested: http://pastebin.com/beM1hvX2
[22:09] <stephanedev> i tried by using vp8 codec instead of h264 and something similar happened: one video is ~1 MB, the other one is ~7 MB
[22:12] <stephanedev> again, ffmpeg -i shows that the bitrate is different: 423 kb/s and 1883 kb/s
[22:12] <stephanedev> in the code, codec context bitrate is set to 400000
[23:19] <stephanedev> i tried on linux and i get the same behavior. i wrote a simple test program to reproduce the issue
[23:20] <stephanedev> it loads images from a directory and generates a video. a command line option allows to choose whether to scale the frame timestamp or the packet timestamp to the stream time base
[23:59] <stephanedev> just to summarize my issue/misunderstanding/confusion/(error?): i get different video files (notably the size) depending on what the time base conversion is applied to (frame pts or packet pts). if anyone wants to reproduce the issue, here is the code i used (sorry, it is not really clean): http://pastebin.com/PQ1aUdgf
[00:00] --- Fri Jan 25 2013


More information about the Ffmpeg-devel-irc mailing list