Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 13:54 GMT+02:00 Carl Eugen Hoyos: > 2016-09-15 13:41 GMT+02:00 ssshukla26 : > > [...] > > Did you already look at other hardware decoders in current FFmpeg? You may be interested to see this patch on -devel: crystalhd: Use up-to-date bsf API http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/199734.html Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
under *./libavcodec/hevc_mp4toannexb_bsf.c* there is note as below. When private_spspps is zero then spspps_buf points to global extradata and bsf does replace a global extradata to own-allocated version (default behaviour). When private_spspps is non-zero the bsf uses a private version of spspps buf. This mode necessary when bsf *uses in decoder*, else bsf has issues after decoder re-initialization. Use the "*private_spspps_buf*" argument to activate this mode. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662662.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
Solved it by following code under *decode* function of decoder. if(*av_bitstream_filter_filter*(decoder->bsf, avctx, "*private_spspps_buf*", >pkt.data, >pkt.size, avpkt->data, avpkt->size, !!(avpkt->flags & AV_PKT_FLAG_KEY)) < 0) { ERROR("Error: unable to convert data from avcc to annexb"); } else { //Do decoding of decoder->pkt.data instead of avpkt->data } -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662661.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 13:41 GMT+02:00 ssshukla26: [...] Did you already look at other hardware decoders in current FFmpeg? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
Ok. I might be wrong, but the demuxers are only for extracting data out of the container ! Right ? So If that the case, any decoder will receive data in *AVCC* format when *mp4* files are used as input ? So one must convert data from avcc to annexb format under the decoder ? -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662657.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 13:30 GMT+02:00 ssshukla26: > But I don't understand one thing, my decoder is working properly > with a *h264* file in proper AnnexB data format, and when using > *mp4* file which is in AVCC format, the demuxing which should take > place is not taking place at all ! I may misunderstand you but I (strongly) suspect it is not the > demuxers job to mess with video data. Again: Please look at what other existing hardware decoders in FFmpeg do. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
Yup. that's true. But I don't understand one thing, my decoder is working properly with a *h264* file in proper AnnexB data format, and when using *mp4* file which is in AVCC format, the demuxing which should take place is not taking place at all ! Does that mean I need to configure the demuxer with my decoder or something like that ? -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662655.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 13:19 GMT+02:00 ssshukla26: > It runs properly, with "*h264*" (default) software decoder without using bit > stream filter. > > Which makes me believe that I must be missing something in configuring > decoder to receive proper demuxed data, but I dont know what I am missing ! Do I understand correctly that your hardware decoder only accepts data in Annex B format, not in avcC? I suspect this is also true for other hardware decoders already in FFmpeg, check what they do. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
It runs properly, with "*h264*" (default) software decoder without using bit stream filter. Which makes me believe that I must be missing something in configuring decoder to receive proper demuxed data, but I dont know what I am missing ! -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662653.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 13:10 GMT+02:00 ssshukla26: > I have made a custom decoder with name "*h264_qhw*" and id > "*AV_CODEC_ID_H264*". What happens if you test your code (without the bitstream filter) with the existing software decoder? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
2016-09-15 11:05 GMT+02:00 ssshukla26: > After debugging, I realized that my decoder is getting data in *AVCC* > format, so on application side I added bit stream filter > "*h264_mp4toannexb*" and everything worked. Which decoder are you using? There should be no bitstream filter needed for FFmpeg decoder afair. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Demuxer not giving proper data to decoder ?
After debugging, I realized that my decoder is getting data in *AVCC* format, so on application side I added bit stream filter "*h264_mp4toannexb*" and everything worked. No artefacts at all. So to make sure that my decoder use data in *AnnexB* format, I added *h264_mp4toannexb* filter *inside* decoder, filtering the incoming packet data, so I don't have to change anything on application side. But I am getting the below error. "*Packet header is not contained in global extradata, corrupted stream or invalid MP4/AVCC bitstream*" Please help. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Demuxer-not-giving-proper-data-to-decoder-tp4662628p4662645.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user