[00:39:57 CEST] <Phi> hey folks [02:25:09 CEST] <{{{}}}> hey there, im on linux mint and i followed this guide to build ffmpeg: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu [02:26:28 CEST] <{{{}}}> when i tried to use the play() function in python using pydub, it defaults to ffmpeg and i get this error: PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \ Invalid Syntax [02:28:20 CEST] <t4nk860> Hi, I have a small question regarding lossless compression using x264 (or x265,vp9): [02:29:48 CEST] <t4nk860> I used `ffmpeg -i $input -c:v libx264 -crf 0 $output` [02:29:52 CEST] <t4nk860> for lossless compression [02:30:19 CEST] <t4nk860> However, the resulting frames seem to be different (different output for some image processing algo) [02:30:33 CEST] <t4nk860> Does crf 0 not produce perfectly lossless? [02:30:55 CEST] <t4nk860> If not, what can I do to obtain lossless performance? [02:31:08 CEST] <furq> use -qp 0 if you want to be sure it's lossless [02:31:14 CEST] <furq> -crf 0 is only lossless with 8-bit output [02:32:00 CEST] <furq> you can also check the frames are identical with the framehash muxer [02:32:26 CEST] <t4nk860> Thanks for the feedback. I will try with qp 0 [02:36:45 CEST] <DHE> t4nk860: there's still colourspace conversion loss before x264 even gets the frames. consider libx264rgb or yuv444 mode depending on what you're up to exactly. [02:37:17 CEST] <furq> it should default to yuv444p if the input is rgb [02:41:19 CEST] <{{{}}}> okay woops i figured out why i got that error. i have a new one now. [02:41:29 CEST] <{{{}}}> it isnt finding ffplay, do i need to install that package seperately? [02:42:14 CEST] <t4nk860> DHE: Thanks for pointing this out. Yes, I am manually specifying the format to be yuv444p (even if it might not be necessary) [02:44:49 CEST] <t4nk860> furq: Will the `-qp 0` flag also work for vp9, x265? ( https://trac.ffmpeg.org/wiki/Encode/VP9 says to explicitly state -lossless 1 flag... but was wondering the original soln will work) [02:45:15 CEST] <furq> i have no idea [02:45:28 CEST] <furq> i doubt it [02:46:43 CEST] <furq> apparently qp 4 is lossless in x265, but i don't know if -qp is actually mapped to anything in libx265 [02:47:00 CEST] <furq> you might need -x265-params qp=4 (or whatever the syntax is) [02:47:53 CEST] <furq> -x265-params lossless=1 [02:50:39 CEST] <t4nk860> cool.. ll try it out [14:37:56 CEST] <beauty> hello [14:38:21 CEST] <beauty> what's the aligned data and none-aliged data?? [14:38:51 CEST] <JEEB> aligned allocation of data so that the ways it's handled can be optimized [14:40:05 CEST] <beauty> could you give a example? [14:48:41 CEST] <DHE> SSE-style instructions work in 128 bit typically. but that means if your memory allocation isn't a multiple of 128 bits your program may crash while doing image processing [14:51:29 CEST] <beauty> thanks [15:03:02 CEST] <Phi> moop [15:03:31 CEST] <Phi> can anyone tell me how to access libx264's internal data while encoding? [15:03:59 CEST] <Phi> AVCodecCtx::priv_data has null x264 encoder and stuff [15:04:11 CEST] <Phi> also hi [15:17:51 CEST] <BtbN> "libx264's internal data"? [15:36:07 CEST] <DHE> x264 only exposes a configuration data structure with things like bitrate, keyframe interval, image size, etc. and even then there's an API to deal with only the text names/values so you can minimize a lot of xx264 structure data access [16:01:41 CEST] <Phi> yea DHE, but in this case, I'm passing options to libx264 via libav* and they're being ignored [16:02:26 CEST] <Phi> to get more debugging info I need to access whatever libav* is accessing, because what it's exposing as output options seems to have no bearing on the *actual* options [16:03:41 CEST] <Phi> vis a vie, I set profile to "baseline" in any option I can, and it just sets it to high [16:05:49 CEST] <Phi> from what I understand you can encode a H264 stream from one profile to another, but it's not doing that, it insists on reflecting the input profile/level [16:08:07 CEST] <Phi> I did see notes that you can't downgrade a profile in x264_param_set_profile(), but the input and output should be completely unrelated [16:08:46 CEST] <Phi> unless I have to decode every frame to an image, then encode the image to the new stream, I'm at a loss [16:09:11 CEST] <BtbN> There is no such information carried over at all. [16:09:23 CEST] <BtbN> x264 takes raw images in, and produces h264. [16:09:32 CEST] <BtbN> All according to the options you pass it. [16:09:42 CEST] <Phi> I've passed baseline in every option I can find [16:09:58 CEST] <Phi> codeccontext->profile, av_opt_set(codecctx->priv_data, "profile" ... [16:10:17 CEST] <BtbN> likely some other option you pass overrides it. [16:10:24 CEST] <BtbN> baseline has quite a few constraints [16:10:39 CEST] <Phi> well, atm I'm just passing baseline, all the other options are defaults [16:11:47 CEST] <BtbN> what chroma format? What resolution? [16:12:01 CEST] <Phi> YUV420p, and whatever the RTSP is [16:12:26 CEST] <Phi> I tried two methods - av_copy_context from the RTSP, and av_context_defaults with manually setting width, height, etc [16:12:49 CEST] <Phi> http://stackoverflow.com/questions/40053873/ffmpeg-rtsp-stream-to-mpeg4-h264... [16:13:01 CEST] <BtbN> encoding baseline works fine for me. You are doing something wrong. [16:13:25 CEST] <Phi> I hope I am, otherwise the libav* guys are doing something wrong :3 [16:14:23 CEST] <Phi> X264Context *x4 = (X264Context *)video_file_stream->codec->priv_data; // is that valid? [16:14:33 CEST] <Phi> because x4->enc, the encoder, is always null [16:15:06 CEST] <BtbN> X264Context is a private struct inside of libx264.c [16:15:16 CEST] <BtbN> you can't access it from the outside anyway, except for setting AVOptions [16:15:33 CEST] <BtbN> *via setting AVOptions [16:15:43 CEST] <Phi> I'm doing read-only trying to read variables for debugging [16:15:46 CEST] <BtbN> priv_data is called private for a reason [16:16:17 CEST] <BtbN> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libx264.c#L677 [16:16:17 CEST] <BtbN> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libx264.c#L729 [16:16:39 CEST] <BtbN> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libx264.c#L905 [16:16:47 CEST] <BtbN> looks fine, and works fine, for me. [16:17:04 CEST] <Phi> not at all for me XD [16:17:13 CEST] <BtbN> you're doing something wrong then. [16:18:22 CEST] <Phi> well, the code's in the link I posted [16:18:57 CEST] <Phi> so to clarify, to set profile I merely change avcodecctx->profile, before I encode the first frame? [16:21:11 CEST] <Phi> is it required I call avcodec_open before the first frame? [16:22:58 CEST] <BtbN> Of course you have to open the encoder before you can use it. [16:23:04 CEST] <Phi> weirdly not [16:23:16 CEST] <Phi> when I do it tends to error [16:23:25 CEST] <Phi> and I still get an MP4 without one [16:23:32 CEST] <Phi> so I'm guessing something is screwed up before then [16:24:03 CEST] <Phi> the examples I've seen don't include calling avcodec_open [16:24:18 CEST] <Phi> to clarify, I'm doing it inside an AVFormatContext's stream [16:27:12 CEST] <Phi> so, it's av_guess_format for MP4 [16:27:27 CEST] <Phi> avformat_alloc_context for the format [16:27:49 CEST] <Phi> set oformat for that context to the av_guess_format [16:28:24 CEST] <Phi> set filename for format context to oformat's filename [16:28:38 CEST] <Phi> avcodec_find_encoder for the formatcontext's video codec [16:28:56 CEST] <Phi> then call avio_open2 on format context's pb [16:29:04 CEST] <Phi> then call avformat_new_stream [16:29:19 CEST] <Phi> then I set options [16:29:27 CEST] <Phi> then avcodec_open2 [16:29:31 CEST] <Phi> then avformat_write_header [16:29:36 CEST] <Phi> then av_write_frame to infinity [16:29:49 CEST] <Phi> is that the right order? [16:44:00 CEST] <rzz> hi, does anyone have experience in switching audio track from 3d mkv? [16:44:35 CEST] <rzz> I seem to get lot of stuttering and dropped frames [16:45:01 CEST] <beauty> https://ffmpeg.org/doxygen/trunk/doc_2examples_2decoding_encoding_8c-example... [16:45:11 CEST] <beauty> fwrite(decoded_frame->data[0], 1, data_size, outfile); [16:45:32 CEST] <beauty> the audio can't be played in example program. [16:47:00 CEST] <beauty> Is it beacause the decoded data is AV_SAMPLE_FMT_FLTP ,but the way to write data[0] to file is wrong? [16:49:56 CEST] <Phi> sorry, new to libav* [17:52:45 CEST] <AlienCat> hey [17:53:13 CEST] <AlienCat> I am trying to convert an SILK V3 amr file [17:53:34 CEST] <AlienCat> ffmpeg -i msg.amr -c:v opus glass.wav [17:53:42 CEST] <AlienCat> but it doesn't work [17:54:00 CEST] <AlienCat> Invalid frame size (732): Could not seek to 4174. [17:54:07 CEST] <AlienCat> got this mp3 error [18:14:49 CEST] <BtbN> AlienCat, you realize opus is an audio codec? [18:14:59 CEST] <AlienCat> yea [18:15:06 CEST] <BtbN> But you are telling it to use it as video codec. [18:15:07 CEST] <AlienCat> I wanna conver audio [18:15:35 CEST] <BtbN> and are also telling it to create a wav file, which is raw uncompressed pcm [18:17:31 CEST] <Phi> BtbN, on a separate note I'm getting av_log passed "libx264 : profile Constrained Baseline, level 3.1", but output is still High [18:19:43 CEST] <AlienCat> so what should I type? [18:28:13 CEST] <BtbN> depends on what you want. You want a wav file? Encode it with opus? [18:32:51 CEST] <AlienCat> I wanna force input opus [18:33:05 CEST] <AlienCat> then convert it to ogg or something [18:41:26 CEST] <Phi> BtbN, can you demo it for me? [18:41:40 CEST] <Phi> I set to Baseline, and it's set to Constrained Baseline, and the output is High [18:43:41 CEST] <BtbN> ffmpeg -f lavfi -i testsrc2 -c libx264 -profile baseline out.mkv [18:49:26 CEST] <Phi> that works, I'm going to try the RTSP [19:01:03 CEST] <BtbN> there is nothing left of the input container/codec, once it reaches libx264 [19:01:37 CEST] <JEEB> other than timestamps :P [19:08:44 CEST] <Phi> one can only hope [19:08:53 CEST] <Phi> I still have a dopey system [19:09:08 CEST] <jpsharp> I need a suggestion on how to get ffmpeg to convert a single frame (but occasionally changing) gif into an rtmp stream. I can get a static stream going, but it never recognizes the new gif if I change it out. And if I kill ffmpeg and start a new stream with a new gif, the far end clients freak out. [19:09:18 CEST] <Phi> the RTSP seems to work, although I'm getting a shedload of "Past duration 0.(some number) too large" [19:09:58 CEST] <jpsharp> Are you streaming a camera Phi? [19:10:54 CEST] <Phi> a network one, I'm just outputting to a MP4 [19:11:48 CEST] <Phi> I set the profile to Baseline via options passed to avcodec_open2, if I read back x264's internal codec it's Constrained Baseline, and the resulting file is High [19:11:53 CEST] <Phi> so it makes no sense [19:14:03 CEST] <Phi> av_log shows "libx264 : profile Constrained Baseline, level 3.1" [19:14:09 CEST] <Phi> output file is *still* High [19:14:19 CEST] <bencoh> Phi: unless you're passing options to x264 *after* setting profile [19:14:58 CEST] <bencoh> profile/level should be set last [19:15:19 CEST] <bencoh> (since it's a constraint) [19:16:26 CEST] <Phi> I'll double-check, but I don't think so [19:17:29 CEST] <Phi> hm, I do avcodec_get_context_defaults3, then I set the profile [19:17:38 CEST] <Phi> then I do avcodec_open2 [19:18:14 CEST] <Phi> I'll drop the defualts call and see if it works [19:23:38 CEST] <Phi> nope, same [19:23:58 CEST] <Phi> I set it to baseline (not constrained baseline), libx264 log shows constrained baseline, output file is high [19:25:35 CEST] <BtbN> are you looking at the right output file? Are you sure you are writing anything? [19:25:37 CEST] <Phi> makes me want to headbutt the wall [19:25:45 CEST] <BtbN> does it work with ffmpeg cli? [19:25:47 CEST] <Phi> it's a new filename every time, incrementing based on existing files [19:25:58 CEST] <bencoh> try setting profile after _open() ? [19:25:59 CEST] <Phi> commandline works, yeah [19:26:16 CEST] <BtbN> after avcodec_open2, it won't have any effect [19:26:22 CEST] <bencoh> (not sure it which order those should be called tbh) [19:26:27 CEST] <bencoh> ah nvm then [19:26:33 CEST] <Phi> I'll try it anyway, won't kill me [19:26:45 CEST] <BtbN> they are only passed to libx264 during init [19:26:53 CEST] <bencoh> right [19:30:14 CEST] <Phi> you guys know how to use avformatcontext? [19:32:17 CEST] <Phi> yeah, no difference [19:39:22 CEST] <Phi> avio_open2, then avformat_new_stream, right? [19:45:30 CEST] <Pet0r> hi - I'm trying to encode an input file with the hevc_nvenc encoder, it seems to work with any -preset option just fine, but if I try to actually use "lossless" or "losslesshp", I get "[hevc_nvenc @ 0000023098f10780] No NVENC capable devices found" [19:45:42 CEST] <Pet0r> any other presets work fine and are certainly HW accelerated [19:52:27 CEST] <AlienCat> ffmpeg -f -acodec libopus -i msg.amr glass.ogg [19:52:43 CEST] <AlienCat> still complains aboput mp3 [19:54:47 CEST] <Pet0r> never mind ,eventually found the answer to my own question - lossless is Pascal only and I'm on Maxwell [20:13:56 CEST] <Phi> and on my end... the profile is still too damn High [20:25:55 CEST] <Phi> this is such a trippy program [20:26:16 CEST] <Phi> BtbN, whyyy [20:29:12 CEST] <furq> have you disgraced any altars recently [20:31:19 CEST] <Phi> ...maybe [20:31:46 CEST] <Phi> I've just noticed "writing application" is Lavf56.1.0 in my program, but from ffmpeg it's libx264 [20:31:56 CEST] <Phi> (in metadata in the mp4s) [20:32:20 CEST] <Phi> so... even though libx264 is writing to av_log... it's not being used? [20:37:46 CEST] <HorikawaOtane> Have a mild question. [20:38:00 CEST] <HorikawaOtane> How would one go about selecting the gpu for scale_npp? [20:40:19 CEST] <BtbN> it uses the one of the context it gets passed. In itself it doesn't have any context creation logic. [20:42:49 CEST] <HorikawaOtane> i see [20:42:55 CEST] <HorikawaOtane> so how would one create a context for it? [20:43:06 CEST] <HorikawaOtane> is there some global variable i need to pass in or something? [20:43:11 CEST] <HorikawaOtane> like GPU=1 ffmpeg <stuff> [20:43:54 CEST] <BtbN> Either cuvid, hwupload_cuda or ffmpeg_cuvid.c does it. [20:44:13 CEST] <BtbN> They all have their own options for device selection [20:46:12 CEST] <AlienCat> okay I think I found my problem [20:46:23 CEST] <AlienCat> there are no opus demuxer [21:00:33 CEST] <Phi> BtbN, I set the codec to libx264, but the output file looks like it's produced by "Lavf56.1.0" [21:01:07 CEST] <BtbN> so? lavformat is what creates the output file. [21:02:31 CEST] <Phi> ffmpeg produces one that says libx264 [21:03:04 CEST] <Phi> ...no, not quite [21:03:12 CEST] <Phi> I have vastly different output data for them [21:03:25 CEST] <furq> i was going to say, it shouldn't [21:03:30 CEST] <furq> the writing application is supposed to be the muxer [21:03:33 CEST] <furq> which is libavformat [21:03:47 CEST] <furq> if you wrote it with mkvmerge it'd say mkvmerge [21:04:22 CEST] <Phi> http://pastie.org/private/la1exrsqbws16tf56a7csa is the faulty one made by my app [21:04:54 CEST] <Phi> http://pastie.org/private/eof0iwihqsynnzuvis7fua is the ffmpeg one [21:05:16 CEST] <Phi> my one doesn't even say the writing library [21:06:55 CEST] <furq> it does [21:07:14 CEST] <furq> it says a different version of lavf for some undoubtedly fun reason [21:07:38 CEST] <furq> it's missing the encoding settings though [21:07:54 CEST] <furq> i thought that was something libx264 dealt with internally [21:07:58 CEST] <HorikawaOtane> So - another question [21:08:10 CEST] <HorikawaOtane> Is there any particular reason to use nvresize vs scale_npp? [21:15:33 CEST] <Phi> furq: it says the writing application, not the writing library :( [21:15:52 CEST] <furq> oh right [21:16:17 CEST] <BtbN> nvresize? [21:16:57 CEST] <HorikawaOtane> yeah [21:17:18 CEST] <BtbN> Is that some external application? [21:17:19 CEST] <HorikawaOtane> nvresize is an ffmpeg patch by nvidia - https://developer.nvidia.com/ffmpeg [21:17:24 CEST] <BtbN> Oh, that. [21:17:38 CEST] <BtbN> Well, you need to patch ffmpeg with an incredibly messy external patch set. [21:17:50 CEST] <BtbN> Which I doubt still applies. [21:17:53 CEST] <HorikawaOtane> oh i guess the key with nvresize is that you can also export to multiple resolutions simultaneously [21:17:57 CEST] <HorikawaOtane> and nah, it doesn't patch cleanly now [21:18:25 CEST] <HorikawaOtane> but nvresize also doesn't seem to allow you to set your scaling method... [21:18:38 CEST] <HorikawaOtane> whereas scale_npp accepts interp_algo [21:19:45 CEST] <Phi> hmm [21:20:20 CEST] <Phi> I want to test by someone else writing an app [21:20:26 CEST] <Phi> but that'll take ages [21:22:17 CEST] <BtbN> nvresize is a pre-compiled cuda kernel which does the scaling with exactly one algorithm. [21:22:34 CEST] <BtbN> No idea what Algorithm it even is [21:22:39 CEST] <BtbN> Something simple I'd guess [21:27:05 CEST] <Phi> sempaiii [00:00:00 CEST] --- Sun Oct 23 2016
participants (1)
-
burek