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

burek burek021 at gmail.com
Fri Jan 19 03:05:01 EET 2018


[00:00:52 CET] <fdemo> after reading, a little understood. but!!
[00:01:00 CET] <fdemo> if the values are set: enc_ctx.time_base.num = 417083, enc_ctx.time_base.den = 10000000, then call avcodec_open2 will get fail. And if values num=1001, den=24000 - then success.
[00:02:02 CET] <fdemo> and 10 000 000 / 416 083 = 23.97 , and 24000 / 1001 = 23.97
[00:04:57 CET] <aokfire> thanks again, bye for now :)
[00:19:47 CET] <iive> fdemo, my calculator says that the first one is 24.03366636
[00:36:19 CET] <b0bby__> hello
[00:36:55 CET] <b0bby__> im compiling the encoder.c example and I'm getting the error /tmp/ccdB8W8F.o: In function `encode':
[00:36:56 CET] <b0bby__> t.c:(.text+0x7e): undefined reference to `avcodec_send_frame'
[00:36:56 CET] <b0bby__> t.c:(.text+0xcb): undefined reference to `avcodec_receive_packet'
[00:36:56 CET] <b0bby__> t.c:(.text+0x29c): undefined reference to `av_packet_alloc'
[00:36:56 CET] <b0bby__> t.c:(.text+0x7b8): undefined reference to `av_packet_free'
[00:38:01 CET] <b0bby__> how do I fix this?
[00:47:01 CET] <JEEB> b0bby__: use pkg-config pointed towards your FFmpeg installation prefix
[00:47:09 CET] <JEEB> `pkg-config --libs libavcodec`
[00:47:30 CET] <JEEB> (use PKG_CONFIG_PATH=/my/custom/ffmpeg/prefix/lib/pkgconfig if you used a custom prefix)
[00:49:05 CET] <b0bby__> i got -lavcodec-ffmpeg when I ran pkg-config --libs libavcodec
[00:49:30 CET] <b0bby__> JEEB:
[00:49:41 CET] <JEEB> yea, you use it (pkg-config) when linking your code
[00:49:48 CET] <JEEB> $(pkg-config --libs libavcodec)
[00:49:50 CET] <JEEB> for example
[00:50:14 CET] <JEEB> that puts -lxxx and possibly -Lxxx into your build command line
[00:50:32 CET] <JEEB> if that is the wrong FFmpeg, then use PKG_CONFIG_PATH to tell pkg-config where to look as I noted before
[00:50:34 CET] <b0bby__> JEEB: I get warning: implicit declaration of function avcodec_send_frame
[00:50:46 CET] <JEEB> then that is not the FFmpeg you built and installed
[00:50:59 CET] <JEEB> use PKG_CONFIG_PATH to point it to your prefix
[00:51:06 CET] <JEEB> (/lib/pkgconfig under your prefix)
[00:51:33 CET] <JEEB> for example I install FFmpeg to /home/user/ownapps, and thus it's PKG_CONFIG_PATH=/home/user/ownapps/lib/pkgconfig
[00:51:39 CET] <b0bby__> I'm trying to compile an example(encode.c) what should I put in to compile it?
[00:52:23 CET] <JEEB> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/README;h=c1ce619d350d66950c7b5ebb5f2016c36cc1024f;hb=HEAD
[00:52:27 CET] <JEEB> :P
[00:52:28 CET] <JEEB> there's a README
[08:43:35 CET] <kiranbsravi> I am using FFMpeg libavformat library to generate a webm file from RTP video and audio streams. Video - vp8 encoded and audio - opus encoded. I will have RTP timestamps for both the streams and NTP timestamps for the corresponding RTP packets from the RTCP. Now how do I set PTS and DTS of AVPacket with these values ?  And, do I need to set any other extra values (like duration, etc) for AVPacket in order to sync the streams and 
[11:17:22 CET] <Kristy> Hi everyone, i have a little question on ffmpeg. Is that possible to directly input a webpage or not? I don't know if any plugin exist to do this kind of stuff, i try to use phantomJS and pipe his output to ffmpeg, but i'm having some issue on quality and on web browser behaviour
[11:18:00 CET] <sfan5> ffmpeg can't read HTML, no
[11:21:11 CET] <BtbN> How would you even "input a webpage"?
[11:21:24 CET] <BtbN> You can stream video from an http server, if that's what you're asking.
[11:25:39 CET] <Kristy> thanks for answer. Well i want to input a webpage because the target is to stream a webpage with dynamic content on facebook, with react counter for example
[11:25:53 CET] <BtbN> Screep-Capture a Browser?
[11:25:53 CET] <jya> is there a way to retrieve the channel layout of a particular file ?
[11:26:29 CET] <Kristy> and the pb is if i'm using a stremaing software like OBS or Xsplit, i must use a desktop, and i'm trying to find a more stable/professional solution, because i'm having issue with cloud desktop and streaming :(
[11:26:57 CET] <jya> Kristy: I think you need to rephrase either your question or your problem, as it is, it doesn't make much sense
[11:27:11 CET] <Kristy> @btbn > that's what i tried with phantomJS, but as i said , i'm having some compatiblity issue, i know it's not due to ffmpeg, but i'm seeking a way to do this :(
[11:27:26 CET] <BtbN> Use OBS
[11:29:26 CET] <Kristy> that is what i was thinking, i need to use OBS, and make this all work on a cloud desktop, thanks for answers :)
[11:54:58 CET] <friki_> Hi, i'm trying to stream a screencast via UDP (from ffmpeg to ffplay, on localhost) . After testing all udp params ( https://ffmpeg.org/ffmpeg-protocols.html#udp ) I still get lot of artifacts on the player
[12:06:01 CET] <relaxed> friki_: pastebin your command
[12:08:37 CET] <friki_> ffmpeg -loglevel info -threads 1 -f x11grab -video_size 1920x1080 -framerate 50 -draw_mouse 0 -i :0.0+0,0 -an -vcodec libx264 -pix_fmt yuv420p -preset fast -crf 0 -f mpegts tcp://127.0.0.1:2000
[12:09:03 CET] <friki_> and: ffplay -i tcp://127.0.0.1:2000
[12:40:30 CET] <esc-reality> I've submitted a bug report 11 days ago, https://trac.ffmpeg.org/ticket/6949. How do I know when any of the devs is looking into this?
[13:05:02 CET] <durandal_1707> esc-reality: by paying them to work on it
[14:21:21 CET] <luneff> hey guys! I'm trying to make a fullscreen desktop recording with ffmpeg. And I seem to get frames where top half is new, and the bottom half isn't updated yet, so I get some sort of a scanline. How do I get rid of that on X11?
[14:23:21 CET] <sfan5> that's tearing
[14:23:34 CET] <sfan5> do you only get that in the recording or on display too?
[14:25:29 CET] <luneff> hard to see by the eye :-) especially, on 144 Hz
[14:29:47 CET] <luneff> on 60 Hz it is there as well :-(
[14:37:14 CET] <luneff> ok, trying to first tweak the nvidia driver side (http://www.thelinuxrain.com/articles/got-tearing-with-proprietary-nvidia-try-this)
[14:37:31 CET] <debianuser> luneff: Do you by chance use any compositors? E.g. compton has a know issue about that: https://github.com/chjj/compton/issues/381 which looks like this: https://youtu.be/q9m_m74mnhA while killing compton fixes the recording.
[14:41:16 CET] <luneff> debianuser, thanks! I've run across this post too and thus trying to tweak the NVidia side. The host is ElementaryOS, not sure about compositor used
[14:45:12 CET] <debianuser> luneff: By the way, do you actually see that "scanline" on screen while recording? Or does it only appear when you play the recorded file? And if it only appears during playback - can you pause the playback and still see it? Or is it only visible during playback and disappears when you pause the video?
[14:45:34 CET] <debianuser> (depending on the answer to those questions that could be 3 different problems)
[14:45:39 CET] <luneff> debianuser, it looks like the scanline appears on the recording only
[14:46:27 CET] <debianuser> luneff: Can you still see the "scanline" if you pause the video playback?
[14:46:51 CET] <esc-reality> durandal_1707: Really?..
[14:46:57 CET] <luneff> debianuser, I check by splitting the video by frames and looking into them. I have frames with scanlines that way
[14:47:22 CET] <luneff> about 2-5% of them
[14:48:45 CET] <debianuser> luneff: Can you upload a small video fragment captured with ffmpeg to some hosting? (sendspace.com, youtube, or any other hosting you like)
[14:49:35 CET] <sfan5> just use uguu.se, it's the least complicated and won't mess with your video file
[14:50:00 CET] <friki_> relaxed: [ffmpeg, udp "server"] http://paste.debian.net/hidden/47e0bd6c/  and [ffplay, udp "client"] http://paste.debian.net/hidden/f7c4943f/
[14:51:02 CET] <luneff> debianuser, just a sec
[14:53:15 CET] <friki_> In "server" side, there are lot errors like: "Past duration 0.954536 too large". It seems to ocurr only when the desktop is not moving.
[14:54:06 CET] <friki_> At "client" side, there are more interesting errors, i think. "[h264 @ 0x7f77eca3daa0] Invalid NAL unit 8, skipping.", "[h264 @ 0x7f77eda1ff60] error while decoding MB 56 2, bytestream -5", ...
[14:56:11 CET] <friki_> Streaming over tcp seems to fix the problem, even at localhost
[15:02:52 CET] <debianuser> recording tearing test is easy: open `xterm`, run `ffmpeg -f x11grab -r 15 -s 1280x1024 -i :0 -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -t 10 out.flv` (replace "1280x1024" with your screen resolution), and move that xterm window around for 10 seconds while ffmpeg is recording it, then play "out.flv" and see half of xterm window moving while the other half had not moved yet... except...
[15:02:58 CET] <debianuser> except... I don't have tearing with this test (nvidia, tested with xcompmgr running and without it).
[15:09:55 CET] <luneff> debianuser, here's the video https://yadi.sk/i/5-nCb3IS3Ra2XA here's an example of tearing observed: https://yadi.sk/i/KW1DS5kh3Ra2hG
[15:12:13 CET] <luneff> line is ffmpeg -y -video_size 300x300 -framerate 144 -f x11grab -i :0.0+1730,363 -c:v libx264 -crf 0 -preset ultrafast -t 11 tearing-issue.mkv
[15:12:13 CET] <luneff> ffmpeg -y -i tearing-issue.mkv -c:v libx264 -crf 0 -preset veryslow tearing-issue-compressed.mkv
[15:12:13 CET] <luneff> ffmpeg -y -i tearing-issue-compressed.mkv -c copy tearing-issue.mp4
[15:12:20 CET] <sfan5> I don't see any tearing in that video file
[15:17:12 CET] <luneff> maybe, vlcsnap and cv2 from python introduce tearing when splitting the video into frames? not sure
[15:20:13 CET] <sfan5> that sounds unlikely
[15:22:46 CET] <debianuser> luneff: Yes, I can see what you're calling "tearing" here (e.g. frame ~77 of your tearing-issue.mp4), but it'
[15:23:35 CET] <debianuser> but it's hard to tell if that's ffmpeg introducing it, or maybe that's the "Figure 2" application drawing each image line by line and ffmpeg just happened to capture it while only half of the image was updated.
[15:24:18 CET] <luneff> I've observed the same scanline over several apps at once, that's just a part of the screen
[15:24:50 CET] <luneff> thought about same first, until watched a GTK window behaving the same under ffmpeg recording
[15:28:42 CET] <debianuser> That's why I suggested to move the window around. :) That'd make sure it's either xorg/compositor/driver or ffmpeg to blame, but not the app.
[15:30:35 CET] <luneff> there is tearing when the window's moving
[15:31:24 CET] <luneff> but it is seen only in the recorded video
[15:33:21 CET] <debianuser> can you see the tearing if you pause the video on individual frames?
[15:34:30 CET] <luneff> that second link was a vlcsnap that included the tearing, right?
[15:37:01 CET] <sfan5> ah there it is
[15:37:41 CET] <debianuser> luneff: I mean can you see the "moving window" tearing if you pause the video on individual frames?
[15:39:00 CET] <sfan5> hard to notice this during playback, but frame 76 does have tearing https://a.uguu.se/zDQfApGesIru.png
[15:49:02 CET] <luneff> debianuser, it is lkounios experimenting with the setup :-)
[15:49:56 CET] <lkounios> Hey, guys. :-) I have the issue that luneff has been describing - screen tearing during recording.
[15:51:14 CET] <lkounios> I've recorded a video using ffmpeg -f x11grab -r 144 -s 2560x1440 -i :0 -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -t 3 out.flv. I'm moving around a window and I can only see the tearing in the video.
[15:53:09 CET] <debianuser> lkounios: There could be multiple origins for the capture tearing. It could be you actually have screen tearing visible on your screen, and ffmpeg just captures it. Or it could be ffmpeg introduces the screen tearing that wasn't there originally. And finally it could be that ffmpeg captures it without tearing, but your video player tears the video.
[15:53:21 CET] <debianuser> lkounios: If you see a tearing while moving a window, can you only see it while video is playing, or do you also see it if you pause the video?
[15:54:12 CET] <debianuser> lkounios: Or maybe you can upload that out.flv video somewhere? (uguu.se, sendspace.com, youtube, or any other hosting you like)
[15:59:14 CET] <lkounios> debianuser, Thanks for the help! I've uploaded the video here: https://a.uguu.se/cJgFu1PW6eFb_out.flv
[15:59:43 CET] <lkounios> I have also "disassembled" the video into frames using ffmpeg -i out.flv -f image2 ./frames/image-%07d.png and confirmed that I can see the tearing in the individual .png files.
[15:59:55 CET] <Fyr> guys, does -itsoffset just modify timestamps of the video, keeping audio tracks intact?
[16:00:12 CET] <Fyr> or it can change also audio track timestamps?
[16:00:27 CET] <lkounios> Anecdotally, I do not see tearing on my screen when moving the window around. I never noticed tearing during day-to-day use either.
[16:04:55 CET] <alexpigment> lkounious: i can see those problems on my end. oddly, i ran across a very similar issue with the AMD AMF encoder recently, and it was a problem with the driver
[16:05:06 CET] <alexpigment> obviously you're using x264, so that's different
[16:05:25 CET] <alexpigment> but lemme see if I can find the details on what the cause was (in case there's a relevant setting to enable)
[16:05:53 CET] <lkounios> alexpigment, That'd be great, thank you!
[16:07:54 CET] <alexpigment> "PPS from extradata returned from AMD runtime dont match SPS/PPS from the stream. The flag is deblocking_filter_control_present is not set to 1 in PPS from extradata. So depending on player and container if extradata is used the decoders go nuts. Some players inject SPS/PPS from extrarata right before IDR NAL unit, after SPS/PPS from stream or just ignore them"
[16:08:29 CET] <alexpigment> so it could be related to the deblocking filter or the SPS/PPS...
[16:08:40 CET] <alexpigment> lemme look at the stream properties
[16:09:40 CET] <alexpigment> your video has deblock on 0:0:0; not sure if that's relevant
[16:10:32 CET] <alexpigment> out of curiosity, are you trying to capture at 144fps?
[16:10:55 CET] <alexpigment> or are you just doing that because it's the native framerate?
[16:12:16 CET] <lkounios> alexpigment, Ideally we want to record at 144fps, but we also observed tearing at 60fps.
[16:13:02 CET] <lkounios> alexpigment, I've tried both recording at 60fps with the monitor set to 144Hz and recording at 60fps with the monitor set to 60Hz. Same issue.
[16:13:45 CET] <alexpigment> what happens if you record at -preset veryfast ?
[16:14:14 CET] <alexpigment> i mean i know you're trying to keep your encoding overhead down, but it may be worth just testing it
[16:14:36 CET] <alexpigment> obviously, that changes a lot of things (turns cabac on, turns deblock on, etc etc)
[16:15:13 CET] <alexpigment> but it's often easier to find a working scenario and keep disabling things until you find the key factor
[16:17:34 CET] <lkounios> alexpigment, Changing the preset to veryfast yields the same results unfortunately.
[16:17:39 CET] <alexpigment> ok
[16:17:53 CET] <alexpigment> also, i'm guessing your player is using your GPU to decode
[16:18:32 CET] <alexpigment> if you play in a player like mpv (which defaults to CPU decoding I believe), the issue goes away, right?
[16:19:12 CET] <lkounios> I've used ffmpeg to split the video into frames and can see the tearing in the individual images. Is GPU acceleration in the media player still relevant in this case?
[16:19:36 CET] <alexpigment> hmmm
[16:19:47 CET] <alexpigment> not sure. i played it in mpv and it plays fine over here
[16:19:55 CET] <alexpigment> it's just broken in WMP and VLC on my end
[16:20:18 CET] <lkounios> Interesting! Let me see if I can reproduce on my end.
[16:21:11 CET] <alexpigment> also, Kodi is unaffected
[16:21:37 CET] <alexpigment> that's not to say that there's not a problem with the video - just that some players are able to deal with that issue
[16:23:45 CET] <luneff> interesting. so what's best to split such video to separate frames?
[16:25:18 CET] <lkounios> alexpigment, Issue exists in mpv for me. Are you positive the issue didn't exist for you? It only happens in a few of the frames, it's not a non-stop issue.
[16:25:56 CET] <alexpigment> yep
[16:26:06 CET] <alexpigment> for what it's worth, it's somewhat persistent on the other players though
[16:26:39 CET] <alexpigment> but in my experience with the AMD encoder issue, the severity of the problem depends on which GPU is in the system
[16:26:46 CET] <alexpigment> i have an Nvidia card
[16:27:18 CET] <alexpigment> ok, that probably made no sense :) lemme rephrase. the severity when *decoding* depends on which GPU is in the system
[16:29:46 CET] <lkounios> alexpigment, I have an nVidia card too. Running 384.111 drivers.
[16:30:17 CET] <alexpigment> gotcha
[16:31:00 CET] <alexpigment> well, i think I've kinda exhausted my ideas here on what you can try :(
[16:31:11 CET] <alexpigment> maybe some others here might have a better idea of what's going on based on your sample video
[16:31:38 CET] <lkounios> alexpigment, Thanks a lot for the help. It is greatly appreciated. We'll figure it out sooner or later! :-)
[16:31:53 CET] <luneff> I wonder if we should just move to Wayland entirely :-)
[16:42:24 CET] <debianuser> lkounios: I can confirm I see the "classic tearing" in your https://a.uguu.se/cJgFu1PW6eFb_out.flv But I can't reproduce it locally. For me it looks like this: https://a.uguu.se/szXjwszCv5XH_out.flv I'm not saying you don't have the problem, you have it clearly, I'm just saying it's not a problem everyone has to deal with, others don't have it, so there must be a solution for you too.
[16:42:28 CET] <debianuser> lkounios: I tested it both without compositor and with out and have no tearing in any case, but maybe your compositor is different? Easy way to test if you have a compositor or not is to run `xcompmgr -c -f` in the terminal, it'd either start (and then you can kill it with Ctrl+C), or print "Another composite manager is already running".
[16:48:50 CET] <debianuser> lkounios: By the way, another noticeable difference between my setup and yours is that I have a much lower resolution and framerate than you. If the issue is caused by ffmpeg it could be related to resolution or framerate. Try capturing `-s 1280x720` that'd capture top left corner of your screen - would you still have tearing in the recording then?
[16:53:47 CET] <lkounios> debianuser, Thanks for the help! I've tried setting the resolution to half what I have now and change from framerate from 144 to 60. Same issue. I've also tried the composite manager command and get the "Another composite manager is already running". Looking into which one it is.
[16:55:00 CET] <lkounios> Something that may or may not be relevant is that if I disable "Allow Flipping" in the nVidia Control Panel, I get videos with the screen tearing issue discussed here. If I enable it, I get videos with lots of seemingly random artifacts. Some of these artifacts may be obscuring the fact that there are also tearing issues, it is difficult to tell for sure.
[16:58:30 CET] <alexpigment> lkounios: for what it's worth, i was seeing lots of artifacts; i assumed that's what you meant by tearing
[16:58:32 CET] <lkounios> debianuser, I believe the compositor is Gala, based on Mutter.
[16:58:44 CET] <alexpigment> but either way, that makes sense with what i was saying earlier about different GPUs behaving differently
[16:59:01 CET] <alexpigment> if it comes down to a GPU setting
[17:00:16 CET] <lkounios> True. May need to start from a fresh install and see where it takes me.
[17:01:44 CET] <lkounios> alexpigment, Do you have a screenshot of the "artifacts" you were seeing? Just to confirm we were seeing the same thing.
[17:02:02 CET] <alexpigment> lemme see if i can capture them
[17:02:20 CET] <alexpigment> but basically the colors are off in certain parts and pieces of the window you're moving around are kinda left behind
[17:02:40 CET] <alexpigment> kinda what it would look like if you deleted an I frame from a video
[17:03:06 CET] <debianuser> lkounios: You can probably just boot livecd and test there. It's faster to test than fresh install. :) Also to check if that's compositor to blame you can test recording without it. I don't know if you can disable gala/mutter, but you can probably relogin into xterm-only "safe mode" session and test there. Or e.g. install "icewm-session" (that's a tiny wm/de with no compositor) and test in it.
[17:03:53 CET] <lkounios> debianuser, Thanks! I'll give it a shot without a compositor.
[17:03:55 CET] <debianuser> alexpigment: that's probably just an encoding artifact. :)
[17:04:45 CET] <alexpigment> debianuser: i doubt it's encoding, because this seems to be an issue that occurs for some players and not others
[17:05:10 CET] <alexpigment> or according to lkounios, depending on whether your have a particular nvidia option enabled
[17:06:42 CET] <alexpigment> lkounios: this was as good as i could capture. when i tried to do a screen capture, that would actually influence the playback of the video, and most of the time cause everything in the video to go green
[17:06:43 CET] <lkounios> alexpigment, Ah, let me clarify. With "Allow Flipping" enabled, my recorded videos have random artifacts regardless of where I play them back. Even switching on a Mac or Windows. Disabling "Allow Flipping" does not help with the playback of a video that was already recorded with "Allow Flipping" enabled.
[17:06:44 CET] <alexpigment> https://a.uguu.se/eVvD3VPfrIgc.png
[17:07:04 CET] <alexpigment> lkounios: oh gotcha. i misunderstood
[17:07:45 CET] <lkounios> alexpigment, Interesting. Didn't have that issue on my end.
[17:07:53 CET] <alexpigment> k
[17:08:18 CET] <lkounios> Anyway. I'll experiment tomorrow without a composite manager. Thank you for all the assitance, alexpigment and debianuser! Have a great day!
[17:08:44 CET] <alexpigment> k good luck. sorry i couldn't help out (apparently we weren't seeing the same issue anyway)
[17:11:35 CET] <debianuser> lkounios: Also you've probably already seen it, but just in case you haven't, there's a "Force Full Composition Pipeline" option in `nvidia-settings`: https://i.stack.imgur.com/P8nKc.png Theoretically it's more important for playback/display, not for capture, but maybe in your case it somehow affects capture too, so it's worth to try anyway.
[17:12:03 CET] Action: debianuser 'd blame either ffmpeg or compositor.
[17:12:23 CET] <AppleTor> i'm trying to download downlaod a video from m3u file. but got HTTP error 403 Forbidden as an error message. weirdly, the playlist run just fine on vlc :/ any idea why
[17:13:22 CET] <AppleTor> ffmpeg -i "/Users/UserName/Downloads/1.m3u" -c copy -bsf:a aac_adtstoasc 1.mp4
[17:13:37 CET] <AppleTor> the command line is correct right ?
[19:52:15 CET] <b0bby__> hello
[19:52:58 CET] <b0bby__> what does undefined reference to symbol 'av_frame_free@@LIBAVUTIL_FFMPEG_54' mean?
[19:53:07 CET] <b0bby__> how do I fix it?
[20:00:31 CET] <Fyr> to avoid this error you need to recompile FFMPEG.
[20:01:08 CET] <Fyr> header file contains the function which source is absent.
[20:15:38 CET] <b0bby__> Fyr: can I just install the devkit from apt-get
[20:21:40 CET] <Fyr> who knows
[20:36:46 CET] <saml> how do I get psnr of a video?
[20:40:36 CET] <kepstin> saml: 'ffmpeg -i original.mkv -i reencoded.mkv -filter_complex psnr -f null -' will log it to the console. The filter has additional options to e.g. log per frame, see the ffmpeg-filters doc for details.
[20:40:40 CET] <durandal_1707> saml: google is your friend
[20:42:25 CET] <saml> thanks. so it's not ffprobe
[20:44:54 CET] <kepstin> I mean, I suppose you could technically do it inside ffprobe if you used a lavfi input.
[21:11:24 CET] <b0bby__> I'm having so much trouble with just compiling a basic ffmpeg program(all linking errors) I have the github source where should I go from here for a proper compilation. If someone could help me that would be great.
[21:12:19 CET] <JEEB> compile FFmpeg and *install* it to a prefix. use --prefix=/some/prefix (default is /usr/local) . if you use a custom prefix you can also remove it easily from your system
[21:13:12 CET] <JEEB> afterwards use PKG_CONFIG_PATH=/some/prefix/lib/pkgconfig with pkg-config --cflags | --libs lib{avcodec,avformat,avfilter,avutil}
[21:13:28 CET] <JEEB> use pkg-config and you get the correct flags to link against those libraries :P
[21:13:43 CET] <JEEB> and if it's the examples then I already linked you to the README included
[21:14:02 CET] <JEEB> they can be built against an installed FFmpeg like a proper 3rd party thing, or as a part of FFmpeg's source tree
[21:14:10 CET] <JEEB> both ways are mentioned in the README
[21:19:06 CET] <b0bby__> JEEB: ok will configure and make.
[21:20:07 CET] <JEEB> you can't really utilize what's in the source tree as-is :P esp. since you lack pkg-config files which make your life generally much simpler.
[21:20:25 CET] <JEEB> I usually do something like /home/jeeb/ownapps or /home/jeeb/ffmpeg_prefix
[21:20:38 CET] <JEEB> where I install stuff I build myself :P
[21:34:27 CET] <b0bby__> JEEB: ok
[21:35:28 CET] <b0bby__> my libs are installed in /mylibs/ffmpeg what should I do to compile https://raw.githubusercontent.com/mpenkov/ffmpeg-tutorial/master/tutorial01.c
[21:36:37 CET] <b0bby__> JEEB: what should I do next?
[21:36:51 CET] <JEEB> it tells you to use the Makefile that came with it :P but really, you should know which libraries you're using (I see libavcodec, libavformat and libswscale being used there
[21:37:31 CET] <JEEB> so `PKG_CONFIG_PATH=/mylibs/ffmpeg/lib/pkgconfig gcc <your code's values> $(pkg-config --libs libavcodec libavformat libswscale)`
[21:37:36 CET] <JEEB> I think that should work :P
[21:37:41 CET] <JEEB> also probably ou need the --cflags as well
[21:38:17 CET] <JEEB> you can first test by just doing `PKG_CONFIG_PATH=/mylibs/ffmpeg/lib/pkgconfig pkg-config --cflags --libs libavcodec libavformat libswscale`
[21:38:27 CET] <JEEB> that should give you the -I and -L -l
[21:38:32 CET] <JEEB> for those three libraries
[21:39:07 CET] <b0bby__> JEEB: undefined reference to symbol 'av_frame_free@@LIBAVUTIL_FFMPEG_54'
[21:39:31 CET] <JEEB> check what you get from pkg-config
[21:39:50 CET] <b0bby__> JEEB: How?
[21:39:53 CET] <JEEB> also that's libavutil and it should be in that line but if you want explicitly define it, add it to the pkg-config line as well
[21:40:08 CET] <JEEB> b0bby__: by, you know, running the command I noted?
[21:40:49 CET] <b0bby__> JEEB: the `PKG_CONFIG_PATH=/mylibs/ffmpeg/lib/pkgconfig pkg-config --cflags --libs libavcodec libavformat libswscale`
[21:40:55 CET] <b0bby__> ?
[21:41:21 CET] <JEEB> yes?
[21:42:09 CET] <b0bby__> JEEB: bash: -I/usr/include/x86_64-linux-gnu: No such file or directory
[21:42:18 CET] <JEEB> what are you doing?
[21:45:05 CET] <b0bby__> JEEB: -I/mylibs/ffmpeg/include -L/mylibs/ffmpeg/lib -lavformat -lm -lz -lavcodec -pthread -lm -lz -lva -ldl -lswresample -lm -lswscale -lm -lavutil -pthread -lva -lva-drm -lva -lva-x11 -lX11 -lvdpau -lX11 -lm -lva -ldl
[21:45:16 CET] <JEEB> there you go
[21:46:27 CET] <b0bby__> Oh my god
[21:46:30 CET] <b0bby__> it works
[21:46:34 CET] <b0bby__> THANK YOU!
[21:46:43 CET] <JEEB> :)
[21:46:56 CET] <JEEB> learn how pkg-config can help you help yourself
[21:47:09 CET] <JEEB> "I'd like to utilize this library and it has a .pc file, please tell me what I need"
[22:01:46 CET] <b0bby__> hello
[22:02:42 CET] <b0bby__> compiled encode_video.c from the examples and libx264 is missing. So is libvorbis
[22:03:39 CET] <JEEB> did you enable those in your FFmpeg compile?
[22:04:12 CET] <JEEB> of course requires that you actually have those libraries' development headers and libraries installed
[22:04:59 CET] <b0bby__> JEEB is there an enable all option / what is dev packages should I install
[22:05:36 CET] <JEEB> no there is no enable-all, you enable what you need. the packages depend on what distro you are, which I cannot know now can I?
[22:06:34 CET] <b0bby__> JEEB: I'm on ubuntu
[22:06:54 CET] <JEEB> libx264-dev and libvorbis-dev or so I would guess then :P
[22:07:09 CET] <JEEB> search your package repos
[22:07:14 CET] <JEEB> (and hope the versions are new enough)
[22:07:57 CET] <b0bby__> Do I have to recompile?
[22:08:34 CET] <JEEB> FFmpeg? yes.
[22:08:40 CET] <JEEB> for libx264 you need --enable-gpl --enable-libx264
[22:08:47 CET] <JEEB> for libvorbis it's just --enable-libvorbis
[22:08:49 CET] <JEEB> IIRC
[22:10:52 CET] <rdz> hey all. is it possible to use ffmpeg as a source client for shoutcast streaming server?
[22:11:37 CET] <JEEB> you mean being the transcoder that feeds into a streaming server?
[22:11:43 CET] <rdz> i was able to make it work with icecast2 (2.4.2), but fail to do so with shoutcast (2.5.2)
[22:11:48 CET] <rdz> JEEB, exactly
[22:11:51 CET] <JEEB> yes, if the input protocol is supported
[22:12:11 CET] <JEEB> and of course you need to keep in mind which formats each media server supports
[22:12:32 CET] <rdz> JEEB, input is mp3, output is mp3 with lower bitrate
[22:13:08 CET] <b0bby__> JEEB: ok trying ./configure --enable-gpl --enable-libx264
[22:13:25 CET] <JEEB> remember your prefix :P
[22:13:57 CET] <b0bby__> yes
[22:16:00 CET] <rdz> JEEB, i'm running into exactly the same problem as described here: https://lists.ffmpeg.org/pipermail/ffmpeg-user/2015-November/029257.html
[22:16:39 CET] <rdz> so i wonder whether the situation has changed in the meanwhile...
[22:16:40 CET] <JEEB> you'd have to debug the server if it says anything :P
[22:16:55 CET] <JEEB> also I have no idea if shoutcast actually uses the same protocol as icecast
[22:16:59 CET] <rdz> good point  :-)
[22:17:01 CET] <JEEB> so you really will have to look into that
[22:17:03 CET] <rdz>  thhanks
[22:18:56 CET] <rdz> when i connect with ffmpeg it doesn't even trigger a log entry....
[22:18:59 CET] <rdz> strange
[22:19:16 CET] <JEEB> if you like spam you can try -v debug and hope that you get any hints
[22:22:28 CET] <rdz> JEEB, what does 'broken pipe' mean?
[22:23:07 CET] <JEEB> "a condition in programming (also known in POSIX as EPIPE error code and SIGPIPE signal), when a process requests an output to pipe or socket, which was closed by peer."
[22:23:17 CET] <JEEB> in your case probably a socket
[22:23:25 CET] <JEEB> so the other side just said nope :P
[22:23:57 CET] <rdz> JEEB, i guess i figured it out...
[22:24:09 CET] <rdz> i mean i might found the reason
[22:24:33 CET] <rdz> i tried to connect with nc and the first thing it said was "bad password"
[22:25:00 CET] <rdz> so i tried again with nc and only entered (without any HTTP bla) the plain pasword and i got a positive respnse
[22:25:10 CET] <rdz> it seems the shoutcast protocol is pretty fucked up....
[22:25:16 CET] <rdz> only using http later in the process..
[22:25:28 CET] <JEEB> well, enjoy
[22:25:54 CET] <rdz> but why keep people in mailinig list and in channel here saying that it is supposed to work?
[22:26:04 CET] <saml> is ffmpeg good
[22:26:05 CET] <JEEB> I have no idea
[22:26:19 CET] <JEEB> saml: it sucks but for what it does it's one of the only things that does what it does
[22:26:21 CET] <saml> or do people create their own using libffmpeg?
[22:26:27 CET] <JEEB> oh you meant in that sense
[22:26:37 CET] <JEEB> yes, most people first get something going with ffmpeg.c
[22:26:40 CET] <JEEB> also there's no libffmpeg
[22:26:59 CET] <JEEB> there's libavcodec,-format,-util,-device,-filter,libswscale
[22:27:00 CET] <saml> yeah, like demuxing and decoding once  and do all filtering in parallel  and possibly share some of results before encoding and muxing
[22:27:12 CET] <saml> ah i see
[22:27:44 CET] <JEEB> but sooner or later people notice that ffmpeg.c is something done for some specific uses (it can be used for a lot, but it definitely can't do everything you could do with the libraries)
[22:27:51 CET] <saml> what's bottleneck?  decoding  or swscale or filter?
[22:28:06 CET] <JEEB> it really depends on what you're doing :P
[22:28:21 CET] <JEEB> if your decoder and encoder are fast then usually the filtering ends up being the bottleneck
[22:28:35 CET] <JEEB> that said, you can do the filtering yourself or use some other library for filtering if you think that is faster
[22:28:47 CET] <JEEB> since avcodec gives you the decoded pictures as AVFrames
[22:28:52 CET] <saml> i want to parallelize ffmpeg stuff so that customers can see their uploaded video being ready quicker
[22:29:38 CET] <saml> hrm i see
[22:31:00 CET] <JEEB> anyways, I recommend you actually use some sort of time-tracing thing
[22:31:06 CET] <JEEB> to see what your actual bottleneck is
[22:35:05 CET] <saml> thanks
[22:35:17 CET] <saml> what is -lavfi ?
[22:35:26 CET] <JEEB> libavfilter
[22:35:53 CET] <saml> The libavfilter library provides a generic audio/video filtering framework containing several filters, sources and sinks.
[22:36:20 CET] <saml> hrm.  if I want to get PSNR,   ffmpeg -i original.mp4 -i transcoded.mp4 -lavfi  psnr="stats_file=psnr.log"  -f null -
[22:36:28 CET] <JEEB> oh right, the ffmpeg.c parameter
[22:36:44 CET] <kepstin> saml: it's the same thing as -filter_complex on the ffmpeg tool
[22:36:52 CET] <saml> i do that. but psnr.log doesn't contain average psnr
[22:36:58 CET] <JEEB> right, I though that was the case. thanks for confirming
[22:37:02 CET] <saml> oh i see
[22:37:14 CET] <kepstin> saml: no, that contains per-frame psnr. I think the average is printed to the console output.
[22:37:30 CET] <saml> so i have to parse stderr as well
[22:37:51 CET] <kepstin> ffmpeg isn't meant to have programmatically parsable output, unfortunately :/
[22:38:03 CET] <saml> i wish output could be json. looks like only ffprobe supports -print_format json
[22:38:42 CET] <saml> someone must have created programmable python module for ffmpeg :P
[22:39:55 CET] <kepstin> well, there's two kinds of libraries to use ffmpeg. The first kind just makes command-lines for the cli tool, and they wouldn't really help with this. The second kind is bindings to libav*, and they're generally pretty hard to use and often old/incomplete :/
[22:40:21 CET] <saml> okay time to rewrite it in rust
[22:41:12 CET] <JEEB> bindgen is pretty good
[22:41:26 CET] <JEEB> although it fails with many C stdlibs' maths libraries
[22:42:09 CET] <JEEB> https://github.com/rust-lang-nursery/rust-bindgen/issues/687
[22:44:26 CET] <saml> reading https://www.ffmpeg.org/ffmpeg-all.html#psnr  looks like psnr doesn't make sense if original and transcoded videos have different resolution
[22:45:11 CET] <kepstin> saml: yep, not an intended use. You could compare psnr between the original and the transcoded resized back to the original, but that's also measuring the particular upscaler as well as the codec
[22:45:23 CET] <kepstin> and psnr doesn't really match human vision all that well anyways
[22:45:46 CET] <saml> i see
[22:56:52 CET] <b0bby__> hello
[22:57:08 CET] <b0bby__> compiling encode.c from examples
[22:57:26 CET] <b0bby__> using libvpx codec to produce a webm
[22:57:33 CET] <b0bby__> the webm won't play
[22:57:36 CET] <b0bby__> why?
[23:01:54 CET] <saml> maybe i can scale original down to transcoded resolution  before psnr
[23:02:25 CET] <alexpigment> b0bby__ : come on, man. that's like calling a car repairman and saying "my car won't start. why?"
[23:02:54 CET] <alexpigment> any additional details would get closer to an answer. a sample file would be ideal
[23:04:45 CET] <b0bby__> https://expirebox.com/download/10aeedc43bdfa136c39fdf479713f806.html
[23:05:13 CET] <alexpigment> there's no video or audio streams in the file
[23:05:53 CET] <b0bby__> encode.c said is wrote packets
[23:06:48 CET] <alexpigment> well, it may have written them, but not in a way that anything can understand
[23:07:45 CET] <b0bby__> I used https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/doc/examples/encode_video.c to create the video but I don't know whats wrong
[23:13:33 CET] <b0bby__> Would it be bad practice to call ffmpeg over the command line inside c++
[23:13:38 CET] <b0bby__> ?
[23:14:26 CET] <JEEB> no, but you're just limited with that
[23:14:31 CET] <JEEB> to what ffmpeg.c can do
[23:14:46 CET] <JEEB> if that is good enough, knock yourself out
[23:15:13 CET] <b0bby__> ok
[23:18:52 CET] <b0bby__> How would I combine multiple videos(different formats and frame rate and audio bitrates) into one video of a some width and height. The videos should all have their aspect ratio preserved and if the can be stretched they should be placed on top of a black background.
[23:29:41 CET] <kepstin> b0bby__: to do that with the ffmpeg cli tool, you'd have to make a complicated filter chain that resizes and pads each video before concatenating them.
[23:31:53 CET] <kepstin> if you're making an app using the api, you'd open and decode each video in turn, resize/pad frames to the correct size (possibly using libavfilter), then send each one on to the encoder/muxer (you'll might have to do some corrections to timestamps to do the concatenation properly)
[00:00:00 CET] --- Fri Jan 19 2018


More information about the Ffmpeg-devel-irc mailing list