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

burek burek021 at gmail.com
Wed Aug 2 03:05:01 EEST 2017


[00:07:26 CEST] <ffpure> guys, is there any filter to set opacity of video to 50% for the entire movie?
[00:08:30 CEST] <ffpure> making it into a semi-transparent alpha-channel movie?
[00:10:54 CEST] <BtbN> There's not a lot of video codecs which support an alpha channel.
[00:11:05 CEST] <BtbN> And for the ones that do it's kind of a hack
[00:19:05 CEST] <ffpure> well, i really need it for playback time, like ffplay
[00:28:25 CEST] <furq> i don't think ffmpeg displays alpha channels anyway
[00:28:29 CEST] <furq> s/ffmpeg/ffplay/
[00:49:45 CEST] <YokoBR> hi folks
[00:50:33 CEST] <YokoBR> please, I want to create a "playlist" (several files to play in sequence) on an icecast server
[00:50:37 CEST] <YokoBR> how do I do that?
[00:51:21 CEST] <ffpure> furq: well, what i am looking for is like fade filter. but same opacity for entire duration
[01:23:34 CEST] <twosee> [Parsed_concat_0 @ 000000002a05bb80] Input link in10:v0 parameters (size 1280x720, SAR 2049:2048) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1)
[01:23:42 CEST] <twosee> hey trying to figure out what this means: what is SAR?
[01:24:28 CEST] <DHE> sample aspect ratio
[01:24:54 CEST] <DHE> should be 1:1 for square pixels
[01:26:00 CEST] <dl2s4> the movie is squeezed and your player plays it in DAR
[01:27:22 CEST] <twosee> im concatting a bunch of video files together as part of an automated process done daily... there isnt errors normally but i guess im hitting some weird edgecase
[01:33:10 CEST] <DHE> a slightly odd sample aspect might happen if, for example, you input 1920x1088 whereas you output at 1920x1080  (1080 vs 1088)
[01:36:00 CEST] <twosee> yeah all the videos are resolution 1280x738 with display 720p
[01:36:50 CEST] <twosee> im concatting 15+ inputs, so I setsar=1:1 on each one?
[01:37:02 CEST] <YokoBR> please folks
[02:29:54 CEST] <new_guy> Hey everyone, I'm trying to downmux some 5.1 channel audio to 2 channel whilst keeping the 5.1 audio as a second track, I can get it working without keeping the second track but can't see where I'm going wrong otherwise. I'm getting an error telling me the filtergraph was defined for audio out stream 0:2 but codec copy was selected with the following script: ffmpeg -i "****.mkv" -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 aac -ac:a:0
[02:30:21 CEST] <new_guy> ffmpeg -i "****.mkv" -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 aac -ac:a:0 2 -af:a:0 "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR" -c:a:1 copy "****(new).mkv"
[02:30:32 CEST] <new_guy> Sorry, looks like I hit a character limit
[02:31:11 CEST] <JASTON> Hey gang, I'm trying to create a system that converts arbitrary multimedia file into an HLS VOD stream (h264/aac) consisting of 10s mpegts segments.
[02:31:29 CEST] <JASTON> The hls muxer works great, but I really want to generate the segments on demand if i can, instead of having to preprocess the whole stream.  What I have so far works okay, but audio falls out of sync after a while into the stream (noticibly at, say 15 minutes).
[02:31:36 CEST] <JASTON> When I try to validate the streams I'm creating I get lots of reports for continuity errors, and I'm wondering if thats the root cause of the drift.  I haven't been able to find a way around that, is the on-demand idea a lost cause?  or can someone point me in the right direction?
[02:33:12 CEST] <thebombzen> new_guy: if you just have one video and one 5.1 audio stream in the input file, try this: ffmpeg -i input.mkv -map 0:0 -map 0:1 -map 0:1 -c:0 copy -c:1 copy -c:2 aac -ac:2 stereo out.mkv
[02:33:15 CEST] <thebombzen> or something like that
[02:35:15 CEST] <thebombzen> new_guy: it appears you have that, and the command you put there should work, so you should paste the complete command and full console output
[02:35:47 CEST] <new_guy> Sure thing give me a sec
[02:40:22 CEST] <YokoBR> please, how can I use ffmpeg to stream mp3 to icecast?
[02:41:33 CEST] <new_guy> Thought I'd use pastebin hope that's cool. https://pastebin.com/fqbdv5CL
[02:42:37 CEST] <thebombzen> new_guy: try using direct indices
[02:43:22 CEST] <thebombzen> new_guy: try using -c:1 aac -ac:1 2 -af:1 your_filter -c:2 copy
[02:43:50 CEST] <thebombzen> your command looks like it should work
[02:44:16 CEST] <thebombzen> but it doesn't. I tested the above just now and it worked for me, so it might just be a bug
[02:45:11 CEST] <new_guy> Just tried and threw the same error, very weird
[02:46:09 CEST] <thebombzen> new_guy: ah, figured it out. so apparently -af is an alias for "-filter:a" and ignores the stream specifier after it
[02:46:16 CEST] <thebombzen> replace -af:a:0 with -filter:a:0
[02:46:18 CEST] <thebombzen> and it should work
[02:47:27 CEST] <new_guy> Seems to have worked perfectly, thanks so much!
[02:50:40 CEST] <YokoBR> okay, got it
[03:58:11 CEST] <codebam> how do I force ffmpeg to never output video
[03:59:18 CEST] <codebam> when transcoding to ogg opus from flac with the extention .ogg it makes it a theora video with opus audio with the album art as the video
[03:59:30 CEST] <codebam> which breaks playback in basically every music player that plays opus
[04:01:17 CEST] <furq> -vn
[04:01:31 CEST] <codebam> thank you
[04:02:13 CEST] <Cracki> cheers. trying to do a 1000x time lapse with integrated/blended frames, so ideally I'd like 1000 frames averaged into one (output rate = input rate).
[04:02:15 CEST] <Cracki> wat do?
[04:02:31 CEST] <Cracki> all I see is either taking just two neighboring frames, or nearest neighbor.
[04:02:54 CEST] <Cracki> right now I'm using tblend=all_mode=average,framestep=2
[04:06:43 CEST] <kepstin> if you repeat that list of filters 10 times, it'll give you one output frame for every 1024 input frames.
[04:06:53 CEST] <kepstin> might be good enough? :)
[04:09:51 CEST] <Cracki> yeah but I was hoping for something smarter
[04:10:04 CEST] <Cracki> also I'm not sure if that filter does twice the work and then discards half of it
[04:10:40 CEST] <Cracki> it probably does... tblend applies this for each of 25 frames/sec, so framestep=2 decimates after the work has been done
[04:11:03 CEST] <Cracki> but if I framestep=2 before that, I'm left with 12.5 frames/sec, so the intermediate ones are gone
[04:11:35 CEST] <Cracki> I'm considering getting into PyAV and coding it up myself real quick :P
[04:12:15 CEST] <Cracki> what are recommended python bindings for ffmpeg these days? pyav seems good to me, but is quite new
[04:13:01 CEST] <kepstin> "quite new" probably isn't entirely a bad thing, since it means it'll compile against recent ffmpeg and will work with python3.
[04:13:15 CEST] <kepstin> that said, I haven't used any python ffmpeg bindings, so :/
[04:13:17 CEST] <Cracki> it does and does
[04:13:33 CEST] <Cracki> I've used it with h264_qsv and _cuvid for hw decode
[04:13:50 CEST] <Cracki> the h264 software decoder is still faster if I give it 2-4x cpu count
[04:14:23 CEST] <Cracki> especially fun is that I can seek in my source videos... and skip feeding (suspected) b-frames to the codec context
[04:14:27 CEST] <Cracki> and also some p-frames
[04:14:43 CEST] <Cracki> so I can very quickly decode video from which i only need every n-th frame
[04:15:00 CEST] <Cracki> (if it's a multiple of p-frame frequency)
[04:18:03 CEST] <Cracki> it unfortunately has a very bare docs export.
[04:18:20 CEST] <Cracki> and ffmpeg libs themselves don't even link the docs: https://ffmpeg.org/libavcodec.html
[04:22:02 CEST] <kepstin> You probably want https://ffmpeg.org/doxygen/trunk/index.html (linked as "API Documentation" off the main ffmpeg docs page)
[04:23:14 CEST] <Cracki> aye
[04:23:55 CEST] <Cracki> are the examples in that doxygen "recent"?
[04:24:54 CEST] <Cracki> also, any document that ties together how to use that bunch of libraries?
[04:25:29 CEST] <Cracki> a getting started or 101 or something that explains the "rules of the game", what are the concepts, primitives, building blocks, etc...
[04:25:43 CEST] <Cracki> conventions, math, etc
[04:25:53 CEST] <Cracki> e.g., I understand dts and pts
[04:26:08 CEST] <kepstin> hmm, not really. The usual suggestion is to look at the C example files to get started
[04:26:12 CEST] <Cracki> and from exploring, I figured out that stream seeking in pyav seeks the DTS
[04:26:27 CEST] <kepstin> They should all be updated to the modern encode/decode apis now, i think
[04:26:32 CEST] <Cracki> I think pyav needs a bunch of articles...
[04:26:45 CEST] <Cracki> good good
[05:11:51 CEST] <Cracki> would be nice to give tblend option of decimating frames and blending more than two... or rolling that into a new filter... maybe :D
[05:43:11 CEST] <tezogmix> hey all, do you happen to know of a utility for windows or even via ffmpeg possibly to allow me to view as a list of all the resolution & frame rate/fps of multiple files at once?
[05:59:54 CEST] <tezogmix> Ah, I think I'm able to view some of this with mediainfo utility when loading a folder, just need to tinker with the viewing options
[07:42:34 CEST] <kam187> Any idea how to apply translationmatrix side data at a set time?
[07:51:48 CEST] <kam187> So I can see I need to use av_display_rotation_set
[07:54:43 CEST] <kam187> Oh I see I add it as side data to the frame
[07:54:45 CEST] <kam187> Nvm
[11:26:16 CEST] <nahsi> I have a DVD9 video that looks like this https://lut.im/EQin5S1Dkk/W3MoIsJN21OkzWlW.png Is there is nothing I can do? Mediainfo reports that it's progressive 23.876 with 2:3 Pulldown. But it's not soft telecined , right? I tried ffmpeg with fieldmatch and decimate filter - it did nothing
[11:27:34 CEST] <BtbN> this looks like there's two entirely seperate videos in each field oO
[11:27:55 CEST] <nahsi> It's a cut from one frame to the other
[11:28:26 CEST] <BtbN> so usually it's just normal interlacing artifacts, and this is an extreme example of a cut?
[11:30:54 CEST] <nahsi> Well, it's not extreme. There are a lot of these 'cuts'. Video seems to be progressive i.e. in some scenes there are no 'combing' artefacts at all. mpv reports variable frame rate ~23~29.
[11:31:49 CEST] <BtbN> try deinterlacing it. If there is low motion, it will be barely noticable
[11:33:50 CEST] <nahsi> I tried. It removes all the combing, video gets blurred and there are lots of artifacts (flicering and jaggering)
[11:34:34 CEST] <nahsi> And if if it's soft telecined like it reports then there is the way to restore original framerate right?
[11:34:43 CEST] <nahsi> And get ideal result
[11:38:11 CEST] <nahsi> screenshot form 'deinterlaced' version https://lut.im/rTPfFk803h/WyJ1FXZh1HlAmddn.png
[12:07:23 CEST] <BtbN> Have you tried the pullup filter? https://ffmpeg.org/ffmpeg-filters.html#pullup-1
[12:08:03 CEST] <BtbN> https://ffmpeg.org/ffmpeg-filters.html#detelecine is also a thing
[12:08:42 CEST] <BtbN> https://ffmpeg.org/ffmpeg-filters.html#telecine has a list of common patterns
[12:08:43 CEST] <nahsi> Thanks I'll try that out
[13:41:25 CEST] <BtbN> Can ffmpeg append to an existing m3u8?
[13:42:25 CEST] <BtbN> seems like it can
[15:22:38 CEST] <Bear10> Hi there I'm attempting to stream an h264 and I'm not having any luck it says [AVBSFContext @ 0x7fa0d6e258c0] No start code is found. and 0:0: could not find codec parameters
[15:22:58 CEST] <Bear10> the command I'm executing is as follows: ffmpeg -re -f avfoundation -c:v h264 -c:a libfdk_aac -pix_fmt uyvy422 -framerate 30 -i "0:0" -bufsize 6000k -maxrate 4000k out.mp4
[15:23:22 CEST] <Bear10> I'm on a mac, I checked out the code and installed with libx264 enabled
[15:23:30 CEST] <Bear10> Help would be much appreciated
[16:31:49 CEST] <leif> Does anyone know why I would be getting an EPERM error when calling av_seek_frame?
[16:42:20 CEST] <kepstin> leif: I dunno specifically that error, but is your input read from a protocol that supports seeking?
[16:44:37 CEST] <leif> kepstin: Here is the file I'm seeking: https://gist.github.com/LeifAndersen/5a53172cefae2dc95c60f3edf7f24af1
[16:45:20 CEST] <leif> So, h264 and aac.
[16:45:25 CEST] <leif> Do they not support seeking?
[16:45:38 CEST] <kepstin> mp4 container read from a local file? that should be fine
[16:46:30 CEST] <leif> hmm...okay.
[16:46:52 CEST] <leif> Would it be possible to get that error if you try to seek to a position out of range?
[16:48:32 CEST] <kepstin> ... av_seek_frame doesn't return an error code
[16:48:40 CEST] <kepstin> it just returns 0 on failure and >0 on success
[16:48:55 CEST] <kepstin> where are you getting an error code from?
[16:49:51 CEST] <kepstin> er, wait no that's wrong
[16:49:59 CEST] <kepstin> >= 0 on success
[16:50:14 CEST] <kepstin> but I don't think it returns any specific error codes on failure
[16:50:37 CEST] <leif> kepstin: up, your second one is right (per the doc page anyway)
[16:50:40 CEST] <leif> yup*
[16:50:48 CEST] <leif> However, I'm getting back a -1.
[16:50:59 CEST] <leif> Which is EPERM on my system.
[16:51:04 CEST] <leif> Which I find....odd...
[16:51:05 CEST] <kepstin> yeah, -1 is returned by the function in several places if the seek fails.
[16:51:14 CEST] <kepstin> it's not an error code, just a number that's not >=0
[16:51:21 CEST] <leif> Ah, okay, that makes sense.
[16:51:29 CEST] <leif> So irs probably just out of range or something like that.
[16:51:33 CEST] <leif> Thanks kepstin :D
[16:51:52 CEST] <kepstin> I mean, that still doesn't help you much, seeking should be working in that file :)
[16:53:29 CEST] <kepstin> the most usual cause of that is that the avformat is unable to seek, e.g. you're reading from a pipe or some types of streams rather than a file
[16:55:14 CEST] <kepstin> but assuming you've just done avformat_open_input on the local file without a customized aviocontext, it should work fine...
[16:59:55 CEST] <leif> kepstin: ya, I did to avformat_open_input.
[17:00:08 CEST] <leif> Although I'm checking to see if I asked it to seek off the end of thefile.
[17:00:17 CEST] <leif> (Like,if I mixed up the timebases of the two streams.)
[17:00:50 CEST] <kepstin> yeah, I think attempting to seek past the last keyframe would give an error
[17:01:16 CEST] <kepstin> depending on seek options? not sure.
[17:07:23 CEST] <leif> mmm...that makes sense.
[17:07:32 CEST] <kepstin> leif: note that with av_seek_frame, you fairly often will want to use AVSEEK_FLAG_BACKWARDS to have it return the closest keyframe before the seek point, rather than the closest keyframe after
[17:07:34 CEST] <leif> I'll try it out and see what happens. Thanks. :)
[17:07:52 CEST] <leif> Oh, cool, thank yo, I didn't realize that.
[17:07:58 CEST] <leif> That is very helpful actually.
[17:08:32 CEST] <kepstin> that's ... poorly documented, unfortunately.
[17:09:31 CEST] <leif> Ya, that happens.
[17:10:01 CEST] <leif> FWIW, I'd be happy to fix that. Is the proper way to do it to modify it in the source repo and send a patch to the dev mailing list?
[17:10:28 CEST] <kepstin> the newer avformat_seek_frame method is a lot more flexible & the docs are more clear, but it's still listed as "under construction" and "do not use this yet" :/
[17:11:05 CEST] <leif> Yup. I hear you.
[17:11:16 CEST] <leif> Also, iirc, its avformat_seek_file, which I found to be a bit confusing.
[17:11:39 CEST] <leif> I just went with av_seek_frame because the docs didn't say that one was under construction. :)
[17:12:18 CEST] <kepstin> It's just the newer naming scheme really; it takes an avformat context and operates only on the format level not codec, so, that's how it's named.
[17:12:55 CEST] <kepstin> and yeah, making a commit in a local clone of the git repo, then posting that as a patch on the dev ml should be fine for documentation patches.
[17:15:14 CEST] <leif> cool, thanks.
[17:19:05 CEST] <leif> Also, just using the backwards flag made the error go away.
[17:19:13 CEST] <leif> Thanks a lot kepstin That really helped. :D
[17:19:36 CEST] <kepstin> if you were seeking past the end of the file, that would, yeah; it'll return the last keyframe in the file rather than an error.
[17:20:37 CEST] <leif> kepstin: Ah, okay. So I should still check for that. Thanks.
[17:20:56 CEST] <leif> (Or I could have been seeking between the last keyframe in the file, and the end of the file, and it was trying to jump off the end.)
[17:20:58 CEST] <leif> Either way, thanks. :)
[17:21:37 CEST] <leif> Also ya, I was trying to seek past the end of the file. It looks like the video is only a few seconds long, and I was trying to seek to 50 seconds in. :)
[17:21:40 CEST] <kepstin> yeah, you have to check the pts of the frames you get back after the seek, and decide what to do if they don't match where you wanted to be
[17:21:42 CEST] <leif> So ya, thanks.
[17:22:31 CEST] <kepstin> with the backwards seek option, what you'll typically want to do is decode and discard frames until you reach the frame you're actually interested in.
[17:23:32 CEST] <leif> kepstin: Yup, that is exactly what I"m doing.
[17:23:44 CEST] <leif> Hence going to the keyframe before what I want is perfectly fine.
[17:24:00 CEST] <leif> Hell, in a sense starting from the beginning of the file is fine, but slower. ;)
[19:39:36 CEST] <JASTON> Hey gang, I'm trying to create a system that converts arbitrary multimedia file into an HLS VOD stream (h264/aac) consisting of 10s mpegts segments.
[19:39:37 CEST] <JASTON> The hls muxer works great, but I really want to generate the segments on demand if i can, instead of having to preprocess the whole stream.  What I have so far works okay, but audio falls out of sync after a while into the stream (noticibly at, say 15 minutes).
[19:39:46 CEST] <JASTON> When I try to validate the streams I'm creating I get lots of reports for continuity errors, and I'm wondering if thats the root cause of the drift.  I haven't been able to find a way around that, is the on-demand idea a lost cause?  or can someone point me in the right direction?
[19:41:36 CEST] <SolarAquarion> some reason for ffplay, mpv and others i'm getting a black screen
[19:41:40 CEST] <kepstin> JASTON: I assume you're generating each segment by, separately for each segment, seeking to a specific spot in the file, encoding 10s to a file?
[19:41:43 CEST] <SolarAquarion> when i use totem it works fine
[19:41:52 CEST] <SolarAquarion> or a frame rate of zero
[19:42:20 CEST] <JASTON> kepstin exactly right
[19:42:38 CEST] <SolarAquarion> Resolution: 512x384, Framerate: 0.000 Hz
[19:43:07 CEST] <kepstin> JASTON: using the ffmpeg cli, or a custom app with libav*?
[19:44:02 CEST] <JASTON> kepstin: ffmpeg, v 3.2.4 fwiw
[19:44:03 CEST] <JodaZ> JASTON, been trying to do that a while ago, never got it right
[19:44:42 CEST] <kepstin> I don't think you'll be able to get that to work with the ffmpeg cli, since it doesn't have much ability to select exactly which stream you're syncing to with seek
[19:44:44 CEST] <JodaZ> JASTON, basically you'd want to do timestamp passthrough, but ffmpeg never gets audio packet splitting right, it always fills with silence
[19:45:18 CEST] <JodaZ> JASTON, if you get it right, tell me i'd be very interested
[19:45:42 CEST] <kepstin> and doing concatenated packets from separate audio encodes is almost always gonna give a discontinuity - that's tricky because of how encoder preroll & overlapped transforms are handled
[19:47:14 CEST] <JASTON> ahhh, kepstin JodaZ think I might be better off trying to get HLS going with fMP4 segments?  Or think I'll just run into different problems there? ;)
[19:47:17 CEST] <JodaZ> if you just need to mux it should be easy, just drop some packets into the ts, and the ones after into the next - but ffmpeg still gives you hell
[19:47:49 CEST] <JodaZ> JASTON, same problems, ffmpeg just has issues with cutting audio at packet boundaries
[19:49:22 CEST] <JodaZ> JASTON, i just gave up personally, serving full size mp4's works for most of my devices
[19:50:04 CEST] <JASTON> there must be some cryptic combination of flags that would make it work?  the hls muxer works great
[19:50:34 CEST] <JASTON> JodaZ: ill look into that, thanks for your feedback. also thanks to kepstin
[19:51:05 CEST] <kepstin> JASTON: I don't think you'll be able to do it with the ffmpeg cli tool; this is such a specialized case you'd have to make a custom application using the apis to get it to do what you want
[19:51:41 CEST] <kepstin> and it would require a fair bit of codec knowledge to get properly concatable segments, particularly audio.
[19:54:00 CEST] <JodaZ> JASTON, for continuous operation the hls muxer can just open a new file every once in a while
[19:54:39 CEST] <kepstin> yeah, it's really just writing a single continuous mpeg-ts stream, just starts writing to a new file every once and a while.
[20:29:57 CEST] <hiru> when using the -map option, how can I select only the source that contains a given language? I found this doc http://ffmpeg.org/ffmpeg.html#Advanced-options
[20:30:07 CEST] <hiru> and this example: ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
[20:30:23 CEST] <hiru> can I use :language:eng with v and a streams?
[20:36:15 CEST] <kepstin> hiru: not sure. it looks like the 'm' is special there, in that it means "match against track metadata"
[20:36:29 CEST] <kepstin> so I think it should be able to select any type of stream
[20:37:27 CEST] <hiru> so it should be something like -map 0:a:language:jpn right?
[20:37:58 CEST] <hiru> I'll try this with a multitrack source.. hopefully it will work
[20:41:02 CEST] <hiru> when using -ss and -to how can I set -to to automatically select the end of the stream?
[20:41:34 CEST] <kepstin> not sure what you mean, ffmpeg will go until it reaches the end of the stream without needing -to
[20:44:32 CEST] <Mockarutan> Good afternoon. I'm having some problem trying to encode Opus into webm. I've written the encoder in c++ and it has worked for H.264+AAC into mp4, and VP8+Opus into ogg. Then with Opus into webm it works only in VLC *but* is totally broken in ffplay and youtube, there is only "click" noises. Can't find much help anywhere I look. I have not found any example that I can get to work with the latest ffmpeg AND encode Opus in webm. But t
[20:44:33 CEST] <Mockarutan> TL;DR: Does anybody have any idea why my Opus into webm encoder produces click sounds? More info in StackOverflow post: https://stackoverflow.com/questions/45440374/ffmp
[20:44:53 CEST] <Mockarutan> (sorry for wall of text out of nowhere...)
[20:45:20 CEST] <kepstin> Mockarutan: hmm. given that opus in webm works perfectly well via the ffmpeg cli tool, this sure ought to be possible.
[20:47:17 CEST] <kepstin> Mockarutan: one thing to note: you should probably be selecting the encoder "libopus" by name, rather than codec id.
[20:47:26 CEST] <kepstin> similarly for other codecs
[20:47:30 CEST] <Mockarutan> Yeah I can make it produce a ogg file with VP8 and Opus, and then convert it to VP9 and opus via ffmpeg.exe tool and it works! I've even gone though a lot of the source code for in ffmpeg.c to so what's different... but can't find much
[20:47:50 CEST] <Mockarutan> Alright, I will try that right away!
[20:50:06 CEST] <kepstin> depending on the ffmpeg version you're using that shouldn't make a difference, tho. Not sure how the experimental status on the internal opus encoder is handled via the api.
[20:50:50 CEST] <Mockarutan> I just yesterday tried the latest stable.
[20:52:26 CEST] Action: kepstin notes that opus uses a (sort of) fixed 48kHz internal sampling rate, so the problem might actually be that it's triggering your resampling code, which the other codecs didn't
[20:52:32 CEST] <kepstin> so make sure that's working correctly.
[20:55:36 CEST] <Mockarutan> Tried with 'avcodec_find_encoder_by_name("libopus");' Did not work. But if the resampler is not working, how can VLC still play it?
[20:57:36 CEST] <Mockarutan> Btw, all my sound will likely be in 48hz either way, it's sampled directly from FMOD which is configured for 48. But since Opus wants 960bit frame sizes for some reson, I figure I need the resampler anyway.
[20:58:56 CEST] <Mockarutan> *960 bytes not bits...
[21:05:55 CEST] <Mockarutan> Also, about the resample. it works in an ogg file...
[21:12:21 CEST] <kepstin> hmm, yeah, maybe not the problem then. hard do say.
[21:14:42 CEST] <kam187> hmm why doesn't this work
[21:14:46 CEST] <kam187> https://www.irccloud.com/pastebin/c0DwVJmj/
[21:23:44 CEST] <ChocolateArmpits> Should a major release be expected somewhere around September?
[21:25:08 CEST] <JEEB> no idea
[21:26:37 CEST] <thebombzen> kepstin: it's not quite accurate to say that "Opus uses a fixed 48 kHz internal sampling rate" but rather that Opus doesn't support arbitrary sample rates
[21:27:11 CEST] <kepstin> that's why I put "(sort of)" in there
[21:27:30 CEST] <thebombzen> it's more that 48 kHz is the smallest supported sampling rate greater than 40 kHz
[21:27:38 CEST] <thebombzen> it supports 96 kHz
[21:28:21 CEST] <thebombzen> I think the most relevant thing is that Opus doesn't support 44.1 kHz, which is a deliberate choice by the developers
[21:28:21 CEST] <kepstin> hmm? no, standard opus doesn't support >48kHz sampling; there's no point since it uses a 20kHz lowpass anyways
[21:29:00 CEST] <kepstin> I mean, I think you can force libopus to use other sample rates in celt-only mode, but the result isn't a standard-compliant audio stream.
[21:29:05 CEST] <thebombzen> ah I was wrong, you're right
[21:29:12 CEST] <thebombzen> it does apply a strict band-limit
[21:29:58 CEST] <thebombzen> The documentation explains it well, as usual
[21:30:07 CEST] <thebombzen> >Opus encoding tools like opusenc will happily encode input files that are sampled at 96 or 192 kHz. However, files at these rates are internally converted to 48 kHz and then only frequencies up to 20 kHz are encoded.
[21:30:41 CEST] <thebombzen> So yes what you said is correct in terms of the 48 kHz internal but it applies to higher frequences
[21:30:44 CEST] <kepstin> the sampling rates used internally are all just divisors of 48kHz to ease the internal resampling used when e.g. mixing stuff in different encoding modes
[21:31:05 CEST] <thebombzen> lower ones like 44.1 kHz aren't "interally 48 kHz" but rather explicitly not supported
[21:31:41 CEST] <thebombzen> this makes sense to be honest since digital audio stuff resamples 44.1 music to 48 upon playback
[21:31:54 CEST] <thebombzen> so it shifts the responsibility of resampling onto the encoder, not the decoder
[21:32:06 CEST] <thebombzen> which makes sense
[21:32:39 CEST] <ChocolateArmpits> >digital audio stuff resamples 44.1 music to 48 upon playback
[21:32:45 CEST] <ChocolateArmpits> Would like a source on that
[21:32:54 CEST] <thebombzen> Most soundcards internally use 48
[21:33:09 CEST] <ChocolateArmpits> There's lots of sound equipment outside of sound cards
[21:33:24 CEST] <ChocolateArmpits> or audio chipsets
[21:33:42 CEST] <ChocolateArmpits> I think you're making a too broad statement
[21:34:19 CEST] <thebombzen> ChocolateArmpits: for people who care about that sort of stuff, don't use Opus.
[21:34:40 CEST] <thebombzen> "but muh 44.1 -> 48 resampling errors"
[21:34:49 CEST] <thebombzen> don't use Opus
[21:36:33 CEST] <thebombzen> because 44.1 -> 48 is actually a mathematically possible thing on a band-limited signal (unlike converting 60 fps -> 24 fps without judder), it's not a big deal. If you really care all that much, then use FLAC. Opus devs say this too
[21:37:43 CEST] <kepstin> now I'm imagining what a temporally band-limited signal would look like
[21:37:51 CEST] <kepstin> quite blurry, i guess :)
[21:37:55 CEST] <kepstin> video signal*
[22:24:36 CEST] <RandomCouch> I'm trying to convert .3gp to .ts
[22:24:41 CEST] <RandomCouch> not getting errors but losing image
[22:24:44 CEST] <RandomCouch> the audio stays
[22:25:10 CEST] <RandomCouch> using this command ffmpeg -i myvideo.3gp -c copy -qscale:v 2 -f mpegts output.ts
[22:27:34 CEST] Action: kepstin notes that the '-qscale:v' does nothing when you're using -c copy
[22:27:42 CEST] <kepstin> can you pastebin the complete output of the command, please?
[22:28:38 CEST] <RandomCouch> Sure thing, give me a few moments
[22:30:17 CEST] <RandomCouch> ok, I'm using an .mp4 video now and it works.. I actually need help with smoething bigger than this
[22:30:57 CEST] <RandomCouch> I'm using ffmpeg on an Android device in my Unity application. The application records videos from the device camera, and then merges it with another video on the device, this other video is yet to be given to us by the client so we're using a placeholder one
[22:31:05 CEST] <JEEB> most likely the video format you had can be put into mpeg-ts, but the playback device doesn't support it
[22:31:09 CEST] <RandomCouch> the issue is when the two videos are merged, the playback is weird
[22:31:27 CEST] <JEEB> see ffprobe file.3gp
[22:31:35 CEST] <JEEB> and compare to ffprobe file.mp4
[22:31:41 CEST] <RandomCouch> when it plays the first part of the video, it plays fine, but when it gets to the second part, which is the second video file it starts playing it very choppy
[22:31:46 CEST] <RandomCouch> like the frame rate drops significantly
[22:32:39 CEST] <RandomCouch> if I play both videos separately they both play fine
[22:32:52 CEST] <RandomCouch> but when they're concatenated, the second part is choppy
[22:33:13 CEST] <kepstin> RandomCouch: how are you concatenating them?
[22:33:24 CEST] <RandomCouch> I'm using this command to concat them (they're both .ts files) -f concat -i files.txt -bsf:a aac_adtstoasc -c copy output.mp4
[22:33:36 CEST] <RandomCouch> in files.txt I'm just naming both files
[22:35:43 CEST] <RandomCouch> I'm running more tests, but would like to point out that this issue isn't consistent across all android devices, some devices can play the concatenated video jsut fine
[22:36:37 CEST] <kepstin> my guess is that the second video is higher framerate that the other, and the player has issue switching?
[22:36:42 CEST] <kepstin> hard to say
[22:37:14 CEST] <RandomCouch> The first video, which is recorded by the device, has a variable frame rate
[22:37:20 CEST] <RandomCouch> while the second video has a fixed frame rate
[22:37:39 CEST] <RandomCouch> I wasn't able to find anything on how to make a video have a fixed frame rate
[22:38:20 CEST] <kepstin> usually requires re-encoding it, and duplicating/dropping frames to even out the rate.
[22:38:40 CEST] <kepstin> (ffmpeg can do this with -vf fps or equivalently the -r output option)
[22:38:40 CEST] <RandomCouch> I'm not exactly sure how to do that
[22:38:49 CEST] <RandomCouch> hm
[22:38:53 CEST] <RandomCouch> I've tried -r 30
[22:38:58 CEST] <RandomCouch> but it didn't change anything
[22:39:25 CEST] <kepstin> you're using "-c copy", right? This requires re-encoding the video.
[22:39:31 CEST] <RandomCouch> O
[22:39:48 CEST] <RandomCouch> I'm first reencoding the recorded video to mpegts using this command
[22:39:53 CEST] <RandomCouch>  -c copy -bsf:v h264_mp4toannexb -r 30 -f mpegts
[22:40:21 CEST] <kepstin> yeah, the -r there does nothing. I'm actually surprised that it doesn't give you an error, tbh.
[22:40:33 CEST] Action: RandomCouch shrugs
[22:40:48 CEST] <RandomCouch> I don't know much on video encoding and such, so I mostly jsut try things out and see what works
[22:40:55 CEST] <RandomCouch> at this point nothing is working though
[22:41:00 CEST] <kepstin> (you would have gotten an error if you'd used "-vf fps=30" - which should do the exact same thing)
[22:41:24 CEST] <kepstin> but yeah, I really don't know why you're seeing choppy playback with the concatenated file
[22:43:32 CEST] <RandomCouch> Hm yeah I'm thinking it's possibly an android issue
[22:43:40 CEST] <RandomCouch> maybe specific devices don't support some specific codec
[22:44:16 CEST] <RandomCouch> Anyway time to head home, thanks for the help guys!
[22:44:18 CEST] <RandomCouch> :)
[23:26:51 CEST] <SolarAquarion> for some reason video isn't playing for the videos
[23:26:59 CEST] <SolarAquarion> only the audio
[00:00:00 CEST] --- Wed Aug  2 2017


More information about the Ffmpeg-devel-irc mailing list