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

burek burek021 at gmail.com
Thu Jan 26 03:05:01 EET 2017

[00:01:55 CET] <furq> generally lower crf is slower, but idk if that applies the same to lossless
[00:03:39 CET] <kerio> i thought crf 18 was visually lossless :<
[00:03:48 CET] <furq> i use 20 or 21 for everything
[00:04:04 CET] <furq> looks fine to me
[00:04:05 CET] <Diag> i use like 24 on the slowest shit
[00:04:33 CET] <furq> generally if i have a source which 20 is struggling with then it's already using more bitrate than i want it to
[00:04:50 CET] <kerio> honestly for a screen capture i like qp 0
[00:05:03 CET] <furq> i can't remember the last time i did a screen capture
[00:05:04 CET] <kerio> or maybe something even dumber like ffvhuff or utvideo
[00:05:13 CET] <kerio> so you can compress decently afterwards
[00:05:19 CET] <Diag> rle?
[00:05:29 CET] <furq> yeah the last time i did a screen capture was probably with fraps or afterburner or something
[00:05:49 CET] <kerio> OBS supports lossless recording
[00:11:19 CET] <kerio> you end up with utvideo/pcm_s16le in a .avi
[00:11:23 CET] <kerio> absolutely disgusting
[00:22:25 CET] <faLUCE> I have some troubles with audio packets' pts. I encode them and mux them: after each  call to avcodec_encode_audio()  I set the pkt.ts and dts to gettimeofday(). Then I write the audio frame with av_interleaved_write() (mpegts muxing).   When I hear the resulting file with vlc, I hear the original audio with a click every second.  VLC says "core audio output warning: playback too early (-96103): down-sampling"    . Then I
[00:22:26 CET] <faLUCE> wonder: is it correct to set audio pts and dts with gettimeofday? Or should I compute them depending on the codec's bitrate ?
[00:34:18 CET] <kerio> hey furq
[00:34:36 CET] <kerio> i found out that there's a 24bit version of radiohead's In Rainbows
[00:34:38 CET] <kerio> ;o
[00:34:55 CET] <kerio> so many bits
[00:37:16 CET] <furq> maybe the extra bits are what makes it not suck
[00:38:36 CET] <kerio> wow so rude
[02:45:27 CET] <faLUCE> I have some troubles with audio packets' pts. I encode them and mux them: after each  call to avcodec_encode_audio()  I set the pkt.ts and dts to gettimeofday(). Then I write the audio frame with av_interleaved_write() (mpegts muxing).   When I hear the resulting file with vlc, I hear the original audio with a click every second.  VLC says "core audio output warning: playback too early (-96103): down-sampling"    . Then I
[02:45:29 CET] <faLUCE> wonder: is it correct to set audio pts and dts with gettimeofday? Or should I compute them depending on the codec's bitrate ?
[03:00:29 CET] <kepstin> not depending on the codec's bitrate; you should compute them based on the audio sample rate
[03:01:29 CET] <kepstin> like, 48kHz audio means there's exactly 48000 audio samples for one second.
[03:03:21 CET] <kepstin> although this gets tricky when you're working with real-time capture, since the audio will be captured with a different clock than the video, so you could get desyncs.
[03:03:42 CET] <kepstin> (in that case, you might want to calculate the video pts based on the audio as well)
[03:26:43 CET] <_Vi> How do I show help for a bitstream filter? "ffmpeg -h bsf=noise" shows generic help.
[03:38:57 CET] <_Vi> For example it has "amount" option, but I don't see it even in "ffmpeg -h full".
[04:46:52 CET] <mixfix41> kerio: you like oss?
[04:47:58 CET] <mixfix41> i figured out my problem i had pulseaudio script running in slackware
[04:48:07 CET] <mixfix41> got my sound
[07:21:49 CET] <phillipk> does anyone know if ffmpeg's "codec_type" can have any value besides "audio" or "video"?
[07:22:02 CET] <phillipk> I just want thing sort of bullet proof.
[07:22:24 CET] <phillipk> I'm looping through the streams to see what each kind is and in what order audio/video streams.
[08:45:40 CET] <vishal733> I need to write a C/C++ file for reading a flv video file, along with the timestamp for each decoded frame. This is required for OpenCV processing (which doesn't obtain the frame timestamps correctly).
[08:45:59 CET] <vishal733> any pointers where I could begin. This example seems to work only for mp4: https://ffmpeg.org/doxygen/trunk/decoding_encoding_8c-example.html
[12:29:49 CET] <cousin_luigi> Greetings.
[12:30:01 CET] <cousin_luigi> Does Fabrice Bellard ever come here?
[12:32:39 CET] <Fyr> guys, AIMP4 and Tagscan can't delete a field the metadata of FLAC files created by the latest FFMPEG. what changes have been made to FFMPEG?
[12:33:29 CET] <Fyr> it's highly unusual that they can read field, but can't delete it.
[12:48:03 CET] <satinder___> hi
[12:48:31 CET] <satinder___> I have confusion when I am using ffmpeg
[12:48:50 CET] <satinder___> can I ask my question on that irc  ?
[12:49:02 CET] <Fyr> looks like
[12:50:10 CET] <satinder___> thanks
[12:50:26 CET] <satinder___> Fyr : I want to ask about ffmpeg
[12:50:44 CET] <Fyr> got it
[12:50:47 CET] <satinder___> there have two main thing in a picture
[12:50:58 CET] <satinder___> One is video capturing
[12:51:08 CET] <satinder___> Second is sound capturing
[12:51:50 CET] <satinder___> my question is that ffmpeg used v4l2 for video capturing , Am right or wrong ?
[12:52:00 CET] <BtbN> depends on the OS of course
[12:52:13 CET] <BtbN> And there's also stuff like declink
[12:52:25 CET] <satinder___> yes
[12:52:31 CET] <satinder___> declink also
[12:52:48 CET] <satinder___> for sound that is use alsa
[12:52:55 CET] <satinder___> ?
[12:53:24 CET] <vsanchez> Hello, I am trying to set the audio language metadata to 'und' (Undefined). I wonder whether this is forbidden or not. Other languages 'spa', 'fra' do set the language value appropriately.
[12:54:05 CET] <satinder___> BtbN : how I can know , how many capturing methods are avaiable in ffmpeg
[12:54:09 CET] <satinder___> ?
[12:54:22 CET] <BtbN> you pick the one that works for the device you want to capture
[12:54:23 CET] <vsanchez> See my command: ffmpeg -i <VIDEO_TRACK> -i <AUDIO_TRACK> -c:v copy -c:a pcm_s24le -b:a 192K -ar 48000 -map 0:v -map 0:a -metadata:s:a:0 language=und -metadata:s:a:0 title="Undetermined" -map 1:a -metadata:s:a:1 language=fra -metadata:s:a:1 title="French"  -y out.mov
[12:54:34 CET] <BtbN> 99% of the cases it'll be v4l on linux
[12:54:43 CET] <satinder___> ok
[12:54:48 CET] <satinder___> and for sound ?
[12:54:54 CET] <BtbN> alsa/pulse
[12:55:00 CET] <satinder___> ok
[12:55:01 CET] <BtbN> If you have something else, you'd know it.
[12:55:28 CET] <satinder___> now I am working on v4l2 and alsa
[12:55:48 CET] <satinder___> no I don't know apart from this
[12:56:14 CET] <satinder___> one another this
[12:56:54 CET] <satinder___> for network transmission , Is encoding necessary of video / audio ?
[12:58:00 CET] <satinder___> second question is that what happened if I use mpegts as muxer
[12:58:16 CET] <satinder___> follow this command :
[12:59:00 CET] <satinder___> ffmpeg  -i /dev/video0  -v:c copy -a:c copy -f mpegts test.ts
[12:59:45 CET] <satinder___> is that make any packeting of data or not because  I think that is raw data
[13:00:20 CET] <BtbN> well, it muxes at mpegts. And I don't think you can put raw video in it, not sure about raw audio.
[13:00:39 CET] <BtbN> But raw video is too much to stream anyway. You easily overwhelm a gigabit network link with raw video.
[15:48:35 CET] <bbert> Is there a way to control ffmpeg filter graph parameters interactively?  For example, if I have a "hue" filter, I's want to change the hue angle during processing based on some input.  Not simply setting up a calculation that will run, but accepting user input?
[15:55:00 CET] <furq> bbert: you can use sendcmd and zmq
[15:55:15 CET] <furq> you can apparently send commands to sendcmd interactively by hitting c, but i've never managed to get that to work
[15:55:27 CET] <furq> it also pauses encoding which probably isn't what you want
[16:08:24 CET] <shincodex> avpicture_get_size is this going to byte align by 2 or 4
[16:09:36 CET] <shincodex> so if i give 202width r8g8b8 my stride is what?
[16:10:48 CET] <shincodex> 606 + (202 % 4) = 608
[16:11:02 CET] <shincodex> should my stride, step, linesize, pitch, wtf ever be 608 using this method
[16:56:30 CET] <IchGucksLive> hi  i got a small problem i hope to fix if i do a FILTER to get 4times speed -filter:v "setpts=0.25*PTS"
[16:56:46 CET] <IchGucksLive> the Video is not shorten to that value
[16:58:12 CET] <IchGucksLive> its the full length sound and the pigtures stop at 1/4
[16:58:26 CET] <IchGucksLive> so only the frames are shorten
[16:58:53 CET] <IchGucksLive> is there a trick to cut the video off at the end of the 1/4
[16:59:01 CET] <c_14> -shortest
[16:59:11 CET] <IchGucksLive> without looking in every VI there are 26
[16:59:38 CET] <kerio> don't you also need to shorten the audio?
[16:59:47 CET] <IchGucksLive> no
[16:59:55 CET] <kerio> then yeah, -shortest
[16:59:58 CET] <IchGucksLive> c=1; for i in *.MOV; do [ ! -f "$i" ] && continue; r=$(printf "venus_2017_%02d" "$c");ffmpeg -threads 2 -i $i -filter:v "setpts=0.25*PTS" -acodec libfdk_aac -ab 90k -vcodec libx264 -preset slow -crf 24 -r 25 "$r.mp4"; ((c++)); done
[17:00:05 CET] <kerio> it will stop the output whenever any input stream ends
[17:00:05 CET] <IchGucksLive> where  to put it
[17:00:26 CET] <Bombo> hi
[17:00:37 CET] <IchGucksLive> beond the fiter tag
[17:00:46 CET] <kerio> yeah, immediately after -filter:v is fine
[17:01:30 CET] <Bombo> is there a way to find out the number of audio streams in a video container with ffprobe?
[17:02:43 CET] <thebombzen> IchGucksLive: id you're speeding the video up by 4x, consider using -af atempo=2.0,atempo=2.0
[17:02:47 CET] <thebombzen> which speeds up the audio by 4x
[17:03:23 CET] <IchGucksLive> that gives a horribel sound
[17:03:28 CET] <IchGucksLive> i tried that
[17:05:37 CET] <IchGucksLive> -shortest  does not work
[17:05:44 CET] <IchGucksLive> still the full length
[17:07:12 CET] <Bombo> ok this shows nb_streams, a+v 'ffprobe -show_format -show_entries format=nb_streams -v error -of default=noprint_wrappers=1:nokey=1 -v error -of default=noprint_wrappers=1:nokey=1'
[17:07:39 CET] <Bombo> nb probably shrt for number
[17:07:40 CET] <Bombo> ;)
[17:10:15 CET] <IchGucksLive> OK i got it
[17:10:33 CET] <IchGucksLive> thebombzen:  you where right to shorten the sound 2
[17:11:01 CET] <IchGucksLive> NOW as i got 26 short mp4 files how can i put them together
[17:11:38 CET] <IchGucksLive> or woudt it be better to firsthand choose a TS container in the main conversion and then put the TS together
[17:11:47 CET] <IchGucksLive> to th final mp4
[17:12:21 CET] <IchGucksLive> i know there is lots of trouble on the mp4 joining
[17:12:26 CET] <thebombzen> if the files are named 01.mp4 through 26.mp4, you can use:
[17:12:54 CET] <thebombzen> ffmpeg $(echo -i\ {01..26}.mp4) -lavfi concat=n=26:v=1:a=1 output_options
[17:13:24 CET] <IchGucksLive> will try it
[17:15:41 CET] <Bombo> got it (bash): 'audio_streams_count=$(ffprobe -select_streams a -show_entries stream=index -v error -v error -of default=noprint_wrappers=1:nokey=1 container.mkv|wc -l)'
[17:16:11 CET] <Bombo> but wc is needed
[17:19:34 CET] <thebombzen> Bombo: this is shorter: "ffprobe -show_streams -select_streams a S01E01\ -\ Prologue\ of\ the\ Beginning\ and\ Ending.mkv 2>/dev/null | grep index | wc -l"
[17:19:46 CET] <thebombzen> or rather that's the one I used for the filename
[17:20:05 CET] <thebombzen> ffprobe -show_streams -select_streams a FILENAME 2>/dev/null | grep index | wc -l
[17:20:39 CET] <Bombo> thebombzen: well ok, but uses even one prg more ;)
[17:20:55 CET] <thebombzen> prg? is there anything wrong with using grep? it's a coreutil
[17:21:01 CET] <Bombo> program
[17:21:19 CET] <thebombzen> so?
[17:21:27 CET] <thebombzen> am I not allowed to use coreutils
[17:21:41 CET] <Bombo> maybe on windows
[17:21:59 CET] <thebombzen> windows also doesn't have wc, so using wc and grep compare to just wc
[17:22:09 CET] <Bombo> would be nice if it could be done just with ffprobe, no grep, no wc
[17:22:59 CET] <Bombo> that's why i said '17:16 <Bombo> but wc is needed' (i want to get rid of that)
[17:23:15 CET] <Bombo> it's ok to use on linux
[17:24:35 CET] <Bombo> (grep, wc)
[17:26:04 CET] <IchGucksLive> FFMPEG is great THANKS Folks
[17:26:57 CET] <Bombo> indeed ;)
[17:28:38 CET] <bbert> furq:  Thanks.  both zmq and sendcmd look like they'll be useful!  Thanks.
[17:30:08 CET] <kuroro> hi guys, im currently running background workers in EC2 that monitor a queue and I want to maximize the throughput that the EC2 instance can achieve
[17:30:20 CET] <kuroro> what the worker does is (download video -> ffmpeg_scale_setsar_normalizevolume -> ffmpeg_split_video_into_3_sec_chunks -> upload_chunk_to_s3 -> insert_chunk_details_to_database )
[17:31:16 CET] <kuroro> my current concern is that ffmpeg_split_video_into_3_sec_chunks is CPU bound, and that would potentially limit the number of concurrent workers I have
[17:32:52 CET] <kuroro> on the other hand, upload_chunk_to_s3 and insert_chunk_details_to_database can be ran async
[17:33:32 CET] <kuroro> whats a good way to increase my throughput as much as possible ?
[17:35:50 CET] <furq> Bombo: grep -c
[17:38:40 CET] <Bombo> furq: ok, but is it possible just with ffprobe? no grep no wc no awk
[17:39:49 CET] <furq> not afaik
[17:41:34 CET] <Bombo> ok
[17:45:03 CET] <kuroro> my current thoughts are each tasks should be individual processes monitoring their corresponding queue, that way, each individual component would try to keep busy as much as possible as long as there's item in their queue (similar to how instruction pipelining works)
[17:57:18 CET] <faLUCE> Hello. With my code I capture 128 audio samples (2 bytes per sample, mono) at each audio-hw-interrupt, with 16000 sample_rate, Then I fill a 1152 mpeg audio frame, and I encode it (mp2) with avcodec_encode_audio(). The encoding is ok, and I can well hear the resulting mp2 file. Now, if I want to mux video ad audio togetgher, I have to call av_interleaved_write_frame() for each audio frame. But this function wants an
[17:57:19 CET] <faLUCE> AVpacket as argument; I can extract the data for the packet from the result of avcodec_encode_audio(), but how can I extract the timestamps that I have to put in the pkt?
[18:02:38 CET] <DHE> the AVFormatContext->stream[x]->time_base indicates the time units.
[20:19:10 CET] <Bombo> hmmm does x265 have the same profiles as x264? so i can keep -profile superfast?
[20:19:41 CET] <kerio> -profile ludicrousspeed
[20:19:48 CET] <Bombo> how about crf, do i need '-x265-params crf=28' or is it the same as -crf 28
[20:20:32 CET] <kerio> it should be the same as -crf 28
[20:22:42 CET] <Bombo> is there a list of profiles?
[20:24:09 CET] <llogan> For profiles x265 only has main, main10, and mainstillpicture.
[20:24:42 CET] <llogan> as for what avoptions are available see: ffmpeg -h encoder=libx265
[20:24:59 CET] <BtbN> Isn't there also rext or whatever it's called?
[20:25:07 CET] <llogan> i don't know
[20:25:33 CET] <llogan> i just looked at "x265 --help".
[20:28:46 CET] <furq> if you mean presets then they're the same as for x264 iirc
[20:29:04 CET] <Bombo> ah yes indeed i meant presets sorry
[20:29:11 CET] <furq> http://x265.readthedocs.io/en/default/presets.html
[20:29:37 CET] <Bombo> seems to work, superfast is superfast ;)
[20:30:01 CET] <furq> it's also generally not worth using over x264
[20:30:12 CET] <furq> unless you specifically need hevc for some reason
[20:31:45 CET] <Bombo> i'm just testing around
[20:32:01 CET] <furq> fair enough
[20:32:20 CET] <Bombo> x264 is 2x speed at superfast
[20:32:33 CET] <Bombo> but x265 is .5x in size
[20:32:42 CET] <Bombo> i don't see a difference
[20:32:44 CET] <furq> well yeah x264 medium or thereabouts should match x265 at the same size
[20:33:02 CET] <furq> last i checked, anything below x265 medium can be matched at the same encoding speed by x264
[20:33:14 CET] <furq> you only start to see worthwhile gains when you use the slow presets
[20:33:34 CET] <furq> obviously i've not checked every source so ymmv
[20:35:51 CET] <Bombo> picture quality gains you mean, half the filesize is nice too, but takes twice the time to encode, at superfast... my source is just SD mpg2 anyway
[20:36:02 CET] <furq> i mean both
[20:36:16 CET] <furq> picture quality is a function of filesize
[20:36:18 CET] <Bombo> hmm and x265 uses more cpu to play
[20:36:41 CET] <furq> also i mean using a slower x264 preset to match the encoding time
[20:37:03 CET] <furq> x265 veryfast and x264 medium were about on par last i heard
[20:37:28 CET] <furq> that was about 18 months ago though and x265 has more headroom to improve
[21:13:04 CET] <kahunamoore> I'm using the avformat library to read an mxf file and want to be able to a) find out the size of a frame before reading it and b) allocate/manage my own frame memory buffer (ie. have ffmpeg read the encoded frame data from the file into a buffer allocated outside of ffmpeg)
[21:14:54 CET] <kahunamoore> We are using a hw decoder and the API to use it requires a specific memory allocation scheme and I want to avoid a memcpy from the ffmpeg AVPacket/Buffer into the hw decoder's memory...
[21:18:22 CET] <DHE> well, AVPacket isn't that big. the data comes straight out of the on-disk file
[21:31:17 CET] <kahunamoore> This is a very small embedded system proc and while right now it is HD-only it will be 4K down the road
[21:31:33 CET] <kahunamoore> it isn't the AVPacket per-se but the data buffer
[21:31:40 CET] <kahunamoore> it references
[21:33:32 CET] <SouLShocK> I'm trying to figure out which filters will be the fastest to combine with ebur128 for normalizing the volume of a wav file. Tried loudnorm, that is very slow
[21:33:38 CET] <SouLShocK> Any ideas?
[21:45:14 CET] <durandal_1707> SouLShocK: perhaps your system is very slow?
[21:48:59 CET] <SouLShocK> No. It can encode wav to 192 kbit mp4 at 15x speed
[21:49:21 CET] <SouLShocK> But using loudnorm it drops to 3x
[21:50:31 CET] <furq> i take it you can't process multiple files in parallel
[21:52:49 CET] <SouLShocK> I can. But a 5x drop in speed is significant
[21:53:08 CET] <SouLShocK> I already do process a lot of files on parallel
[21:55:33 CET] <SouLShocK> Is loudnorm the only filter which can normalize to ebu r128 values?
[21:57:15 CET] <durandal_1707> SouLShocK: yes, why not sponsor bounty to make filter faster?
[21:58:11 CET] <durandal_1707> also did you profiled where cycles are mostly spent?
[21:59:06 CET] <SouLShocK> No. How would I do that? I noticed that cpu usage was only  about 15% when loudnorm was running
[21:59:20 CET] <furq> well yeah libavfilter is mostly singlethreaded
[22:00:49 CET] <durandal_1707> SouLShocK: google-perftools
[22:01:21 CET] <SouLShocK> Ok thanks
[22:01:29 CET] <SouLShocK> Will try that tomorrow
[23:20:06 CET] <faLUCE> I get from my audio hw a mpeg audio frame of 1152 samples (sampled at 1/16000). Then I put them into a pkt, and set pkt.pts = 1152*i/16000, where i is the frames' cycle counter. However, if I print   av_ts2timestr(pkt.pts, (AVRational){1, 16000})   at each cycle, I obtain a time which is a little bit faster than the SYSTEM clock. Why?  I already checked that the hw delivers 16000 samples in one second, then... what's wrong?
[23:22:37 CET] <faLUCE> (sorry: I simply set  pkt.pts = 1152*i . And when  print   av_ts2timestr(pkt.pts, (AVRational){1, 16000})  I obtain a time which is a little bit faster than the SYSTEM clock )
[23:22:52 CET] <faLUCE> what's wrong?
[23:28:01 CET] <spiderkeys> Is it possible to modify VUI parameters in an H264 stream without needing to re-encode the stream using libavcodec? I have a camera that is not setting the bitstream_restriction_flag or max_num_reorder_frames fields properly and I would like to manually modify them such that they render in an optimized fashion on decoding hardware.
[23:28:42 CET] <spiderkeys> decode* not render
[23:32:45 CET] <furq> you can probably hand-edit it
[23:33:03 CET] <furq> there's an old patch which let you edit SEIs without reencoding, but idk about VUIs
[23:38:12 CET] <spiderkeys> Yea, that old patch didn't have support for the flags I'm trying to set. I need to do this live on each SPS NALU as it leaves the camera as I am doing ultralow latency streaming to the browser and the camera manufacturer doesn't have a way to modify the encoder settings.
[23:38:40 CET] <spiderkeys> Trying to avoid any expensive operations and get it modified in less than a millisecond on an RPI3
[23:39:26 CET] <kerio> oh, is the h264 coming from the rpi camera broken?
[23:40:12 CET] <spiderkeys> Nah, it's a different camera from a manufacturer in the automotive space
[23:40:40 CET] <spiderkeys> But its possible the RPI camera does it too, haven't worked with it
[23:41:40 CET] <spiderkeys> The only reason I found out is because google's Chromium team informed us that our datastream didn't have the reorder or bitstream_restriction flags set, and because of that the hardware decoder was trying to buffer 15 additional frames, leading to a 0.5s latency (which goes away when you switch back to the software decoder)
[23:46:20 CET] <BtbN> probably easiest to write yourself a bitstream filter for that
[23:46:29 CET] <BtbN> no idea if they can be external
[00:00:00 CET] --- Thu Jan 26 2017

More information about the Ffmpeg-devel-irc mailing list