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

burek burek021 at gmail.com
Sun May 27 03:05:01 EEST 2018


[00:17:50 CEST] <wfbarksdale> attempting to load buffers manually into an AVFrame but the encoder spits out the error: [libx264 @ 0x102807400] Input picture width (848) is greater than stride (448)
[00:19:46 CEST] <the_k> Liquid - Sweet Harmony -- https://www.youtube.com/watch?v=RW4YfSxBeAw
[00:19:57 CEST] <wfbarksdale> https://pastebin.com/Udy2DjPr
[00:20:56 CEST] <wfbarksdale> pseudocode of how i'm loading the frame
[00:21:55 CEST] <wfbarksdale> seems like setting the pixel format should be enough for ffmpeg to know how to handle the buffer, but its over, striding on the UV components
[00:28:26 CEST] <wfbarksdale> found my goof
[00:28:46 CEST] <wfbarksdale> soory soory
[01:13:18 CEST] <Cracki> damn... moving from h.264 to h.265 is a real shocker in terms of file size
[01:13:32 CEST] <Cracki> I just wish people would use vpx and av1 more
[01:25:45 CEST] <furq> well av1 isn't finished yet so i'm glad nobody is using it
[01:40:37 CEST] <Cracki> heh
[01:41:14 CEST] <Cracki> I'm sure they're already thinking about fixed function hardware to accelerate encoding and decoding that's sure to be useful
[01:44:54 CEST] <Cracki> hmmm mainconcept has an office in my town. maybe I should pay them a visit
[01:46:10 CEST] <Cracki> lol they're advertising for a "sales allrounder / janitor"
[01:46:22 CEST] <furq> nice
[01:48:31 CEST] <furq> oh hey it looks like they finally froze the bitstream
[01:50:16 CEST] <Cracki> wtf their job vacancy reads like they have ONE employee in aachen, who's nothing but a "traveling" salesman
[01:50:47 CEST] <Cracki> nvm, 14-strong team, they claim
[01:51:15 CEST] <Lin-Buo-Ren> Hello, I would like to inform you that I am unable to shallow-clone the source repository with the "fatal: protocol error: bad pack header" error message
[01:58:21 CEST] <leinne_> Lin-Buo-Ren: try from git.videolan.org
[01:59:09 CEST] <Lin-Buo-Ren> leinne: That's working, the github mirror also works
[02:21:37 CEST] <nicolas17> when I use ffplay, it disables desktop compositing until it quits
[02:21:41 CEST] <nicolas17> how do I make it not do that?
[02:21:51 CEST] <furq> use something that isn't ffplay
[02:22:12 CEST] <nicolas17> ...there is no option for it?
[02:22:38 CEST] <furq> it's an issue with sdl
[02:23:41 CEST] <furq> you might be able to block it from disabling compoeition in your window manager, but there's nothing in ffplay itself
[02:23:44 CEST] <furq> s
[02:26:32 CEST] <nicolas17> I'm reviewing short video segments and VLC stutters badly for the first second or so :/
[02:28:33 CEST] <furq> use mpv
[02:29:57 CEST] <nicolas17> wow that works great
[02:30:21 CEST] <nicolas17> there's even negligible delay between one file and the next
[04:38:27 CEST] <johnnny22> I wonder where ffprobe gets the start_pts for fmp4 files. I get different value on a single file when comparing to MP4Box. The value from MP4Box should be the right value, but could there be a another place where a PTS might be obtained that ffprobe uses ?
[04:40:37 CEST] <johnnny22> The stream wasn't encoded with ffmpeg to my knowledge, but is being used then by ffmpeg, so I'm trying to see  if i can help the demystify what the other encoder might be doing wrong.
[04:41:02 CEST] <johnnny22> Or maybe ffmpeg needs it adjusted, but that just feel like a long process :)
[04:41:45 CEST] <johnnny22> I'll probably try to create a ticket though
[05:28:28 CEST] <johnnny22> I guess it's all done in the mov.c
[06:10:06 CEST] <Nosomy> Someone have examples of eval AF of ffmpeg?
[06:11:29 CEST] <furq> https://ffmpeg.org/ffmpeg-filters.html#Examples-32
[06:11:30 CEST] <furq> you mean this
[06:11:56 CEST] <Nosomy> thanks
[06:12:19 CEST] <Nosomy> I don't why google are too bad todays.
[10:21:10 CEST] <acresearch> people, have a .mkv video file, and i just to remove 1 minute from it between times 24:31 and 25:31    i do not need any re-encoding or video or audio nor anything else, just cutting out that segment. is this possible with ffmpeg? i would appriciate your help
[10:40:28 CEST] <acresearch> i tried this command ffmpeg -i input.mkv -ss 00:24:39 -to 00:25:10 -c copy output.mkv    but it extracts and generates a new file with the section i want removed (i want to do the opposite - regenerate the whole video WITHOUT this section)
[12:07:48 CEST] <ChocolateArmpits> acresearch, either cut two parts you want to remain and then concatenate them or create a concat file with two entries of the same file each having different start and end times defined
[12:08:58 CEST] <acresearch> ChocolateArmpits: i see, but there is no way to cutout a part?
[12:09:28 CEST] <ChocolateArmpits> without re-encoding nope
[12:10:13 CEST] <ChocolateArmpits> even then you'd have to use a filter which I think is more cumbersome than concatenation
[12:33:38 CEST] <acresearch> ChocolateArmpits: ok, how do i concatunate 4 videos?
[12:36:13 CEST] <acresearch> hmmm my command  ffmpeg -i Podcasting.mkv -ss 00:00:00 -to 00:24:39 -c copy cut1.mkv   is only starting at second 00:00:04 rather than 00:00:00   so i get 4 seconds of audio but not video
[12:38:12 CEST] <ChocolateArmpits> acresearch, you don't have to use -ss 00:00:00 as it'll copy the beginning regardless
[12:38:31 CEST] <ChocolateArmpits> remove that and try again to see if the initial thing gets copied now properly
[12:38:35 CEST] <acresearch> oh ok
[12:38:49 CEST] <acresearch> ok it works
[12:40:11 CEST] <ChocolateArmpits> acresearch, to concatenate videos use this article https://trac.ffmpeg.org/wiki/Concatenate it lists two methods in the first section
[12:40:35 CEST] <ChocolateArmpits> try concat protocol first, though that depends on input file format, not all formats are concateable like that
[12:47:30 CEST] <acresearch> ChocolateArmpits: my command: ffmpeg -f concat -safe 0 -i 1.txt -c copy output.mkv
[12:47:41 CEST] <acresearch> [NULL @ 0x55b2a3f9c9a0] Unable to find a suitable output format for 'output'
[12:47:43 CEST] <acresearch> output: Invalid argument
[12:48:37 CEST] <ChocolateArmpits> acresearch, pastebin the whole commnad output
[12:50:18 CEST] <acresearch> ChocolateArmpits: https://www.hastebin.com/gepeqareqi.pl
[12:51:04 CEST] <ChocolateArmpits> acresearch, hmm what is the 1.txt composed of?
[12:51:13 CEST] <acresearch> file 'cut1.mkv'
[12:51:15 CEST] <acresearch> file 'cut2.mkv'
[12:51:31 CEST] <ChocolateArmpits> the files themselves play back correctly, right?
[12:52:20 CEST] <acresearch> yes
[12:52:46 CEST] <ChocolateArmpits> acresearch, I have no idea, can you maybe try the -i "concat:cut1.mkv|..." thing ?
[12:52:56 CEST] <ChocolateArmpits> though not sure if mkv is supported
[12:54:34 CEST] <acresearch> ChocolateArmpits: did not concatinate, just republished cut1.mkv
[12:58:09 CEST] <ChocolateArmpits> acresearch, I think it should maybe work if you first split to mp4 then try the concatenation procedure
[12:58:25 CEST] <acresearch> ChocolateArmpits: oh so it is not possible with mkv?
[12:58:29 CEST] <ChocolateArmpits> but I geniunely don't know what the error is about
[12:58:38 CEST] <acresearch> oh
[12:58:41 CEST] <ChocolateArmpits> well it should be possible at least with the text file
[13:01:57 CEST] <acresearch> ok it works now with the file method, strange
[13:04:01 CEST] <acresearch> ChocolateArmpits: ok one last thing, my final "cut" command is this: ffmpeg -i Podcasting.mkv -ss 00:53:41 -c copy cut4.mkv     but that causes a 3 second black video screen but audio is available
[13:05:02 CEST] <ChocolateArmpits> acresearch, well that's expected because it will start copying from the first keyframe which may be later than the timestamp
[13:05:15 CEST] <acresearch> ChocolateArmpits: hmmm
[13:05:27 CEST] <ChocolateArmpits> while the audio will be mostly copy-able right from the timestamp
[13:05:45 CEST] <acresearch> ChocolateArmpits: but that did not happen with cut2 and cut3   they worked perfectly
[13:06:08 CEST] <ChocolateArmpits> so maybe you were close to the keyframe
[13:06:19 CEST] <acresearch> hmmm
[13:06:25 CEST] <acresearch> there is no way arround it?
[13:06:44 CEST] <ChocolateArmpits> i don't know of a straightforward way
[13:06:52 CEST] <ChocolateArmpits> there might be but I'm not yet aware
[13:07:10 CEST] <acresearch> ok
[13:07:12 CEST] <ChocolateArmpits> acresearch, you can try maybe using the -ss as an input option
[13:07:27 CEST] <ChocolateArmpits> I think ffmpeg then tries to position itself on keyframes
[13:07:31 CEST] <acresearch> ffmpeg -i Podcasting.mkv -ss 00:53:41 -c copy cut4.mkv        i thought i did
[13:07:39 CEST] <acresearch> am i using it wrong?
[13:07:40 CEST] <ChocolateArmpits> that's used as an output option
[13:07:44 CEST] <ChocolateArmpits> there are two ways to seek
[13:08:11 CEST] <ChocolateArmpits> did you see this article? https://trac.ffmpeg.org/wiki/Seeking
[13:08:47 CEST] <acresearch> ok let me read it
[13:14:09 CEST] <acresearch> thatis really strange, it won't cut at the defined position rather at a different position
[13:14:37 CEST] <acresearch> ffmpeg -ss 00:53:41 -i Podcasting.mkv -c copy cut4.mkv
[13:14:43 CEST] <ChocolateArmpits> well that's where the keyframe is
[13:14:51 CEST] <ChocolateArmpits> how far off is it?
[13:14:58 CEST] <acresearch> 3 seconds
[13:15:09 CEST] <ChocolateArmpits> yeah definitely a keyframe
[13:15:14 CEST] <acresearch> but if i try : ffmpeg -ss 00:56:41 -i Podcasting.mkv -c copy cut4.mkv   i get only a 3 second video
[13:15:44 CEST] <acresearch> so i was lucky the first 3 times?
[13:15:54 CEST] <ChocolateArmpits> why 56 instead of 53?
[13:16:02 CEST] <ChocolateArmpits> it's a different place ?
[13:16:45 CEST] <acresearch> ChocolateArmpits: yes, i am trying to remove parts of the interview i recorded and i have to cut at 56, i tried 53 but it was too early
[13:26:04 CEST] <acresearch> ChocolateArmpits: can't i bypass the keyframe and cut at that spesific timestep?
[13:26:36 CEST] <ChocolateArmpits> acresearch, you'd need to reencode the video
[13:26:42 CEST] <acresearch> ChocolateArmpits: oh
[13:27:06 CEST] <ChocolateArmpits> the timestamp starts with an incomplete gop which can't be rendered properly because a keyframe is missing
[13:27:32 CEST] <acresearch> ChocolateArmpits: why is cutting a video so complicated? it seems  conviluted for something so simple
[13:27:37 CEST] <acresearch> i don't understand
[13:28:13 CEST] <ChocolateArmpits> that's because you have a specific requirement of preserving the initial stream
[13:29:38 CEST] <ChocolateArmpits> If you are finding this hard then it would probably be more sane to use an NLE and cut your video there, on output render at sufficient quality albeit at file size increase.
[13:35:34 CEST] <acresearch> ChocolateArmpits: ok i will search it, thanks so much for helping me :-)
[17:05:16 CEST] <Cork> when reading a stream to a local file, is it possible to set it to always copy it straight off?
[17:11:43 CEST] <styler2go> Hi i am trying to open a video file but i can't figure out which codec/file type it could be. any ideas?
[17:13:15 CEST] <BtbN> You don't need to care about that. ffmpeg will figure it out, if it supports what you have there.
[17:14:53 CEST] <styler2go> Alright
[17:15:19 CEST] <styler2go> what if it can't recognize it?
[17:15:42 CEST] <BtbN> chances are whatever you have there is not even a media file then
[17:15:59 CEST] <JEEB> or you try to post a sample somewhere like here
[17:16:14 CEST] <JEEB> and/or try to figure out more with various tools or google
[17:16:17 CEST] <BtbN> or very broken/proprietary.
[17:16:23 CEST] <JEEB> if it's not supported with FFmpeg
[17:16:46 CEST] <styler2go> it's footage of my security camera and each file ends on .264 so i assume it's h264
[17:17:06 CEST] <BtbN> ffmpeg would support that just fine though
[17:17:21 CEST] <styler2go> upgrade still running.. will try it as soon as upgrade is done
[17:17:47 CEST] <durandal_1707> security camera videos can be anything under sun
[17:19:12 CEST] <JEEB> they can also be packed in very interesting ways
[17:19:39 CEST] <styler2go> https://p.styler2go.de/22781 That's what ffprobe told me
[17:19:55 CEST] <styler2go> so it seeeems to be something liek a 720p20 h264
[17:20:32 CEST] <JEEB> yes, seems so
[17:22:02 CEST] <styler2go> https://p.styler2go.de/4672521 output is just grey screen
[17:22:37 CEST] <styler2go> and, of course, tons of errors: https://p.styler2go.de/6912871
[17:23:12 CEST] <JEEB> has anyone been able to actually decode this video anywhere?
[17:23:32 CEST] <styler2go> i don't know
[17:23:37 CEST] <JEEB> is it actually raw H.264 or something different with that extension and some semi-valid packet-looking data
[17:24:40 CEST] <durandal_1707> look in hex editor for text of that .264 file?
[17:24:52 CEST] <durandal_1707> maybe it have junks
[17:26:59 CEST] <styler2go> https://p.styler2go.de/8034446 does this help in some way?
[18:19:11 CEST] <durandal_1707> styler2go: custom format
[18:21:15 CEST] <styler2go> durandal_1707, no way to watch this file?
[18:26:07 CEST] <durandal_1707> styler2go: grap software of corp that created that camera
[18:26:26 CEST] <styler2go> china camera
[18:28:56 CEST] <Hackerpcs> https://pastebin.com/vvYa2hCM what's the problem with my script and it says no output file specified?
[18:30:13 CEST] <durandal_1707> styler2go: certainly it could be done if you paid someone, or figure out bitstream format yourself
[20:36:08 CEST] <BlueShark> Hi. What's the easiest way to install ffmpeg with https support in Ubuntu 16.04?
[20:38:47 CEST] <JEEB> install gnutls's -dev package
[20:38:53 CEST] <JEEB> then configure with --enable-gnutls
[20:40:58 CEST] <BlueShark> JEEB, not possible to do the entire installation with apt?
[20:41:16 CEST] <BlueShark> "gnutls's -dev package" - what is the name of the package?
[20:41:39 CEST] <JEEB> apt search ".*gnutls.*-dev"
[20:41:52 CEST] <JEEB> and there is a version of FFmpeg in the repos, but that is IIRC 2.8
[20:42:05 CEST] <JEEB> so you are not exactly going to get a lot of support for that here due to its age
[20:43:54 CEST] <BlueShark> JEEB, I cloned the git repo and ran ./configure --enable-gnutls
[20:44:00 CEST] <BlueShark> Then make install - would this work?
[20:44:06 CEST] <JEEB> just run make
[20:44:15 CEST] <JEEB> you can run the ffmpeg.c binary out of the build dir
[20:44:40 CEST] <BlueShark> I'm trying to get youtube-dl working - it's failing because of this https error.
[20:44:43 CEST] <JEEB> also did that regexp actually work with apt search :P
[20:44:47 CEST] <JEEB> umm
[20:44:53 CEST] <JEEB> youtube-dl itself should do TLS
[20:45:03 CEST] <BlueShark> https protocol not found, recompile with openssl, gnutls,
[20:45:03 CEST] <BlueShark> or securetransport enabled.
[20:45:08 CEST] <JEEB> huh
[20:45:14 CEST] <JEEB> that's *weird*
[20:45:19 CEST] <JEEB> unless you're using it with ffmpeg somehow
[20:45:25 CEST] <JEEB> in a way that passes the URL to ffmpeg
[20:45:44 CEST] <JEEB> youtube-dl can download the stuff by itself just fine
[20:46:04 CEST] <BlueShark> JEEB, I believe youtube-dl uses ffmpeg internally for some conversion or something.
[20:46:12 CEST] <JEEB> it should only do remultiplexing
[20:46:14 CEST] <BlueShark> That error, I get when I run `youtube-dl URL`.
[20:46:21 CEST] <JEEB> how old is that youtube-dl?
[20:46:56 CEST] <BlueShark> virtualenv venv; source venv/bin/activate; pip install youtube-dl; youtube-dl URL
[20:46:59 CEST] <BlueShark> that's what I did.
[20:47:07 CEST] <JEEB> youtube-dl --version
[20:47:11 CEST] <JEEB> basically what it does for me with youtube-dl URL is that it downloads the parts, and then call ffmpeg.c
[20:47:18 CEST] <JEEB> it doesn't pass the URL to ffmpeg.c
[20:47:25 CEST] <JEEB> (ffmpeg.c is the command line app in FFmpeg)
[20:47:33 CEST] <BlueShark>   Downloading youtube_dl-2018.5.26-py2.py3-none-any.whl (1.7MB): 1.7MB downloaded
[20:47:58 CEST] <BlueShark> the compiling is going on. i'll run the verson command after this
[20:48:52 CEST] <BlueShark> JEEB, pip install youtube-dl will give you the latest verson right?
[20:49:19 CEST] <BlueShark> ffmpeg version git-2015-05-30-debf4d6 Copyright (c) 2000-2015 the FFmpeg developers
[20:49:23 CEST] <BlueShark> ffmpeg version was this one.
[20:50:31 CEST] <BlueShark> also, i'd like to know why this enable-gnutls is not enabled by default?
[20:52:16 CEST] <JEEB> BlueShark: actually it should be since gnutls doesn't require any extra parameters I think. if the FFmpeg binary was built without gnutls's development stuff around then of course it won't error out unless you specifically note that you wanted it
[20:52:31 CEST] <JEEB> but the standard ubuntu package FFmpeg should have it
[20:52:58 CEST] <BlueShark> JEEB, apt install ffmpeg/
[20:52:58 CEST] <BlueShark> ?
[20:53:24 CEST] <JEEB> https://packages.ubuntu.com/xenial/libavformat-ffmpeg56
[20:53:44 CEST] <JEEB> basically yea, that version in there should have this as a requirement, and it has gnutls as a dep
[20:54:09 CEST] <BlueShark> i wonder if I should stop this compile thingy and try to install it from apt
[20:54:10 CEST] <BlueShark> again.
[20:54:22 CEST] <BlueShark> CC	libavcodec/vp9prob.o
[20:54:22 CEST] <BlueShark> CC	libavcodec/vp9recon.o
[20:54:26 CEST] <BlueShark> stuck here
[20:54:27 CEST] <JEEB> I just hope you don't have random repos or PPAs installed at this point that might be derping you up :P
[20:54:42 CEST] <JEEB> anyways you can cancel the compilation at any point with ctrl+c
[20:55:00 CEST] <BlueShark> or should I let it run to completion? ;p
[20:55:15 CEST] <JEEB> it's a newer one and you can just open another terminal if you want
[20:55:24 CEST] <JEEB> you can tell youtube-dl which ffmpeg.c you want it to use
[20:55:34 CEST] <BlueShark> specifying path?
[20:56:10 CEST] <JEEB> yea, that way you don't have to install it into any global place (although you can in your profile set your custom prefix into PATH)
[20:56:26 CEST] <JEEB> --ffmpeg-location PATH           Location of the ffmpeg/avconv binary
[20:56:33 CEST] <JEEB> so you can pass it like that
[20:56:39 CEST] <BlueShark> JEEB, and what should I specify that path as?
[20:56:57 CEST] <JEEB> the path you're building in + /ffmpeg ?
[20:57:11 CEST] <JEEB> echo "$(pwd)/ffmpeg"
[20:59:41 CEST] <BlueShark> I installed it using apt
[20:59:44 CEST] <BlueShark> and seems to work fine
[20:59:55 CEST] <JEEB> if it works - great
[21:00:53 CEST] <BlueShark> i am not too fond of installing packages from source. mostly because I don't have a clue what's going on. i just run make and make install and wait for a long time and usually it will throw some error along the way, and then it's a ton of googling, installing dependencies, and lot of issues like that :D
[21:35:56 CEST] <blayze> hi all.. where can i get a build of ffmpeg 4.0 with libaom av1 already compiled in for windows
[21:37:00 CEST] Last message repeated 1 time(s).
[21:37:08 CEST] <JEEB> no need to spam. no idea, and do remember that AV1 isn't frozen yet, so even if you can encode/decode it doesn't mean that the next version of libaom will be able to decode what you've encoded
[21:40:03 CEST] <blayze> thanx -smile
[21:44:00 CEST] <shfil> hi, I'm trying to get swresample to working I'm getting error `[SWR @ 0x556b4f2dadc0] Input channel count and layout are unset`
[21:44:22 CEST] <JEEB> I recommend utilizing it through libavfilter since you can feed that AVFrames
[21:45:06 CEST] <JEEB> unless swresample takes those, too
[21:45:08 CEST] <durandal_1707> iirc libswr also have avframes api
[21:45:12 CEST] <JEEB> ok
[21:45:26 CEST] <JEEB> yea, then that might have less overhead, although I think not by much
[21:45:54 CEST] <shfil> just it looks like codecContexct doesn't grab properties of file.
[21:46:16 CEST] <JEEB> that can be dynamic anyways, so you always want to decode an AVFrame before initializing any filtering
[21:46:51 CEST] <JEEB> the AVFrame will then contain various information about the input
[21:47:24 CEST] <JEEB> think of the case where you have a broadcast audio track that in the middle switches from stereo to 5.1
[21:47:27 CEST] <JEEB> and then back
[21:47:34 CEST] <JEEB> AVFrames will have that info
[21:48:27 CEST] <shfil> can you judge what should I change in this code? https://gist.github.com/ShFil119/ebd0cf30632c89aa393913b1abf52594
[21:50:48 CEST] <shfil> (been trying implement as in working examples)
[21:50:50 CEST] <JEEB> after you init the decoder, try doing avcodec_parameters_to_context as well with the created context and the params
[21:51:35 CEST] <JEEB> also yea, don't try to probe from the context's stuff
[21:51:42 CEST] <JEEB> you have to decode an audio frame
[21:51:59 CEST] <JEEB> and see what comes in, and preferably since you're doing resampling you can just do X->stereo
[21:52:16 CEST] <JEEB> and generally you want to keep output sample rate static
[21:52:53 CEST] <JEEB> so just set your output sample rate, channel layout and sample format
[21:53:11 CEST] <JEEB> and otherwise take from the AVFrame
[21:53:43 CEST] <JEEB> yea, it even has the sample rate for audio there in the decoded AVFrame
[21:55:52 CEST] <shfil> about first line just - just call `avcodec_parameters_to_context(codecContext, audioStream->codecpar)` once more?
[21:56:05 CEST] <JEEB> oh I missed it?
[21:56:12 CEST] <JEEB> I didn't notice it in the gist
[21:56:32 CEST] <JEEB> right, because I was ctrl+F'ing "copy" for some reason before looking at the docs
[21:58:41 CEST] <shfil> so it's enough? thx for suggestion about grabbing info from frame
[21:59:04 CEST] <shfil> or setting static setting
[22:01:30 CEST] <JEEB> yea, since you usually know your output "I want it stereo, xx kHz, in this sample format"
[22:03:09 CEST] <JEEB> also look at https://www.ffmpeg.org/doxygen/trunk/swresample_8h.html
[22:03:15 CEST] <JEEB> the part "AVFrame based API"
[22:03:40 CEST] <JEEB> since you most likely want to wait until you get AVFrames out of your decoder to know what's coming, that should be pretty useful
[22:04:07 CEST] <JEEB> esp. since you can (re)configure the SwrContext with them too
[22:14:16 CEST] <shfil> I've changed this way: https://gist.github.com/ShFil119/ebd0cf30632c89aa393913b1abf52594/revisions
[22:15:46 CEST] <shfil> but still doesn't play wav and mp3 sounds like channels alternately
[22:17:20 CEST] <JEEB> also why are you looking for the default channel layout for something that already has a layout? I think that function was meant to take in channel count?
[22:17:55 CEST] <JEEB> (and still, I would really prefer you taking those values from the AVFrame in case those values weren't yet set in the AVCodecContext
[22:19:43 CEST] <shfil> 1) you mean `resampled->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS);` to `resampled->channel_layout = OUTPUT_CHANNELS;`
[22:19:55 CEST] <JEEB> no
[22:20:06 CEST] <JEEB> `av_get_default_channel_layout(codecContext->channel_layout),   // input`
[22:20:07 CEST] <shfil> swr_alloc_set_opts?
[22:20:23 CEST] <JEEB> that kind of looks weird, but I was going to check the doxy
[22:20:33 CEST] <shfil> ah ok.
[22:21:10 CEST] <JEEB> "av_get_default_channel_layout (int nb_channels)"
[22:21:19 CEST] <JEEB> > int nb_channels
[22:21:25 CEST] <shfil> fixed ;)
[22:22:02 CEST] <shfil> 2) setting ops after avcodec_receive_frame
[22:22:03 CEST] <shfil> ?
[22:22:16 CEST] <shfil> *opts
[22:22:19 CEST] <JEEB> yes, you can call the AVFrame api for config
[22:22:35 CEST] <JEEB> I think you can feed it a dummy output AVFrame with the output params set too
[22:22:49 CEST] <JEEB> so it will then (re)configure the swresample context
[22:23:32 CEST] <faLUCE> hello. How can I check if ffmpeg is compiled with networking support?
[22:23:42 CEST] <JEEB> ffmpeg -protocols
[22:25:33 CEST] <JEEB> also this is output at the end of the configure script when you build FFmpeg
[22:28:45 CEST] <faLUCE> ok
[22:38:18 CEST] <shfil> sample_fmt has to be also set for swrContext?
[22:38:31 CEST] <JEEB> most likely
[22:38:37 CEST] <JEEB> at least hte output one
[22:38:50 CEST] <JEEB> that should also get configured by the AVFrame API though I think?
[22:39:05 CEST] <JEEB> you decode a frame of audio, that has a sample_fmt
[22:48:55 CEST] <shfil> weird with these changes, no sound :(
[22:48:57 CEST] <shfil> https://gist.github.com/ShFil119/ebd0cf30632c89aa393913b1abf52594/revisions
[22:49:03 CEST] <faLUCE> ciao rcdilorenzo ;-)
[22:50:10 CEST] <JEEB> yea not sure if that API is avopt based...
[22:50:26 CEST] <JEEB> and you were already using swr_config_frame
[22:50:33 CEST] <JEEB> which takes in AVFrames
[22:51:32 CEST] <d-safinaskar> i trying to write C code, which converts sequence of RGB frames into YUV4MPEG2 video
[22:51:47 CEST] <d-safinaskar> just as a excersize
[22:52:00 CEST] <d-safinaskar> so the program not nessesary should be production quality
[22:52:26 CEST] <d-safinaskar> so i don't care about gamma translation
[22:52:34 CEST] <d-safinaskar> about linear vs non-linear rgb
[22:53:07 CEST] <d-safinaskar> i just need red to look similar to red (not-nessesary exact red, something similar to red will go)
[22:53:11 CEST] <shfil> JEEB when using also only swr_config_frame also no sound.
[22:53:15 CEST] <d-safinaskar> green look similar to green etc
[22:53:21 CEST] <d-safinaskar> so, how to do this?
[22:53:51 CEST] <d-safinaskar> of course, the most important place is actual converting rgb into YCbCr
[22:53:59 CEST] <d-safinaskar> what formula i should use?
[22:54:14 CEST] <JEEB> shfil: for the reference I have no idea if you need to initial-configure swresample and I kind of have no idea how your values were set. I've only done resampling with avfilter myself (which then utilizes swresample in the background)
[22:54:22 CEST] <d-safinaskar> in this particular case, i. e. rgb (for example, ppm) to yuv4mpeg2
[22:54:25 CEST] <JEEB> although in theory since swresample has that nice AVFrame API
[22:54:35 CEST] <JEEB> so you should be capable of doing things
[22:54:51 CEST] <d-safinaskar> i tried this formula: https://stackoverflow.com/a/7086872 , but it converts white into green :(
[22:55:23 CEST] <JEEB> d-safinaskar: libavfilter can handle that for you with either the scale filter (good for basic stuff), or zimg filter (for various very specifics) - most likely you will have the first one and not the second one built in so go with the scale filter
[22:55:30 CEST] <JEEB> then you get raw AVFrames with that
[22:55:58 CEST] <JEEB> and I'm actually not 100% sure what's the correct way to then pass those to the y4m muxer since that then wants AVPackets
[22:56:21 CEST] <JEEB> for examples there are various examples under doc/examples
[22:56:35 CEST] <JEEB> additionally googling with "site:ffmpeg.org doxygen trunk KEYWORD" is generally useful
[22:56:42 CEST] <JEEB> since that should bring up related documentation
[22:56:54 CEST] <JEEB> (always start with the "trunk" [master] documentation)
[23:01:22 CEST] <d-safinaskar> JEEB: so, you recommend using libavfilter?
[23:01:29 CEST] <d-safinaskar> JEEB: you didn't understand me
[23:01:41 CEST] <d-safinaskar> JEEB: i want to write C code from stratch without any libs
[23:01:50 CEST] <d-safinaskar> JEEB: think about this as an excersize
[23:01:54 CEST] <JEEB> and you came to #ffmpeg for that?
[23:02:07 CEST] <JEEB> of course you are going to get things on how to do that with the FFmpeg APIs
[23:02:12 CEST] <d-safinaskar> JEEB: i think here are people good at computer graphics
[23:02:14 CEST] <JEEB> you can of course NIH all you want
[23:02:22 CEST] <d-safinaskar> JEEB: what channel i should use instead?
[23:03:13 CEST] <JEEB> if you really want to write it yourself, you could start looking at all the alternative colorspaces/primaries/transfer functions etc in zimg or libplacebo
[23:03:36 CEST] <JEEB> those generally I think have the values from the specs
[23:04:14 CEST] <JEEB> of course you could just hard-code "this crap produces" BT.709/BT.709/gamma
[23:04:28 CEST] <JEEB> (move end of the quote at the end)
[23:41:26 CEST] <shfil> is it possible that codecContext and frame doesn't contain information about nr of channels and layout? if I set input as mono with one channel it produces weird sound but works
[23:42:49 CEST] <JEEB> if you actually get a frame decoded it most definitely should have
[23:44:11 CEST] <JEEB> https://www.ffmpeg.org/doxygen/trunk/group__lavc__encdec.html
[23:44:18 CEST] <JEEB> overview of the dec/enc api
[23:51:01 CEST] <shfil> with mp3(stereo) ok, but with mono wav looks like layout is uninitialized.
[23:51:23 CEST] <JEEB> right, I think there was a value which said "unknown" and then you could use the "get default" thing
[23:52:41 CEST] <JEEB> seems like zarro is such a value
[23:53:57 CEST] <JEEB> so if zero, get default layout for that amount of channels
[23:54:03 CEST] <JEEB> (and possibly warn in your logging)
[23:59:24 CEST] <shfil> yes, I have all sounds now, maybe do know why two channels are mixed into one and played much faster?
[00:00:00 CEST] --- Sun May 27 2018


More information about the Ffmpeg-devel-irc mailing list