Re: [Libav-user] How to use hwaccel H264 CUVID decoder from ffmpeg API?

2018-05-28 Thread Michael IV
I advice you to go to Nvidia website and download their VideoSDK. All the answers to your questions are there )) On Mon, May 28, 2018 at 4:51 PM, Sergio Basurco < sergi...@coherentsynchro.com> wrote: > I have a nice H264 decoder based on this one: > > http://roxlu.com/2014/039/decoding-h264-and-

Re: [Libav-user] How to use an existing CUDA context for decoding

2018-05-23 Thread Michael IV
Not sure if this is the right place, but Nvidia Video SDK page contains wonderful examples with runnable source code which shows you how to decode and encode. That's not FFMPEG, but from what you're trying to do it sounds like you can do most of it with Nvidia NVENC and NVDEC and just use AV lib to

[Libav-user] "Delay between the first packet and last packet in the muxing queue is"

2018-04-16 Thread Michael IV
Hi guys, I am muxing video and audio into mp4. The final file looks ok,but during the muxing session I am getting this error all the time. Can just discard it or there is an issue I need to solve here? *[mp4 @ 023c51dc7880] Delay between the first packet and last packet in the muxing queue is

[Libav-user] Audio stream is longer than video when muxing

2018-03-26 Thread Michael IV
Hi. I will ask again,as nobody answered. I am performing muxing,based on muxing.c example.But in my case the audio comes from a file,which sometimes is longer (in terms of duration) then the video stream. For some reason,even that I am checking and comparing current times of both streams,at the end

Re: [Libav-user] codec id for wav encoding

2018-03-23 Thread Michael IV
AV_CODEC_ID_PCM_S16LE Yeah ,probably this is it. I write PCM 16bit. Thanks. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user

Re: [Libav-user] codec id for wav encoding

2018-03-23 Thread Michael IV
You're right.Let me rephrase: I need to encode the data so that the encoded frame contains PCM16 . What codec ID do I need to use for that? I see in the ID list all sorts of PCM and I am not sure which to choose. Thanks. ___ Libav-user mailing list Liba

[Libav-user] codec id for wav encoding

2018-03-23 Thread Michael IV
Hi, what is the codec id for wav enoding? I see in encode_audio.c AV_CODEC_ID_MP2 is used. So is this the correct id to write wav files? Thanks. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user

[Libav-user] Muxing audio and video streams with different length

2018-03-19 Thread Michael IV
Hi all. I have a nasty bug. I have written a muxer,which is based on muxing.c sample. The only different is that in my case audio stream comes from AAC file.And if the sound track's time is longer than video total time,then the overall resulting video time becomes larger than expected. Here is the

[Libav-user] Synchronization of audio and video streams during muxing

2018-03-17 Thread Michael IV
Hi, I am rewriting some messy FFMPEG code I wrote a while ago. My reference is muxing.c The difference I have is that my audio stream comes from file (AAC) ,while video packets come from generated pixel frame. I mostly have it working,but my problem is interleaved packets write.If I do it like the

[Libav-user] Fratctional fps

2018-03-16 Thread Michael IV
Hi . I am muxing a video stream. Setting 60 fps. But when inspecting codec info in VLC it shows me FPS: 60.20668 Is it normal? In ffprob everything looks fine. VLC plays the video also fine. But Adobe aftereffects,fails to read the whole video fine. What can be the issue here? I do all exaclty as

Re: [Libav-user] New api and deprecation warning

2018-03-15 Thread Michael IV
*AVCodecParameters is for information that codecs need to do their workbut is stored in a structured way in the container format rather thanencoded in the bitstream. Codecs vary in what they need and what theyput in the bitstream, and formats vary in what they are able to encode,but there is enough

Re: [Libav-user] New api and deprecation warning

2018-03-14 Thread Michael IV
en you need to > tell the encoder to put its details in the header also. > > Salsaman. > > > http://lives-video.com > https://www.openhub.net/accounts/salsaman > > On Wed, Mar 14, 2018 at 5:31 PM, Michael IV wrote: > >> Hi Anton. I see what you mean, but I actually use

Re: [Libav-user] New api and deprecation warning

2018-03-14 Thread Michael IV
Hi Anton. I see what you mean, but I actually use that internal context,and it works perfectly. For video I am getting h264 NALs from somewhere,so I don't perform encoding at all. For audio, I am opening existing audio files/ streams with data in the format I need,so I don't transcode,but just pass

Re: [Libav-user] New api and deprecation warning

2018-03-14 Thread Michael IV
xing of input inStream into mAudioOutStream... So I don't get it. On Wed, Mar 14, 2018 at 9:52 PM Michael IV wrote: > Exactly: > > > *For muxing/encoding:avcodec_parameters_from_context(stream->codecpar, > codec_ctx); * > > That's what I am talking about.In

Re: [Libav-user] New api and deprecation warning

2018-03-14 Thread Michael IV
y I have to create codec context just to get rid of those warnings. On Wed, Mar 14, 2018 at 9:44 PM Philippe Gorley < philippe.gor...@savoirfairelinux.com> wrote: > On 2018-03-14 03:26 PM, Michael IV wrote: > > Hi. I am trying to get rid of deprecation warning in the API. I am >

[Libav-user] New api and deprecation warning

2018-03-14 Thread Michael IV
Hi. I am trying to get rid of deprecation warning in the API. I am running with ffmpeg -20170711 version. I have a code where I don't explicitly create AVCodecContext because I multiplex already existing h264 NALS. But I still have to setup AVStream which has AVCodecContext which it creates interna

Re: [Libav-user] Audio frames and resampling

2018-03-14 Thread Michael IV
Thanks for the tip.Will look into it. On Wed, Mar 14, 2018 at 6:48 PM Gonzalo Garramuño wrote: > > > El 14/03/18 a las 09:03, Michael IV escribió: > > Hi.I have the following case: > > I am receiving audio stream which consist > > of 2 channel float 32 (non plan

Re: [Libav-user] Audio frames and resampling

2018-03-14 Thread Michael IV
Well I cracked this one. The audio encoding example is not a good fit for formats like aac. One has to use also output format and write container for this thing to work as expected. Raw aac stream is useless. On Mar 14, 2018 15:42, "Michael IV" wrote: > Just a dumb quest

Re: [Libav-user] Audio frames and resampling

2018-03-14 Thread Michael IV
t; 2018-03-14 13:13 GMT+01:00, Michael IV : > > So I am using that lib as you can see. > > Yes, sorry... > > Carl Eugen > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user &g

Re: [Libav-user] Audio frames and resampling

2018-03-14 Thread Michael IV
So I am using that lib as you can see. Or you mean something else? On Wed, Mar 14, 2018 at 2:10 PM Carl Eugen Hoyos wrote: > 2018-03-14 13:03 GMT+01:00, Michael IV : > > > I resample from non planar FLT to FLTP as follows: > > While I didn't check, I would expect

[Libav-user] Audio frames and resampling

2018-03-14 Thread Michael IV
Hi.I have the following case: I am receiving audio stream which consist of 2 channel float 32 (non planar) audio frames. Then I am trying to convert those into AV_SAMPLE_FMT_FLTP in order to encode with AAC codec. The problem is that I receive that data as packets of size different from what my AV

[Libav-user] Encode PCM16 to AAC

2018-03-13 Thread Michael IV
Hi. I have a PCM 16 bit (signed) stream,which I want to encode using AAC codec. Now I am following the setup of audio encoding example and where I check for SAMPLE FMT support by the codec,the check fails: while (*p != AV_SAMPLE_FMT_NONE) { if (*p == c->sample_fmt) { break; } p++; } Beca

[Libav-user] Fragmented mp4 with audio stream issue

2017-12-10 Thread Michael IV
I am streaming fragmented MP4 into browser video tag via websocket.On the browser side I use MSE to accept and process fragments. Now,as long as I stream only video,without adding AAC audio stream,it works fine. But it doesn;t work with audio at all.No video and and the sound playback gets playe

[Libav-user] Flushing AVIOContext

2017-11-24 Thread Michael IV
Hi! I am trying to reuse AVIOContext. I call avio_flush() after finihsing muxing and before starting next session. But in this case the output video is corrupted.The corruption is in the header.The AVCC info is missing,which leads me to think that the first thing the avio does at the beginning of

[Libav-user] Write header more than once

2017-11-19 Thread Michael IV
Hi. I am trying to reuse already created instances of AVFormatContext,AVCodecContext and AVIOContext. My question is related to avformat_write_header() with parameters. At the end of the session I usually call avcodec_parameters_free to free internal buffers. Do I have also to call this method

[Libav-user] Writing AVCC extra data in header

2017-11-17 Thread Michael IV
Hi. I am trying to understand something regarding AVCC info when muxing elementary h264 stream into mp4.SO far I was adding extra data which is SPS and PPS that I retrieve from h264 encoder. But when I analized the mp4 file I found that all the AVC stuff like AVC profile AVC level AVC NALU length s

Re: [Libav-user] SPS PPS header

2017-11-15 Thread Michael IV
Btw, I turned off the auto spspps insertion on my h264 bitstream encoder and put this info only into mp4 container header when muxing. It doesn't work. The muxer produces invalid data. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/ma

Re: [Libav-user] SPS PPS header

2017-11-14 Thread Michael IV
Which probably means this is not an important one? I am asking these maybe "silly " question because I am streaming fragmented MP4 to browser. Firefox has no problems, but Chrome has.It fails on the two first nals. That's why I am trying to see maybe it's because I have spspps header embedded both

Re: [Libav-user] SPS PPS header

2017-11-14 Thread Michael IV
Thanks John. Can you tell me where I set that "sample entry "? Is it a part of sps pps bits? On Nov 14, 2017 6:07 PM, "John Stebbins" wrote: On 11/14/2017 03:10 AM, Michael IV wrote: > Hi. I am not sure about the following setup. > I create elementary h264 bitst

[Libav-user] SPS PPS header

2017-11-14 Thread Michael IV
Hi. I am not sure about the following setup. I create elementary h264 bitstream using h264 encoder. I append SPS PPS nals to the start of the stream because I stream this raw bitstream to some presentation endpoint. But now I also have a use case where I wrap that stream into mp4 container. Should

[Libav-user] Fragmented MP4 muxing

2017-11-13 Thread Michael IV
HI All. If I need to stream fragmented mp4 chunks, what are the optimal flags? I see in the web something like this: "frag_keyframe+empty_moov" or something like that: empty_moov+faststart-default_base_moof What effect does "default_base_moof" flsg have ? Thanks. ___

Re: [Libav-user] Synchronizing video and audio playback

2017-11-11 Thread Michael IV
Does ffplay.c shed some light? I am interested to learn this too. On Nov 11, 2017 11:36 PM, "Patrick Cusack" wrote: > I am looking for example code on synchronizing audio and video playback of > a simple .mov container file (the streams could be comprised of ppm/aac and > dnhd/prores/h264). I h

Re: [Libav-user] Can't get MPEG4 decoder

2017-11-10 Thread Michael IV
Guys, you didn't follow my last question. I don't need a help with the API usage. I am quite fine with that. I tried to attract your attention to the fact that after I retrieve the info my streams contain uninitialized codecpar . Which looks weird. The ffmpeg version is from chrome. It's hacked. A

Re: [Libav-user] Can't get MPEG4 decoder

2017-11-09 Thread Michael IV
re looking for. > > Good luck, > Dan > > > On Nov 9, 2017 at 9:38 AM, > wrote: > > But now I see in vlc that the MPEG4 codec is actually named "mp4v" .So > that's the name I have to specificy in --enable-decoder when doing FFMPEG > config

Re: [Libav-user] Can't get MPEG4 decoder

2017-11-09 Thread Michael IV
But now I see in vlc that the MPEG4 codec is actually named "mp4v" .So that's the name I have to specificy in --enable-decoder when doing FFMPEG config? On Thu, Nov 9, 2017 at 7:26 PM, Michael IV wrote: > And testing the actual codecId of the video stream in the file I am a

Re: [Libav-user] Can't get MPEG4 decoder

2017-11-09 Thread Michael IV
st->codec; dec = avcodec_find_decoder(dec_ctx->codec_id); * where ec_ctx->codec_id == AV_CODEC_ID_MPEG4* On Thu, Nov 9, 2017 at 7:22 PM, Michael IV wrote: > Hi, thanks for the input. Now I am confused even more. All I need is to > start demuxing an mp4 file. Those codecs test abov

Re: [Libav-user] Can't get MPEG4 decoder

2017-11-09 Thread Michael IV
ing location: *pFormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO* Because my *codecpar *is not initialized. That's what I don't understand here. On Nov 9, 2017 8:14 PM, "Carl Eugen Hoyos" wrote: > Hi! > > > Am 09.11.2017 um 17:13 schri

[Libav-user] Can't get MPEG4 decoder

2017-11-09 Thread Michael IV
Hi All. What maybe a reason that avcodec_find_decoder returns NULL ? I enabled in my FFMPEG build MOV and h264 demuxer. Configure report clearly states that. But doing this test: av_register_all(); avcodec_register_all(); avformat_network_init(); AVCodec* h264codc =

[Libav-user] avformat_open_input protocol not found

2017-11-08 Thread Michael IV
Hi guys. I have a weird error. I want to open input file with avformat_open_input. And I am getting the error "protocol not found" Here is the code: pCodecCtx = NULL; pFormatCtx = NULL; avcodec_register_all(); av_register_all(); avformat_network_init(); pFormatCtx = avform

Re: [Libav-user] Faster X265 encoding, buying new hardware, advice please?

2017-10-29 Thread Michael IV
I never did 1:1comparison, but it's more than satisfactory. And it's blazing fast. On Oct 29, 2017 3:52 PM, "Carl Eugen Hoyos" wrote: > 2017-10-29 9:14 GMT+01:00 Michael IV : > > I would recommend to invest into good Nvidia GPU and use > > NVENC which o

Re: [Libav-user] Faster X265 encoding, buying new hardware, advice please?

2017-10-29 Thread Michael IV
I would recommend to invest into good Nvidia GPU and use NVENC which outperforms libx264 and reduces CPU consumption dramatically. On Oct 28, 2017 10:51 PM, "Carl Eugen Hoyos" wrote: 2017-10-25 22:09 GMT+02:00 Dave : > Should I be wary of AMD though or do the more modern CPUs support > the sam

[Libav-user] correct use of swr_convert for PCM float to PCM16

2017-10-09 Thread Michael IV
Hy guys,need a little help here. I am reading audio buffer from WASAPI which is in PCM float 32 format. I am using libswrescale to convert it to PCM S16 Getting a lot of noise along with the original sound . I asked a related question on SO: https://stackoverflow.com/questions/46645109/windowswa

Re: [Libav-user] Encoding MPEG DASH

2017-09-28 Thread Michael IV
I have tried with dash.js and with VLC. In fact vlc doesn't play even dash samples which I downloaded from the web. What is CLI? On Sep 29, 2017 12:40 AM, "Carl Eugen Hoyos" wrote: 2017-09-28 18:40 GMT+02:00 Michael IV : > Hi all. > > I have two questions: > >

[Libav-user] Encoding MPEG DASH

2017-09-28 Thread Michael IV
Hi all. I have two questions: 1) is there any example how to encode video (h264) into MPEG DASH? I tried doing it with setting output file name to be with extension ".mpd" and avformat_alloc_output_context2(&mOutputFormatContext, NULL, "dash", filename.c_str()) This setup produces single .mpd fi

Re: [Libav-user] avcodec_copy_context deprecation

2017-09-28 Thread Michael IV
like uncompleted refactoring of the api. On Sep 28, 2017 5:03 PM, "Power Pan" wrote: On Thu, Sep 28, 2017 at 7:30 PM, Michael IV wrote: > Hi! > I am getting compiler warning for avcodec_parameters_copy being deprecated. > > But I also can't figure out how to use avc

[Libav-user] avcodec_copy_context deprecation

2017-09-28 Thread Michael IV
Hi! I am getting compiler warning for avcodec_parameters_copy being deprecated. But I also can't figure out how to use avcodec_parameters_copy when I have AVStream as destination and AVCodecContext as src .AVCodecContext doesn't have AVCodecParamters property. ___

[Libav-user] Writing frames into custom buffer

2017-09-27 Thread Michael IV
Hi! I want to accumulate results of av_interleaved_write_frame() in a buffer instead of a file. avformat_alloc_output_context2() file name parameter can be null. That probably means I should be able to access some internal buffer with the write frames?Or can I supply a custom buffer to write the

Re: [Libav-user] av_open_input_stream() with the new API

2017-09-27 Thread Michael IV
Ok,I think I got it.In my case I have to use av_parser_parse2() to get h264 frame into packet,then mux into interleaved frame. On Wed, Sep 27, 2017 at 1:46 PM, Michael IV wrote: > What I understood from doc/examples/muxing.c is that it operates on YUV > frames. > My data is raw h

Re: [Libav-user] av_open_input_stream() with the new API

2017-09-27 Thread Michael IV
What I understood from doc/examples/muxing.c is that it operates on YUV frames. My data is raw h264 NALUs stream from NVENC and I want mux those directly into TS adding audio frames . On Wed, Sep 27, 2017 at 1:36 PM, Carl Eugen Hoyos wrote: > 2017-09-27 11:19 GMT+02:00 Michael IV : >

Re: [Libav-user] help required for creating MPEGTS from raw h264 & PCM Audio

2017-09-27 Thread Michael IV
I join Ajay's question. I found this very old and incomplete example: https://lists.libav.org/pipermail/libav-user/2009-May/003034.html What it does it first decodes h264 from a file and writes it into stream. The example has some code that attempts to setup audio frame but it doesn't mux it int

[Libav-user] av_open_input_stream() with the new API

2017-09-27 Thread Michael IV
I am trying to open input stream,and I found an example which seems to be pretty old : https://lists.libav.org/pipermail/libav-user/2009-May/003034.html So I am moving step by step converting the old API to the new one. Now I have this part: AVFormatParameters params, *ap = ¶ms; memset(ap,

Re: [Libav-user] Adding alpha channel to h264 encoder

2017-09-12 Thread Michael IV
As far as I know h264 doesn't support alpha. But VP8 does. On Sep 12, 2017 2:06 PM, "Davood Falahati" wrote: > Dear community, > > I have a opevCV Mat frame, call it mask. I decode frames into AVFrame, > convert AVFrame to openCV Mat and encode them into AVPacket again. > > Now, I want to add

Re: [Libav-user] Decoding h264 (NV12) stream from NVENC

2017-07-31 Thread Michael IV
, how do I flip the frame vertically on decoding ? On Jul 31, 2017 2:07 PM, "jing zhang" wrote: You should use decoded AVFrame->format to check decoded yuv format. Maybe H.264 bitstream encoded by NVENC is corrupted? 2017-07-31 16:27 GMT+08:00 Michael IV : > So you basically say

Re: [Libav-user] Decoding h264 (NV12) stream from NVENC

2017-07-31 Thread Michael IV
aming from NVENC. https://stackoverflow.com/questions/33185966/how-to-stream-h-264-video-over-udp-using-the-nvidia-nvenc-hardware-encoder And I currently don't set those params for encoder.Do I have to? On Mon, Jul 31, 2017 at 11:04 AM, Hendrik Leppkes wrote: > On Mon, Jul 31, 2017 at 10

[Libav-user] Decoding h264 (NV12) stream from NVENC

2017-07-31 Thread Michael IV
Hi! I am using NVENC encoder to create h264 stream.The YUV format is NV12. Now, I need also to decode that stream back to YUV.I wrote a module for that,based on this example: https://gist.github.com/roxlu/9329339 But, because my YUV format is not 420P, but NV12 I am trying to force it on AVCodecC