From anshul.ffmpeg at gmail.com Sat Feb 1 07:08:30 2014 From: anshul.ffmpeg at gmail.com (anshul) Date: Sat, 01 Feb 2014 11:38:30 +0530 Subject: [Libav-user] Tearing sound when I concat the audio files Message-ID: <52EC8F5E.7030907@gmail.com> Hi I am using api avformat_seek_file(ctx->audio.in_fmt, -1, 0, 0, 0, 0); when eof file is received av_read_frame.I want to restart the same audio Thanks Anshul From vojtech at kral.hk Sat Feb 1 12:52:10 2014 From: vojtech at kral.hk (=?UTF-8?Q?Vojt=C4=9Bch_Kr=C3=A1l?=) Date: Sat, 01 Feb 2014 12:52:10 +0100 Subject: [Libav-user] MPEG-2 bitstream & huffman coding Message-ID: <1d60a1c33e4129a52b17488a892e1c80@kral.hk> Hello, for my current project I need to learn about MPEG-2 video bitstream format as well as how huffman/vlc coding is applied for MPEG-2. Using ffmpeg I can extract raw stream, using libav I'm able to extract raw frames. Would it be possible to extract raw data after vlc decoding but before video decoding? This would be very useful because I could study the bitstream structure on real data. I am willing to modify libav code if need be. I have already identified the parts of libav code which implement vlc decoding. (It seems it's also used by other codecs.) I'd be glad if you could point me in general direction as to how this could be done. Also, is there any information source describing MPEG-2 bistream format besides the standard? The standard itself is very large, very verbose and it's quite a challenge to find and extract relevant information. Thanks for any advice. Best Regards, Vojt?ch Kr?l From yurkao at gmail.com Sat Feb 1 22:47:38 2014 From: yurkao at gmail.com (=?UTF-8?B?WXVyaSBPbGV5bmlrb3YgKNeZ15XXqNeZINeQ15XXnNeZ15nXoNeZ16fXldeR?=) Date: Sat, 1 Feb 2014 23:47:38 +0200 Subject: [Libav-user] Remuxing video file Message-ID: hello, i am new to libav. after reading documentation and examples for serveral weeks, i tried to write simple remuxing (e.g mp4->avi) w/o decoding/encoding, just like *ffmpeg -i inputfile.mp4 -f avi -c:v copy -an output.avi.* however both VLC and windows media player refuse to play output avi file - no video playback. moreoever ffprobe on output file shows me incorrect duration and bitrate. moreover, though the output file contains only video streams and lacks audio streams it's much bigger than the input file: -rw-r--r-- 1 me me 28689538 Feb 1 13:00 inputk.mp4 -rw-r--r-- 1 me me 77916554 Feb 1 13:40 output.avi i am definitely missing somesthing. again, my appologies, i'm a new to libav*. :( thanks for help. PS: sorry for long mail. my shortened code: avformat_open_input(&ic, infname, NULL, NULL); avformat_find_stream_info(ic, NULL); oc = avformat_alloc_context(); oc->oformat = av_guess_format("avi", NULL, NULL); /**no need to open encoders/decoders since i do no want to recode the frames) **/ memmove(oc->filename, outfname, strlen(outfname)); avio_open(&oc->pb, outfname, AVIO_FLAG_WRITE); // stripped map input video streams to output video streams block avformat_write_header(oc, NULL); for(i=0; av_read_frame(ic, &inpacket)>=0; i++, av_free_packet(&inpacket)) { idx = inpacket.stream_index; stream = ic->streams[idx]; if(stream_map[idx]==-1){ continue; } if(ic->streams[stream_map[idx]]->codec->codec_type!=AVMEDIA_TYPE_VIDEO) continue; av_copy_packet(&outpacket, &inpacket); outpacket.stream_index = stream_map[idx]; av_interleaved_write_frame(oc, &outpacket); av_free_packet(&outpacket); } av_write_trailer(oc); my full code: https://github.com/yurkao/libavformat-test/blob/master/remux.c ffprobe original.mp4 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'original.mp4': > Metadata: > major_brand : mp42 > minor_version : 1 > compatible_brands: isommp41avc1 > creation_time : 2011-05-05 18:09:35 > Duration: 00:01:10.04, start: 0.000000, bitrate: 3277 kb/s > Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 3150 kb/s, 29.96 fps, 29.96 tbr, 29956 tbn, 59.92 tbc (default) > Metadata: > creation_time : 2011-05-05 18:09:35 > handler_name : ?Apple Video Media Handler > Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 123 kb/s (default) > Metadata: > creation_time : 2011-05-05 18:09:35 > handler_name : ?Apple Sound Media Handler > Stream #0:2(eng): Data: none (mp4s / 0x7334706D), 0 kb/s (default) > Metadata: > creation_time : 2011-05-05 18:09:35 > handler_name : ? > Stream #0:3(eng): Data: none (mp4s / 0x7334706D), 0 kb/s (default) > Metadata: > creation_time : 2011-05-05 18:09:35 > handler_name : ? ffprobe output.avi > Input #0, avi, from 'output.avi': > Metadata: > encoder : Lavf55.19.104 > Duration: 09:43:16.62, start: 0.000000, bitrate: 17 kb/s > Stream #0:0: Video: h264 (Main) (H264 / 0x34363248), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 59.92 fps, 0.06 tbr, 59.92 tbn, 59.92 tbc Linux ffmpeg libs: Version: 2.1.3 OS: Ubuntu 12.04.3 LTS amd64 compiler: gcc 4.6.3 > --disable-doc --enable-shared --disable-network --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libvpx --enable-libfaac --enable-libopenjpeg --disable-ffserver --enable-postproc --disable-w32threads --disable-os2threads --disable-indevs --disable-outdevs --disable-avdevice --disable-x11grab --enable-pic --enable-zlib --enable-bzlib --enable-shared --enable-avresample --enable-swscale --enable-swresample --enable-postproc --enable-avfilter --enable-avformat --enable-avcodec --enable-avutil Windows ffmpeg libs: Version: ffmpeg-20140121-git-13e0109-win32-shared OS: Windows 7 64 bit compiler: VS 2010 target 32bit -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrebrice at optonline.net Sun Feb 2 01:37:21 2014 From: pierrebrice at optonline.net (Pierre Brice) Date: Sat, 01 Feb 2014 19:37:21 -0500 (EST) Subject: [Libav-user] MPEG-2 bitstream & huffman coding In-Reply-To: <1d60a1c33e4129a52b17488a892e1c80@kral.hk> References: <1d60a1c33e4129a52b17488a892e1c80@kral.hk> Message-ID: <23f384fc.76ab.143f0073bc8.Webtop.44@optonline.net> One reference you might want to check is? Digital Video: An Introduction to MPEG2-2, Barry, G. Haskell, Atul Puri, and Arun N. Netravali, 1997, It has information about the bitstream structure. Best regards P. B. On Sat, Feb 01, 2014 at 06:52 AM, Vojt?ch Kr?l wrote: > Hello, > for my current project I need to learn about MPEG-2 video bitstream > format > as well as how huffman/vlc coding is applied for MPEG-2. > Using ffmpeg I can extract raw stream, using libav I'm able to extract > raw frames. > > Would it be possible to extract raw data after vlc decoding but before > video decoding? > This would be very useful because I could study the bitstream > structure on real data. > I am willing to modify libav code if need be. I have already > identified the parts of libav > code which implement vlc decoding. (It seems it's also used by other > codecs.) > I'd be glad if you could point me in general direction as to how this > could be done. > > Also, is there any information source describing MPEG-2 bistream > format besides the standard? > The standard itself is very large, very verbose and it's quite a > challenge to find and extract > relevant information. > > Thanks for any advice. > Best Regards, > Vojt?ch Kr?l > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From anshul.ffmpeg at gmail.com Sun Feb 2 07:22:13 2014 From: anshul.ffmpeg at gmail.com (anshul) Date: Sun, 02 Feb 2014 11:52:13 +0530 Subject: [Libav-user] Info regarding API clip_interval Message-ID: <52EDE415.50709@gmail.com> Hi guys In file libavfilter/drawutils.c there is a function called clip_interval static void clip_interval(int wmax, int *x, int *w, int *dx) what does the parameter means over here, means what is x and what is w wmax is understood to me. I came over here, since valgrind showed me that I am using uninitialized memory. Thanks Anshul From anshul.ffmpeg at gmail.com Sun Feb 2 07:32:03 2014 From: anshul.ffmpeg at gmail.com (anshul) Date: Sun, 02 Feb 2014 12:02:03 +0530 Subject: [Libav-user] Info regarding API clip_interval In-Reply-To: <52EDE415.50709@gmail.com> References: <52EDE415.50709@gmail.com> Message-ID: <52EDE663.5000401@gmail.com> On 02/02/2014 11:52 AM, anshul wrote: > Hi guys > > In file libavfilter/drawutils.c there is a function called clip_interval > > static void clip_interval(int wmax, int *x, int *w, int *dx) > what does the parameter means over here, means what is x and what is w > wmax is understood to me. > > I came over here, since valgrind showed me that I am using > uninitialized memory. > > Thanks > Anshul Hi In source code there is reallocation of memory 935 if ((len = s->expanded_text.len) > s->nb_positions) { 936 if (!(s->positions = 937 av_realloc(s->positions, len*sizeof(*s->positions)))) 938 return AVERROR(ENOMEM); 939 s->nb_positions = len; and I didn't found any initialization of positions, and we are using uninitialized position in clip filter. would it be ok to initialize just after allocating the memory. Thanks Anshul From vojtech at kral.hk Sun Feb 2 11:09:19 2014 From: vojtech at kral.hk (=?UTF-8?Q?Vojt=C4=9Bch_Kr=C3=A1l?=) Date: Sun, 02 Feb 2014 11:09:19 +0100 Subject: [Libav-user] MPEG-2 bitstream & huffman coding In-Reply-To: <23f384fc.76ab.143f0073bc8.Webtop.44@optonline.net> References: <1d60a1c33e4129a52b17488a892e1c80@kral.hk> <23f384fc.76ab.143f0073bc8.Webtop.44@optonline.net> Message-ID: <9d542037c2d914d732def784b2c4ee70@kral.hk> That looks promising, thanks a lot! Regards ~VK On 2014-02-02 01:37, Pierre Brice wrote: > One reference you might want to check is? Digital Video: An > Introduction to MPEG2-2, Barry, G. Haskell, Atul Puri, and Arun N. > Netravali, 1997, It has information about the bitstream structure. > Best regards > P. B. > > > On Sat, Feb 01, 2014 at 06:52 AM, Vojt?ch Kr?l wrote: > >> Hello, >> for my current project I need to learn about MPEG-2 video bitstream >> format >> as well as how huffman/vlc coding is applied for MPEG-2. >> Using ffmpeg I can extract raw stream, using libav I'm able to extract >> raw frames. >> >> Would it be possible to extract raw data after vlc decoding but before >> video decoding? >> This would be very useful because I could study the bitstream >> structure on real data. >> I am willing to modify libav code if need be. I have already >> identified the parts of libav >> code which implement vlc decoding. (It seems it's also used by other >> codecs.) >> I'd be glad if you could point me in general direction as to how this >> could be done. >> >> Also, is there any information source describing MPEG-2 bistream >> format besides the standard? >> The standard itself is very large, very verbose and it's quite a >> challenge to find and extract >> relevant information. >> >> Thanks for any advice. >> Best Regards, >> Vojt?ch Kr?l >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From stefasab at gmail.com Sun Feb 2 11:18:07 2014 From: stefasab at gmail.com (Stefano Sabatini) Date: Sun, 2 Feb 2014 11:18:07 +0100 Subject: [Libav-user] Remuxing video file In-Reply-To: References: Message-ID: <20140202101807.GC8558@barisone> In data Saturday 2014-02-01 23:47:38 +0200, Yuri Oleynikov (???? ?????????? ha scritto: > hello, i am new to libav. after reading documentation and examples for > serveral weeks, i tried to write simple remuxing (e.g mp4->avi) w/o > decoding/encoding, just like *ffmpeg -i inputfile.mp4 -f avi -c:v copy -an > output.avi.* > > however both VLC and windows media player refuse to play output avi file - > no video playback. > moreoever ffprobe on output file shows me incorrect duration and bitrate. > > moreover, though the output file contains only video streams and lacks > audio streams it's much bigger than the input file: > > -rw-r--r-- 1 me me 28689538 Feb 1 13:00 inputk.mp4 > -rw-r--r-- 1 me me 77916554 Feb 1 13:40 output.avi > > > > i am definitely missing somesthing. > again, my appologies, i'm a new to libav*. :( > thanks for help. > > PS: sorry for long mail. > > my shortened code: > > avformat_open_input(&ic, infname, NULL, NULL); > avformat_find_stream_info(ic, NULL); > > oc = avformat_alloc_context(); > oc->oformat = av_guess_format("avi", NULL, NULL); > /**no need to open encoders/decoders since i do no want to recode the > frames) **/ > memmove(oc->filename, outfname, strlen(outfname)); > avio_open(&oc->pb, outfname, AVIO_FLAG_WRITE); > > // stripped map input video streams to output video streams block > > avformat_write_header(oc, NULL); > for(i=0; av_read_frame(ic, &inpacket)>=0; i++, av_free_packet(&inpacket)) { > > idx = inpacket.stream_index; > stream = ic->streams[idx]; > if(stream_map[idx]==-1){ > continue; > } > if(ic->streams[stream_map[idx]]->codec->codec_type!=AVMEDIA_TYPE_VIDEO) > continue; > av_copy_packet(&outpacket, &inpacket); > outpacket.stream_index = stream_map[idx]; You're missing timestamp rescaling here. > av_interleaved_write_frame(oc, &outpacket); > av_free_packet(&outpacket); > } > > av_write_trailer(oc); > > my full code: https://github.com/yurkao/libavformat-test/blob/master/remux.c I recently wrote a remuxing example and added it to doc/examples, you can compare it with your code and report in case you seem some problems with it. From stefasab at gmail.com Sun Feb 2 11:19:52 2014 From: stefasab at gmail.com (Stefano Sabatini) Date: Sun, 2 Feb 2014 11:19:52 +0100 Subject: [Libav-user] Info regarding API clip_interval In-Reply-To: <52EDE663.5000401@gmail.com> References: <52EDE415.50709@gmail.com> <52EDE663.5000401@gmail.com> Message-ID: <20140202101952.GD8558@barisone> In data Sunday 2014-02-02 12:02:03 +0530, anshul ha scritto: > On 02/02/2014 11:52 AM, anshul wrote: > >Hi guys > > > >In file libavfilter/drawutils.c there is a function called clip_interval > > > > static void clip_interval(int wmax, int *x, int *w, int *dx) > >what does the parameter means over here, means what is x and what is w > >wmax is understood to me. > > > >I came over here, since valgrind showed me that I am using > >uninitialized memory. > > > >Thanks > >Anshul > > > Hi > > In source code there is reallocation of memory > > 935 if ((len = s->expanded_text.len) > s->nb_positions) { > 936 if (!(s->positions = > 937 av_realloc(s->positions, len*sizeof(*s->positions)))) > 938 return AVERROR(ENOMEM); > 939 s->nb_positions = len; > > and I didn't found any initialization of positions, and we are using > uninitialized position > in clip filter. > > would it be ok to initialize just after allocating the memory. Please repost the mail to ffmpeg-devel, even better if you have a patch to fix the issue (assuming it's not a false positive). From yurkao at gmail.com Sun Feb 2 14:05:14 2014 From: yurkao at gmail.com (=?UTF-8?B?WXVyaSBPbGV5bmlrb3YgKNeZ15XXqNeZINeQ15XXnNeZ15nXoNeZ16fXldeR?=) Date: Sun, 2 Feb 2014 15:05:14 +0200 Subject: [Libav-user] Remuxing video file In-Reply-To: <20140202101807.GC8558@barisone> References: <20140202101807.GC8558@barisone> Message-ID: Thanks, Stefano. Adding timestamp scaling partially solved the issue: in VLC everything work find, however in WMP12 only audio stream is played. Also tried with your remuxing code ( http://ffmpeg.org/doxygen/trunk/doc_2examples_2remuxing_8c-example.html) - same result: no video playback. I thought that the problem is codec, but it seems to me that it's not the case because * the code is just remuxing streams * remuxing mp4->mp4 or mp4->megts produces correct output. * the original mp4 file is played correctly in both VLC and WMP. 2014-02-02 Stefano Sabatini : > In data Saturday 2014-02-01 23:47:38 +0200, Yuri Oleynikov (???? > ?????????? ha scritto: > > hello, i am new to libav. after reading documentation and examples for > > serveral weeks, i tried to write simple remuxing (e.g mp4->avi) w/o > > decoding/encoding, just like *ffmpeg -i inputfile.mp4 -f avi -c:v copy > -an > > output.avi.* > > > > however both VLC and windows media player refuse to play output avi file > - > > no video playback. > > moreoever ffprobe on output file shows me incorrect duration and bitrate. > > > > moreover, though the output file contains only video streams and lacks > > audio streams it's much bigger than the input file: > > > > -rw-r--r-- 1 me me 28689538 Feb 1 13:00 inputk.mp4 > > -rw-r--r-- 1 me me 77916554 Feb 1 13:40 output.avi > > > > > > > > i am definitely missing somesthing. > > again, my appologies, i'm a new to libav*. :( > > thanks for help. > > > > PS: sorry for long mail. > > > > my shortened code: > > > > avformat_open_input(&ic, infname, NULL, NULL); > > avformat_find_stream_info(ic, NULL); > > > > oc = avformat_alloc_context(); > > oc->oformat = av_guess_format("avi", NULL, NULL); > > /**no need to open encoders/decoders since i do no want to recode the > > frames) **/ > > memmove(oc->filename, outfname, strlen(outfname)); > > avio_open(&oc->pb, outfname, AVIO_FLAG_WRITE); > > > > // stripped map input video streams to output video streams block > > > > avformat_write_header(oc, NULL); > > for(i=0; av_read_frame(ic, &inpacket)>=0; i++, > av_free_packet(&inpacket)) { > > > > idx = inpacket.stream_index; > > stream = ic->streams[idx]; > > if(stream_map[idx]==-1){ > > continue; > > } > > > if(ic->streams[stream_map[idx]]->codec->codec_type!=AVMEDIA_TYPE_VIDEO) > > continue; > > av_copy_packet(&outpacket, &inpacket); > > outpacket.stream_index = stream_map[idx]; > > You're missing timestamp rescaling here. > > > av_interleaved_write_frame(oc, &outpacket); > > av_free_packet(&outpacket); > > } > > > > av_write_trailer(oc); > > > > my full code: > https://github.com/yurkao/libavformat-test/blob/master/remux.c > > I recently wrote a remuxing example and added it to doc/examples, you > can compare it with your code and report in case you seem some problems > with it. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christkeren at gmail.com Sun Feb 2 16:29:28 2014 From: christkeren at gmail.com (keren happuch) Date: Sun, 2 Feb 2014 20:59:28 +0530 Subject: [Libav-user] nb_streams is not initialized it is always zero Message-ID: Hi, I am trying to executed the example program encoding_decoding.c example program given in the ffmpeg folder downloaded from github. When I try to execute the program ill get the following run time error. The problem: AVFormatContext::nb_streams has zero value. nb_stream is not initialized. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Feb 2 20:34:41 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 2 Feb 2014 19:34:41 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstreams_is_not_initialized_it_is_alwa?= =?utf-8?q?ys_zero?= References: Message-ID: keren happuch writes: > I am trying to executed the example program > encoding_decoding.c? example program given in > the ffmpeg folder downloaded from github. I may misunderstand but the only supported source for FFmpeg is git://source.ffmpeg.org/ffmpeg.git > When I try to execute the program ill get the > following run time error. > The problem: AVFormatContext::nb_streams has zero > value. nb_stream is not initialized. This looks unexpected. How did you compile and how do you call the executable? Carl Eugen From andrey.krieger.utkin at gmail.com Mon Feb 3 16:28:04 2014 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 3 Feb 2014 17:28:04 +0200 Subject: [Libav-user] Remuxing video file In-Reply-To: References: <20140202101807.GC8558@barisone> Message-ID: 2014-02-02 Yuri Oleynikov (???? ?????????? : > Thanks, Stefano. > > Adding timestamp scaling partially solved the issue: in VLC everything work > find, however in WMP12 only audio stream is played. > Also tried with your remuxing code > (http://ffmpeg.org/doxygen/trunk/doc_2examples_2remuxing_8c-example.html) - > same result: no video playback. > > I thought that the problem is codec, but it seems to me that it's not the > case because > * the code is just remuxing streams > * remuxing mp4->mp4 or mp4->megts produces correct output. > * the original mp4 file is played correctly in both VLC and WMP. It happens that players play differently files created with different video creating software. You should try to figure out what exactly confuses WMP, and we'll see if we can help it on level of ffmpeg or at application context. Does it work in WMP if you remux via ffmpeg command line tool? What ffprobe shows for output file? -- Andrey Utkin From mayank77fromindia at gmail.com Mon Feb 3 15:36:24 2014 From: mayank77fromindia at gmail.com (Mayank Agarwal) Date: Mon, 3 Feb 2014 20:06:24 +0530 Subject: [Libav-user] Difference between frame and video packet. Message-ID: HI, Please pardon me for posting to this group. Please answer my following questions. 1.In ffmpeg if we are parsing any mp4 file and after that demuxing it,how can we know total no of audio/video packets in entire file. av_read_frame outputs audio/video packets,then how the video frame is related to packet or if there is no relation.packets become frame only after decoding in case of video. Any parameters or ffmpeg demuxer input/output using which we can use to quantify the demuxer performance for playing various file formats like mp4,etc Regards Mayank -------------- next part -------------- An HTML attachment was scrubbed... URL: From blairuk at gmail.com Tue Feb 4 16:50:54 2014 From: blairuk at gmail.com (Blair Azzopardi) Date: Tue, 4 Feb 2014 15:50:54 +0000 Subject: [Libav-user] AVERROR_INVALIDDATA in avformat_open_input on Raspberry Pi Message-ID: Hi I am investigating why opencv on raspberry pi isn't able to connect to the camera using video4linux and the "/dev/video0" device handle. I've managed to trace the error to opencv calling avformat_open_input. When this function is called it returns an AVERROR_INVALIDDATA (0xbebbb1b7) error code. I have been able to reproduce this using: #include #include #include #include int main(int argc, char *argv[]) { AVFormatContext *fmt_ctx = NULL; int ret = 0; av_log_set_level(AV_LOG_DEBUG); av_register_all(); ret = avformat_open_input(&fmt_ctx, "/dev/video0", NULL, NULL); if (ret < 0) { fprintf(stderr, "Could not open input: %08x\n", ret); } return 0; } I note in the above code sample I am using a null AVFormatContext. This seems to be what opencv does too. Should this code return an AVERROR_INVALIDDATA error? The error appears to occur during av_opt_set_defaults2 function. Another possibility is that raspberry pi's video4linux driver needs to be pre-configured initially although I am not sure. Any help or pointers would be greatly appreciated :) Thanks Blair -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Feb 4 16:56:01 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Feb 2014 15:56:01 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?AVERROR=5FINVALIDDATA_in_avformat=5Fopen?= =?utf-8?q?=5Finput_on_Raspberry_Pi?= References: Message-ID: Blair Azzopardi writes: > I've managed to trace the error to opencv calling? > avformat_open_input. When this function is called > it returns n?AVERROR_INVALIDDATA?(0xbebbb1b7) error > code. Now add some debug code to v4l2_read_header() to find out why AVERROR_INVALIDDATA is returned. Carl Eugen From cehoyos at ag.or.at Tue Feb 4 16:58:08 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Feb 2014 15:58:08 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?AVERROR=5FINVALIDDATA_in_avformat=5Fopen?= =?utf-8?q?=5Finput_on_Raspberry_Pi?= References: Message-ID: Blair Azzopardi writes: > ret = avformat_open_input(&fmt_ctx, "/dev/video0", NULL, NULL); > I note in the above code sample I am using a null AVFormatContext. Sorry, I missed this. You cannot auto-detect video4linux, you have to set it as format, before calling avformat_open_input(). Just compare "ffmpeg -i /dev/video0" with "ffmpeg -f v4l2 -i /dev/video0" Carl Eugen From blairuk at gmail.com Tue Feb 4 17:03:11 2014 From: blairuk at gmail.com (Blair Azzopardi) Date: Tue, 4 Feb 2014 16:03:11 +0000 Subject: [Libav-user] AVERROR_INVALIDDATA in avformat_open_input on Raspberry Pi In-Reply-To: References: Message-ID: On Tue, Feb 4, 2014 at 3:58 PM, Carl Eugen Hoyos wrote: > > Sorry, I missed this. > You cannot auto-detect video4linux, you have to > set it as format, before calling avformat_open_input(). > > Just compare "ffmpeg -i /dev/video0" with > "ffmpeg -f v4l2 -i /dev/video0" > > Ah, I see. I'll do a little more investigating. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Feb 4 16:58:45 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Feb 2014 15:58:45 +0000 (UTC) Subject: [Libav-user] Difference between frame and video packet. References: Message-ID: Mayank Agarwal writes: > 1.In ffmpeg if we are parsing any mp4 file and after > that demuxing it,how can we know total no of audio/video > packets in entire ile. Simply demux the whole file. Carl Eugen From christkeren at gmail.com Tue Feb 4 10:17:18 2014 From: christkeren at gmail.com (keren happuch) Date: Tue, 4 Feb 2014 14:47:18 +0530 Subject: [Libav-user] nb_stream is always 0 Message-ID: hi, I am trying to execute the example code decoding_encoding.c given in ffmpeg source code. code executes correctly upto av_dumpformat. but the nb_streams is always 0 and it is not initialized. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From christkeren at gmail.com Tue Feb 4 14:40:58 2014 From: christkeren at gmail.com (keren happuch) Date: Tue, 4 Feb 2014 19:10:58 +0530 Subject: [Libav-user] nb_stream always fails Message-ID: I'm having trouble with av_find_stream_info(). It always says that the nb_streams is 0. Why is this?. Basically, my code consists of the classic arrangement: av_register_all (), av_open_input_file () and then av_find_stream_info () av_find_stream_info() doesn't fail, but the nb_streams field of the AVFormatContext structure is always zero. I've tried different input mpeg files and an avi file but it always returns '0'. Anybody got any ideas?. I'm using version 5.1 avformat & avcodec. Thanks in advance, -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Feb 6 10:00:42 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 6 Feb 2014 09:00:42 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstream_always_fails?= References: Message-ID: keren happuch writes: > I'm using version 5.1 avformat & avcodec. I have never heard of this version, where did you get it? Carl Eugen From d.colasante at resi.it Fri Feb 7 09:56:37 2014 From: d.colasante at resi.it (Daniele Colasante) Date: Fri, 7 Feb 2014 09:56:37 +0100 Subject: [Libav-user] How to use API ffmpeg to capture a vnc stream and create the output video file? Message-ID: Hello I am Daniele Colasante, I would like to understand how to use API ffmpeg to capture a vnc stream and create the output video file. I tried from vnc2mpg.c (from http://libvncserver.sourceforge.net/doc/html/vnc2mpg_8c-example.html ) and muxing.c (from http://www.ffmpeg.org/doxygen/trunk/doc_2examples_2muxing_8c-example.html ) but I got poor results. Has anyone ever done this? Any suggestion is welcome. Thanks to all for your attention and sorry for my English. Attached my code, video.c, when I run: ./video -o video.avi -t 30 ip_address:port vncpassword the results are: Output #0, avi, to 'video.avi': Stream #0:0: Video: mpeg4, yuv420p, 1680x1050, q=2-31, 400 kb/s, 90k tbn, 25 tbc [avi @ 0x1ec4060] Application provided invalid, non monotonically increasing dts to muxer in stream 33754816: 269628272584 >= 0 Error while writing video frame: Invalid argument RUN FINISHED; exit value 1; real time: 1s; user: 570ms; system: 90ms Descrizione: cid:image001.gif at 01C9DD69.C5A5ECE0 Daniele Colasante System Engineering RESI Informatica S.p.A. Via Pontina Km 44,044 04011 Aprilia (LT) - Italy Tel: +39 06 92710398 Mobile: Fax: +39 06 92710208 Email: d.colasante at resi.it Web: www.resi.it Descrizione: cid:image002.gif at 01C9DD69.C5A5ECE0 _ _ _ _ _ _ _ _ _ _ _ _ Nota di riservatezza: Ai sensi del Decreto Legislativo n. 196/2003, "Codice in materia di Protezione dei dati personali", si precisa che le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e per uso esclusivo del destinatario. Persone diverse dallo stesso non possono copiare o distribuire il messaggio a terzi. Chiunque riceva questo messaggio per errore ? pregato di distruggerlo e di informare immediatamente il mittente. Grazie. Confidentiality Notice: Accordingly to Italian legislative decree n. 196/2003 concerning privacy, the information contained in this e-mail is intended for the named recipients only. It may contain privileged and confidential information and if you are not an intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this e-mail in error, please notify the sender by e-mail and delete the e-mail and any copies of it. Thank you. P Please consider the environment before printing this mail. Rispettate l?ambiente e stampate questa email solo in caso di reale necessit? Descrizione: Descrizione: https://rb1itspoint001/images/stories/RESI.png Descrizione: Descrizione: https://rb1itspoint001/images/stories/IPS.png Descrizione: Descrizione: https://rb1itspoint001/images/stories/SMETANA.png Descrizione: Descrizione: https://rb1itspoint001/images/stories/ItaliaMobile.png -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 3746 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1967 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 1332 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 1147 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 1328 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 2580 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: video.c Type: application/octet-stream Size: 13308 bytes Desc: not available URL: From christkeren at gmail.com Fri Feb 7 10:28:20 2014 From: christkeren at gmail.com (keren happuch) Date: Fri, 7 Feb 2014 14:58:20 +0530 Subject: [Libav-user] avcodec_find_decoder is always null Message-ID: Hi, Im trying to execute a example program given in ffmpeg folder , *1.1. Register all formats and codecs* av_register_all(); avcodec_register_all(); avformat_network_init(); works fine *1.2. Open video file* char *drone_addr = "http://192.168.1.1:5555"; AVFormatContext *pFormatCtx = NULL; while(avformat_open_input(&pFormatCtx, drone_addr, NULL, NULL) != 0) printf("Could not open the video file\nRetrying...\n"); works fine *1.3. Display information* // Retrieve stream information avformat_find_stream_info(pFormatCtx, NULL); // Dump information to standard output av_dump_format(pFormatCtx, 0, drone_addr, 0); works fine *1.4. Find decoder * // Get a pointer to the codec context for the video stream // and find the decoder for the video stream AVCodecContext *pCodecCtx; AVCodec *pCodec; pCodecCtx = pFormatCtx->streams[0]->codec; pCodec = avcodec_find_decoder(pCodecCtx->codec_id); the condition fails.. avcodec_find_decoder always fails.. any help Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From omagrane at bmat.com Fri Feb 7 22:05:46 2014 From: omagrane at bmat.com (=?ISO-8859-1?Q?Oriol_Magran=E9?=) Date: Fri, 07 Feb 2014 22:05:46 +0100 Subject: [Libav-user] avcodec_find_decoder is always null In-Reply-To: References: Message-ID: <52F54AAA.3090608@bmat.com> Which is it the value of pCodecCtx->codec_id that you pass to avcodec_find_decoder()? On 07/02/14 10:28, keren happuch wrote: > Hi, > > Im trying to execute a example program given in ffmpeg folder , > > > _1.1. Register all formats and codecs_ > > av_register_all(); > avcodec_register_all(); > avformat_network_init(); > > works fine > > > _1.2. Open video file_ > > char *drone_addr = "http://192.168.1.1:5555"; > AVFormatContext *pFormatCtx = NULL; > while(avformat_open_input(&pFormatCtx, drone_addr, NULL, NULL) != 0) > printf("Could not open the video file\nRetrying...\n"); > > works fine > > > > _1.3. Display information_ > > // Retrieve stream information > avformat_find_stream_info(pFormatCtx, NULL); > // Dump information to standard output > av_dump_format(pFormatCtx, 0, drone_addr, 0); > > > works fine > > > > _1.4. Find decoder _ > > // Get a pointer to the codec context for the video stream > // and find the decoder for the video stream > AVCodecContext *pCodecCtx; > AVCodec *pCodec; > pCodecCtx = pFormatCtx->streams[0]->codec; > pCodec = avcodec_find_decoder(pCodecCtx->codec_id); > > > > the condition fails.. avcodec_find_decoder always fails.. any help > Thanks in advance > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Sun Feb 9 00:08:31 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 08 Feb 2014 20:08:31 -0300 Subject: [Libav-user] Sound disappears after seek Message-ID: <52F6B8EF.60100@gmail.com> I have an mp4 clip that has sound and it disappears on seek. That is, even in ffplay, a seek causes audio to go mute. I've uploaded the file at: http://www.datafilehost.com/d/885d526c From ggarra13 at gmail.com Sun Feb 9 00:16:45 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 08 Feb 2014 20:16:45 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: <52F6B8EF.60100@gmail.com> References: <52F6B8EF.60100@gmail.com> Message-ID: <52F6BADD.8080306@gmail.com> On 08/02/14 20:08, Gonzalo Garramuno wrote: > I have an mp4 clip that has sound and it disappears on seek. That is, > even in ffplay, a seek causes audio to go mute. > > I've uploaded the file at: > http://www.datafilehost.com/d/885d526c > More info. The sound disapppears in a seek after the clip reaches its ending. From cehoyos at ag.or.at Sun Feb 9 00:31:19 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 8 Feb 2014 23:31:19 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> Message-ID: Gonzalo Garramuno writes: > I have an mp4 clip that has sound and it disappears on seek. > That is, even in ffplay, a seek causes audio to go mute. Duplicate of ticket #3662, thank you for the sample! http://thread.gmane.org/gmane.comp.video.ffmpeg.trac/20273 Carl Eugen From ggarra13 at gmail.com Sun Feb 9 00:45:01 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 08 Feb 2014 20:45:01 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: References: <52F6B8EF.60100@gmail.com> Message-ID: <52F6C17D.2090600@gmail.com> On 08/02/14 20:31, Carl Eugen Hoyos wrote: > Gonzalo Garramuno writes: > >> I have an mp4 clip that has sound and it disappears on seek. >> That is, even in ffplay, a seek causes audio to go mute. > Duplicate of ticket #3662, thank you for the sample! > http://thread.gmane.org/gmane.comp.video.ffmpeg.trac/20273 > > Carl Eugen Is it a duplicate? The #3662 ticket talks about a video freeze. In my case video works ok. From cehoyos at ag.or.at Sun Feb 9 07:52:46 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 06:52:46 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> Message-ID: Gonzalo Garramuno writes: > > Duplicate of ticket #3662, thank you for the sample! > > http://thread.gmane.org/gmane.comp.video.ffmpeg.trac/20273 > > Is it a duplicate? What did your regression tests show? Did you test the sample from that ticket? > The #3662 ticket talks about a video freeze. As I explained there, the naming is bad. (But for your sample, sound never "disappears", seeking just doesn't work.) > In my case video works ok. Really? Seeking works if you specify -an? Carl Eugen From ggarra13 at gmail.com Sun Feb 9 14:40:06 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 09 Feb 2014 10:40:06 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> Message-ID: <52F78536.8060403@gmail.com> On 09/02/14 03:52, Carl Eugen Hoyos wrote: > Gonzalo Garramuno writes: > >>> Duplicate of ticket #3662, thank you for the sample! >>> http://thread.gmane.org/gmane.comp.video.ffmpeg.trac/20273 >> Is it a duplicate? > What did your regression tests show? > Did you test the sample from that ticket? No, sorry. >> The #3662 ticket talks about a video freeze. > As I explained there, the naming is bad. > (But for your sample, sound never "disappears", > seeking just doesn't work.) Ah. Okay. I understand now. >> In my case video works ok. > Really? > Seeking works if you specify -an? Seeking works if you perform it before the clip reaches its end. After that it no longer works. From cehoyos at ag.or.at Sun Feb 9 17:47:24 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 16:47:24 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> Message-ID: Gonzalo Garramuno writes: > On 09/02/14 03:52, Carl Eugen Hoyos wrote: > > Gonzalo Garramuno ...> writes: > > > >>> Duplicate of ticket #3662, thank you for the sample! Sorry, should have been #3362. > >>> http://thread.gmane.org/gmane.comp.video.ffmpeg.trac/20273 > >> Is it a duplicate? > > > > What did your regression tests show? > > Did you test the sample from that ticket? > > No, sorry. Please do so if you believe my findings are wrong. > >> The #3662 ticket talks about a video freeze. > > > > As I explained there, the naming is bad. > > (But for your sample, sound never "disappears", > > seeking just doesn't work.) > > Ah. Okay. I understand now. > > >> In my case video works ok. > > > > Really? > > Seeking works if you specify -an? > > Seeking works if you perform it before the clip reaches > its end. After that it no longer works. While I never succeeded seeking backwards in your sample, it is true that seeking forwards works sometimes. But seeking also works sometimes for the sample from ticket #3362, so this is not a big difference. I suggest you test again once ticket #3362 is fixed (and the bug tracker works again which should be soon.) Carl Eugen From ggarra13 at gmail.com Sun Feb 9 19:21:06 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 09 Feb 2014 15:21:06 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> Message-ID: <52F7C712.7030703@gmail.com> On 09/02/14 13:47, Carl Eugen Hoyos wrote: > Gonzalo Garramuno writes: > >> On 09/02/14 03:52, Carl Eugen Hoyos wrote: >> What did your regression tests show? >> Did you test the sample from that ticket? > Please do so if you believe my findings are wrong. > I tried the sample from #3362 and in that case seeking is completely broken. It hangs up my player and ffplay hangs while reporting tons of errors like: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f80ec0008c0] stream 1, offset 0x1494053: partial file With my clip, nothing of the sort happens. But I'll follow your advice and wait for #3362 to be fixed before I complain about my clip not working. From cehoyos at ag.or.at Sun Feb 9 19:37:19 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 18:37:19 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> Message-ID: Gonzalo Garramuno writes: > [mov,mp4,m4a,3gp,3g2,mj2 0x7f80ec0008c0] > stream 1, offset 0x1494053: partial file That is unrelated, I cut the very large sample. Carl Eugen From cehoyos at ag.or.at Sun Feb 9 19:39:02 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 18:39:02 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> Message-ID: Gonzalo Garramuno writes: > I tried the sample from #3362 and in that case > seeking is completely broken. > With my clip, nothing of the sort happens. Both samples fail horribly if you try to seek backwards. Carl Eugen From ggarra13 at gmail.com Sun Feb 9 19:47:12 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 09 Feb 2014 15:47:12 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> Message-ID: <52F7CD30.5040801@gmail.com> On 09/02/14 15:39, Carl Eugen Hoyos wrote: > Both samples fail horribly if you try to seek > backwards. > > Carl Eugen Okay. Thanks for all the help, Carl! Any possible ETA on when there might be a fix for it? From cehoyos at ag.or.at Sun Feb 9 19:52:40 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 18:52:40 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> <52F7CD30.5040801@gmail.com> Message-ID: Gonzalo Garramuno writes: > > On 09/02/14 15:39, Carl Eugen Hoyos wrote: > > Both samples fail horribly if you try to seek > > backwards. > > Okay. Thanks for all the help, Carl! > Any possible ETA on when there might be a fix for it? (This questions sometimes implies a big misunderstanding about how open-source development and FFmpeg development in particular work.) No, but you can comment out "!sc->keyframe_absent &&" around line 2148 in mov.c as a work-around. Carl Eugen From ggarra13 at gmail.com Sun Feb 9 20:01:21 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 09 Feb 2014 16:01:21 -0300 Subject: [Libav-user] Sound disappears after seek In-Reply-To: References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> <52F7CD30.5040801@gmail.com> Message-ID: <52F7D081.3070801@gmail.com> On 09/02/14 15:52, Carl Eugen Hoyos wrote: > No, but you can comment out "!sc->keyframe_absent &&" around line 2148 > in mov.c as a work-around. Thanks. That makes the clip work correctly. What are the drawbacks? From cehoyos at ag.or.at Sun Feb 9 20:07:10 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Feb 2014 19:07:10 +0000 (UTC) Subject: [Libav-user] Sound disappears after seek References: <52F6B8EF.60100@gmail.com> <52F6C17D.2090600@gmail.com> <52F78536.8060403@gmail.com> <52F7C712.7030703@gmail.com> <52F7CD30.5040801@gmail.com> <52F7D081.3070801@gmail.com> Message-ID: Gonzalo Garramuno writes: > On 09/02/14 15:52, Carl Eugen Hoyos wrote: > > No, but you can comment out "!sc->keyframe_absent &&" > > around line 2148 in mov.c as a work-around. > > Thanks. That makes the clip work correctly. > What are the drawbacks? I don't know. Consider adding an empty line between quotes and your text, Carl Eugen From mayank77fromindia at gmail.com Mon Feb 10 19:35:06 2014 From: mayank77fromindia at gmail.com (Mayank Agarwal) Date: Tue, 11 Feb 2014 00:05:06 +0530 Subject: [Libav-user] Error in av_register_all Message-ID: Hi, I am just initializing ffmpeg by calling av_register_all in android jni code JNIEXPORT jstring JNICALL Java_com_testplayer_MainActivity_ffmpegOpen( JNIEnv* env, jobject thiz, jstring path) { const char *input_filename = "mtbiketribe-small.mp4"; av_register_all(); return env->NewStringUTF("Success in av_register_all"); } i am including libavcodec,libavformat,libavutil in extern "C" in the file. in makefile i am including prebuilt ffmpeg.so. My code is building fine but on running the code i am getting error in av_register_all. segmentation fault :fatal signal 11 at 0xa660001d. Please point why i am getting this error. Regards, Mayank -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco_sie at web.de Tue Feb 11 14:11:05 2014 From: marco_sie at web.de (Silver) Date: Tue, 11 Feb 2014 05:11:05 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks Message-ID: <1392124265162-4659230.post@n4.nabble.com> Hello, i'm new to AvCodec Libs and .. to this Mailist System, pls be gentle :) Where to start... first i have a lot of Questions .... and i could fill a Book with it (with no answers of course). But anyway.. I developed a transcoder with libav... for Mac/Windows, lets Focus for Mac for now. It works and i'm happy i got so far already... but i faceing a Problem with async Video and Audio Tracks... If the Clip is really long then it gets really bad, People who Speaking (Mouth movement) doesn't match with the words. (I saw Drangers tutorial... but it was for video playing?) I think it has to do something with the time_base,pts,dts,.... and because i'm new i don't get it at all. And i read a lot about dropped Frames... in ffmpeg.c there get frames duplicated.. Is there some A-Z or Step by Step Guide out there.. if i would understand this fully i would create one... because i'm really good in forgetting... Because the whole transcoding Code is long... i just write pseudo code, that you can get a glimpse... Transcoding Target: xxx Format to mp4 - h264/AAC ( for iPad,Web) ----- *Pseudecode My Transcoding* open_prepare_streams_in(); open_prepare_streams_out(); settings_for_encoder_h264(); while(1) { if (av_read_frame() == ok) { if (audio_stream == ok) if (decode_audio == ok) encode_audio else if (video_stream == ok) if (decode_video == ok) encode_video } } catch_delayed_video_frames catch_delayed_audio_frames ---- Before Encoding i set the pts to my frame counter(i saw it some examples) *for video:* newScaledFrame->pts = decodedVFrameCounter; //decodedVideoFrame, which get scaled decodedVFrameCounter++; *for audio:* newSampledFrame->pts = decodedAFrameCounter; //decodedAudioFrame, which get sampled decodedAFrameCounter++; The Code for PTS/DTS after Encoding (for both audio and video): if (encoderPacketV.pts != AV_NOPTS_VALUE) encoderPacketV.pts = av_rescale_q(encoderPacketV.pts, codecCtxOut->time_base,video_st->time_base); if (encoderPacketV.dts != AV_NOPTS_VALUE) encoderPacketV.dts = av_rescale_q(encoderPacketV.dts, codecCtxOut->time_base,video_st->time_base); if (encoderPacketV.duration > 0) encoderPacketV.duration = av_rescale_q(encoderPacketV.duration, codecCtxOut->time_base, video_st->time_base); --------- I already watched in ffmpeg.c and handbrake Code... and what i see that they do a lot more about pts/dts and i confused me :( -- There are still some other things.. like 2 frames missing at the start (bytes but no got_picts/finishedFrame from video_decode2). But let this aside.. the major thing is the async tracks of the video file. If you require more information let see how i can provide it. I hope somebody can help me. -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Tue Feb 11 14:33:45 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Feb 2014 13:33:45 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Transcoding_Decoding=5FEncoding_to_MP4/h26?= =?utf-8?q?4_-_asynchron_tracks?= References: <1392124265162-4659230.post@n4.nabble.com> Message-ID: Silver writes: > It works and i'm happy i got so far already... but i > faceing a Problem with async Video and Audio Tracks... Is the problem reproducible with ffmpeg (the application)? Carl Eugen From yurkao at gmail.com Tue Feb 11 14:38:41 2014 From: yurkao at gmail.com (=?UTF-8?B?WXVyaSBPbGV5bmlrb3YgKNeZ15XXqNeZINeQ15XXnNeZ15nXoNeZ16fXldeR?=) Date: Tue, 11 Feb 2014 15:38:41 +0200 Subject: [Libav-user] segfault at avcodec_encode_audio2 when Message-ID: Hello, may be this mailing list is not a "destination" for my question, but i'll try. i have troubles re-encoding audio file (with re-sampling) with ffmpeg libs on windows. my application takes MP3 file and converts it to WAV+PCM. Everything goes fine when re-encoding input file once. but if i re-encode the file in infinite loop - it somewhen crashes on avcodec_encode_audio2. this occurs with every PCM encoder, but never with libmp3lame. May be this is a windows build problem - i do not known, because: * my Linux application passed more than 10K loops with the same MP3 file and nothing crashed. * on windows, PCM's AVCodec.supported_samplerates and AVCodec.channel_layouts is always NULL (though i've called avcodec_register_all earlier). Nevertheless, i set them to decoder's values and (again) everything goes fine until some loop iteration. Thanks input file info: format mp3 codec mp3 sample_rate 22050 sample format AV_SAMPLE_FMT_S16P output file info: format wav codec pcm_s32_le sample_rate 22050 sample format AV_SAMPLE_FMT_S16 Windows FFmpeg libs build info: ffmpeg version N-60487-g5129006 Copyright (c) 2000-2014 the FFmpeg developers built on Feb 9 2014 22:01:12 with gcc 4.8.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 63.101 / 52. 63.101 libavcodec 55. 50.100 / 55. 50.100 libavformat 55. 31.100 / 55. 31.100 libavdevice 55. 8.100 / 55. 8.100 libavfilter 4. 1.102 / 4. 1.102 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 Linux FFMpeg build info: ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers built on Feb 9 2014 03:05:55 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --disable-doc --enable-shared --disable-network --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libvpx --enable-libfaac --enable-libopenjpeg --disable-ffserver --enable-postproc --disable-w32threads --disable-os2threads --disable-indevs --disable-outdevs --disable-avdevice --disable-x11grab --enable-pic --enable-zlib --enable-bzlib --enable-shared --enable-avresample --enable-swscale --enable-swresample --enable-postproc --enable-avfilter --enable-avformat --enable-avcodec --enable-avutil --disable-protocols --enable-protocol=pipe --enable-protocol=file --valgrind=/usr/bin/valgrind --enable-ftrapv --disable-stripping --disable-optimizations -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Feb 11 14:47:52 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Feb 2014 13:47:52 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segfault_at_avcodec=5Fencode=5Faudio2_when?= References: Message-ID: Yuri Oleynikov (???? ?????????? writes: > i have troubles re-encoding audio file (with re-sampling) > with ffmpeg libs on windows. my application takes MP3 file > and converts it to WAV+PCM.? > > Everything goes fine when re-encoding input file once. but > if i?re-encode?the file in infinite loop - it somewhen > crashes on?avcodec_encode_audio2. Backtrace etc. missing, see http://ffmpeg.org/bugreports.html I also suggest recompilation with "./configure && make ffmpeg.exe" to rule out funny problems with external libraries. Carl Eugen From yurkao at gmail.com Tue Feb 11 22:33:25 2014 From: yurkao at gmail.com (=?UTF-8?B?WXVyaSBPbGV5bmlrb3YgKNeZ15XXqNeZINeQ15XXnNeZ15nXoNeZ16fXldeR?=) Date: Tue, 11 Feb 2014 23:33:25 +0200 Subject: [Libav-user] segfault at avcodec_encode_audio2 when In-Reply-To: References: Message-ID: The backtrace: Program received signal SIGSEGV, Segmentation fault. 0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll (gdb) bt #0 0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll #1 0x7692a00b in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll #2 0x5d282c0f in avcodec-55!av_parser_close () from C:\Users\devel\Documents\Visual Studio 2010\Projects\avconv\Debug\avcode c-55.dll #3 0x00168940 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb) info locals No symbol table info available. (gdb) info args No symbol table info available. (gdb) info registers eax 0x4d75a0 5076384 ecx 0x17 23 edx 0x0 0 ebx 0x4d8940 5081408 esp 0x39eb90 0x39eb90 ebp 0x39eb98 0x39eb98 esi 0x4d8fc0 5083072 edi 0x4d7c20 5078048 eip 0x7692a06e 0x7692a06e eflags 0x10206 [ PF IF RF ] cs 0x23 35 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x53 83 gs 0x2b 43 2014-02-11 15:47 GMT+02:00 Carl Eugen Hoyos : > Yuri Oleynikov (???? ?????????? writes: > > > i have troubles re-encoding audio file (with re-sampling) > > with ffmpeg libs on windows. my application takes MP3 file > > and converts it to WAV+PCM. > > > > Everything goes fine when re-encoding input file once. but > > if i re-encode the file in infinite loop - it somewhen > > crashes on avcodec_encode_audio2. > > Backtrace etc. missing, see http://ffmpeg.org/bugreports.html > > I also suggest recompilation with > "./configure && make ffmpeg.exe" to rule out funny problems > with external libraries. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Feb 12 00:42:32 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Feb 2014 23:42:32 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segfault_at_avcodec=5Fencode=5Faudio2_when?= References: Message-ID: Yuri Oleynikov (???? ?????????? writes: > 0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > (gdb) bt > > #0 ?0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > #1 ?0x7692a00b in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > > #2 ?0x5d282c0f in avcodec-55!av_parser_close () > ? ?from C:\Users\devel\Documents\Visual Studio 2010\ > Projects\avconv\Debug\avcodec-55.dll > #3 ?0x00168940 in ?? () > > Backtrace stopped: previous frame inner to this frame (corrupt stack?) If you use shared libraries, you will need --disable-stripping (and maybe --disable-optimizations) to produce a useful backtrace. Carl Eugen From christkeren at gmail.com Wed Feb 12 01:00:09 2014 From: christkeren at gmail.com (keren) Date: Wed, 12 Feb 2014 00:00:09 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstream_always_fails?= References: Message-ID: Carl Eugen Hoyos writes: > > keren happuch ...> writes: > > > I'm using version 5.1 avformat & avcodec. > > I have never heard of this version, where > did you get it? > > Carl Eugen > hi, Sorry i am using ffmpeg version 2.1.3, with this i am unable to execute any of the sample code. always i will get the following message unable to find the stream ... From cehoyos at ag.or.at Wed Feb 12 01:12:12 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 12 Feb 2014 00:12:12 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstream_always_fails?= References: Message-ID: keren writes: > i am using ffmpeg version 2.1.3, with this i > am unable to execute any of the sample code. Please provide a little more information. (And consider testing current git head, if you are a user nothing else is supported.) Carl Eugen From christkeren at gmail.com Wed Feb 12 01:21:44 2014 From: christkeren at gmail.com (keren) Date: Wed, 12 Feb 2014 00:21:44 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstreams_is_not_initialized_it_is_alwa?= =?utf-8?q?ys_zero?= References: Message-ID: Carl Eugen Hoyos writes: > > keren happuch ...> writes: > > > I am trying to executed the example program > > encoding_decoding.c? example program given in > > the ffmpeg folder downloaded from github. > > I may misunderstand but the only supported source > for FFmpeg is git://source.ffmpeg.org/ffmpeg.git > > > When I try to execute the program ill get the > > following run time error. > > > The problem: AVFormatContext::nb_streams has zero > > value. nb_stream is not initialized. > > This looks unexpected. How did you compile and how > do you call the executable? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > I compiled the code using gcc and included all the required libraries 1.libavcodec 2.libavutil 3.libavformat it is generating the output file. when i try to execute the exe it is terminating saying "unsupported codec" iam using ubuntu version 12.04 and ffmpeg 2.1.3 From ninakarina at seatech.com Tue Feb 11 12:30:24 2014 From: ninakarina at seatech.com (Nina Wiryanto) Date: Tue, 11 Feb 2014 18:30:24 +0700 Subject: [Libav-user] Using libav API to stream video from iOS device Message-ID: Hi all, I want to make an iOS app which streams video in format H.264/AAC. I found a source code which able to wrap my video file into AVPacket. Now I want to send it using RTMP protocol. And I have no idea how to do this with FFMPEG libav API. Can anyone give me an example on how to do this ? Any help would be very appreciated. Thank you, Nina -------------- next part -------------- An HTML attachment was scrubbed... URL: From christkeren at gmail.com Wed Feb 12 05:01:57 2014 From: christkeren at gmail.com (keren) Date: Wed, 12 Feb 2014 04:01:57 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstream_always_fails?= References: Message-ID: Carl Eugen Hoyos writes: > > keren ...> writes: > > > i am using ffmpeg version 2.1.3, with this i > > am unable to execute any of the sample code. > > Please provide a little more information. > (And consider testing current git head, if you > are a user nothing else is supported.) > > Carl Eugen > Hi this is the first time I haven't been able to find my answer I have this codesniplet that is my attempt to follow the few tutorials I have found on getting some basic libav functionality (working my way to extracting video frames). 1 #ifndef INT64_C 2 #define INT64_C(c) (c ## LL) 3 #define UINT64_C(c) (c ## ULL) 4 #endif 5 6 extern "C" { 7 #include 8 #include 9 #include 10 } 11 #include 12 using namespace std; 13 #define FILENAME "/home/jon/Videos/testvideo.avi" 14 15 16 int main(int argc, char** argv) 17 { 18 av_register_all(); 19 AVFormatContext * avFormatPtr = avformat_alloc_context(); 20 if (avformat_open_input(&avFormatPtr, FILENAME, NULL, NULL) != 0) 21 cout<<"Error while calling avformat_open_input (probably invalid file format)"<nb_streams<<" streams"<nb_streams; ++i) { 29 cout<<"loop iteration "<streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) 31 { 32 cout<<"Found video "< Message-ID: keren writes: > I compiled the code using gcc Which configure line did you use? Carl Eugen From cehoyos at ag.or.at Wed Feb 12 11:07:07 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 12 Feb 2014 10:07:07 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?nb=5Fstream_always_fails?= References: Message-ID: keren writes: > I have this codesniplet that is my attempt to follow > the few tutorials I have found on getting some basic > libav functionality I compiled your code here with current FFmpeg git head and it works fine (nb_streams > 0) Carl Eugen From marco_sie at web.de Wed Feb 12 11:33:10 2014 From: marco_sie at web.de (Silver) Date: Wed, 12 Feb 2014 02:33:10 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: References: <1392124265162-4659230.post@n4.nabble.com> Message-ID: <1392201190516-4659243.post@n4.nabble.com> Hi, thx for your Response. i checked it but it worked... here are the settings (its the same like i fill AVCodecContext) ffmpeg -r 25 -i "test.mov" -pix_fmt yuv420p -ac 2 -strict experimental -s hd720 -vcodec libx264 -preset slow -profile:v baseline -level 31 -refs 1 -maxrate 2M -bufsize 2M -vb 2M -threads 0 -g 4 -r 25 "test.mp4" -y video: dnxhd -> libx264 audio: pcm_s24le -> libfaac I think its something in my code... i don't know but i can only guess.. it something with: - pts/dts/timebase - dropped frames (i don't handle it at all) - or some general mistake in my transcoding process (i posted a pseudocode) - maybe something related with key/i frames ? I really want to understand.. so that i can help me myself. ---- If i print pts out i get following: av_read_frame(fmt_ctx,&g_avpkt) g_avpkt.pts/dts - increased by 1024 for audio (samples?) - increased by 1000 for video before Audio Encoding i calculate: convertFrame->pts = av_rescale_q(samples_count, (AVRational){1, aCodecCtxOut->sample_rate}, aCodecCtxOut->time_base); samples_count += dst_nb_samples; ----- -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659243.html Sent from the libav-users mailing list archive at Nabble.com. From hemiao_1990 at 126.com Wed Feb 12 14:15:02 2014 From: hemiao_1990 at 126.com (Tomi He) Date: Wed, 12 Feb 2014 21:15:02 +0800 Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1392201190516-4659243.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> <1392201190516-4659243.post@n4.nabble.com> Message-ID: <52FB73D6.3050403@126.com> in doc/examples/remuxing.c, it gets pts and dts in this way: pkt.pts = av_rescale_q(pkt.pts, in_stream->time_base, out_stream->time_base); pkt.dts = av_rescale_q(pkt.dts, in_stream->time_base, out_stream->time_base); pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base); you can have a try. > Hi, > > thx for your Response. > i checked it but it worked... here are the settings (its the same like i > fill AVCodecContext) > ffmpeg -r 25 -i "test.mov" -pix_fmt yuv420p -ac 2 -strict experimental -s > hd720 -vcodec libx264 -preset slow -profile:v baseline -level 31 -refs 1 > -maxrate 2M -bufsize 2M -vb 2M -threads 0 -g 4 -r 25 "test.mp4" -y > > -- > View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659243.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From marco_sie at web.de Wed Feb 12 18:24:08 2014 From: marco_sie at web.de (Silver) Date: Wed, 12 Feb 2014 09:24:08 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <52FB73D6.3050403@126.com> References: <1392124265162-4659230.post@n4.nabble.com> <1392201190516-4659243.post@n4.nabble.com> <52FB73D6.3050403@126.com> Message-ID: <1392225848482-4659245.post@n4.nabble.com> Thx, i will try it.. both for video and audio Stream? I currently take it from OutputCodex and OutputStream: encoderPacketA.pts = av_rescale_q(encoderPacketA.pts, aCodecCtxOut->time_base,audio_st->time_base); I think its something more deeper... isn't there a general way to search for such asynchron errors? Can i use some debug Messages to get a better Feeling, why or where it gets asynchrony? I'm lost in the Woods... I'm tired of Trial&Error. hemiao wrote > in doc/examples/remuxing.c, it gets pts and dts in this way: > > pkt.pts = av_rescale_q(pkt.pts, in_stream->time_base, > out_stream->time_base); > pkt.dts = av_rescale_q(pkt.dts, in_stream->time_base, > out_stream->time_base); > pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, > out_stream->time_base); > > you can have a try. > >> Hi, >> >> thx for your Response. >> i checked it but it worked... here are the settings (its the same like i >> fill AVCodecContext) >> ffmpeg -r 25 -i "test.mov" -pix_fmt yuv420p -ac 2 -strict experimental -s >> hd720 -vcodec libx264 -preset slow -profile:v baseline -level 31 -refs 1 >> -maxrate 2M -bufsize 2M -vb 2M -threads 0 -g 4 -r 25 "test.mp4" -y >> >> -- >> View this message in context: >> http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659243.html >> Sent from the libav-users mailing list archive at Nabble.com. >> _______________________________________________ >> Libav-user mailing list >> > Libav-user@ >> http://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user@ > http://ffmpeg.org/mailman/listinfo/libav-user -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659245.html Sent from the libav-users mailing list archive at Nabble.com. From yurkao at gmail.com Wed Feb 12 21:11:07 2014 From: yurkao at gmail.com (=?UTF-8?B?WXVyaSBPbGV5bmlrb3YgKNeZ15XXqNeZINeQ15XXnNeZ15nXoNeZ16fXldeR?=) Date: Wed, 12 Feb 2014 22:11:07 +0200 Subject: [Libav-user] segfault at avcodec_encode_audio2 when In-Reply-To: References: Message-ID: sorry, seems to be my fault:( after running static analysis tools and code fixing, the segfault seems to be disappeared. however, the minor problem still presents: on windows, after avcodec_find_decoder(some_id), PCM's AVCodec.supported_samplerates and AVCodec.channel_layouts are always NULL, though i've called avcodec_register_all before. 2014-02-12 1:42 GMT+02:00 Carl Eugen Hoyos : > Yuri Oleynikov (???? ?????????? writes: > > > 0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > > (gdb) bt > > > > #0 0x7692a06e in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > > #1 0x7692a00b in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll > > > > #2 0x5d282c0f in avcodec-55!av_parser_close () > > from C:\Users\devel\Documents\Visual Studio 2010\ > > Projects\avconv\Debug\avcodec-55.dll > > #3 0x00168940 in ?? () > > > > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > > If you use shared libraries, you will need > --disable-stripping (and maybe --disable-optimizations) > to produce a useful backtrace. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Feb 12 23:47:23 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 12 Feb 2014 22:47:23 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segfault_at_avcodec=5Fencode=5Faudio2_when?= References: Message-ID: Yuri Oleynikov (???? ?????????? writes: > on windows, after?avcodec_find_decoder(some_id),?PCM's > AVCodec.supported_samplerates?and AVCodec.channel_layouts > are always NULL, though i've called avcodec_register_all > before. Both are not pointers and should neither be set nor compared with NULL. Carl Eugen From yurkao at gmail.com Thu Feb 13 05:37:19 2014 From: yurkao at gmail.com (Yurkao@gmail) Date: Thu, 13 Feb 2014 06:37:19 +0200 Subject: [Libav-user] segfault at avcodec_encode_audio2 when In-Reply-To: References: Message-ID: <6C3B9456-7CC5-49FF-9C62-DB5BE05CA78F@gmail.com> Hmm, according to documentation "array of supported audio samplerates, or NULL if unknown, array is terminated by 0" Yurii Oleynikov > 13 ???? 2014, ? 00:47, Carl Eugen Hoyos ???????(?): > > AVCodec.supported_samplerates -------------- next part -------------- An HTML attachment was scrubbed... URL: From eclipse7 at gmx.net Thu Feb 13 19:45:12 2014 From: eclipse7 at gmx.net (Alexander Strasser) Date: Thu, 13 Feb 2014 19:45:12 +0100 Subject: [Libav-user] trac.ffmpeg.org / trac.mplayerhq.hu Security Breach Message-ID: <20140213184512.GA2740@akuma.hitronhub.home> Some people might not follow ffmpeg.org closely, the following news were posted originally at https://ffmpeg.org/#trac_sec The server on which FFmpeg and MPlayer Trac issue trackers were installed was compromised. The affected server was taken offline and has been replaced and all software reinstalled. FFmpeg Git, releases, FATE, web and mailinglists are on other servers and were not affected. We believe that the original compromise happened to a server, unrelated to FFmpeg and MPlayer, several months ago. That server was used as a source to clone the VM that we recently moved Trac to. It is not known if anyone used the backdoor that was found. We recommend all users to change their passwords. Especially users who use a password on Trac that they also use elsewhere, should change that password at least elsewhere. Alexander -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From get2jils at gmail.com Fri Feb 14 07:35:43 2014 From: get2jils at gmail.com (Keestu Pillo) Date: Fri, 14 Feb 2014 12:05:43 +0530 Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. Message-ID: I m trying to retrieve Frame rate in following manner. context = avformat_alloc_context(); int err; err = avformat_open_input (&context, "", NULL, NULL); for (i = 0; i < context->nb_streams; i++) { codec = avcodec_find_decoder(context->streams[i]->codec->codec_id); if (codec->type == AVMEDIA_TYPE_VIDEO ) { videoStreamIndex = i; video_stream = context->streams[videoStreamIndex]; AVRational fr = av_guess_frame_rate(context, video_stream, NULL); LOGD(" Frame RAte = %d/%d ", fr.num, fr.den); } } I am getting ways 0/0 printed. What am i doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Feb 14 13:40:26 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 14 Feb 2014 12:40:26 +0000 (UTC) Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. References: Message-ID: Keestu Pillo writes: > AVRational fr = av_guess_frame_rate(context, video_stream, NULL); > LOGD(" Frame RAte = %d/%d ", fr.num, fr.den); > > I am getting ways 0/0?? printed. What does ffmpeg -i report? Carl Eugen From get2jils at gmail.com Fri Feb 14 14:49:08 2014 From: get2jils at gmail.com (whoami Jils) Date: Fri, 14 Feb 2014 19:19:08 +0530 Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. In-Reply-To: References: Message-ID: Carl, I am working on android, and unfortunately my device is not a rooted one. i am unable to execute ffmpeg command there. Any other hook please to find why i am not getting frame rate, from the programming point of view ? On Fri, Feb 14, 2014 at 6:10 PM, Carl Eugen Hoyos wrote: > Keestu Pillo writes: > > > AVRational fr = av_guess_frame_rate(context, video_stream, NULL); > > LOGD(" Frame RAte = %d/%d ", fr.num, fr.den); > > > > I am getting ways 0/0 printed. > > What does ffmpeg -i report? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Feb 14 16:46:39 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 14 Feb 2014 15:46:39 +0000 (UTC) Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. References: Message-ID: whoami Jils writes: > I am working on android, and unfortunately my device is > not a rooted one. i am unable to execute ffmpeg command > there. Then please execute ffmpeg command from any other computer of your choice. Please remember not to top-post here, Carl Eugen From get2jils at gmail.com Fri Feb 14 16:53:55 2014 From: get2jils at gmail.com (whoami Jils) Date: Fri, 14 Feb 2014 21:23:55 +0530 Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. In-Reply-To: References: Message-ID: HI Carl, It returned me the below!! libavutil 52. 63.100 / 52. 63.100 libavcodec 55. 49.100 / 55. 49.100 libavformat 55. 26.100 / 55. 26.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 4. 1.101 / 4. 1.101 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 Input #0, rtsp, from 'rtsp://192.168.10.10:8554/demoVideo': Metadata: title : Session streamed by "testOnDemandRTSPServer" comment : demoVideo. Duration: N/A, start: 0.080000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720, 25 tbr, 90k tbn, 180k tbc On Fri, Feb 14, 2014 at 9:16 PM, Carl Eugen Hoyos wrote: > whoami Jils writes: > > > I am working on android, and unfortunately my device is > > not a rooted one. i am unable to execute ffmpeg command > > there. > > Then please execute ffmpeg command from any other computer > of your choice. > > Please remember not to top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Fri Feb 14 18:27:09 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 14 Feb 2014 14:27:09 -0300 Subject: [Libav-user] EXR channel support? Message-ID: <52FE51ED.1070803@gmail.com> I was wondering if ffmpeg ( thru the exr reader ) has a way to specify channels different than the standard rgba channels. If it can, can someone provide an example of the command-line. From onemda at gmail.com Fri Feb 14 18:48:16 2014 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 14 Feb 2014 18:48:16 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FE51ED.1070803@gmail.com> References: <52FE51ED.1070803@gmail.com> Message-ID: On 2/14/14, Gonzalo Garramuno wrote: > I was wondering if ffmpeg ( thru the exr reader ) has a way to specify > channels different than the standard rgba channels. If it can, can > someone provide an example of the command-line. No, it can not. From ggarra13 at gmail.com Fri Feb 14 22:48:29 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 14 Feb 2014 18:48:29 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> Message-ID: <52FE8F2D.9060109@gmail.com> On 14/02/14 14:48, Paul B Mahol wrote: > No, it can not. Thanks. Looking at the exr code it seems it would be easy to modify it to support other channels. However I am unfamiliar how to pass options down from ffmpeg_opt.c to the libavcodec/exr.c file. Maybe someone can point to a good example. From onemda at gmail.com Fri Feb 14 23:17:17 2014 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 14 Feb 2014 23:17:17 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FE8F2D.9060109@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> Message-ID: On 2/14/14, Gonzalo Garramuno wrote: > On 14/02/14 14:48, Paul B Mahol wrote: >> No, it can not. > Thanks. Looking at the exr code it seems it would be easy to modify it > to support other channels. However I am unfamiliar how to pass options > down from ffmpeg_opt.c to the libavcodec/exr.c file. > Maybe someone can point to a good example. See for example libx264 encoder, by using AVOption ... > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From ggarra13 at gmail.com Sat Feb 15 00:51:09 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 14 Feb 2014 20:51:09 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> Message-ID: <52FEABED.8010503@gmail.com> On 14/02/14 19:17, Paul B Mahol wrote: > See for example libx264 encoder, by using AVOption ... > Okay, I tinkered a bit but I cannot get the option to work. Here's my patch against latest head. -------------- next part -------------- diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f231b70..93a0622 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -40,6 +40,7 @@ #include "thread.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" +#include "libavutil/opt.h" enum ExrCompr { EXR_RAW = 0, @@ -90,6 +91,8 @@ typedef struct EXRContext { uint64_t scan_line_size; int scan_lines_per_block; + const char* layer; + const uint8_t *buf, *table; int buf_size; @@ -100,6 +103,20 @@ typedef struct EXRContext { int thread_data_size; } EXRContext; +#define OFFSET(x) offsetof(EXRContext, x) +#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption options[] = { + { "layer", "Set the decoding layer", OFFSET(layer), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD}, + { NULL }, +}; + +static const AVClass exr_class = { + .class_name = "EXR", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + /** * Converts from 32-bit float as uint32_t to uint16_t * @@ -951,6 +968,7 @@ static int decode_frame(AVCodecContext *avctx, s->buf = buf; s->buf_size = buf_size; + if (buf_size < 10) { av_log(avctx, AV_LOG_ERROR, "Too short header to parse\n"); return AVERROR_INVALIDDATA; @@ -990,13 +1008,15 @@ static int decode_frame(AVCodecContext *avctx, int channel_index = -1; int xsub, ysub; - if (!strcmp(buf, "R")) + const char* b = buf + strlen(buf) - 1; + + if (!strcmp(b, "R")||!strcmp(b, "X")||!strcmp(b, "U")) channel_index = 0; - else if (!strcmp(buf, "G")) + else if (!strcmp(b, "G")||!strcmp(b, "Y")||!strcmp(b, "V")) channel_index = 1; - else if (!strcmp(buf, "B")) + else if (!strcmp(b, "B")||!strcmp(b, "Z")) channel_index = 2; - else if (!strcmp(buf, "A")) + else if (!strcmp(b, "A")||!strcmp(b, "W")) channel_index = 3; else av_log(avctx, AV_LOG_WARNING, "Unsupported channel %.256s\n", buf); @@ -1275,4 +1295,5 @@ AVCodec ff_exr_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS, + .priv_class = &exr_class, }; From onemda at gmail.com Sat Feb 15 08:53:49 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 15 Feb 2014 08:53:49 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FEABED.8010503@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> Message-ID: On 2/15/14, Gonzalo Garramuno wrote: > On 14/02/14 19:17, Paul B Mahol wrote: >> See for example libx264 encoder, by using AVOption ... >> > Okay, I tinkered a bit but I cannot get the option to work. Here's my > patch against latest head. > Missing AVClass, must be first in EXRContext. Code can be much simpler using enums for layer option. From onemda at gmail.com Sat Feb 15 08:54:59 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 15 Feb 2014 08:54:59 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> Message-ID: On 2/15/14, Paul B Mahol wrote: > On 2/15/14, Gonzalo Garramuno wrote: >> On 14/02/14 19:17, Paul B Mahol wrote: >>> See for example libx264 encoder, by using AVOption ... >>> >> Okay, I tinkered a bit but I cannot get the option to work. Here's my >> patch against latest head. >> > > Missing AVClass, must be first in EXRContext. > > Code can be much simpler using enums for layer option. > Ignore last one, I was out of my mind. From onemda at gmail.com Sat Feb 15 08:56:35 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 15 Feb 2014 08:56:35 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> Message-ID: On 2/15/14, Paul B Mahol wrote: > On 2/15/14, Paul B Mahol wrote: >> On 2/15/14, Gonzalo Garramuno wrote: >>> On 14/02/14 19:17, Paul B Mahol wrote: >>>> See for example libx264 encoder, by using AVOption ... >>>> >>> Okay, I tinkered a bit but I cannot get the option to work. Here's my >>> patch against latest head. >>> >> >> Missing AVClass, must be first in EXRContext. >> >> Code can be much simpler using enums for layer option. >> > > Ignore last one, I was out of my mind. > Also the layer option is not used at all.... From ggarra13 at gmail.com Sat Feb 15 14:09:32 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 15 Feb 2014 10:09:32 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> Message-ID: <52FF670C.5080602@gmail.com> On 15/02/14 04:56, Paul B Mahol wrote: > On 2/15/14, Paul B Mahol wrote: > Also the layer option is not used at all.... Yes, I know. I tried just printing it with av_log and it crashes with segfault. The layer option works fine command-line (it asks for a string), but the EXRContext->layer never gets filled it seems. I am unsure if I need to do something more to parse the option. From ggarra13 at gmail.com Sat Feb 15 14:23:57 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 15 Feb 2014 10:23:57 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> Message-ID: <52FF6A6D.9040606@gmail.com> On 15/02/14 04:56, Paul B Mahol wrote: > Also the layer option is not used at all.... > Here's a patch with layer being printed that segfaults. It seems the field is never initialized nor parsed, even though command-line works. -------------- next part -------------- diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f231b70..0d3a793 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -40,6 +40,7 @@ #include "thread.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" +#include "libavutil/opt.h" enum ExrCompr { EXR_RAW = 0, @@ -90,6 +91,8 @@ typedef struct EXRContext { uint64_t scan_line_size; int scan_lines_per_block; + char* layer; + const uint8_t *buf, *table; int buf_size; @@ -100,6 +103,20 @@ typedef struct EXRContext { int thread_data_size; } EXRContext; +#define OFFSET(x) offsetof(EXRContext, x) +#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption options[] = { + { "layer", "Set the decoding layer", OFFSET(layer), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD}, + { NULL }, +}; + +static const AVClass exr_class = { + .class_name = "EXR", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + /** * Converts from 32-bit float as uint32_t to uint16_t * @@ -951,6 +968,7 @@ static int decode_frame(AVCodecContext *avctx, s->buf = buf; s->buf_size = buf_size; + if (buf_size < 10) { av_log(avctx, AV_LOG_ERROR, "Too short header to parse\n"); return AVERROR_INVALIDDATA; @@ -974,6 +992,7 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_PATCHWELCOME; } + // Parse the header while (buf < buf_end && buf[0]) { unsigned int variable_buffer_data_size; @@ -990,13 +1009,17 @@ static int decode_frame(AVCodecContext *avctx, int channel_index = -1; int xsub, ysub; - if (!strcmp(buf, "R")) + const char* b = buf + strlen(buf) - 1; + + av_log( avctx, AV_LOG_INFO, "Layer %s\n", s->layer ); + + if (!strcmp(b, "R")||!strcmp(b, "X")||!strcmp(b, "U")) channel_index = 0; - else if (!strcmp(buf, "G")) + else if (!strcmp(b, "G")||!strcmp(b, "Y")||!strcmp(b, "V")) channel_index = 1; - else if (!strcmp(buf, "B")) + else if (!strcmp(b, "B")||!strcmp(b, "Z")) channel_index = 2; - else if (!strcmp(buf, "A")) + else if (!strcmp(b, "A")||!strcmp(b, "W")) channel_index = 3; else av_log(avctx, AV_LOG_WARNING, "Unsupported channel %.256s\n", buf); @@ -1275,4 +1298,5 @@ AVCodec ff_exr_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS, + .priv_class = &exr_class, }; From onemda at gmail.com Sat Feb 15 22:09:58 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 15 Feb 2014 22:09:58 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FF6A6D.9040606@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> Message-ID: On 2/15/14, Gonzalo Garramuno wrote: > On 15/02/14 04:56, Paul B Mahol wrote: >> Also the layer option is not used at all.... >> > > Here's a patch with layer being printed that segfaults. It seems the > field is never initialized nor parsed, even though command-line works. > AVClass is still missing.... From ggarra13 at gmail.com Sat Feb 15 22:16:10 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 15 Feb 2014 18:16:10 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> Message-ID: <52FFD91A.8050904@gmail.com> On 15/02/14 18:09, Paul B Mahol wrote: > On 2/15/14, Gonzalo Garramuno wrote: >> On 15/02/14 04:56, Paul B Mahol wrote: >>> Also the layer option is not used at all.... >>> >> Here's a patch with layer being printed that segfaults. It seems the >> field is never initialized nor parsed, even though command-line works. >> > AVClass is still missing.... AVClass is there. See: +static const AVClass exr_class = { + .class_name = "EXR", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + @@ -1275,4 +1298,5 @@ AVCodec ff_exr_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS, + .priv_class = &exr_class, }; I put the code under valgrind and I can see that the crash is in the opt code. See the trace of valgrind: valgrind ffmpeg_g -layer RenderLayer.Color -i /media/Linux/anims/sub2/sub.%04d.exr test.mov ==9798== ==9798== Invalid read of size 8 ==9798== at 0x6CF1C08: av_opt_next (in /usr/local/lib/libavutil.so.52.63.101) ==9798== by 0x6CF1E9A: av_opt_free (in /usr/local/lib/libavutil.so.52.63.101) ==9798== by 0x5714EB2: avcodec_close (in /usr/local/lib/libavcodec.so.55.52.101) ==9798== by 0x542353F: avformat_find_stream_info (in /usr/local/lib/libavformat.so.55.32.101) ==9798== by 0x410A7D: open_input_file (ffmpeg_opt.c:861) ==9798== by 0x40F346: open_files.isra.7 (ffmpeg_opt.c:2587) ==9798== by 0x4174B9: ffmpeg_parse_options (ffmpeg_opt.c:2624) ==9798== by 0x407630: main (ffmpeg.c:3576) ==9798== Address 0x9847850 is 16 bytes inside a block of size 624 free'd ==9798== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9798== by 0x6CF0AAB: av_freep (in /usr/local/lib/libavutil.so.52.63.101) ==9798== by 0x541BA18: ??? (in /usr/local/lib/libavformat.so.55.32.101) ==9798== by 0x54234C7: avformat_find_stream_info (in /usr/local/lib/libavformat.so.55.32.101) ==9798== by 0x410A7D: open_input_file (ffmpeg_opt.c:861) ==9798== by 0x40F346: open_files.isra.7 (ffmpeg_opt.c:2587) ==9798== by 0x4174B9: ffmpeg_parse_options (ffmpeg_opt.c:2624) ==9798== by 0x407630: main (ffmpeg.c:3576) ==9798== From ggarra13 at gmail.com Sat Feb 15 22:24:41 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 15 Feb 2014 18:24:41 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FFD91A.8050904@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> <52FFD91A.8050904@gmail.com> Message-ID: <52FFDB19.4000803@gmail.com> Here's the final patch that works out the layers for exr. This patch works fine if run under valgrind but segfaults otherwise if run normally. The problem appears to be the parsing of options (and thus in my options definition I guess). Commenting out: priv_class = &exr_class, makes it work fine (albeit with no options of course). -------------- next part -------------- diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f231b70..c8ba1e9 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -40,6 +40,7 @@ #include "thread.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" +#include "libavutil/opt.h" enum ExrCompr { EXR_RAW = 0, @@ -98,8 +99,24 @@ typedef struct EXRContext { EXRThreadData *thread_data; int thread_data_size; + + const char* layer; } EXRContext; +#define OFFSET(x) offsetof(EXRContext, x) +#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption options[] = { + { "layer", "Set the decoding layer", OFFSET(layer), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD}, + { NULL }, +}; + +static const AVClass exr_class = { + .class_name = "EXR", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + /** * Converts from 32-bit float as uint32_t to uint16_t * @@ -990,13 +1007,26 @@ static int decode_frame(AVCodecContext *avctx, int channel_index = -1; int xsub, ysub; - if (!strcmp(buf, "R")) + const char* b = buf; + + if ( strcmp( s->layer, "" ) != 0 ) + { + if ( strncmp( b, s->layer, strlen(s->layer) ) == 0 ) + { + b += strlen(s->layer); + if ( *b == '.' ) ++b; /* skip dot if not given */ + av_log( avctx, AV_LOG_INFO, "Layer %s.%s matched\n", s->layer, b ); + } + } + + + if (!strcmp(b, "R")||!strcmp(b, "X")||!strcmp(b,"U")) channel_index = 0; - else if (!strcmp(buf, "G")) + else if (!strcmp(b, "G")||!strcmp(b, "Y")||!strcmp(b,"V")) channel_index = 1; - else if (!strcmp(buf, "B")) + else if (!strcmp(b, "B")||!strcmp(b, "Z")||!strcmp(b,"W")) channel_index = 2; - else if (!strcmp(buf, "A")) + else if (!strcmp(b, "A")) channel_index = 3; else av_log(avctx, AV_LOG_WARNING, "Unsupported channel %.256s\n", buf); @@ -1275,4 +1305,5 @@ AVCodec ff_exr_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS, + .priv_class = &exr_class, }; From onemda at gmail.com Sun Feb 16 00:02:20 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 16 Feb 2014 00:02:20 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FFDB19.4000803@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> <52FFD91A.8050904@gmail.com> <52FFDB19.4000803@gmail.com> Message-ID: On 2/15/14, Gonzalo Garramuno wrote: > Here's the final patch that works out the layers for exr. This patch > works fine if run under valgrind but segfaults otherwise if run > normally. The problem appears to be the parsing of options (and thus in > my options definition I guess). Commenting out: priv_class = > &exr_class, makes it work fine (albeit with no options of course). > > I'm not clear enough: AVClass is missing in EXRContext struct. From ggarra13 at gmail.com Sun Feb 16 00:14:51 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 15 Feb 2014 20:14:51 -0300 Subject: [Libav-user] EXR channel support? In-Reply-To: References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> <52FFD91A.8050904@gmail.com> <52FFDB19.4000803@gmail.com> Message-ID: <52FFF4EB.5080408@gmail.com> On 15/02/14 20:02, Paul B Mahol wrote: > I'm not clear enough: AVClass is missing in EXRContext struct. Thanks for the explanation. Now it all works fine. What's the proper way to submit a patch to get it added; this being my first contribution to ffmpeg. Should I send it here or at ffmpeg-devel? From onemda at gmail.com Sun Feb 16 00:41:31 2014 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 16 Feb 2014 00:41:31 +0100 Subject: [Libav-user] EXR channel support? In-Reply-To: <52FFF4EB.5080408@gmail.com> References: <52FE51ED.1070803@gmail.com> <52FE8F2D.9060109@gmail.com> <52FEABED.8010503@gmail.com> <52FF6A6D.9040606@gmail.com> <52FFD91A.8050904@gmail.com> <52FFDB19.4000803@gmail.com> <52FFF4EB.5080408@gmail.com> Message-ID: On 2/16/14, Gonzalo Garramuno wrote: > On 15/02/14 20:02, Paul B Mahol wrote: >> I'm not clear enough: AVClass is missing in EXRContext struct. > Thanks for the explanation. Now it all works fine. What's the proper > way to submit a patch to get it added; this being my first contribution > to ffmpeg. Should I send it here or at ffmpeg-devel? ffmpeg-devel > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From lkm9125 at gmail.com Fri Feb 14 09:37:02 2014 From: lkm9125 at gmail.com (funta) Date: Fri, 14 Feb 2014 00:37:02 -0800 (PST) Subject: [Libav-user] Unable to Retrieve Frame Rate. it always zero. In-Reply-To: References: Message-ID: <1392367022085-4659251.post@n4.nabble.com> double fps = 0.0; avformat_open_input(&in, infile, NULL, NULL); avformat_find_stream_info(in, NULL); for(i = 0; i < in->nb_streams; i++) { AVStream *input_stream = in->streams[i]; if(input_stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) { fps = (double)input_stream->r_frame_rate.num / input_stream->r_frame_rate.den; break; } } printf("FPS: %f\n", fps); -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Unable-to-Retrieve-Frame-Rate-it-always-zero-tp4659250p4659251.html Sent from the libav-users mailing list archive at Nabble.com. From edimartin at gmail.com Fri Feb 14 21:13:23 2014 From: edimartin at gmail.com (Edimartin) Date: Fri, 14 Feb 2014 12:13:23 -0800 (PST) Subject: [Libav-user] Write X264 to MP4 Message-ID: <1392408803773-4659258.post@n4.nabble.com> Hi. I am trying to write h264 frames to a MP4 file (no audio) and I am having problems. I try one example code but not with success . I am trying write h264 frames in the file but the VLC don't recognize the duration. Then I try make a frame to write on the file and it crash. Here is the source code. It's just a temporary project to teste to write the file. I am using one class who I made to encode h264 with x264 library. source code: #define fileName "test.mp4" int main(){ printf("\nHELLO MP4"); av_register_all(); unsigned char frame[(unsigned int)(352*240*1.5)]; H264VideoEncoder encoder; //create the context AVFormatContext *file=avformat_alloc_context(); if(file){ //load the format (MP4) AVOutputFormat *format = av_guess_format(NULL, fileName, NULL); if(format){ format->video_codec = CODEC_ID_H264; //add the format in the context file->oformat = format; //copi the fileName snprintf(file->filename,sizeof(file->filename),"%s",fileName); printf("FileName '%s'",file->filename);fflush(stdout); //create a new stream AVStream *stream = av_new_stream(file, 0); if(stream){ // printf("\nTRUE");fflush(stdout); if(avio_open(&file->pb,fileName,AVIO_FLAG_WRITE)>=0){ printf("\nTRUE");fflush(stdout); //try write a header file av_write_header(file); //flush the file avio_flush(file->pb); //load the encoder encoder.loadEncoder(352,240,5);//five is the keyframes number unsigned int count = 0u; for(unsigned int i=0u;i<500;i++){ //draw the frame to the encoder encoder.drawYUVinFrame(frame); //process the encoder while(!encoder.encode()){ // count++; } AVPacket pkt; av_init_packet(&pkt); pkt.data = encoder.getEncoded(); pkt.size = encoder.getEncodedSize(); //THE PROGRAM CRASH HERE av_interleaved_write_frame(file, &pkt); pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = stream->index; pkt.data = NULL; pkt.size = 0; av_write_frame(file,&pkt); //write the frame in a file /* avio_write(file->pb, encoder.getEncoded(), encoder.getEncodedSize() ); */ } encoder.deleteEncoder(); //close the file avio_close(file->pb); } } } } return 0; } I hope someone can show me a good tutorial to write MP4 files with libav . -- View this message in context: http://libav-users.943685.n4.nabble.com/Write-X264-to-MP4-tp4659258.html Sent from the libav-users mailing list archive at Nabble.com. From danieljlaird at hotmail.com Mon Feb 17 11:52:46 2014 From: danieljlaird at hotmail.com (djl197) Date: Mon, 17 Feb 2014 02:52:46 -0800 (PST) Subject: [Libav-user] UDP Streaming and multiple Ethernet devices Message-ID: <1392634366006-4659274.post@n4.nabble.com> All, I am using a CLI program that passes a string to Libav inorder to setup UDP streaming. I have 2 ethernet devices in my system and I would like to get it to stream out of eth1 instead of eth0. I have tried specifiying the IP address of eth1 in the output command i.e udp://@: But that did not seem to work (looking at wireshark) Anyone know if I can do this? Dan -- View this message in context: http://libav-users.943685.n4.nabble.com/UDP-Streaming-and-multiple-Ethernet-devices-tp4659274.html Sent from the libav-users mailing list archive at Nabble.com. From marco_sie at web.de Mon Feb 17 14:35:02 2014 From: marco_sie at web.de (Silver) Date: Mon, 17 Feb 2014 05:35:02 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1392124265162-4659230.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> Message-ID: <1392644102939-4659275.post@n4.nabble.com> Hello me again. Still the same. Its only for longer Clips, short Clips you don really notice anything. I played a little bit with pts... but couldn't fix it. Do i have to handle the pts manually... so that video and audio pts matches? What else could be the reason for asynchron video/audio? How can i investigate and improve my results... i can't trial error for Month... there have to be something, some steps .. some way. Other Software likes ffmpeg or handbrake doing a lot of pts/dts... and handling other stuff too. But i'm not sure what it does and if this isn't a lot of overkill for my project. -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659275.html Sent from the libav-users mailing list archive at Nabble.com. From danieljlaird at hotmail.com Mon Feb 17 11:50:02 2014 From: danieljlaird at hotmail.com (djl197) Date: Mon, 17 Feb 2014 02:50:02 -0800 (PST) Subject: [Libav-user] UDP Streaming and multiple Ethernet devices Message-ID: <1392634202424-4659273.post@n4.nabble.com> All, I am using a CLI program that passes a string to Libav inorder to setup UDP streaming. I have 2 ethernet devices in my system and I would like to get it to stream out of eth1 instead of eth0. I have tried specifiying the IP address of eth1 in the output command i.e udp://@: But that did not seem to work (looking at wireshark) Anyone know if I can do this? Dan -- View this message in context: http://libav-users.943685.n4.nabble.com/UDP-Streaming-and-multiple-Ethernet-devices-tp4659273.html Sent from the libav-users mailing list archive at Nabble.com. From edimartin at gmail.com Mon Feb 17 17:24:00 2014 From: edimartin at gmail.com (Edimartin) Date: Mon, 17 Feb 2014 08:24:00 -0800 (PST) Subject: [Libav-user] encoding h264 In-Reply-To: References: Message-ID: <1392654240517-4659276.post@n4.nabble.com> You can encode a frame with x264 (http://www.videolan.org/developers/x264.html) folowing this example (https://github.com/hiccupzhu/x264-example/blob/master/yuv2h264/yuv2h264.c). The encoder receive a YV12 image (not RGB) with is 50% the size of a RGB image (width*height*1.5). You will write the frame in the lines: memcpy(pic_in.img.plane[0], data, widthXheight); memcpy(pic_in.img.plane[1], data + widthXheight, widthXheight >> 2); memcpy(pic_in.img.plane[2], data + widthXheight + (widthXheight >> 2), widthXheight >> 2); The plane[0] receive a image width*height. The plane[1] and [2] receive 1/4 the size of the Y. You get the encoded frame in "nal[0].p_payload" and "i_frame_size". -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-encoding-h264-tp4658906p4659276.html Sent from the libav-users mailing list archive at Nabble.com. From adrozdoff at gmail.com Tue Feb 18 00:33:23 2014 From: adrozdoff at gmail.com (Alexander Drozdov) Date: Tue, 18 Feb 2014 10:33:23 +1100 Subject: [Libav-user] Transcoding MPES-TS to MPES-TS and some packet drops Message-ID: Hi, We try to transcode MPEG-TS(mpeg2video/mp2 audio) stream to MPEG-TS(h264/aac) and found that some packets drops from output stream, like: 0x0010 NIT 0x0012 EIT 0x0013 RST 0x0014 TDT/TOT Is it possible to replicate it at output stream? If source code modification is needed, any recomendations is velcomed also. Main purpose: show program schedule. Next command line is used: ffmpeg -i input.ts -strict experimental -dts_delta_threshold 1000 -map 0:0 -map 0:1 -c:v h264 -x264opts force-cfr -filter:v yadif -vprofile baseline -level 3.0 -preset veryfast -tune film -g 25 -bufsize 2048k -b:v 1024k -maxrate 1500k -r 25 -bsf:v h264_mp4toannexb -c:a aac -b:a 128K -ar 44100 -ac 2 -async 1 -isync -af aresample=async=1000 -threads 2 -flags -global_header -f mpegts out.ts -- WBR, Alexander Drozdov http://htrd.su -------------- next part -------------- An HTML attachment was scrubbed... URL: From uei.user036 at gmail.com Wed Feb 19 10:23:51 2014 From: uei.user036 at gmail.com (Kevin Kratzer) Date: Wed, 19 Feb 2014 18:23:51 +0900 Subject: [Libav-user] Reasons for avcodec_find_encoder failing Message-ID: <53047827.20000@gmail.com> Hello, I would appreciate if you could tell me the reason for a failed avcodec_find_encoder call. I'm trying to find an encoder e.g. for bmp e.g. AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_BMP); AVCodec* codec = avcodec_find_encoder(CODEC_ID_BMP); AVCodec* codec = avcodec_find_encoder_by_name("bmp"); However, in all three cases NULL is returned. The configuration call stated: Enabled encoders: bmp The same happens for example with AV_CODEC_ID_MJPEG when I enable the mjpeg encoder Thank you for any information what the reasons could be for this! (I'm using FFmpeg from git, master, b9936e59e8e0b17d7c1c41a910d86c31eb6142a5) Best, Kevin From mrfun.china at gmail.com Wed Feb 19 10:35:19 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 19 Feb 2014 20:35:19 +1100 Subject: [Libav-user] about flushing decoder at the end of file Message-ID: Hi friends, I know when av_read_frame(ctx, pkt) returns < 0 we can set pkt.data = NULL and pkt.size = 0 to flush any frames in decoder if the decoder has the CODEC_CAP_DELAY set. The example in src/doc/examples/demuxing.c does these while (av_read_frame(ctx, &pkt) >=0 ) { decode_packet(&got_frame, 0); av_free_packet() } pkt.data = NULL; pkt.size = 0; do { decode_packet(&got_frame, 1); } while (got_frame); so my question is how if both Audio and Video has something to flush? Because decode_packet() depends on pkt.stream_index to call audio or video decoder, but pkt.stream_index is set in the last call to av_read_frame, so it never changes in whole do {} while. My second question is how to flush all video frame quickly. Can I do this: while (av_read_frame(ctx, &pkt) >=0 ) { decode_packet(&got_frame, 0); av_free_packet() } // will it have problem if there're only audio frames wait to flush but no video frame // can I explicitly set pkt index to video and call decode_video? (I only want video frames) pkt.stream_index = video_index; pkt.data = NULL; pkt.size = 0; do { avcodec_decode_video2(,&got_frame,..); } while(got_frame) I set steam_index to video index because I'm afraid that pkt.stream_index may be the index of audio after return from av_read_frame(). Just imagine this case: when av_read_frame() returns < 0, there're audio frames wait to flush but no video frames left. Will my call to avcodec_decode_video2(,&got_frame,..) cause any crash? or it's guaranteed to return got_frame == false so that I know there's no video frame left? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Feb 19 12:12:48 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 11:12:48 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Reasons_for_avcodec=5Ffind=5Fencoder_faili?= =?utf-8?q?ng?= References: <53047827.20000@gmail.com> Message-ID: Kevin Kratzer writes: > I'm trying to find an encoder e.g. for bmp e.g. > > AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_BMP); > AVCodec* codec = avcodec_find_encoder(CODEC_ID_BMP); > AVCodec* codec = avcodec_find_encoder_by_name("bmp"); > > However, in all three cases NULL is returned. Please provide sample stand-alone code. (Did you call *register()?) Carl Eugen From lucas.soltic at orange.fr Wed Feb 19 15:40:50 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Wed, 19 Feb 2014 15:40:50 +0100 Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X Message-ID: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> Hello, I'm running OS X 10.9 and I'm not able to build FFmpeg dynamic libraries with decoders disabled. I use this configure command: ../configure --disable-yasm --enable-shared --disable-decoders For FFmpeg 2.1.3, it fails with the following: LD libavcodec/libavcodec.55.dylib Undefined symbols for architecture x86_64: "_ff_hevc_compute_poc", referenced from: _hevc_parse in hevc_parser.o "_ff_hevc_decode_nal_pps", referenced from: _hevc_parse in hevc_parser.o "_ff_hevc_decode_nal_sei", referenced from: _hevc_parse in hevc_parser.o "_ff_hevc_decode_nal_sps", referenced from: _hevc_parse in hevc_parser.o "_ff_hevc_decode_nal_vps", referenced from: _hevc_parse in hevc_parser.o "_ff_hevc_extract_rbsp", referenced from: _hevc_parse in hevc_parser.o Full build log here: http://pastebin.com/wiayd4tA For FFmpeg HEAD from the git repository (git://source.ffmpeg.org/ffmpeg.git), it fails with the following: LD libavfilter/libavfilter.4.dylib Undefined symbols for architecture x86_64: "_av_dct_calc", referenced from: _filter_frame in vf_dctdnoiz.o "_av_dct_end", referenced from: _uninit in vf_dctdnoiz.o "_av_dct_init", referenced from: _init in vf_dctdnoiz.o Full build log here: http://pastebin.com/WCwmh6TW If I remove the --disable-decoders configure flag, then both FFmpeg 2.1.3 and FFmpeg HEAD build fine. However I wish to use this option in order to enable only a few decoders in my build, for legal reasons, thus this is a blocking issue to me. My OS: uname -rsv Darwin 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 And compiler: clang -v Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix Regards, Lucas SOLTIC From krueger at lesspain.de Wed Feb 19 17:17:33 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 19 Feb 2014 17:17:33 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On Mon, Jan 13, 2014 at 3:53 PM, Robert Kr?ger wrote: > On Mon, Jan 13, 2014 at 11:57 AM, Carl Eugen Hoyos wrote: >> Robert Kr?ger writes: >> >>> Could you elaborate a bit what would be needed to make >>> this work, i.e. demuxing single images (not a series) >>> like jpg, png, dpx >> >> jpg and png and dpx should work fine with image2pipe > > OK, so just to avoid misunderstandings: What I would have to do is to > first determine the file type myself (e.g. by file extension) and if > it is one that should use the image2pipe demuxer (for simplicity's > sake let's say that's jpg, png and dpx) I obtain an instance of > AVInputFormat (using > av_find_input_format) for image2pipe and then call avformat_open_input > using that input format pointer. Is that correct? > >> >>> and probably others covered by the image2 demuxer >> >> Which others? >> Some will have constant frame size, for the rest a >> parser would be needed. >> I did this: - get the image2pipe demuxer by calling av_find_input_format - get the dpx codec by avcodec_find_decoder_by_name with "dpx" - set dpx as video codec in my format context using av_format_set_video_codec - opened the file using avformat_open_input specifying the image2pipe demuxer This works for some dpx files for which a corresponding command line also works. However for some it fails (e.g. the fate sample lighthouse_rgb48.dpx), for which this command line also fails: cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png ffmpeg version N-60736-gb14517d Copyright (c) 2000-2014 the FFmpeg developers built on Feb 19 2014 17:14:26 with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration: libavutil 52. 64.100 / 52. 64.100 libavcodec 55. 52.102 / 55. 52.102 libavformat 55. 33.100 / 55. 33.100 libavdevice 55. 10.100 / 55. 10.100 libavfilter 4. 1.103 / 4. 1.103 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 [dpx @ 0x7fcb21822600] Overread buffer. Invalid header? Input #0, image2pipe, from 'pipe:': Duration: N/A, bitrate: N/A Stream #0:0: Video: dpx, rgb48be, 768x512, 25 tbr, 25 tbn, 25 tbc Output #0, image2, to '/Users/krueger/tmp/fromdpx_pipe2.png': Metadata: encoder : Lavf55.33.100 Stream #0:0: Video: png, rgb48be, 768x512, q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (dpx -> png) [dpx @ 0x7fcb21822600] Overread buffer. Invalid header? Error while decoding stream #0:0: Invalid data found when processing input pipe:: Input/output error frame= 0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A video:0kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead -inf% Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) Is this a bug, shall I make a trac ticket? From cehoyos at ag.or.at Wed Feb 19 17:35:11 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 16:35:11 +0000 (UTC) Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> Message-ID: Lucas Soltic writes: > ../configure --disable-yasm --enable-shared --disable-decoders > > For FFmpeg 2.1.3, it fails with the following: > LD libavcodec/libavcodec.55.dylib > Undefined symbols for architecture x86_64: > "_ff_hevc_compute_poc", referenced from: > _hevc_parse in hevc_parser.o > For FFmpeg HEAD from the git repository > (git://source.ffmpeg.org/ffmpeg.git), it fails > with the following: > LD libavfilter/libavfilter.4.dylib > Undefined symbols for architecture x86_64: > "_av_dct_calc", referenced from: > _filter_frame in vf_dctdnoiz.o Both should be fixed. Such reports are definitely welcome, thank you! That being said, allow me to note that I am not sure "../configure" (building within the source directory) is supported and you should never use --disable-yasm, its use is strongly discouraged! You may want to add --disable-static if you want shared libraries. Carl Eugen From cehoyos at ag.or.at Wed Feb 19 17:56:26 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 16:56:26 +0000 (UTC) Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? References: Message-ID: Robert Kr?ger writes: > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png > [dpx 0x7fcb21822600] Overread buffer. Invalid header? The image is cut in the middle, I don't know if that is a problem with the parser or if it is a fundamental problem with image2pipe: Did you try very large pngs? Carl Eugen From krueger at lesspain.de Wed Feb 19 18:10:58 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 19 Feb 2014 18:10:58 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On Wed, Feb 19, 2014 at 5:56 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >> -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png > >> [dpx 0x7fcb21822600] Overread buffer. Invalid header? > > The image is cut in the middle, I don't know if that is > a problem with the parser or if it is a fundamental > problem with image2pipe: Did you try very large pngs? I just tested a png of 11MB and that worked ok except for the message "pipe:: Input/output error" but I got that message also with dpx files that worked. Full CL and output: ffmpeg version git-2014-01-19-8decf37 Copyright (c) 2000-2014 the FFmpeg developers built on Jan 19 2014 15:49:12 with llvm-gcc 4.2.1 (LLVM build 2336.1.00) configuration: --enable-shared --disable-static --disable-doc --disable-avdevice --prefix=/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/native/build/ffmpeg --extra-cflags=-I/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/native/build/libmp3lame/include/ --extra-ldflags=-L/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/native/build/libmp3lame/lib/ --extra-ldflags='-Wl,-rpath, at loader_path/../lib' --enable-libmp3lame libavutil 52. 62.100 / 52. 62.100 libavcodec 55. 48.101 / 55. 48.101 libavformat 55. 24.100 / 55. 24.100 libavfilter 4. 1.100 / 4. 1.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 [image2pipe @ 0x101808200] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, image2pipe, from 'pipe:': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, rgba64be, 1920x1080 [SAR 9:16 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Output #0, image2, to '/Users/krueger/tmp/frompng_pipe2.png': Metadata: encoder : Lavf55.24.100 Stream #0:0: Video: png, rgba64be, 1920x1080 [SAR 9:16 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (png -> png) pipe:: Input/output error frame= 1 fps=0.9 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A video:11038kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000195% The output file looks ok. On a sidenote: [SAR 9:16 DAR 1:1] does not seem correct for a 1920:1080 file. From cehoyos at ag.or.at Wed Feb 19 18:18:49 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 17:18:49 +0000 (UTC) Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? References: Message-ID: Robert Kr?ger writes: > The output file looks ok. On a sidenote: [SAR 9:16 DAR 1:1] > does not seem correct for a 1920:1080 file. This looks definitely worth a report;-) I don't know about the dpx problem but since it is easily reproducible, I would suggest to open a ticket. Carl Eugen From marco_sie at web.de Wed Feb 19 18:26:40 2014 From: marco_sie at web.de (Silver) Date: Wed, 19 Feb 2014 09:26:40 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1392644102939-4659275.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> <1392644102939-4659275.post@n4.nabble.com> Message-ID: <1392830800257-4659287.post@n4.nabble.com> Hello, This Problem is not super new... but i couldn't find some solutions for it. Some were for ffmpeg or already too old and outdated and most Tutorials or Guides are for Streaming or Video Playing. Not Transcoding and saving it to File. Somebody out there with knowledge? How does it work? PTS/DTS are millisecond based... for 25fps: 1Second/25 Frames = 0,04 Seconds, does this mean both pts/dts from video and audioframe(packet) have to be 400? Next Value then 800,1200,.... ? ---- And whats about dropped Frames, can this be a reason for out of sync Clips? Where should i look? Is there a better place? :( -.- Have a nice Day. -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659287.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Wed Feb 19 18:27:28 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 17:27:28 +0000 (UTC) Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? References: Message-ID: Carl Eugen Hoyos writes: > Robert Kr?ger ...> writes: > > > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg > > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png > > > [dpx 0x7fcb21822600] Overread buffer. Invalid header? > > The image is cut in the middle Iiuc, the parser reads the file size from the file header while the decoder calculates the (minimal possible) file size. The value that the parser reads from the file header is too small. I suspect the bug can be fixed by reusing the logic to determine the image size also in the parser or by ignoring the file size outputting everything until the next magic marker. Carl Eugen From lucas.soltic at orange.fr Wed Feb 19 21:57:56 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Wed, 19 Feb 2014 21:57:56 +0100 Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X In-Reply-To: References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> Message-ID: <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Le 19 f?vr. 2014 ? 17:35, Carl Eugen Hoyos a ?crit : > Lucas Soltic writes: > >> ../configure --disable-yasm --enable-shared --disable-decoders >> >> For FFmpeg 2.1.3, it fails with the following: >> LD libavcodec/libavcodec.55.dylib >> Undefined symbols for architecture x86_64: >> "_ff_hevc_compute_poc", referenced from: >> _hevc_parse in hevc_parser.o > >> For FFmpeg HEAD from the git repository >> (git://source.ffmpeg.org/ffmpeg.git), it fails >> with the following: >> LD libavfilter/libavfilter.4.dylib >> Undefined symbols for architecture x86_64: >> "_av_dct_calc", referenced from: >> _filter_frame in vf_dctdnoiz.o > > Both should be fixed. > Such reports are definitely welcome, thank you! > > That being said, allow me to note that I am not > sure "../configure" (building within the source > directory) is supported and you should never use > --disable-yasm, its use is strongly discouraged! > > You may want to add --disable-static if you want > shared libraries. > > Carl Eugen What are the consequences of disabling YASM? is it about disabling most assembler optimizations? and how important is the difference with and without YASM? As for the build, I have pulled your fix from the Git repository but I have another issue. After many builds I managed to find the combination that produces the error. ok: configure --disable-decoders --disable-yasm --enable-shared --disable-static ok: configure --disable-encoders --disable-yasm --enable-shared --disable-static ok: configure --disable-muxers --disable-yasm --enable-shared --disable-static ok: configure --disable-decoders --disable-muxers --disable-yasm --enable-shared --disable-static nok: configure --disable-encoders --disable-decoders --disable-yasm --enable-shared --disable-static So the weird thing is that --disable-encoders or --disable-decoders alone work fine, but not when they're both present. The full build log is here: http://pastebin.com/9wLnzpHy Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Wed Feb 19 22:02:51 2014 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 19 Feb 2014 22:02:51 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On 2/19/14, Carl Eugen Hoyos wrote: > Carl Eugen Hoyos writes: > >> Robert Krueger ...> writes: >> >> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >> >> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >> >> The image is cut in the middle > > Iiuc, the parser reads the file size from the file > header while the decoder calculates the (minimal > possible) file size. The value that the parser > reads from the file header is too small. > > I suspect the bug can be fixed by reusing the logic > to determine the image size also in the parser or > by ignoring the file size outputting everything until > the next magic marker. There is no bug in parser, bug is in dpx file which do not conform to the specification. FFmpeg dpx encoder is fine. ImageMagick sucks. From cehoyos at ag.or.at Wed Feb 19 22:12:08 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 21:12:08 +0000 (UTC) Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Message-ID: Lucas Soltic writes: > What are the consequences of disabling YASM? You get a crippled FFmpeg binary at the benefit of exactly nothing. > nok: configure --disable-encoders --disable-decoders > --disable-yasm --enable-shared --disable-static Works fine here. Please confirm that you run "make distclean" before testing build issues. When reporting build issues, please do not post the complete build log (unless requested), instead post your configure line, then run make locally, if make fails, run it again (just to confirm that you still see the same error), then run "make V=1" and post the complete output of the third run here on the mailing list, do not use external resources, they may disappear. Carl Eugen From cehoyos at ag.or.at Wed Feb 19 22:15:03 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 21:15:03 +0000 (UTC) Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? References: Message-ID: Paul B Mahol writes: > There is no bug in parser, bug is in dpx file which > do not conform to the specification. So it is ok for a parser to fail for a file that the respective decoder accepts? Sounds strange to me. What does the parser currently do with trailing garbage? Carl Eugen From lucas.soltic at orange.fr Wed Feb 19 22:32:56 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Wed, 19 Feb 2014 22:32:56 +0100 Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X In-Reply-To: References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Message-ID: Le 19 f?vr. 2014 ? 22:12, Carl Eugen Hoyos a ?crit : > Lucas Soltic writes: > >> What are the consequences of disabling YASM? > > You get a crippled FFmpeg binary at the benefit > of exactly nothing. With "crippled", do you mean non-optimized or with missing/broken features? > >> nok: configure --disable-encoders --disable-decoders >> --disable-yasm --enable-shared --disable-static > > Works fine here. > > Please confirm that you run "make distclean" before > testing build issues. > When reporting build issues, please do not post > the complete build log (unless requested), instead > post your configure line, then run make locally, > if make fails, run it again (just to confirm that > you still see the same error), then run "make V=1" > and post the complete output of the third run here > on the mailing list, do not use external resources, > they may disappear. > > Carl Eugen Ok. I did "make distclean" before using this configure line: configure --disable-encoders --disable-decoders --disable-yasm --enable-shared --disable-static Then make -j5 (fails), then make (fails), then make V=1 (fails too) : gcc -dynamiclib -Wl,-single_module -Wl,-install_name,/usr/local/lib/libavcodec.55.dylib,-current_version,55.52.102,-compatibility_version,55 -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-dynamic,-search_paths_first -Qunused-arguments -o libavcodec/libavcodec.55.dylib libavcodec/aac_ac3_parser.o libavcodec/aac_adtstoasc_bsf.o libavcodec/aac_parser.o libavcodec/aacadtsdec.o libavcodec/ac3_parser.o libavcodec/ac3tab.o libavcodec/adx.o libavcodec/adx_parser.o libavcodec/allcodecs.o libavcodec/audioconvert.o libavcodec/avfft.o libavcodec/avpacket.o libavcodec/avpicture.o libavcodec/bitstream.o libavcodec/bitstream_filter.o libavcodec/bmp_parser.o libavcodec/cabac.o libavcodec/cavs_parser.o libavcodec/chomp_bsf.o libavcodec/codec_desc.o libavcodec/cook_parser.o libavcodec/dca.o libavcodec/dca_parser.o libavcodec/dct.o libavcodec/dct32_fixed.o libavcodec/dct32_float.o libavcodec/dirac.o libavcodec/dirac_parser.o libavcodec/dnxhd_parser.o libavcodec/dnxhddata.o libavcodec/dpx_parser.o libavcodec/dsputil.o libavcodec/dump_extradata_bsf.o libavcodec/dv_profile.o libavcodec/dvbsub_parser.o libavcodec/dvd_nav_parser.o libavcodec/dvdsub_parser.o libavcodec/elbg.o libavcodec/error_resilience.o libavcodec/faanidct.o libavcodec/fft_fixed.o libavcodec/fft_fixed_32.o libavcodec/fft_float.o libavcodec/fft_init_table.o libavcodec/flac.o libavcodec/flac_parser.o libavcodec/flacdata.o libavcodec/fmtconvert.o libavcodec/golomb.o libavcodec/gsm_parser.o libavcodec/h261_parser.o libavcodec/h263.o libavcodec/h263_parser.o libavcodec/h263dec.o libavcodec/h264.o libavcodec/h264_cabac.o libavcodec/h264_cavlc.o libavcodec/h264_direct.o libavcodec/h264_loopfilter.o libavcodec/h264_mp4toannexb_bsf.o libavcodec/h264_parser.o libavcodec/h264_ps.o libavcodec/h264_refs.o libavcodec/h264_sei.o libavcodec/h264chroma.o libavcodec/h264dsp.o libavcodec/h264idct.o libavcodec/h264pred.o libavcodec/h264qpel.o libavcodec/hevc.o libavcodec/hevc_cabac.o libavcodec/hevc_filter.o libavcodec/hevc_mvs.o libavcodec/hevc_parser.o libavcodec/hevc_ps.o libavcodec/hevc_refs.o libavcodec/hevc_sei.o libavcodec/hevcdsp.o libavcodec/hevcpred.o libavcodec/hpeldsp.o libavcodec/iff.o libavcodec/imgconvert.o libavcodec/imx_dump_header_bsf.o libavcodec/ituh263dec.o libavcodec/jrevdct.o libavcodec/latm_parser.o libavcodec/log2_tab.o libavcodec/mathtables.o libavcodec/mjpeg.o libavcodec/mjpeg2jpeg_bsf.o libavcodec/mjpeg_parser.o libavcodec/mjpega_dump_header_bsf.o libavcodec/mlp.o libavcodec/mlp_parser.o libavcodec/movsub_bsf.o libavcodec/mp3_header_decompress_bsf.o libavcodec/mpeg12.o libavcodec/mpeg12data.o libavcodec/mpeg4audio.o libavcodec/mpeg4video.o libavcodec/mpeg4video_parser.o libavcodec/mpeg4videodec.o libavcodec/mpegaudio_parser.o libavcodec/mpegaudiodata.o libavcodec/mpegaudiodecheader.o libavcodec/mpegvideo.o libavcodec/mpegvideo_motion.o libavcodec/mpegvideo_parser.o libavcodec/msmpeg4.o libavcodec/msmpeg4data.o libavcodec/noise_bsf.o libavcodec/options.o libavcodec/parser.o libavcodec/png_parser.o libavcodec/pnm.o libavcodec/pnm_parser.o libavcodec/pthread.o libavcodec/pthread_frame.o libavcodec/pthread_slice.o libavcodec/raw.o libavcodec/rawdec.o libavcodec/rdft.o libavcodec/remove_extradata_bsf.o libavcodec/resample.o libavcodec/resample2.o libavcodec/rv34_parser.o libavcodec/simple_idct.o libavcodec/tak.o libavcodec/tak_parser.o libavcodec/utils.o libavcodec/vc1.o libavcodec/vc1_parser.o libavcodec/vc1data.o libavcodec/videodsp.o libavcodec/vorbis_data.o libavcodec/vorbis_parser.o libavcodec/vp3_parser.o libavcodec/vp8_parser.o libavcodec/vp9_parser.o libavcodec/x86/constants.o libavcodec/x86/dct_init.o libavcodec/x86/dsputil_init.o libavcodec/x86/dsputil_mmx.o libavcodec/x86/dsputil_x86.o libavcodec/x86/fft_init.o libavcodec/x86/fmtconvert_init.o libavcodec/x86/fpel_mmx.o libavcodec/x86/h264_intrapred_init.o libavcodec/x86/h264_qpel.o libavcodec/x86/h264chroma_init.o libavcodec/x86/h264dsp_init.o libavcodec/x86/hpeldsp_init.o libavcodec/x86/hpeldsp_mmx.o libavcodec/x86/idct_mmx_xvid.o libavcodec/x86/idct_sse2_xvid.o libavcodec/x86/mpegvideo.o libavcodec/x86/rnd_mmx.o libavcodec/x86/simple_idct.o libavcodec/x86/videodsp_init.o libavcodec/xiph.o -lavutil -liconv -lm -lbz2 -lz -pthread ld: warning: directory not found for option '-Llibavresample' ld: warning: directory not found for option '-Llibpostproc' Undefined symbols for architecture x86_64: "_ff_h263dsp_init", referenced from: _ff_h263_decode_init in h263dec.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [libavcodec/libavcodec.55.dylib] Error 1 Lucas From cehoyos at ag.or.at Wed Feb 19 22:51:03 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 21:51:03 +0000 (UTC) Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Message-ID: Lucas Soltic writes: > Ok. I did "make distclean" before using this configure line: > configure --disable-encoders --disable-decoders --disable-yasm > --enable-shared --disable-static > Undefined symbols for architecture x86_64: > "_ff_h263dsp_init", referenced from: > _ff_h263_decode_init in h263dec.o The relevant file libavcodec/h263dsp.o gets compiled here because config.mak defines H263DSP here with your configure line and this forces libavcodec/Makfile to enable compilation of libavcodec/h263dsp.o: $ make distclean $ git pull $ configure --disable-encoders --disable-decoders --disable-yasm \ --enable-shared --disable-static $ grep H263DSP config.mak CONFIG_H263DSP=yes $ make ffmpeg $ ls libavcodec/h263dsp.o libavcodec/h263dsp.o Carl Eugen From cehoyos at ag.or.at Wed Feb 19 22:52:27 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 21:52:27 +0000 (UTC) Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Message-ID: Lucas Soltic writes: > >> What are the consequences of disabling YASM? > > > > You get a crippled FFmpeg binary at the benefit > > of exactly nothing. > > With "crippled", do you mean non-optimized or > with missing/broken features? Yes, this is correct, you get a binary with missing / broken features and non-existing optimizations. Carl Eugen From onemda at gmail.com Wed Feb 19 23:15:25 2014 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 19 Feb 2014 23:15:25 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On 2/19/14, Carl Eugen Hoyos wrote: > Paul B Mahol writes: > >> There is no bug in parser, bug is in dpx file which >> do not conform to the specification. > > So it is ok for a parser to fail for a file that the > respective decoder accepts? > Sounds strange to me. > > What does the parser currently do with trailing > garbage? There is no trailing garbage, bytes in header that tells size of file are incorrect. From cehoyos at ag.or.at Wed Feb 19 23:17:25 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 22:17:25 +0000 (UTC) Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? References: Message-ID: Paul B Mahol writes: > > What does the parser currently do with trailing > > garbage? > > There is no trailing garbage, bytes in header that > tells size of file are incorrect. Sorry for being unclear: I do understand that the file in question does not contain trailing garbage, I just wonder what the parser does with a file that actually contains trailing garbage. Carl Eugen From lucas.soltic at orange.fr Wed Feb 19 23:17:54 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Wed, 19 Feb 2014 23:17:54 +0100 Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X In-Reply-To: References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> Message-ID: <95285561-9B35-4D21-AF20-75888E65619E@orange.fr> Le 19 f?vr. 2014 ? 22:51, Carl Eugen Hoyos a ?crit : > Lucas Soltic writes: > >> Ok. I did "make distclean" before using this configure line: >> configure --disable-encoders --disable-decoders --disable-yasm >> --enable-shared --disable-static > >> Undefined symbols for architecture x86_64: >> "_ff_h263dsp_init", referenced from: >> _ff_h263_decode_init in h263dec.o > > The relevant file libavcodec/h263dsp.o gets compiled > here because config.mak defines H263DSP here with > your configure line and this forces libavcodec/Makfile > to enable compilation of libavcodec/h263dsp.o: > > $ make distclean > $ git pull > $ configure --disable-encoders --disable-decoders --disable-yasm \ > --enable-shared --disable-static > $ grep H263DSP config.mak > CONFIG_H263DSP=yes > $ make ffmpeg > $ ls libavcodec/h263dsp.o > libavcodec/h263dsp.o > > Carl Eugen So what am I supposed to do..? Executing the same commands as you gives me the following: ~/ffmpeg $ git pull Updating 0a30ad3..ca9f7e1 Fast-forward doc/muxers.texi | 2 +- libavcodec/hevc.c | 30 ++++++++++++++++-------------- libavcodec/hevc_ps.c | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) ~/ffmpeg $ cd ../ffbuild ~/ffbuild $ make distclean ~/ffbuild $ ../ffmpeg/configure --disable-encoders --disable-decoders --disable-yasm --enable-shared --disable-static ~/ffbuild $ grep H263DSP config.mak !CONFIG_H263DSP=yes ~/ffbuild $ make ffmpeg [...] (link error here) ~/ffbuild $ make ffmpeg V=1 gcc -dynamiclib -Wl,-single_module -Wl,-install_name,/usr/local/lib/libavcodec.55.dylib,-current_version,55.52.102,-compatibility_version,55 -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-dynamic,-search_paths_first -Qunused-arguments -o libavcodec/libavcodec.55.dylib libavcodec/aac_ac3_parser.o libavcodec/aac_adtstoasc_bsf.o libavcodec/aac_parser.o libavcodec/aacadtsdec.o libavcodec/ac3_parser.o libavcodec/ac3tab.o libavcodec/adx.o libavcodec/adx_parser.o libavcodec/allcodecs.o libavcodec/audioconvert.o libavcodec/avfft.o libavcodec/avpacket.o libavcodec/avpicture.o libavcodec/bitstream.o libavcodec/bitstream_filter.o libavcodec/bmp_parser.o libavcodec/cabac.o libavcodec/cavs_parser.o libavcodec/chomp_bsf.o libavcodec/codec_desc.o libavcodec/cook_parser.o libavcodec/dca.o libavcodec/dca_parser.o libavcodec/dct.o libavcodec/dct32_fixed.o libavcodec/dct32_float.o libavcodec/dirac.o libavcodec/dirac_parser.o libavcodec/dnxhd_parser.o libavcodec/dnxhddata.o libavcodec/dpx_parser.o libavcodec/dsputil.o libavcodec/dump_extradata_bsf.o libavcodec/dv_profile.o libavcodec/dvbsub_parser.o libavcodec/dvd_nav_parser.o libavcodec/dvdsub_parser.o libavcodec/elbg.o libavcodec/error_resilience.o libavcodec/faanidct.o libavcodec/fft_fixed.o libavcodec/fft_fixed_32.o libavcodec/fft_float.o libavcodec/fft_init_table.o libavcodec/flac.o libavcodec/flac_parser.o libavcodec/flacdata.o libavcodec/fmtconvert.o libavcodec/golomb.o libavcodec/gsm_parser.o libavcodec/h261_parser.o libavcodec/h263.o libavcodec/h263_parser.o libavcodec/h263dec.o libavcodec/h264.o libavcodec/h264_cabac.o libavcodec/h264_cavlc.o libavcodec/h264_direct.o libavcodec/h264_loopfilter.o libavcodec/h264_mp4toannexb_bsf.o libavcodec/h264_parser.o libavcodec/h264_ps.o libavcodec/h264_refs.o libavcodec/h264_sei.o libavcodec/h264chroma.o libavcodec/h264dsp.o libavcodec/h264idct.o libavcodec/h264pred.o libavcodec/h264qpel.o libavcodec/hevc.o libavcodec/hevc_cabac.o libavcodec/hevc_filter.o libavcodec/hevc_mvs.o libavcodec/hevc_parser.o libavcodec/hevc_ps.o libavcodec/hevc_refs.o libavcodec/hevc_sei.o libavcodec/hevcdsp.o libavcodec/hevcpred.o libavcodec/hpeldsp.o libavcodec/iff.o libavcodec/imgconvert.o libavcodec/imx_dump_header_bsf.o libavcodec/ituh263dec.o libavcodec/jrevdct.o libavcodec/latm_parser.o libavcodec/log2_tab.o libavcodec/mathtables.o libavcodec/mjpeg.o libavcodec/mjpeg2jpeg_bsf.o libavcodec/mjpeg_parser.o libavcodec/mjpega_dump_header_bsf.o libavcodec/mlp.o libavcodec/mlp_parser.o libavcodec/movsub_bsf.o libavcodec/mp3_header_decompress_bsf.o libavcodec/mpeg12.o libavcodec/mpeg12data.o libavcodec/mpeg4audio.o libavcodec/mpeg4video.o libavcodec/mpeg4video_parser.o libavcodec/mpeg4videodec.o libavcodec/mpegaudio_parser.o libavcodec/mpegaudiodata.o libavcodec/mpegaudiodecheader.o libavcodec/mpegvideo.o libavcodec/mpegvideo_motion.o libavcodec/mpegvideo_parser.o libavcodec/msmpeg4.o libavcodec/msmpeg4data.o libavcodec/noise_bsf.o libavcodec/options.o libavcodec/parser.o libavcodec/png_parser.o libavcodec/pnm.o libavcodec/pnm_parser.o libavcodec/pthread.o libavcodec/pthread_frame.o libavcodec/pthread_slice.o libavcodec/raw.o libavcodec/rawdec.o libavcodec/rdft.o libavcodec/remove_extradata_bsf.o libavcodec/resample.o libavcodec/resample2.o libavcodec/rv34_parser.o libavcodec/simple_idct.o libavcodec/tak.o libavcodec/tak_parser.o libavcodec/utils.o libavcodec/vc1.o libavcodec/vc1_parser.o libavcodec/vc1data.o libavcodec/videodsp.o libavcodec/vorbis_data.o libavcodec/vorbis_parser.o libavcodec/vp3_parser.o libavcodec/vp8_parser.o libavcodec/vp9_parser.o libavcodec/x86/constants.o libavcodec/x86/dct_init.o libavcodec/x86/dsputil_init.o libavcodec/x86/dsputil_mmx.o libavcodec/x86/dsputil_x86.o libavcodec/x86/fft_init.o libavcodec/x86/fmtconvert_init.o libavcodec/x86/fpel_mmx.o libavcodec/x86/h264_intrapred_init.o libavcodec/x86/h264_qpel.o libavcodec/x86/h264chroma_init.o libavcodec/x86/h264dsp_init.o libavcodec/x86/hpeldsp_init.o libavcodec/x86/hpeldsp_mmx.o libavcodec/x86/idct_mmx_xvid.o libavcodec/x86/idct_sse2_xvid.o libavcodec/x86/mpegvideo.o libavcodec/x86/rnd_mmx.o libavcodec/x86/simple_idct.o libavcodec/x86/videodsp_init.o libavcodec/xiph.o -lavutil -liconv -lm -lbz2 -lz -pthread ld: warning: directory not found for option '-Llibavresample' ld: warning: directory not found for option '-Llibpostproc' Undefined symbols for architecture x86_64: "_ff_h263dsp_init", referenced from: _ff_h263_decode_init in h263dec.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [libavcodec/libavcodec.55.dylib] Error 1 ~/ffbuild $ ls libavcodec/h263dsp.o ls: libavcodec/h263dsp.o: No such file or directory Lucas From onemda at gmail.com Wed Feb 19 23:22:32 2014 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 19 Feb 2014 23:22:32 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On 2/19/14, Carl Eugen Hoyos wrote: > Paul B Mahol writes: > >> > What does the parser currently do with trailing >> > garbage? >> >> There is no trailing garbage, bytes in header that >> tells size of file are incorrect. > > Sorry for being unclear: I do understand that the > file in question does not contain trailing garbage, > I just wonder what the parser does with a file that > actually contains trailing garbage. It should be ignored and parser should split it at right place ... if not, open bug report. From cehoyos at ag.or.at Wed Feb 19 23:24:27 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 19 Feb 2014 22:24:27 +0000 (UTC) Subject: [Libav-user] FFmpeg 2.1.3 and Git HEAD builds fail on OS X References: <19C365AC-2489-4CBD-B49B-92D29C245922@orange.fr> <7F0D3EA5-719C-49D2-AFAD-65BD889322AE@orange.fr> <95285561-9B35-4D21-AF20-75888E65619E@orange.fr> Message-ID: Lucas Soltic writes: > ~/ffbuild $ ../ffmpeg/configure --disable-encoders > --disable-decoders --disable-yasm > --enable-shared --disable-static > ~/ffbuild $ grep H263DSP config.mak > !CONFIG_H263DSP=yes I can now reproduce the problem (needs --disable-hwaccels here), should be fixed within 48 hours. This reminds me that vda should be auto-detected on OSX... Thank you, Carl Eugen From krueger at lesspain.de Thu Feb 20 09:33:19 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Thu, 20 Feb 2014 09:33:19 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On Wed, Feb 19, 2014 at 10:02 PM, Paul B Mahol wrote: > On 2/19/14, Carl Eugen Hoyos wrote: >> Carl Eugen Hoyos writes: >> >>> Robert Krueger ...> writes: >>> >>> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >>> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >>> >>> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >>> >>> The image is cut in the middle >> >> Iiuc, the parser reads the file size from the file >> header while the decoder calculates the (minimal >> possible) file size. The value that the parser >> reads from the file header is too small. >> >> I suspect the bug can be fixed by reusing the logic >> to determine the image size also in the parser or >> by ignoring the file size outputting everything until >> the next magic marker. > > There is no bug in parser, bug is in dpx file which do not > conform to the specification. > > FFmpeg dpx encoder is fine. > > ImageMagick sucks. OK, I didn't know the file was generated using ImageMagick but I see it now. Then it is irrelevant for me and I will ignore this as long as valid dpx files work with this approach. Thank you for the analysis. I don't know what the sample is used for in fate but maybe it's there for testing broken dpx files. It just happend to be there when I was looking for a dpx file to test the image2pipe approach. From onemda at gmail.com Thu Feb 20 15:01:19 2014 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 20 Feb 2014 15:01:19 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On 2/20/14, Robert Krueger wrote: > On Wed, Feb 19, 2014 at 10:02 PM, Paul B Mahol wrote: >> On 2/19/14, Carl Eugen Hoyos wrote: >>> Carl Eugen Hoyos writes: >>> >>>> Robert Krueger ...> writes: >>>> >>>> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >>>> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >>>> >>>> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >>>> >>>> The image is cut in the middle >>> >>> Iiuc, the parser reads the file size from the file >>> header while the decoder calculates the (minimal >>> possible) file size. The value that the parser >>> reads from the file header is too small. >>> >>> I suspect the bug can be fixed by reusing the logic >>> to determine the image size also in the parser or >>> by ignoring the file size outputting everything until >>> the next magic marker. >> >> There is no bug in parser, bug is in dpx file which do not >> conform to the specification. >> >> FFmpeg dpx encoder is fine. >> >> ImageMagick sucks. > > OK, I didn't know the file was generated using ImageMagick but I see > it now. Then it is irrelevant for me and I will ignore this as long as > valid dpx files work with this approach. Thank you for the analysis. I > don't know what the sample is used for in fate but maybe it's there > for testing broken dpx files. It just happend to be there when I was > looking for a dpx file to test the image2pipe approach. The sample is made before dpx encoder existed in ffmpeg.... > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From marco_sie at web.de Thu Feb 20 17:51:00 2014 From: marco_sie at web.de (Silver) Date: Thu, 20 Feb 2014 08:51:00 -0800 (PST) Subject: [Libav-user] HLS out of sync... In-Reply-To: References: Message-ID: <1392915060116-4659304.post@n4.nabble.com> Hello, did you solve this because this is already a little bit old? Because after some Testing today (look my topic about transcoding)... i think i have a related problem. Its the same phenomenon like you say and slowly i get crazy... or im already. Thats why i want to ask if you found a solution? Its transcoding DNxHD(xxx) to H264/MP4 (for web and iPad). Maybe somebody else? -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-HLS-out-of-sync-tp4655687p4659304.html Sent from the libav-users mailing list archive at Nabble.com. From marco_sie at web.de Thu Feb 20 18:31:08 2014 From: marco_sie at web.de (Silver) Date: Thu, 20 Feb 2014 09:31:08 -0800 (PST) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1392907011801-4659303.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> <1392907011801-4659303.post@n4.nabble.com> Message-ID: <1392917468459-4659305.post@n4.nabble.com> Thank you. It exists there is even a Function with av_frame_get_best_effort_timestamp. hmm.. my 00:19 Clip with 93MB only got to 90MB... and i reduced Bitrate/and Resolution. But it can't be your code ... not sure what to think... But i noticed it only today... it gets only out of sync while playing for a while... if you use scrubbing on player it resync somehow. Thank to you i have new idea... to check this stuff with other Formats. We did face this with ProRes/DNxHD ... I looked the Code from ffmpeg.c and they do a lot with pts/dts, its mind-blowing... they dealing somehow with dropped frames or duplice frames.. its hard to understand for newcomer. -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659305.html Sent from the libav-users mailing list archive at Nabble.com. From krueger at lesspain.de Fri Feb 21 11:48:33 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 21 Feb 2014 11:48:33 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On Thu, Feb 20, 2014 at 3:01 PM, Paul B Mahol wrote: > On 2/20/14, Robert Krueger wrote: >> On Wed, Feb 19, 2014 at 10:02 PM, Paul B Mahol wrote: >>> On 2/19/14, Carl Eugen Hoyos wrote: >>>> Carl Eugen Hoyos writes: >>>> >>>>> Robert Krueger ...> writes: >>>>> >>>>> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >>>>> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >>>>> >>>>> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >>>>> >>>>> The image is cut in the middle >>>> >>>> Iiuc, the parser reads the file size from the file >>>> header while the decoder calculates the (minimal >>>> possible) file size. The value that the parser >>>> reads from the file header is too small. >>>> >>>> I suspect the bug can be fixed by reusing the logic >>>> to determine the image size also in the parser or >>>> by ignoring the file size outputting everything until >>>> the next magic marker. >>> >>> There is no bug in parser, bug is in dpx file which do not >>> conform to the specification. >>> >>> FFmpeg dpx encoder is fine. >>> >>> ImageMagick sucks. >> >> OK, I didn't know the file was generated using ImageMagick but I see >> it now. Then it is irrelevant for me and I will ignore this as long as >> valid dpx files work with this approach. Thank you for the analysis. I >> don't know what the sample is used for in fate but maybe it's there >> for testing broken dpx files. It just happend to be there when I was >> looking for a dpx file to test the image2pipe approach. > > The sample is made before dpx encoder existed in ffmpeg.... OK, if it helps I could generate some dpx samples for fate using Software like Adobe Speedgrade. Just let me know if there is interest in that. From onemda at gmail.com Fri Feb 21 12:54:41 2014 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 21 Feb 2014 12:54:41 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On 2/21/14, Robert Krueger wrote: > On Thu, Feb 20, 2014 at 3:01 PM, Paul B Mahol wrote: >> On 2/20/14, Robert Krueger wrote: >>> On Wed, Feb 19, 2014 at 10:02 PM, Paul B Mahol wrote: >>>> On 2/19/14, Carl Eugen Hoyos wrote: >>>>> Carl Eugen Hoyos writes: >>>>> >>>>>> Robert Krueger ...> writes: >>>>>> >>>>>> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >>>>>> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >>>>>> >>>>>> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >>>>>> >>>>>> The image is cut in the middle >>>>> >>>>> Iiuc, the parser reads the file size from the file >>>>> header while the decoder calculates the (minimal >>>>> possible) file size. The value that the parser >>>>> reads from the file header is too small. >>>>> >>>>> I suspect the bug can be fixed by reusing the logic >>>>> to determine the image size also in the parser or >>>>> by ignoring the file size outputting everything until >>>>> the next magic marker. >>>> >>>> There is no bug in parser, bug is in dpx file which do not >>>> conform to the specification. >>>> >>>> FFmpeg dpx encoder is fine. >>>> >>>> ImageMagick sucks. >>> >>> OK, I didn't know the file was generated using ImageMagick but I see >>> it now. Then it is irrelevant for me and I will ignore this as long as >>> valid dpx files work with this approach. Thank you for the analysis. I >>> don't know what the sample is used for in fate but maybe it's there >>> for testing broken dpx files. It just happend to be there when I was >>> looking for a dpx file to test the image2pipe approach. >> >> The sample is made before dpx encoder existed in ffmpeg.... > > OK, if it helps I could generate some dpx samples for fate using > Software like Adobe Speedgrade. Just let me know if there is interest > in that. Does such dpx files works with dpx parser? > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krueger at lesspain.de Fri Feb 21 13:22:26 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 21 Feb 2014 13:22:26 +0100 Subject: [Libav-user] Does the image2 demuxer work with a custom AVIOContext? In-Reply-To: References: Message-ID: On Fri, Feb 21, 2014 at 12:54 PM, Paul B Mahol wrote: > On 2/21/14, Robert Krueger wrote: >> On Thu, Feb 20, 2014 at 3:01 PM, Paul B Mahol wrote: >>> On 2/20/14, Robert Krueger wrote: >>>> On Wed, Feb 19, 2014 at 10:02 PM, Paul B Mahol wrote: >>>>> On 2/19/14, Carl Eugen Hoyos wrote: >>>>>> Carl Eugen Hoyos writes: >>>>>> >>>>>>> Robert Krueger ...> writes: >>>>>>> >>>>>>> > cat ~/samples/fate/dpx/lighthouse_rgb48.dpx | ./ffmpeg >>>>>>> > -f image2pipe -vcodec dpx -i - ~/tmp/fromdpx_pipe2.png >>>>>>> >>>>>>> > [dpx 0x7fcb21822600] Overread buffer. Invalid header? >>>>>>> >>>>>>> The image is cut in the middle >>>>>> >>>>>> Iiuc, the parser reads the file size from the file >>>>>> header while the decoder calculates the (minimal >>>>>> possible) file size. The value that the parser >>>>>> reads from the file header is too small. >>>>>> >>>>>> I suspect the bug can be fixed by reusing the logic >>>>>> to determine the image size also in the parser or >>>>>> by ignoring the file size outputting everything until >>>>>> the next magic marker. >>>>> >>>>> There is no bug in parser, bug is in dpx file which do not >>>>> conform to the specification. >>>>> >>>>> FFmpeg dpx encoder is fine. >>>>> >>>>> ImageMagick sucks. >>>> >>>> OK, I didn't know the file was generated using ImageMagick but I see >>>> it now. Then it is irrelevant for me and I will ignore this as long as >>>> valid dpx files work with this approach. Thank you for the analysis. I >>>> don't know what the sample is used for in fate but maybe it's there >>>> for testing broken dpx files. It just happend to be there when I was >>>> looking for a dpx file to test the image2pipe approach. >>> >>> The sample is made before dpx encoder existed in ffmpeg.... >> >> OK, if it helps I could generate some dpx samples for fate using >> Software like Adobe Speedgrade. Just let me know if there is interest >> in that. > > Does such dpx files works with dpx parser? I have only tried other samples from the software "Nuke" and those worked. But I don't own these samples and I don't have that software. I will make samples anyway and then I'll tell you if they work with the parser and then you can decide whether you are interested in the samples. From s at svagant.com Sun Feb 23 23:38:52 2014 From: s at svagant.com (Stanislav Smida) Date: Sun, 23 Feb 2014 23:38:52 +0100 Subject: [Libav-user] Detection of the first NAL unit of a primary coded picture in H.264 bitstream Message-ID: <4FB66C0C-8A66-4BED-AC47-AF43B5FD56CB@svagant.com> Hi everyone, I believe the problem will be trivial for experienced lib users, but I?m desperate (I?ve never used ffmpeg before). I have raw H.264 bitstream (NALUs as (const void *)bytes) and I need to determine which NALU is access unit (first NALU of the next frame). Can someone give me a hint how to do that? In I?ve found `H264Context` struct and its fields like `got_first` and `ref_count[]` but I don?t have an idea how to initialize this context and flow particular NALUs through this context. Thanks, best, Stano From mtaha.ansari at gmail.com Mon Feb 24 11:12:49 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Feb 2014 15:12:49 +0500 Subject: [Libav-user] Changing frame size for audio encoding Message-ID: Hi, Using muxing sample that comes with documentation, inside open_audio() function, this is called: /* open it */ ret = avcodec_open2(c, codec, NULL) ; if ( ret < 0) { fprintf(stderr, "could not open codec\n"); return -1; //exit(1); } if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) audio_output_frame_size = 10000; else audio_output_frame_size = c->frame_size; For an encoder like Vorbis, according to their docs ( http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html): " legal frame sizes are powers of two from 64 to 8192 samples", but after avcodec_open2() function returns, I get c->frame_size equal to 64. How can I increase codec's frame size to a higher value as allowed by it's documentation? Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkordani at lsa2.com Mon Feb 24 16:51:33 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Mon, 24 Feb 2014 10:51:33 -0500 Subject: [Libav-user] Detection of the first NAL unit of a primary coded picture in H.264 bitstream In-Reply-To: <4FB66C0C-8A66-4BED-AC47-AF43B5FD56CB@svagant.com> References: <4FB66C0C-8A66-4BED-AC47-AF43B5FD56CB@svagant.com> Message-ID: <530B6A85.7040502@lsa2.com> On 2/23/14 5:38 PM, Stanislav Smida wrote: > Hi everyone, > > I believe the problem will be trivial for experienced lib users, but I?m desperate (I?ve never used ffmpeg before). I have raw H.264 bitstream (NALUs as (const void *)bytes) and I need to determine which NALU is access unit (first NALU of the next frame). Can someone give me a hint how to do that? > > In I?ve found `H264Context` struct and its fields like `got_first` and `ref_count[]` but I don?t have an idea how to initialize this context and flow particular NALUs through this context. > > Thanks, best, > Stano > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user The answer depends on the bitstream that you have, but as far as I can tell, you likely have a bitstream that ships frames in one of two ways. Those ways are outlined here: http://en.wikipedia.org/wiki/Network_Abstraction_Layer#Access_Units This section and the section right after should help you figure out The second section might be a little obtuse at the moment, but what it describes is that (I think), if you find an IDR nalu, the decoder should be able to use the whole nalu for decoding one picture, and that subsequent i-frames will not refer to i-frames prior to the idr in front of them, as in (I think), one picture gets shipped as (idr)(non-idr)(non-idr)(non-idr) ... (idr) <-this begins a new whole picture. For one complete self-contained frame, you may obviously need the sps and pps. So far, IDR, non IDR, and the units listed in the first section of the wiki link area all nalu types, refer to any google search for the values, or go download the spec. -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From lkm9125 at gmail.com Mon Feb 24 15:33:02 2014 From: lkm9125 at gmail.com (Funta) Date: Mon, 24 Feb 2014 06:33:02 -0800 (PST) Subject: [Libav-user] Is there a way to encoding PCM to AAC? In-Reply-To: <1389936294239-4659145.post@n4.nabble.com> References: <1389936294239-4659145.post@n4.nabble.com> Message-ID: <1393252382602-4659311.post@n4.nabble.com> Problem solved I had to guess channel layout if there is no channel layout value if(in_acodec->channels > 0 && in_acodec->channel_layout == 0) in_acodec->channel_layout = av_get_default_channel_layout(in_acodec->channels); else if(in_acodec->channels == 0 && in_acodec->channel_layout > 0) in_acodec->channels = av_get_channel_layout_nb_channels(in_acodec->channel_layout); The output has well transcoded But, I'm wondering pcm channels how to be plenty My expectating channels are mono(1) or stereo(2) Is there PCM 3 channels or more(e.g. 5, 7.1) possible exist? -- View this message in context: http://libav-users.943685.n4.nabble.com/Is-there-a-way-to-encoding-PCM-to-AAC-tp4659145p4659311.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Mon Feb 24 20:28:40 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Feb 2014 19:28:40 +0000 (UTC) Subject: [Libav-user] Is there a way to encoding PCM to AAC? References: <1389936294239-4659145.post@n4.nabble.com> <1393252382602-4659311.post@n4.nabble.com> Message-ID: Funta writes: > Is there PCM 3 channels or more(e.g. 5, 7.1) possible exist? PCM by definition has an arbitrary number of channels, while mono and stereo are normal, files with more channels exist, 16 channel files were reported by users. Carl Eugen From get2jils at gmail.com Wed Feb 26 06:27:03 2014 From: get2jils at gmail.com (whoami Jils) Date: Wed, 26 Feb 2014 10:57:03 +0530 Subject: [Libav-user] avformat_find_stream_info does not provide information. Message-ID: 1) What i am trying? -> understanding ffmpeg, writting new video player in android. 2) avformat_find_stream_info returns nothing. :( if (avformat_open_input(&pFormatCtx, "rtsp://:", NULL, NULL) != 0) { return -1; } AVDictionary *opts=NULL; if (avformat_find_stream_info(pFormatCtx, &opts) < 0) { LOGD (" uNABLE TO GET STREAM INFO .."); return -1; // Couldn't find stream information } 3) print av_dict_count(opts) , and it give me the value zero [ 0 ]. Is it expected behavior or did i miss something? Thanks for your support. -------------- next part -------------- An HTML attachment was scrubbed... URL: From get2jils at gmail.com Wed Feb 26 09:59:03 2014 From: get2jils at gmail.com (whoami Jils) Date: Wed, 26 Feb 2014 14:29:03 +0530 Subject: [Libav-user] av_read_frame () what is the source buffer it is receving from? Message-ID: Hello, Streaming data from RTSP Server [ using live555], which i am trying to capture in av_read_frame(). Server -> [ sends packet] -> Client [ received packet ] Now, Client to receive packet it uses av_read_frame(), the speed of receiving frames might be slower then the server sends, what i understood is this is where pts is required. My question is where the packets are stored that are received from Server, -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Wed Feb 26 13:21:04 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 26 Feb 2014 23:21:04 +1100 Subject: [Libav-user] Is AVSteam.duration accurate enough? Message-ID: Hi, Can anyone help to explain which duration is more accurate. 1. duration from the avstream object 2. read out all packets from that avstream, find the max pts. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Wed Feb 26 13:54:00 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 26 Feb 2014 13:54:00 +0100 Subject: [Libav-user] Is AVSteam.duration accurate enough? In-Reply-To: References: Message-ID: On Wed, Feb 26, 2014 at 1:21 PM, YIRAN LI wrote: > Hi, > > Can anyone help to explain which duration is more accurate. > > 1. duration from the avstream object > 2. read out all packets from that avstream, find the max pts. 3. read out all packets from that avstream and add all durations in most cases (I do not remember where there were cases when duration was not reliable but I think there were some) The reliability of 1 differs a lot with the formats and for some even with the properties of individual files. For some it is normally exact and for others it is just an estimate which can be completely wrong. Solution #2 may fail if you have timestamp discontinuities like e.g. in transport streams IIRC. From muec at virgilio.it Wed Feb 26 20:49:06 2014 From: muec at virgilio.it (alessio matiz) Date: Wed, 26 Feb 2014 11:49:06 -0800 (PST) Subject: [Libav-user] During screencast problems with audio when duration set Message-ID: <1393444146142-4659318.post@n4.nabble.com> Hello, I'm recording a desktop session (video and audio) with command "avconv -f alsa -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0 -vcodec libx264 -preset ultrafast -ab 320k -threads 8 screen.mkv" And everything goes fine. When I add duration for the recording with command -t 10, no sound is recorded: "avconv -f alsa -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0 -t 10 -vcodec libx264 -preset ultrafast -ab 320k -threads 8 screen.mkv" Any suggestion? Thanx! Output for command: avconv version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers built on Feb 6 2014 20:56:59 with gcc 4.6.3 [alsa @ 0xd2ca60] capture with some ALSA plugins, especially dsnoop, may hang. [alsa @ 0xd2ca60] Estimating duration from bitrate, this may be inaccurate Input #0, alsa, from 'pulse': Duration: N/A, start: 1393444085.087724, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s [x11grab @ 0xd2d280] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768 [x11grab @ 0xd2d280] shared memory extension found [x11grab @ 0xd2d280] Estimating duration from bitrate, this may be inaccurate Input #1, x11grab, from ':0.0': Duration: N/A, start: 1393444085.131106, bitrate: 1007124 kb/s Stream #1.0: Video: rawvideo, bgra, 1366x768, 1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc File 'screen.mkv' already exists. Overwrite ? [y/N] y Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format 'yuv420p' [buffer @ 0xd2e7e0] w:1366 h:768 pixfmt:bgra [avsink @ 0xd2c140] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out' [scale @ 0xd2c8a0] w:1366 h:768 fmt:bgra -> w:1366 h:768 fmt:yuv420p flags:0x4 [libx264 @ 0xd2bca0] lookaheadless mb-tree requires intra refresh or infinite keyint [libx264 @ 0xd2bca0] using cpu capabilities: MMX2 SSE2Fast FastShuffle LZCNT [libx264 @ 0xd2bca0] profile Constrained Baseline, level 3.2 [libx264 @ 0xd2bca0] 264 - core 120 r2151 a3f4407 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.25 aq=0 Output #0, matroska, to 'screen.mkv': Metadata: encoder : Lavf53.21.1 Stream #0.0: Video: libx264, yuv420p, 1366x768, q=-1--1, 1k tbn, 30 tbc Stream #0.1: Audio: libvorbis, 48000 Hz, 2 channels, s16, 320 kb/s Stream mapping: Stream #1:0 -> #0:0 (rawvideo -> libx264) Stream #0:0 -> #0:1 (pcm_s16le -> libvorbis) Press ctrl-c to stop encoding ^Cframe= 56 fps= 21 q=-1.0 Lsize= 1130kB time=5.39 bitrate=1718.2kbits/s video:959kB audio:164kB global headers:4kB muxing overhead 0.246981% [libx264 @ 0xd2bca0] frame I:1 Avg QP:21.00 size:238383 [libx264 @ 0xd2bca0] frame P:55 Avg QP:14.80 size: 13518 [libx264 @ 0xd2bca0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0xd2bca0] mb P I16..4: 1.7% 0.0% 0.0% P16..4: 5.8% 0.0% 0.0% 0.0% 0.0% skip:92.4% [libx264 @ 0xd2bca0] coded y,uvDC,uvAC intra: 47.3% 46.1% 45.2% inter: 3.6% 4.6% 3.9% [libx264 @ 0xd2bca0] i16 v,h,dc,p: 62% 34% 2% 1% [libx264 @ 0xd2bca0] i8c dc,h,v,p: 51% 25% 23% 2% [libx264 @ 0xd2bca0] kb/s:1370.03 Received signal 2: terminating. -- View this message in context: http://libav-users.943685.n4.nabble.com/During-screencast-problems-with-audio-when-duration-set-tp4659318.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Thu Feb 27 12:41:09 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 27 Feb 2014 11:41:09 +0000 (UTC) Subject: [Libav-user] During screencast problems with audio when duration set References: <1393444146142-4659318.post@n4.nabble.com> Message-ID: alessio matiz writes: > I'm recording a desktop session (video and audio) with command > > "avconv -f alsa -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0 avconv is known to contain several hundred user-reported bugs not present in FFmpeg, some of them security relevant. Please understand that we cannot support it here, see http://ffmpeg.org/download.html for supported versions of FFmpeg. Carl Eugen From wagner.patriota at gmail.com Thu Feb 27 14:14:31 2014 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 27 Feb 2014 10:14:31 -0300 Subject: [Libav-user] How to add "-strict -2" with AAC programmatically? Message-ID: The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it. I tried to add it to the codec options in avcodec_open2() but got no success... how do I add this programmatically? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Thu Feb 27 14:35:34 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Thu, 27 Feb 2014 14:35:34 +0100 Subject: [Libav-user] How to add "-strict -2" with AAC programmatically? In-Reply-To: References: Message-ID: Try setting the field strict_std_compliance in the codec context to -2. Works for me. On Thu, Feb 27, 2014 at 2:14 PM, Wagner Patriota wrote: > The encoder 'aac' is experimental but experimental codecs are not enabled, > add '-strict -2' if you want to use it. > > I tried to add it to the codec options in avcodec_open2() but got no > success... how do I add this programmatically? > > Thanks > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From wagner.patriota at gmail.com Thu Feb 27 15:00:57 2014 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 27 Feb 2014 11:00:57 -0300 Subject: [Libav-user] How to add "-strict -2" with AAC programmatically? In-Reply-To: References: Message-ID: thanks. it worked! ;-) On Thu, Feb 27, 2014 at 10:35 AM, Robert Kr?ger wrote: > Try setting the field strict_std_compliance in the codec context to > -2. Works for me. > > On Thu, Feb 27, 2014 at 2:14 PM, Wagner Patriota > wrote: > > The encoder 'aac' is experimental but experimental codecs are not > enabled, > > add '-strict -2' if you want to use it. > > > > I tried to add it to the codec options in avcodec_open2() but got no > > success... how do I add this programmatically? > > > > Thanks > > > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pstevens at evertz.com Thu Feb 27 16:23:29 2014 From: pstevens at evertz.com (Peter Stevens) Date: Thu, 27 Feb 2014 10:23:29 -0500 Subject: [Libav-user] Decoding AVFrame datastructure Message-ID: Hello, I'm new to video/ffmpeg and new to using it for development. I'm working on a project where I need to decode MOV files (which are encoded with pixel format yuv422p10le) and save the resulting output to disk in a raw yuv format. I would use the ffmpeg command line however, this is not an option for the project I am working on. So far I have been able to read and decode an input file and save at least partially the decoded output using the below example (which is for yuv420p, which not the format I really need). https://lists.libav.org/pipermail/ffmpeg-user/2006-April/002828.html I guess my question is how can I modify the below example to work with yuv422p10le and not yuv420p. My confusion lies in how to differently interpret the AVFrame data structure? Also, a 2nd question, what format does ffmpeg decode to internally? I have read that it is yuv420p. Is this Always the case do all codes by default decode their output to yuv420p; which would imply that the developer must then call sws_scale to convert the image to the desired format. Thanks, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From get2jils at gmail.com Thu Feb 27 17:04:08 2014 From: get2jils at gmail.com (whoami Jils) Date: Thu, 27 Feb 2014 21:34:08 +0530 Subject: [Libav-user] TCP + rtsp time delay. Message-ID: Hi, Connecting RTSP Server using UDP, have seen huge packet loss, and resulted to flickering images, hence configured to use TCP like: AVDictionary *stream_opts = 0; av_dict_set(&stream_opts, "rtsp_transport", "tcp", 0); The issue what i see is at the initial period, the time delay between RTSP server and av_read_frame() is around 1 sec, and which grows gradually to 5 sec after some time, then it gets somehow reset to again 1 sec. Server is sending for about max 25 fps, min is 18 fps. Coder: x264, YUV420p file format [ 1028*720] I am not sure where i can hook around ?. Please advise?. P.S: I am not using any PTS calculation, but simply dumping completed frames into UI. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gedikmert89 at gmail.com Thu Feb 27 20:56:28 2014 From: gedikmert89 at gmail.com (Mert Gedik) Date: Thu, 27 Feb 2014 21:56:28 +0200 Subject: [Libav-user] Decoding external subtitles Message-ID: Hello, I've made a video player for iOS using ffmpeg libraries with the help of dranger tutorial. It is working well, and now I want to add subtitle feature. I know that, ffmpeg can decode internal subtitle stream, and for a long investigation, I realized that subtitle filter can decode external subtitle. For example, ffplay movie.mp4 -vf subtitles=movie.srt This renders the external subtitle on the screen. I use render word , as subtitles are drawn on the screen and when I resize to a bigger frame size, the text resolution becomes lower. What I need is using the ffmpeg subtitle decoders but don't want to render it as fflay does, I want to get decoded subtitle data and show it in my UILabel. Is there a way to do this ? Thanks for helping, Regards, -MG -------------- next part -------------- An HTML attachment was scrubbed... URL: From anshul.ffmpeg at gmail.com Thu Feb 27 21:16:08 2014 From: anshul.ffmpeg at gmail.com (Anshul) Date: Fri, 28 Feb 2014 01:46:08 +0530 Subject: [Libav-user] Decoding external subtitles In-Reply-To: References: Message-ID: Mert Gedik wrote: >Hello, > >I've made a video player for iOS using ffmpeg libraries with the help >of >dranger tutorial. >It is working well, and now I want to add subtitle feature. > >I know that, ffmpeg can decode internal subtitle stream, and for a long >investigation, I realized that subtitle filter can decode external >subtitle. > >For example, >ffplay movie.mp4 -vf subtitles=movie.srt > >This renders the external subtitle on the screen. I use render word , >as >subtitles are drawn on the screen and when I resize to a bigger frame >size, >the text resolution becomes lower. > >What I need is using the ffmpeg subtitle decoders but don't want to >render >it as fflay does, I want to get decoded subtitle data and show it in my >UILabel. > >Is there a way to do this ? > >Thanks for helping, > >Regards, > >-MG > > >------------------------------------------------------------------------ > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user Srt files are simple text file with there timing, if you have time of each audio frame, then at the same time u can read srt file directly and at correct time you can change ur ui label. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From gedikmert89 at gmail.com Thu Feb 27 21:25:33 2014 From: gedikmert89 at gmail.com (Mert Gedik) Date: Thu, 27 Feb 2014 22:25:33 +0200 Subject: [Libav-user] Decoding external subtitles In-Reply-To: References: Message-ID: On Thu, Feb 27, 2014 at 10:16 PM, Anshul wrote: > > > Mert Gedik wrote: > >Hello, > > > >I've made a video player for iOS using ffmpeg libraries with the help > >of > >dranger tutorial. > >It is working well, and now I want to add subtitle feature. > > > >I know that, ffmpeg can decode internal subtitle stream, and for a long > >investigation, I realized that subtitle filter can decode external > >subtitle. > > > >For example, > >ffplay movie.mp4 -vf subtitles=movie.srt > > > >This renders the external subtitle on the screen. I use render word , > >as > >subtitles are drawn on the screen and when I resize to a bigger frame > >size, > >the text resolution becomes lower. > > > >What I need is using the ffmpeg subtitle decoders but don't want to > >render > >it as fflay does, I want to get decoded subtitle data and show it in my > >UILabel. > > > >Is there a way to do this ? > > > >Thanks for helping, > > > >Regards, > > > >-MG > > > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >Libav-user mailing list > >Libav-user at ffmpeg.org > >http://ffmpeg.org/mailman/listinfo/libav-user > > Srt files are simple text file with there timing, if you have time of each > audio frame, then at the same time u can read srt file directly and at > correct time you can change ur ui label. > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Yes ,that's right how ever there are many subtitle formats and I don't want to implement every subtitle parser by myself ... Ffmpeg has already many decoders for subtitles, therefore I want to find an easy way to pass subtitle file to ffmpeg. but how to do this ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From anshul.ffmpeg at gmail.com Thu Feb 27 22:00:13 2014 From: anshul.ffmpeg at gmail.com (Anshul) Date: Fri, 28 Feb 2014 02:30:13 +0530 Subject: [Libav-user] Decoding external subtitles In-Reply-To: References: Message-ID: <055cca10-4ab4-44a4-9cae-38091cd346fd@email.android.com> Mert Gedik wrote: >On Thu, Feb 27, 2014 at 10:16 PM, Anshul >wrote: > >> >> >> Mert Gedik wrote: >> >Hello, >> > >> >I've made a video player for iOS using ffmpeg libraries with the >help >> >of >> >dranger tutorial. >> >It is working well, and now I want to add subtitle feature. >> > >> >I know that, ffmpeg can decode internal subtitle stream, and for a >long >> >investigation, I realized that subtitle filter can decode external >> >subtitle. >> > >> >For example, >> >ffplay movie.mp4 -vf subtitles=movie.srt >> > >> >This renders the external subtitle on the screen. I use render word >, >> >as >> >subtitles are drawn on the screen and when I resize to a bigger >frame >> >size, >> >the text resolution becomes lower. >> > >> >What I need is using the ffmpeg subtitle decoders but don't want to >> >render >> >it as fflay does, I want to get decoded subtitle data and show it in >my >> >UILabel. >> > >> >Is there a way to do this ? >> > >> >Thanks for helping, >> > >> >Regards, >> > >> >-MG >> > >> > >> >>------------------------------------------------------------------------ >> > >> >_______________________________________________ >> >Libav-user mailing list >> >Libav-user at ffmpeg.org >> >http://ffmpeg.org/mailman/listinfo/libav-user >> >> Srt files are simple text file with there timing, if you have time of >each >> audio frame, then at the same time u can read srt file directly and >at >> correct time you can change ur ui label. >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > > >Yes ,that's right how ever there are many subtitle formats and >I don't want to implement every subtitle parser by myself ... >Ffmpeg has already many decoders for subtitles, therefore I want to >find an >easy way to pass subtitle file to ffmpeg. > >but how to do this ? > > >------------------------------------------------------------------------ > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user I have never tried but still i would advice you look for transcoding the subtitle in srt if i understand u well, u need time and text to show in ur personal ui label. I use drawtext filter with automatic font size that adjust according to text length. If you have only the problem of fontsize at the time of high resolution you can try workaround using drawtext filter. If you have time u can look in subtitle filter and check if it is possible to add fontsize option. If it is possible can u link me how u r displaying the frames where font size is very small.(code) -Anshul -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From m.kaname at mail.cansoft.co.jp Fri Feb 28 05:36:31 2014 From: m.kaname at mail.cansoft.co.jp (=?iso-2022-jp?B?GyRCPj5fN01XGyhC?=) Date: Fri, 28 Feb 2014 04:36:31 +0000 Subject: [Libav-user] The stalls when using av_write_frame Message-ID: Hello. I'm new to libav. Please teach me why stop. It's the following situations. Thanks Kaname ffmpeg: ffmpeg-2.1.3 develop os: mac osx target os: Android armv7-a AndroidManifest.xml permission: WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE configure: --disable-doc \ --disable-ffplay \ --disable-ffserver \ --disable-ffprobe \ --enable-zlib \ --enable-version3 \ --enable-nonfree \ --enable-shared \ --enable-static \ --enable-rdft \ --enable-ffmpeg \ --enable-protocol=file \ --enable-parsers \ --enable-demuxer=aac \ --enable-demuxer=ac3 \ --enable-demuxer=ape \ --enable-demuxer=asf \ --enable-demuxer=flac \ --enable-demuxer=matroska_audio \ --enable-demuxer=mp3 \ --enable-demuxer=mpc \ --enable-demuxer=mov \ --enable-demuxer=mpc8 \ --enable-demuxer=ogg \ --enable-demuxer=tta \ --enable-demuxer=wav \ --enable-demuxer=wv \ --enable-decoder=aac \ --enable-decoder=ac3 \ --enable-decoder=alac \ --enable-decoder=ape \ --enable-decoder=flac \ --enable-decoder=mp1 \ --enable-decoder=mp2 \ --enable-decoder=mp3 \ --enable-decoder=mpc7 \ --enable-decoder=mpc8 \ --enable-decoder=tta \ --enable-decoder=vorbis \ --enable-decoder=wavpack \ --enable-decoder=wmav1 \ --enable-decoder=wmav2 \ --enable-decoder=pcm_alaw \ --enable-decoder=pcm_dvd \ --enable-decoder=pcm_f32be \ --enable-decoder=pcm_f32le \ --enable-decoder=pcm_f64be \ --enable-decoder=pcm_f64le \ --enable-decoder=pcm_s16be \ --enable-decoder=pcm_s16le \ --enable-decoder=pcm_s16le_planar \ --enable-decoder=pcm_s24be \ --enable-decoder=pcm_daud \ --enable-decoder=pcm_s24le \ --enable-decoder=pcm_s32be \ --enable-decoder=pcm_s32le \ --enable-decoder=pcm_s8 \ --enable-decoder=pcm_u16be \ --enable-decoder=pcm_u16le \ --enable-decoder=pcm_u24be \ --enable-decoder=pcm_u24le \ --enable-decoder=rawvideo \ --enable-encoders \ --enable-libmp3lame \ --enable-libspeex \ --enable-libtheora \ --enable-libfaac \ --enable-libvorbis \ --enable-libaacplus \ stop source: jint copyMovie(JNIEnv *pEnv, jobject pObj, jobject pMainAct, jstring pSrcFileName, jstring pDstFileName) { AVFormatContext* inFormatContext = NULL; AVFormatContext* outFormatContext = NULL; AVOutputFormat* fmt = NULL; AVCodecContext* codecCtxIn = NULL; AVCodecContext* codecCtxOut = NULL; AVCodec* codecEnc = NULL; AVCodec* codecDec = NULL; int i, ret; int streamIndex = -1; char* srcMovieFilePath = (char *)(*pEnv)->GetStringUTFChars(pEnv, pSrcFileName, NULL); char* dstMovieFilePath = (char *)(*pEnv)->GetStringUTFChars(pEnv, pDstFileName, NULL); av_register_all(); if(avformat_open_input(&inFormatContext, srcMovieFilePath, NULL, NULL) != 0) goto EXIT_METHOD; if(avformat_find_stream_info(inFormatContext, NULL) < 0) goto EXIT_METHOD; for(i = 0; i < inFormatContext->nb_streams; i++){ if(inFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO){ streamIndex = i; break; } } if(streamIndex < 0) goto EXIT_METHOD; codecCtxIn = inFormatContext->streams[streamIndex]->codec; codecDec = avcodec_find_decoder(codecCtxIn->codec_id); if(codecDec == NULL) goto EXIT_METHOD; if( avcodec_open2(codecCtxIn, codecDec, NULL) < 0 ) goto EXIT_METHOD; fmt = av_guess_format( NULL, dstMovieFilePath, NULL ); if (!fmt) { fmt = av_guess_format("mpeg", NULL, NULL); } if (!fmt) goto EXIT_METHOD; outFormatContext = avformat_alloc_context(); if (!outFormatContext) goto EXIT_METHOD; outFormatContext->oformat = fmt; snprintf(outFormatContext->filename, sizeof(outFormatContext->filename), "%s", dstMovieFilePath); codecEnc = avcodec_find_encoder( AV_CODEC_ID_MPEG4 ); if(codecEnc == NULL) goto EXIT_METHOD; codecCtxOut = avcodec_alloc_context3(codecEnc); if( codecCtxOut ) { codecCtxOut->bit_rate = codecCtxIn->bit_rate; codecCtxOut->width = codecCtxIn->width; codecCtxOut->height = codecCtxIn->height; codecCtxOut->pix_fmt = codecCtxIn->pix_fmt; codecCtxOut->codec_id = codecCtxIn->codec_id; codecCtxOut->codec_type = codecCtxIn->codec_type; codecCtxOut->time_base.num = codecCtxIn->time_base.num; codecCtxOut->time_base.den = codecCtxIn->time_base.den; codecCtxOut->time_base= codecCtxIn->time_base; if ( avcodec_open2(codecCtxOut, codecEnc, NULL) >= 0 ) goto EXIT_METHOD; } else { goto EXIT_METHOD; } if ( !( fmt->flags & AVFMT_NOFILE ) ) { if ( avio_open( &outFormatContext->pb, dstMovieFilePath, AVIO_FLAG_WRITE ) < 0 ) goto EXIT_METHOD; } avformat_write_header( outFormatContext, NULL ); AVPacket packet; av_init_packet(&packet); i = 0; while ( av_read_frame(inFormatContext, &packet) >= 0 ) { AVStream *inputStream = inFormatContext->streams[i]; if ( packet.stream_index == streamIndex ) { /* if (av_write_frame(codecCtxOut, &packet) != 0) { // < It's stop when enable here LOGI( "convert(): error while writing video frame\n" ); }*/ } i++; } // av_write_frame(outFormatContext, NULL); // < It's stop when enable here // av_write_trailer(outFormatContext); // < It's stop when enable here EXIT_METHOD: if ( fmt != NULL && outFormatContext != NULL ) { if ( !( fmt->flags & AVFMT_NOFILE ) ) { avio_close(outFormatContext->pb); } avformat_free_context(outFormatContext); } if ( codecCtxOut != NULL ) avcodec_close(codecCtxOut); if ( codecCtxIn != NULL ) avcodec_close(codecCtxIn); if ( inFormatContext != NULL ) avformat_close_input( &inFormatContext ); return 0; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Fri Feb 28 07:19:22 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 28 Feb 2014 17:19:22 +1100 Subject: [Libav-user] About av_seek_frame flag Message-ID: Hi I'm using av_seek_frame with AVSEEK_FLAG_BACKWARD flag and I'd like to know, if I specified a position beyond the duration (I use avstream.duration to init the time line), will av_seek_frame with AVSEEK_FLAG_BACKWARD guarantee to seek to a position from where I can read at least one frame. In fact I'm considering this case: |.............................................................................. | last frame pts avstream.duration as I said, my player's timeline is initialized with avstream.duration as max pos, if I call av_seek_frame( lastframe From stephen at napkinstudio.com Fri Feb 28 15:54:02 2014 From: stephen at napkinstudio.com (Stephen H. Gerstacker) Date: Fri, 28 Feb 2014 09:54:02 -0500 Subject: [Libav-user] AVFilterGraph and an In-Memory Image Message-ID: <9937C12F-C389-475D-9BDD-7E98816EF667@napkinstudio.com> I'm making an AVFilterGraph in code. I need to apply a watermark to the video. My assumption is that I need to use the "movie" AVFilter to then overlay it. My watermark is just stored in memory, not in a file, so I'm unsure how to point the "movie" filter to use that watermark? Can someone clarify how I would do that? My current filter graph is basically: buffer -> (optional rotation) -> scale -> pad -> buffersink The watermark would come in after the pad and overlaid there. - Stephen From murat.sudan at argela.com.tr Thu Feb 27 21:24:08 2014 From: murat.sudan at argela.com.tr (Murat Sudan) Date: Thu, 27 Feb 2014 22:24:08 +0200 Subject: [Libav-user] Decoding external subtitles In-Reply-To: References: Message-ID: On Thu, Feb 27, 2014 at 10:16 PM, Anshul wrote: > > > Mert Gedik wrote: > >Hello, > > > >I've made a video player for iOS using ffmpeg libraries with the help > >of > >dranger tutorial. > >It is working well, and now I want to add subtitle feature. > > > >I know that, ffmpeg can decode internal subtitle stream, and for a long > >investigation, I realized that subtitle filter can decode external > >subtitle. > > > >For example, > >ffplay movie.mp4 -vf subtitles=movie.srt > > > >This renders the external subtitle on the screen. I use render word , > >as > >subtitles are drawn on the screen and when I resize to a bigger frame > >size, > >the text resolution becomes lower. > > > >What I need is using the ffmpeg subtitle decoders but don't want to > >render > >it as fflay does, I want to get decoded subtitle data and show it in my > >UILabel. > > > >Is there a way to do this ? > > > >Thanks for helping, > > > >Regards, > > > >-MG > > > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >Libav-user mailing list > >Libav-user at ffmpeg.org > >http://ffmpeg.org/mailman/listinfo/libav-user > > Srt files are simple text file with there timing, if you have time of each > audio frame, then at the same time u can read srt file directly and at > correct time you can change ur ui label. > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Yes ,that's right how ever there are many subtitle formats and I don't want to implement every subtitle parser by myself ... Ffmpeg has already many decoders for subtitles, therefore I want to find an easy way to pass subtitle file to ffmpeg. but how to do this ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen at napkinstudio.com Fri Feb 28 22:41:07 2014 From: stephen at napkinstudio.com (Stephen H. Gerstacker) Date: Fri, 28 Feb 2014 16:41:07 -0500 Subject: [Libav-user] AVFilterGraph and an In-Memory Image In-Reply-To: <9937C12F-C389-475D-9BDD-7E98816EF667@napkinstudio.com> References: <9937C12F-C389-475D-9BDD-7E98816EF667@napkinstudio.com> Message-ID: As a follow up, I attempted the following Create a new ?buffer? that I dump BGRA frames in to (that?s the format the watermark is in as memory). Every time I add a frame to my original buffer, I add a watermark frame to my watermark buffer. After the pad link, I added an ?overlay? filter with the pad and watermark buffer as inputs, outputting to the buffersink. This worked, but I loose the alpha transparency. Anything I can do to preserve that? - Stephen On Feb 28, 2014, at 9:54 AM, Stephen H. Gerstacker wrote: > I'm making an AVFilterGraph in code. I need to apply a watermark to the video. > > My assumption is that I need to use the "movie" AVFilter to then overlay it. My watermark is just stored in memory, not in a file, so I'm unsure how to point the "movie" filter to use that watermark? > > Can someone clarify how I would do that? > > My current filter graph is basically: > > buffer -> (optional rotation) -> scale -> pad -> buffersink > > The watermark would come in after the pad and overlaid there. > > - Stephen > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From nfxjfg at googlemail.com Fri Feb 28 23:54:08 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 28 Feb 2014 23:54:08 +0100 Subject: [Libav-user] Decoding external subtitles In-Reply-To: References: Message-ID: <20140228235408.57f72c75@debian> On Thu, 27 Feb 2014 22:25:33 +0200 Mert Gedik wrote: > Yes ,that's right how ever there are many subtitle formats and > I don't want to implement every subtitle parser by myself ... > Ffmpeg has already many decoders for subtitles, therefore I want to find an > easy way to pass subtitle file to ffmpeg. > > but how to do this ? All ffmpeg can do is convert text subtitles to ASS, which is a subtitle format that can handle most forms of text formatting. You could try to make ffmpeg convert subtitles to ASS (see vf_subtitles how to do that), and then strip or convert ASS format format tags. Or you could do it properly and use libass directly to render text in screen resolution.