[Ffmpeg-devel-irc] ffmpeg.log.20180523
burek
burek021 at gmail.com
Thu May 24 03:05:02 EEST 2018
[00:02:29 CEST] <wfbarksdale> kepstin: is calling av_frame_free safe in the context of my pipeline we where talking about?
[00:03:00 CEST] <wfbarksdale> i'm using c++ smart pointers, and its not clear if the deleter should be using av_frame_free or av_frame_unref
[00:03:13 CEST] <wfbarksdale> don't want to pull the buffers out from under the cached frame
[00:03:43 CEST] <kepstin> It depends how the memory of the struct avframe itself was allocated
[00:04:06 CEST] <wfbarksdale> av_frame_alloc()
[00:04:49 CEST] <kepstin> av_frame_unref frees the buffers only, and _free also frees the struct itself
[00:05:16 CEST] <wfbarksdale> but will _free abide by the reference counting on the buffers?
[00:05:24 CEST] <kepstin> Yes
[00:06:38 CEST] <wfbarksdale> thanks for the peace of mind
[00:12:54 CEST] <kepstin> Just remember that the ref counting is on the buffers in the frames, not the avframe object itself.
[00:13:44 CEST] <kepstin> So make sure you don't have two things sharing an avframe pointer
[00:16:54 CEST] <Kaedenn1> I have a ~3.5 hour VOD with a bunch of audio skips. I'd like to cut out all sections that have less than a certain threshold of audio. The video seems to be a chunked mp2t
[00:17:14 CEST] <Kaedenn1> Can I do this programatically with ffmpeg?
[00:20:00 CEST] <kepstin> You're not going to be able to do that with a single ffmpeg cli command. You might be able to write a script that uses ffmpeg to find the quiet sections then generates a command or series of commands to build a final video from the other sections.
[00:21:19 CEST] <nicolas17> or did you mean writing your own program using lavf when you said "programmatically"?
[00:21:30 CEST] <Kaedenn1> kepstin: I had a feeling that would be the case. However, I'm fine writing a script to do this.
[00:22:01 CEST] <Kaedenn1> nicolas17: I meant a way to identify and then remove quiet sections without me manually identifying all of the sections
[00:23:08 CEST] <kepstin> I think the "silencedetect" filter can be used to find quiet sections, I think it can be made to print out time ranges.
[00:23:20 CEST] <kepstin> Haven't used it myself
[00:27:20 CEST] <furq> printing out time ranges is the only thing it can do
[00:28:05 CEST] <furq> silenceremove is the one that trims silence
[00:37:53 CEST] <flubble> I'd like to add an srt subtile file to a mp4 container. I tried 'ffmpeg -i input.mp4 -i input.srt -c copy -c:s mov_text output.mp4
[00:38:17 CEST] <flubble> But get an Error: Invalid UTF-8 in decoded subtitles text; maybe missing -sub_charenc option
[00:39:05 CEST] <flubble> I suspect that the encoding of the srt is somehow wrong, but I don't know what I can do to fix it
[00:40:34 CEST] <flubble> Here is an example of the srt file: https://pastebin.com/ersZAcB7
[00:42:59 CEST] <Kaedenn1> flubble: You have non-UTF8 characters in there it seems
[00:43:40 CEST] <nicolas17> probably latin1
[00:45:59 CEST] <Kaedenn1> I can't figure out an encoding where \xe9 is e'
[00:46:11 CEST] <Kaedenn1> ...wait, I'm dumb
[00:46:16 CEST] <flubble> how can I determine which encoding is used?
[00:46:36 CEST] <Kaedenn1> it's probably latin1
[00:46:48 CEST] <Kaedenn1> try -sub_charenc LATIN1
[00:47:42 CEST] <Kaedenn1> flubble: a cursory google search gives https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options#Set_Subtitles_Character_Encoding_Conversion which lists LATIN1 as one of the known values. \xe9 parses nicely with latin1
[00:57:11 CEST] <flubble> Yessss! It worked, thank you very much Kaedenn1
[01:49:09 CEST] <laomaiweng> Hi there, with the new API how am I supposed to pass a 'const AVOutputFormat*' obtained from av_muxer_iterate() to avformat_alloc_output_context2()?
[10:59:17 CEST] <shfil> I was talking one week ago about issue ffmepg 4.0 no sound from mp3 files in playing cutscenes in openRW. I can't figure what is causing it. There's no errors in log and with older versions it works. Should I start issue on bug tracer?
[10:59:48 CEST] <JEEB> check the output sample rate, the default decoder for mp1/2/3 was switched to the higher quality floating point one
[10:59:56 CEST] <JEEB> not sure if it was between 3.4 and 4.0 but most likely
[11:00:29 CEST] <JEEB> the integer decoder is still available but generally people are recommended to utilize libswresample to convert to whatever audio format their output requires
[11:04:05 CEST] <shfil> thx, I will go for libswresample, do you know how can I use the integer decoder for quick test?
[11:08:37 CEST] <JEEB> seems like they share the name :/ but are different by just their AVCodec->sample_fmts listing
[11:08:50 CEST] <JEEB> one returns S16P as the first one, another FLTP
[11:08:59 CEST] <JEEB> I thought the signed one would get a suffix in the name...
[11:09:18 CEST] <JEEB> oh, I guess they do
[11:09:19 CEST] <JEEB> D.A.L. mp3 MP3 (MPEG audio layer 3) (decoders: mp3float mp3 )
[11:09:25 CEST] <JEEB> ffmpeg -codecs gives me two names
[11:09:37 CEST] <JEEB> so mp3float is now the default
[11:09:45 CEST] <JEEB> while mp3 is the integer one, I would guess
[11:10:01 CEST] <JEEB> checking the sample_fmts array will make it possible to check before opening the decoder
[11:12:10 CEST] <shfil> I get it, thanks
[12:28:09 CEST] <sunzofman1> is it possible to compile support for one codec without explicitly listing all others that may have been previously compiled? simply attempting to encode opus files to mp3. forgot to compile in mp3 encoding capability.
[13:23:18 CEST] <th3_v0ice> What is the best way to force FFmpeg to generate PTS for each segment? Lets say I have a live stream pipe. ffmpeg -i pipe:0 -f segment -f segment_time 10 -reset_timestamps 1 -fflags +genpts out%03d.ts. Is there a way to have pts and dts 0's for first packet in each segment? Previous command is not resetting them. Thanks!
[15:13:34 CEST] <Blacker47> i have some DV.avi files (audio muxed in the video stream?) what i try to cut with ffmpeg -i file -ss -to -c copy outfile but the audio get async on longer input videos (up to 4h). playing the input files with mpv is sync. any ideas how to manage this?
[16:12:09 CEST] <saml> how do I use --enable-rpath properly?
[16:12:35 CEST] <saml> I've been doing --extra-ldflags="'-Wl-rpath,$ORIGIN'"
[16:12:54 CEST] <saml> but, some libraries like libogg.so isn't searched within $ORIGIN
[16:13:38 CEST] <saml> ffmpeg elf itself does not NEED libogg.so
[16:13:51 CEST] <saml> looks like something else (libtheora.so?) needs libogg.so
[16:28:26 CEST] <kepstin> you'd probably have to enable rpath when linking that library, then
[16:29:33 CEST] <saml> hrm
[16:29:38 CEST] <saml> let me try --enable-rpath
[16:30:41 CEST] <saml> makefile so good bro. make clean; make
[16:30:47 CEST] <saml> bam and it builds
[16:31:39 CEST] <saml> but looks like i did something wrong. it doesn't build
[16:34:53 CEST] <saml> man someone needs to create ffmpeg build script so i can just use it instead of writing one myself
[16:39:45 CEST] <saml> --enable-rpath works. but libogg.so is still dangling
[17:13:06 CEST] <saml> https://trac.ffmpeg.org/wiki/CompilationGuide/Centos this compiles ogg, theora, vorbis with --disable-shared to get around libogg problem, i think
[17:40:49 CEST] <rungcc> Hello guys. I need help putting together an extremely complex ffmpeg command. Im trying to do this for months now, so I can get rid of telestream episode (i borowed a license temporarily from a friend). Here we go: I neet to create a MPEG-TS container with audio pid 482, video pid 481, pcr pid 481 and pmt pid 480, ts extension and 8mbps of constant bit rate and one PES per frame. The video itself need to have 7mbps constant bitrate, a keyframe every 30
[17:40:49 CEST] <rungcc> frames, a B frames every 2 frames and a reference frame also every 2 frames, the video need to be an interlaced 29,97fps frame rate with top field first, the audio need to be AC-3 with 192kbps and 48kHz sample rate. Does anyone know if this is possible with ffmpeg?
[17:42:01 CEST] <BtbN> Your gop setup sounds impossible
[17:42:20 CEST] <BtbN> you want IBIBIBIBIBIBIB...?
[17:43:08 CEST] <rungcc> it is how it has been working with the distributor at the moment I think, let me check with the manual just a sec& And BtbN , THANKS A MILLION for helping.
[17:43:48 CEST] <BtbN> not impossible with ffmpeg I mean, impossible in general.
[17:43:49 CEST] <ariyasu> if everyother frame is an i-frame, whats the point of the b frames
[17:43:58 CEST] <rungcc> at the manual& it is mentiones ad: GOP: maximum recomended = 60
[17:44:22 CEST] <rungcc> for 4k at least, let me also check the fullhd and sd manual.
[17:44:24 CEST] <BtbN> That's the length of it, but not its "layout"
[17:44:51 CEST] <rungcc> the fullhd manual is more detailed, just a sec
[17:46:27 CEST] <rungcc> format configuration reference 3 frames
[17:47:41 CEST] <kepstin> hmm, that gop sounds like IPBPBPB... or something like that, i'd think? which should be doable
[17:47:54 CEST] <kepstin> what video codec?
[17:48:00 CEST] <kepstin> mpeg-2? h264?
[17:48:08 CEST] <rungcc> Due to the nature of the trick-mode operation, it is recommended the utilization of a maximum GOP size of 15 frames. If, due to content requirements, such GOP is too restrictive, a biger GOP, no larger than 29 frames(1 IDR, or I frame, in every 30 frames, at least) is supported, although with inferior trick-mode appearance for the final user.
[17:48:25 CEST] <rungcc> this is how it is layed on the manual for fullhd deliveries
[17:48:36 CEST] <rungcc> the codec is h.264
[17:49:45 CEST] <rungcc> the team that put together their tvod platform are honestly, crazy& they put extremely low bitrates as well IMHO, but this isnt the problem itself
[17:50:38 CEST] <rungcc> the h.264 profile is high l4.0 btw
[17:50:50 CEST] <rungcc> not sure if has something to do with that.
[17:51:11 CEST] <kepstin> right, should be doable with libx264 if you just set gop size (-g), and use x264-specific options to set bframes to 1 and maybe b-pyramid to strict. You might have to use no-scenecut too.
[17:52:10 CEST] <rungcc> let me copy here what I was able to put together as a command :)
[17:52:31 CEST] <kepstin> x264 also supports an option to set specific frame types per frame, if you need a particularly strict sequency (although I've never used that, and dunno how it works)
[17:53:14 CEST] <rungcc> ffmpeg -i 4kvid.mov -vcodec libx264 -x264opts nal-hrd=cbr:force-cfr=1:keyint=60 -profile:v main -level 4.0 -r:v 29.97 -vf "tinterlace=4" -b:v 8000k -minrate 8000k -maxrate 8000k -bufsize 8000k -streamid 0:481 -acodec ac3 -c:a ac3 -b:a 192k -streamid 1:482 test.ts
[17:55:23 CEST] <kepstin> rungcc: well, you've set keyint to 60 there, which is longer than you said :) (sounds like it should be 30). Add the bframes=1 and b-pyramid=strict and no-scenecut options to your x264opts and you should be good.
[17:55:33 CEST] <kepstin> for the video encoding at least.
[17:56:40 CEST] <kepstin> (I forget whether that option parser supports 'no-scenecut' - if it doesn't, setting 'scenecut=0' should be equivalent)
[18:02:55 CEST] <rungcc> this encode is giving me also a variable bitrate
[18:04:30 CEST] <rungcc> kepstin, could you put together a command for this specs? I can pay you if this is the case :D maybe a ko.fi or something :D
[18:05:11 CEST] <kepstin> nah, that's not something I do. I'm just trying to give you pointers so you can figure it out yourself.
[18:05:12 CEST] <rungcc> Im honestly not that video oriented myself, have been busting my head trying to understand some of this specs and gops and things like that.
[18:05:46 CEST] <rungcc> kepstin: :( well, thanks for your help nevertheless
[18:05:56 CEST] <kepstin> you have nal-hrd=cbr so it's putting filler into the h264 stream, you might need some options on the mpeg-ts muxer.
[18:07:29 CEST] <kepstin> also, what makes you think it's producing variable bitrate? how are you checking that?
[18:07:40 CEST] <rungcc> mediainfo
[18:09:10 CEST] <rungcc> he is giving me VBR as spec for the video
[18:09:46 CEST] <rungcc> while the sample encode that the company sent me are marked as bit rate mode: constant
[18:19:17 CEST] <furq> rungcc: that shows as constant for me
[18:20:00 CEST] <rungcc> weird, maybe something related to the ffmpeg build used?
[18:21:08 CEST] <rungcc> let me encode a sample here.
[18:21:50 CEST] <rungcc> hey
[18:21:52 CEST] <rungcc> it worked.
[18:22:09 CEST] <furq> i thought you might need -muxrate but apparently not
[18:22:15 CEST] <rungcc> definitely something related to the build used. Im at home now, on linux 18.04 with apt version of ffmpeg
[18:22:19 CEST] <furq> fun
[18:23:03 CEST] <rungcc> it is weird that mediainfo now shows me bitrate and nominal bitrate
[18:23:09 CEST] <rungcc> and bitrate mode constant
[18:23:17 CEST] <rungcc> scan time is progressive still though.
[18:24:06 CEST] <furq> iirc for an interlaced encode you need -flags ilme+ildct
[18:34:34 CEST] <ChocolateArmpits> OR -x264-params interlaced=1 OR -x264-params tff=1 OR -x264-params bff=1
[19:15:08 CEST] <rungcc> still no luck configuring this encoding& :( If anyone is interested on making an extra money putting together ffmpeg commands for me, please send me a PM
[20:22:27 CEST] <a__pi> is possible to resume a m3u8 download with ffmpeg ?
[20:25:02 CEST] <nicolas17> an m3u8 file is a playlist of smaller files, so you can download the ones you're missing
[20:25:05 CEST] <nicolas17> what were you doing?
[21:04:02 CEST] <seeking_ffmpeg_s> Hi... I ran this... ffmpeg -i C:\Video\CarGoPro.mp4 -an -s 1920x1080 -tune "animation ref 1" C:\Video\CarGoPro.h264... in order to set number of reference frames in my output H.264 stream to 1... according to Wireshark RTP -> SPS -> h264.num_ref_frames still being larger than 1, it didn't seem to work... what am I doing wrong ?... Thanks :)
[21:09:20 CEST] <kepstin> seeking_ffmpeg_s: er, that's not what the tune option is for. You might want to use the -x264opts option to set advanced things, it takes basically the same set of options as the x264 command line tool does.
[21:13:25 CEST] <ChocolateArmpits> seeking_ffmpeg_s, why did you wrap a parameter in quotes? it should be -tune animation -refs 1
[21:17:21 CEST] <seeking_ffmpeg_s> Tried several syntax options... that's what worked... the way you suggest I got... [NULL @ 0000000002cf96c0] Unable to find a suitable output format for 'refs' ; refs: Invalid argument
[21:18:20 CEST] <ChocolateArmpits> seeking_ffmpeg_s, surely you borked the command line somehow else after that
[21:18:21 CEST] <seeking_ffmpeg_s> I looked at this... https://superuser.com/questions/564402/explanation-of-x264-tune
[21:18:51 CEST] <nicolas17> did you use refs or -refs?
[21:20:08 CEST] <seeking_ffmpeg_s> exactly as I wrote initially did not throw anything syntax wise, however didn't do the trick
[21:20:32 CEST] <kepstin> seeking_ffmpeg_s: the -tune option takes a single string value, from the list of available tunes. that link just shows what each tune option does behind the scenes.
[21:20:40 CEST] <ChocolateArmpits> seeking_ffmpeg_s, paste your command line
[21:21:01 CEST] <kepstin> seeking_ffmpeg_s: in order to change the refs and override the settings the tunes do, you have to use different options
[21:21:15 CEST] <seeking_ffmpeg_s> ffmpeg -i C:\Video\CarGoPro.mp4 -an -s 1920x1080 -tune "animation ref 1" C:\Video\CarGoPro.h264
[21:21:29 CEST] <nicolas17> that's not what ChocolateArmpits told you to try
[21:21:44 CEST] <seeking_ffmpeg_s> kepstin... how would you use -x264opts ?
[21:21:46 CEST] <nicolas17> there is no tuning preset called "animation ref 1"
[21:23:06 CEST] <kepstin> seeking_ffmpeg_s: -x264opts ref=1
[21:23:08 CEST] <kepstin> should do it
[21:28:18 CEST] <furq> you don't need to set that with x264opts
[21:28:28 CEST] <furq> just -tune animation -refs 1
[21:34:54 CEST] <seeking_ffmpeg_s> furq: It was suggested... syntax doesn't work
[21:36:21 CEST] <seeking_ffmpeg_s> kepstin: your syntax works, however output file changed to 25 fps & VLC doesn't identify its' duration
[21:36:56 CEST] <seeking_ffmpeg_s> maybe need to add -r 30 ?... although that's original frame rate
[21:48:30 CEST] <kepstin> seeking_ffmpeg_s: sounds like you changed something else, please paste your entire current command
[21:49:43 CEST] <seeking_ffmpeg_s> That's it... ffmpeg -i C:\Video\CarGoPro.mp4 -an -s 1920x1080 -x264opts ref=1 C:\Video\CarGoPro_opts_ref1.h264
[21:50:03 CEST] <seeking_ffmpeg_s> (and adding -r 30 to it didn't help)
[21:52:26 CEST] <kepstin> seeking_ffmpeg_s: oh, raw .h264 files don't preserve framerate. Please put the video into a container format instead
[22:00:36 CEST] <seeking_ffmpeg_s> I need to check which containers my streaming app can work with... will continue tomorrow at office ;) Many Thanks !
[22:26:20 CEST] <shfil> hi, been trying use swresampler for mono wav, I'm not able to convert it to AV_SAMPLE_FMT_S16P. It isn't possible to do, or do I something stupid?
[22:27:05 CEST] <shfil> With rest of files(stereo mp3) it works.
[22:28:15 CEST] <furq> shfil: p is planar
[22:28:25 CEST] <furq> i.e. the channels aren't interleaved
[22:28:32 CEST] <furq> that obviously makes no sense for mono
[22:29:27 CEST] <shfil> I was thinking it would store everything in data[0].
[22:29:41 CEST] <furq> is there some reason you're not just using s16
[22:29:48 CEST] <kepstin> shfil: didn't you want interleaved anyways? (i think you had some code to interleave the planes). Just request AV_SAMPLE_FMT_S16 to start with
[22:31:15 CEST] <shfil> we are using 16bit integers buffers in openAL, maybe it would be better if I show the code.
[22:32:21 CEST] <shfil> https://github.com/rwengine/openrw/pull/420/files#diff-e9cc6b7c0e9b40ae49ea18ed92518bfcR163
[22:33:21 CEST] <shfil> with AV_SAMPLE_FMT_S16 crashes :(
[22:35:47 CEST] <shfil> there with resampler https://gist.github.com/ShFil119/a49baef6ede5cda5f1b6ca87e1d0bef6
[22:37:56 CEST] <shfil> With AV_SAMPLE_FMT_S16 should I somehow change way of extracting data from frame?
[22:56:22 CEST] <radicate> Anyone knows of a way to stream a webcam (with dshow and ffmpeg) while still allowing other programs view the webcam properly?
[22:57:06 CEST] <kepstin> shfil: if you use _S16, you need to remove your code that interleaves the channels - the already-interleaved data will be stored in ->data[0]
[23:04:11 CEST] <shfil> but won't be two channel merged in one then? or there's some option for openAL?
[23:04:56 CEST] <shfil> hmmm, still no sound with mono mp3
[23:05:22 CEST] <shfil> (sorry for many stupid questions)
[23:05:53 CEST] <kepstin> of course the two channels are merged into a single data stream. That's exactly what interleaving does. In fact, that's exactly what the code under the comment "// Interleave left/right channels" in your code did
[23:06:33 CEST] <kepstin> it looks like openal expects audio with channels interleaved, so having libswsample give you data already in interleaved format saves you from having to do the interleave yourself.
[00:00:00 CEST] --- Thu May 24 2018
More information about the Ffmpeg-devel-irc
mailing list