From prathap.malempati at gmail.com Sat Jun 1 04:47:32 2013 From: prathap.malempati at gmail.com (prathap) Date: Fri, 31 May 2013 19:47:32 -0700 (PDT) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: K, thank you i am porting ffmpeg library to android using android-ndk anyway Thank you for your replay , i fixed that above error also Regards Prathap.M On Sat, Jun 1, 2013 at 2:26 AM, Alex Cohn [via libav-users] < ml-node+s943685n4657777h33 at n4.nabble.com> wrote: > On Fri, May 31, 2013 at 9:39 AM, prathap <[hidden email]> > wrote: > > > Thanks for your previous solution , and now i have two Android.mk > files > > in my project > > > > 1 .../(my_project_root)/jni/Android.mk > > > > 2 .../ (my_project_root)/jni/ffmpeg/android/arm/Android.mk > > > > > > and my first android.mk code is: > > > > > ----------------------------------------------------------------------------- > > > LOCAL_PATH := $(call my-dir) > > include $(CLEAR_VARS) > > LOCAL_MODULE := framegrabber > > LOCAL_SRC_FILES := framegrabber.c > > LOCAL_LDLIBS := -llog -lz > > LOCAL_STATIC_LIBRARIES := libavformat_static libavcodec_static > > libavutil_static > > include $(BUILD_SHARED_LIBRARY) > > $(call import-module,ffmpeg/android/arm) > > ... > > > when i am trying to run ndk-build it shows Error like this: > > > > > -------------------------------------------------------------------------------------------------- > > > Android NDK: /home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk: Cannot > find module with tag 'ffmpeg/android/arm' in import path > > Android NDK: Are you sure your NDK_MODULE_PATH variable is properly > defined? > > Android NDK: The following directories were searched: > > Android NDK: home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk:8: *** > Android NDK: Aborting. . Stop. > > > ------------------------------------------------------------------------------------------------------ > > > > > Could you please tell me where the mistake is? > > > > Thank you > > > > Regards > > Prathap.M > > Try > > $(call import-module,$(LOCAL_PATH)/ffmpeg/android/arm) > > I am afraid we have stirred too far from the topic of the libav-user > mail list. You would be better served if you ask the questions about > Android NDK in relevant user groups, or at stack-overflow. > > Regards, > Alex Cohn > _______________________________________________ > Libav-user mailing list > [hidden email] > http://ffmpeg.org/mailman/listinfo/libav-user > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657777.html > To unsubscribe from Error when creating .so file using .c program and > ffmpeg using android NDK, click here > . > NAML > -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657779.html Sent from the libav-users mailing list archive at Nabble.com. From wbsecg1 at gmail.com Sun Jun 2 17:39:50 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Sun, 2 Jun 2013 23:39:50 +0800 Subject: [Libav-user] how to get fps Message-ID: i find that AVStream has r_frame_rate and avg_frame_rate. r_frame_rate is a guessed value, what about avg_frame_rate? sometimes avq2d(avg_frame_rate) is 0, why? if i want to know fps, which one should i use? or other methods? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Tue Jun 4 01:06:27 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 03 Jun 2013 20:06:27 -0300 Subject: [Libav-user] Dolby 5.1 vs Dolby 5.1 (side) Message-ID: <51AD2173.4000602@gmail.com> I am wondering what's the difference between the two formats (Dolby 5.1) vs (Dolby 5.1 (side)). From cehoyos at ag.or.at Tue Jun 4 01:18:42 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 3 Jun 2013 23:18:42 +0000 (UTC) Subject: [Libav-user] Dolby 5.1 vs Dolby 5.1 (side) References: <51AD2173.4000602@gmail.com> Message-ID: Gonzalo Garramuno writes: > I am wondering what's the difference between the > two formats (Dolby 5.1) vs (Dolby 5.1 (side)). I am not sure I understand what you mean with "Dolby 5.1" (is that something that FFmpeg prints?) but the difference between "5.1" and "5.1 (side)" is the position of the surround speakers: Both are FL - FC - FR - LFE, the two additional speakers are BL and BR for "5.1" and SL and SR for "5.1 (side)". Carl Eugen From hs at tagtraum.com Tue Jun 4 13:29:38 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 4 Jun 2013 13:29:38 +0200 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample Message-ID: Hello everybody: I'm working on a little (java) library for decoding audio using FFmpeg/libav* and have some questions regarding the handling of 24 bit audio. 1. (SHIFTING) When decoding, 24bit audio is apparently shifted, i.e. 24bit become 32bit, as there is no 24bit AVSampleFormat. Am I right to assume that the data is shifted toward the most significant byte? I.e. the most significant 3 bytes are the same as the original 24bit? Or is the most significant byte simply "sign-extended" and the three least significant bytes are the original 24bit? 2. (SWRESAMPLE) I'm using libswresample to, well, resample data, get rid of planar formats etc. It's working great. libswresample also accepts AVSampleFormat parameters for input and output format. This implies that it does not support any conversion to true 24bit, represented by 3 bytes. Correct? 3. (CODEC) What is the recommend way to produce 24bit audio? After decoding (and potentially resampling), should I use the corresponding codec (e.g. AV_CODEC_ID_PCM_S24LE) to produce the data in the format I'm interested in? Or is there another, better way? Thanks in advance. -hendrik From onemda at gmail.com Tue Jun 4 13:34:43 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 4 Jun 2013 11:34:43 +0000 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: References: Message-ID: On 6/4/13, Hendrik Schreiber wrote: > Hello everybody: > > I'm working on a little (java) library for decoding audio using > FFmpeg/libav* and have some questions regarding the handling of 24 bit > audio. > > 1. (SHIFTING) When decoding, 24bit audio is apparently shifted, i.e. 24bit > become 32bit, as there is no 24bit AVSampleFormat. Am I right to assume that > the data is shifted toward the most significant byte? I.e. the most > significant 3 bytes are the same as the original 24bit? > Or is the most significant byte simply "sign-extended" and the three least > significant bytes are the original 24bit? > > 2. (SWRESAMPLE) I'm using libswresample to, well, resample data, get rid of > planar formats etc. It's working great. libswresample also accepts > AVSampleFormat parameters for input and output format. This implies that it > does not support any conversion to true 24bit, represented by 3 bytes. > Correct? > > 3. (CODEC) What is the recommend way to produce 24bit audio? After decoding > (and potentially resampling), should I use the corresponding codec (e.g. > AV_CODEC_ID_PCM_S24LE) to produce the data in the format I'm interested in? > Or is there another, better way? There should be dithering applied, see output_sample_bits option. > > Thanks in advance. > > -hendrik > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From mhkgalvez at gmail.com Tue Jun 4 17:41:29 2013 From: mhkgalvez at gmail.com (Matheus Henrique Klem Galvez) Date: Tue, 4 Jun 2013 11:41:29 -0400 Subject: [Libav-user] Memory leak reading videos Message-ID: Hi all, I am developing a C++ class that stands between two media libraries, namely OpenCV and the very ffmpeg. The aim is simple: to read uncompressed .avi videos with ffmpeg and send frames to OpenCV format in order that OpenCV might be able to process these frames. The reason why I am doing such a class rather than doing everything using OpenCV is that there is a bug with OpenCV still unresolved (as the best of my knowledge tells me). This bug unfortunately makes the application using OpenCV crash when trying to read an uncompressed video like those I have to read. So, I learned the basics of ffmpeg and was able to develop, compile and run an application that reads these videos and saves the frames into hard disk, if I want. The question is that I tested my functions in a loop and figured out that there is a huge leak of memory: the memory space allocated increases very fast. The structure of the code inside the loop is that: 1) Open file and initialize ffmpeg structures and variables 2) Read 10 frames from the file 3) Close file and release ffmpeg structures and variables I developed Open() and Close() functions specially to avoid memory accumulation but for some reason I am not being able to release properly all ffmpeg resources. I tested the loop without Open() and Close() and it works properly, so the leak is inside these functions and not inside reading routine. Here follows my Open() and Close() routines: Notice: you will not see the function av_register_all() in my open() code. It is called inside the class constructor. Open(): void VideoInterface::open(string filePath) { // Check if it is already open if (openSuccess) { throw GeneralException("There is an already open video in this interface."); } // Open video file if (avformat_open_input(&formatCtx, filePath.c_str(), NULL, NULL) != 0) { throw OpenVideoException("Video could not be open."); } //Retrieve stream information if (avformat_find_stream_info(formatCtx, NULL) < 0) { throw OpenVideoException("Could not ind stream information for the given video."); } // Find first video stream vStreamIndex = -1; for (int i = 0; i < formatCtx->nb_streams; ++i) { if (formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { vStreamIndex = i; break; } } if (vStreamIndex == -1) { throw OpenVideoException("Could not find a video stream."); } // Get a pointer to the codec context for the video stream codecCtx = formatCtx->streams[vStreamIndex]->codec; /*------------------------------*/ //Grabbing useful information double duration = ((double) formatCtx->duration)/AV_TIME_BASE; double fps = 1/av_q2d(codecCtx->time_base); int frameCount = duration * fps; /*cout << "Numerator:\t" << codecCtx->time_base.num << endl; cout << "Denominator:\t" << codecCtx->time_base.den << endl; cout << "FPS:\t\t" << fps << endl; cout << "Duration:\t" << duration << " secs." << endl; cout << "Frame count:\t" << frameCount << endl;*/ // Fill VideoInformation structure vinfo->duration = duration; vinfo->fps = fps; vinfo->frameCount = frameCount; /*------------------------------*/ // Find the decoder for the video stream codec = avcodec_find_decoder(codecCtx->codec_id); if (codec == NULL) { throw OpenVideoException("Unsuported codec!"); } // Open codec AVDictionary *options = NULL; if (avcodec_open2(codecCtx, codec, &options) < 0) { throw OpenVideoException("Could not open codec!"); } /*------- Prepare interface for first reading -------*/ // Allocate an AVFrame structure frame = avcodec_alloc_frame(); frameRGB = avcodec_alloc_frame(); if (frameRGB == NULL or frame == NULL) { throw OpenVideoException("Not able to allocate frame space."); } // Determine required buffer size and allocate buffer int numBytes = avpicture_get_size(PIX_FMT_RGB24, codecCtx->width, codecCtx->height); rawData = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t)); sws_ctx = sws_getContext(codecCtx->width, codecCtx->height, codecCtx->pix_fmt, codecCtx->width, codecCtx->height, PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL); // Assign appropriate parts of buffer to image planes in pFrameRGB // Note that pFrameRGB is an AVFrame, but AVFrame is a superset // of AVPicture avpicture_fill((AVPicture*) frameRGB, rawData, PIX_FMT_RGB24, codecCtx->width, codecCtx->height); openSuccess = true; } Close(): void VideoInterface::close() { // Free buffer av_free(rawData); // Free the RGB image av_free(frameRGB); // Free the YUV frame av_free(frame); // Free packet av_free_packet(&packet); // Close Codec context avcodec_close(codecCtx); // Close Format context avformat_close_input(&formatCtx); // Reinit class variables (not ffmpeg at all, and not any dynamically allocate memory as well) init(); } One possible reason for my problem is that I found out that avcodec_close(AvCodecContext*) only frees AVCodecContext content, and not the variable itself. After it I tried to call av_free(codecCtx) but it generated an error. So, a first approach would be: how can one completely release AVCodecContext variables? Thank you all! -- -- Matheus Henrique Klem Galvez The Catholic University of America, Washington, DC Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jun 4 17:51:07 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Jun 2013 15:51:07 +0000 (UTC) Subject: [Libav-user] Memory leak reading videos References: Message-ID: Matheus Henrique Klem Galvez writes: > The aim is simple: to read uncompressed .avi videos > with ffmpeg and send frames to OpenCV format in order > that OpenCV might be able to process these frames. (Unrelated to your problem:) You do know that this is possible with ffmpeg (the application)? Carl Eugen From mhkgalvez at gmail.com Tue Jun 4 18:03:30 2013 From: mhkgalvez at gmail.com (Matheus Henrique Klem Galvez) Date: Tue, 4 Jun 2013 12:03:30 -0400 Subject: [Libav-user] Memory leak reading videos In-Reply-To: References: Message-ID: What do you mean, Carl? On Tue, Jun 4, 2013 at 11:51 AM, Carl Eugen Hoyos wrote: > Matheus Henrique Klem Galvez writes: > > > The aim is simple: to read uncompressed .avi videos > > with ffmpeg and send frames to OpenCV format in order > > that OpenCV might be able to process these frames. > > (Unrelated to your problem:) > You do know that this is possible with ffmpeg > (the application)? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- -- Matheus Henrique Klem Galvez The Catholic University of America, Washington, DC Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From vahid at kowsari.com Wed Jun 5 05:53:32 2013 From: vahid at kowsari.com (Vahid Kowsari) Date: Tue, 04 Jun 2013 20:53:32 -0700 Subject: [Libav-user] Is there any way to programmatically get ffmpeg decoding error count or callbacks? Message-ID: <51AEB63C.4040004@kowsari.com> Hi, I am developing a media monitoring solution and it would be really helpful to know if we are receiving a good signal. I am using ffmpeg APIs to decode udp mpegts streams. Are there any ffmpeg APIs that I can call to get notified of errors in the decoding? Or just get a current count of errors? Thank You From andrey.krieger.utkin at gmail.com Wed Jun 5 08:41:07 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Wed, 5 Jun 2013 09:41:07 +0300 Subject: [Libav-user] Is there any way to programmatically get ffmpeg decoding error count or callbacks? In-Reply-To: <51AEB63C.4040004@kowsari.com> References: <51AEB63C.4040004@kowsari.com> Message-ID: 2013/6/5 Vahid Kowsari : > Hi, > > I am developing a media monitoring solution and it would be really helpful > to know if we are receiving a good signal. > I am using ffmpeg APIs to decode udp mpegts streams. Are there any ffmpeg > APIs that I can call to get notified of errors in the decoding? Or just get > a current count of errors? You can catch log messages, or create decoder with option err_detect=explode (or other value, consult with decoder source code), which will result in decoding failure instead of surviving the error. Of course you may proceed to decode after failure, you are not required to restart everything after that. -- Andrey Utkin From ashvyrkin at gosniias.ru Wed Jun 5 12:13:37 2013 From: ashvyrkin at gosniias.ru (=?UTF-8?B?0JDQvdC00YDQtdC5?=) Date: Wed, 05 Jun 2013 14:13:37 +0400 Subject: [Libav-user] avcodec_close() crash Message-ID: <51AF0F51.7050309@gosniias.ru> I use to compile the 32-bit version of ffmpeg visual studio 2012. I used the latter for now build from 5/29/13. This is my test code that reproduces the problem: avcodec_register_all(); int width = 764, height = 480; int got_output; AVFrame *frame; AVPacket pkt; AVCodec *codec; AVCodecContext *c = NULL; while(1) { frame = avcodec_alloc_frame(); if (!frame) { fprintf(stderr, "Could not allocate video frame\n"); return -1; } frame->format = AV_PIX_FMT_YUV420P; frame->width = width; frame->height = height; /* the image can be allocated by any means and av_image_alloc() is * just the most convenient way if av_malloc() is to be used */ int ret = av_image_alloc(frame->data, frame->linesize, width, height, AV_PIX_FMT_YUV420P, 1); if (ret < 0) { fprintf(stderr, "Could not allocate raw picture buffer\n"); av_freep(&frame->data[0]); avcodec_free_frame(&frame); return -1; } /* find the mpeg4 video encoder */ codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); if (!codec) { fprintf(stderr, "Codec not found\n"); return -1; } c = avcodec_alloc_context3(codec); if (!c) { fprintf(stderr, "Could not allocate video codec context\n"); return -1; } /* put sample parameters */ c->profile = FF_PROFILE_MPEG4_SIMPLE; /* resolution must be a multiple of two */ c->width = width; c->height = height; /* frames per second */ c->time_base.den = 25; c->time_base.num = 1; c->gop_size = 25; /* emit one intra frame every 25 frames */ c->pix_fmt = AV_PIX_FMT_YUV420P; c->qmax = 4; c->qmin = 4; /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); avcodec_close(c); av_free(c); return -1; } for(int k = 0; k < 30; k++) { av_init_packet(&pkt); pkt.data = NULL; // packet data will be allocated by the encoder pkt.size = 0; frame->pts = c->frame_number; /* encode the image */ if (avcodec_encode_video2(c, &pkt, frame, &got_output) < 0) { fprintf(stderr, "Error encoding frame\n"); return -1; } if (got_output) { av_free_packet(&pkt); } } if(c) { avcodec_close(c); av_free(c); } if(frame) { av_freep(&frame->data[0]); avcodec_free_frame(&frame); } } When you call function avcodec_close () throws an exception. Such an error is detected on the MPEG4 codec with a frame width in the range 754-767 at an altitude of 480. Perhaps at other resolutions, too. Help solve the problem. ...sorry for bad english -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Wed Jun 5 12:39:27 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Wed, 5 Jun 2013 13:39:27 +0300 Subject: [Libav-user] avcodec_close() crash In-Reply-To: <51AF0F51.7050309@gosniias.ru> References: <51AF0F51.7050309@gosniias.ru> Message-ID: 2013/6/5 ?????? : > I use to compile the 32-bit version of ffmpeg visual studio 2012. I used the > latter for now build from 5/29/13. > This is my test code that reproduces the problem: > > avcodec_register_all(); > > int width = 764, height = 480; > int got_output; > AVFrame *frame; > AVPacket pkt; > AVCodec *codec; > AVCodecContext *c = NULL; > > while(1) > { > frame = avcodec_alloc_frame(); > if (!frame) { > fprintf(stderr, "Could not allocate video frame\n"); > return -1; > } > frame->format = AV_PIX_FMT_YUV420P; > frame->width = width; > frame->height = height; > > /* the image can be allocated by any means and av_image_alloc() is > * just the most convenient way if av_malloc() is to be used */ > int ret = av_image_alloc(frame->data, frame->linesize, width, > height, > AV_PIX_FMT_YUV420P, 1); > if (ret < 0) { > fprintf(stderr, "Could not allocate raw picture buffer\n"); > av_freep(&frame->data[0]); > avcodec_free_frame(&frame); > return -1; > } > > /* find the mpeg4 video encoder */ > codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); > if (!codec) { > fprintf(stderr, "Codec not found\n"); > return -1; > } > > c = avcodec_alloc_context3(codec); > if (!c) { > fprintf(stderr, "Could not allocate video codec context\n"); > return -1; > } > > /* put sample parameters */ > c->profile = FF_PROFILE_MPEG4_SIMPLE; > /* resolution must be a multiple of two */ > c->width = width; > c->height = height; > /* frames per second */ > c->time_base.den = 25; > c->time_base.num = 1; > c->gop_size = 25; /* emit one intra frame every 25 frames */ > c->pix_fmt = AV_PIX_FMT_YUV420P; > c->qmax = 4; > c->qmin = 4; > > /* open it */ > if (avcodec_open2(c, codec, NULL) < 0) { > fprintf(stderr, "Could not open codec\n"); > avcodec_close(c); You shouldn't avcodec_close() here. I think this can cause a problem. > av_free(c); > return -1; > } > > for(int k = 0; k < 30; k++) > { > av_init_packet(&pkt); > pkt.data = NULL; // packet data will be allocated by the > encoder > pkt.size = 0; > > frame->pts = c->frame_number; > > /* encode the image */ > if (avcodec_encode_video2(c, &pkt, frame, &got_output) < 0) { > fprintf(stderr, "Error encoding frame\n"); > return -1; > } > > if (got_output) { > av_free_packet(&pkt); > } > } > > if(c) > { > avcodec_close(c); > av_free(c); Can't say for sure, but av_free() seems redundant. > } > if(frame) > { > av_freep(&frame->data[0]); > avcodec_free_frame(&frame); Maybe there also something is redundant. > } > } > > When you call function avcodec_close () throws an exception. Such an error > is detected on the MPEG4 codec with a frame width in the range 754-767 at an > altitude of 480. Perhaps at other resolutions, too. Help solve the problem. > ...sorry for bad english You have more than one call to avcodec_close(), do you know, which one is executed? Your code snippet should be easily compiled on linux, there you can use valgrind memcheck tool, which makes debugging easy. Also i suggest you to re-read avcodec.h and avformat.h for explanations on how to release context objects correclty, some places in your code are suspicious for me. -- Andrey Utkin From hs at tagtraum.com Wed Jun 5 17:29:01 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Wed, 5 Jun 2013 17:29:01 +0200 Subject: [Libav-user] How to tell if a mp3 file was encoded with VBR? Message-ID: <55E7BA0C-CED4-4662-BE2F-07409AC36E07@tagtraum.com> Hey everybody: Is there an easy way to find out, whether an mp3 file (or any other codec for that matter) was encoded with VBR? Thank you, -hendrik From arvind_raman at yahoo.com Wed Jun 5 18:28:20 2013 From: arvind_raman at yahoo.com (Arvind Raman) Date: Wed, 5 Jun 2013 09:28:20 -0700 (PDT) Subject: [Libav-user] Demuxing data directly into user provided buffers Message-ID: <1370449700.98499.YahooMailNeo@web122302.mail.ne1.yahoo.com> Question:? Is it possible to configure libavformat to demux data directly into user provided buffers (allocated in the application) rather than into the packet buffers that get allocated within calls to the libavformat function. Additional details: While going through the following files * demuxing.c -?http://ffmpeg.org/doxygen/trunk/demuxing_8c_source.html * utils.c -?http://ffmpeg.org/doxygen/trunk/libavformat_2utils_8c_source.html * avpacket.c -?http://ffmpeg.org/doxygen/trunk/avpacket_8c_source.html I found that libavformat was allocating packet buffers inside the call to the function av_dup_packet() (av_dup_packet() [avpacket.c] calls the function copy_packet_data() [avpacket.c] which is were the buffers get allocated). Since my application implements its own buffer manager (and allocates these buffers), this mail is to check if it is possible to configure libavformat to work directly with the buffers that I allocate in my application. Needless to say I would like to avoid copying media data from the packet buffers allocated within libavformat to the buffers allocated by my application.? Any help / pointers would be greatly appreciated.? Thanks and Best Regards Arvind -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.leppkes at gmail.com Wed Jun 5 18:32:09 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 5 Jun 2013 18:32:09 +0200 Subject: [Libav-user] Demuxing data directly into user provided buffers In-Reply-To: <1370449700.98499.YahooMailNeo@web122302.mail.ne1.yahoo.com> References: <1370449700.98499.YahooMailNeo@web122302.mail.ne1.yahoo.com> Message-ID: On Wed, Jun 5, 2013 at 6:28 PM, Arvind Raman wrote: > Question: > Is it possible to configure libavformat to demux data directly into user > provided buffers (allocated in the application) rather than into the packet > buffers that get allocated within calls to the libavformat function. > No, thats not possible. Demuxed data is generally so small (in comparison to decoded data), that it was deemed too high complexity, and never implemented. From andrey.krieger.utkin at gmail.com Wed Jun 5 19:56:46 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Wed, 5 Jun 2013 20:56:46 +0300 Subject: [Libav-user] How to tell if a mp3 file was encoded with VBR? In-Reply-To: <55E7BA0C-CED4-4662-BE2F-07409AC36E07@tagtraum.com> References: <55E7BA0C-CED4-4662-BE2F-07409AC36E07@tagtraum.com> Message-ID: 2013/6/5 Hendrik Schreiber : > Hey everybody: > > Is there an easy way to find out, whether an mp3 file (or any other codec for that matter) was encoded with VBR? What about demuxing file to AVPackets, and then analyzing sum of their sizes within sliding timestamp window? I hope i used right terms. -- Andrey Utkin From hs at tagtraum.com Wed Jun 5 20:04:11 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Wed, 5 Jun 2013 20:04:11 +0200 Subject: [Libav-user] How to tell if a mp3 file was encoded with VBR? In-Reply-To: References: <55E7BA0C-CED4-4662-BE2F-07409AC36E07@tagtraum.com> Message-ID: On Jun 5, 2013, at 7:56 PM, Andrey Utkin wrote: > 2013/6/5 Hendrik Schreiber : >> Is there an easy way to find out, whether an mp3 file (or any other codec for that matter) was encoded with VBR? > > What about demuxing file to AVPackets, and then analyzing sum of their > sizes within sliding timestamp window? I was hoping for something easier :-) Also, not having to scan through the entire file, would be preferable. -hendrik From ashvyrkin at gosniias.ru Thu Jun 6 05:53:45 2013 From: ashvyrkin at gosniias.ru (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA?=) Date: Thu, 06 Jun 2013 07:53:45 +0400 Subject: [Libav-user] avcodec_close() crash In-Reply-To: References: <51AF0F51.7050309@gosniias.ru> Message-ID: <51B007C9.7060009@gosniias.ru> 05.06.2013 14:39, Andrey Utkin ?????: > 2013/6/5 ?????? : >> I use to compile the 32-bit version of ffmpeg visual studio 2012. I used the >> latter for now build from 5/29/13. >> This is my test code that reproduces the problem: >> >> avcodec_register_all(); >> >> int width = 764, height = 480; >> int got_output; >> AVFrame *frame; >> AVPacket pkt; >> AVCodec *codec; >> AVCodecContext *c = NULL; >> >> while(1) >> { >> frame = avcodec_alloc_frame(); >> if (!frame) { >> fprintf(stderr, "Could not allocate video frame\n"); >> return -1; >> } >> frame->format = AV_PIX_FMT_YUV420P; >> frame->width = width; >> frame->height = height; >> >> /* the image can be allocated by any means and av_image_alloc() is >> * just the most convenient way if av_malloc() is to be used */ >> int ret = av_image_alloc(frame->data, frame->linesize, width, >> height, >> AV_PIX_FMT_YUV420P, 1); >> if (ret < 0) { >> fprintf(stderr, "Could not allocate raw picture buffer\n"); >> av_freep(&frame->data[0]); >> avcodec_free_frame(&frame); >> return -1; >> } >> >> /* find the mpeg4 video encoder */ >> codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); >> if (!codec) { >> fprintf(stderr, "Codec not found\n"); >> return -1; >> } >> >> c = avcodec_alloc_context3(codec); >> if (!c) { >> fprintf(stderr, "Could not allocate video codec context\n"); >> return -1; >> } >> >> /* put sample parameters */ >> c->profile = FF_PROFILE_MPEG4_SIMPLE; >> /* resolution must be a multiple of two */ >> c->width = width; >> c->height = height; >> /* frames per second */ >> c->time_base.den = 25; >> c->time_base.num = 1; >> c->gop_size = 25; /* emit one intra frame every 25 frames */ >> c->pix_fmt = AV_PIX_FMT_YUV420P; >> c->qmax = 4; >> c->qmin = 4; >> >> /* open it */ >> if (avcodec_open2(c, codec, NULL) < 0) { >> fprintf(stderr, "Could not open codec\n"); >> avcodec_close(c); > You shouldn't avcodec_close() here. I think this can cause a problem. > >> av_free(c); >> return -1; >> } >> >> for(int k = 0; k < 30; k++) >> { >> av_init_packet(&pkt); >> pkt.data = NULL; // packet data will be allocated by the >> encoder >> pkt.size = 0; >> >> frame->pts = c->frame_number; >> >> /* encode the image */ >> if (avcodec_encode_video2(c, &pkt, frame, &got_output) < 0) { >> fprintf(stderr, "Error encoding frame\n"); >> return -1; >> } >> >> if (got_output) { >> av_free_packet(&pkt); >> } >> } >> >> if(c) >> { >> avcodec_close(c); >> av_free(c); > Can't say for sure, but av_free() seems redundant. > >> } >> if(frame) >> { >> av_freep(&frame->data[0]); >> avcodec_free_frame(&frame); > Maybe there also something is redundant. > >> } >> } >> >> When you call function avcodec_close () throws an exception. Such an error >> is detected on the MPEG4 codec with a frame width in the range 754-767 at an >> altitude of 480. Perhaps at other resolutions, too. Help solve the problem. >> ...sorry for bad english > You have more than one call to avcodec_close(), do you know, which one > is executed? > > Your code snippet should be easily compiled on linux, there you can > use valgrind memcheck tool, which makes debugging easy. > Also i suggest you to re-read avcodec.h and avformat.h for > explanations on how to release context objects correclty, some places > in your code are suspicious for me. > > -- > Andrey Utkin > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Ok, for now I'm using video_encode_example from decoding_encoding.c example: AVCodec *codec; AVCodecContext *c = NULL; int i, ret, x, y, got_output; AVFrame *frame; AVPacket pkt; /* register all the codecs */ avcodec_register_all(); /* find the mpeg1 video encoder */ codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); if (!codec) { fprintf(stderr, "Codec not found\n"); exit(1); } c = avcodec_alloc_context3(codec); if (!c) { fprintf(stderr, "Could not allocate video codec context\n"); exit(1); } /* put sample parameters */ c->bit_rate = 400000; /* resolution must be a multiple of two */ c->width = 764; c->height = 480; /* frames per second */ c->time_base.den = 25; c->time_base.num = 1; c->gop_size = 10; /* emit one intra frame every ten frames */ c->max_b_frames = 1; c->pix_fmt = AV_PIX_FMT_YUV420P; /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); exit(1); } frame = avcodec_alloc_frame(); if (!frame) { fprintf(stderr, "Could not allocate video frame\n"); exit(1); } frame->format = c->pix_fmt; frame->width = c->width; frame->height = c->height; /* the image can be allocated by any means and av_image_alloc() is * just the most convenient way if av_malloc() is to be used */ ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height, c->pix_fmt, 32); if (ret < 0) { fprintf(stderr, "Could not allocate raw picture buffer\n"); exit(1); } /* encode 1 second of video */ for(i=0;i<25;i++) { av_init_packet(&pkt); pkt.data = NULL; // packet data will be allocated by the encoder pkt.size = 0; fflush(stdout); /* prepare a dummy image */ /* Y */ for(y=0;yheight;y++) { for(x=0;xwidth;x++) { frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3; } } /* Cb and Cr */ for(y=0;yheight/2;y++) { for(x=0;xwidth/2;x++) { frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2; frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5; } } frame->pts = i; /* encode the image */ ret = avcodec_encode_video2(c, &pkt, frame, &got_output); if (ret < 0) { fprintf(stderr, "Error encoding frame\n"); exit(1); } if (got_output) { av_free_packet(&pkt); } } avcodec_close(c); av_free(c); av_freep(&frame->data[0]); avcodec_free_frame(&frame); The problem is that the context is not released correctly when the resolution is 764x480 and some other resolutions. If you use a different codec instead of MPEG4, such as H264, no error occurs if any resolution. I use the assembly under windows and unfortunately I do not have the possibility to compile the example under Linux to pinpoint the cause of the fall. From vkarthik90 at gmail.com Thu Jun 6 12:21:03 2013 From: vkarthik90 at gmail.com (Karthik Viswanathan) Date: Thu, 6 Jun 2013 15:51:03 +0530 Subject: [Libav-user] Provided packet is too small, needs to be x Message-ID: Hello, I got the ffmpeg builds from zeranoe[20130601-git-716dbc7] & used gcc 4.8.0 on windows to compile. I am trying to convert a h264 video to webm. The output video is empty and the console is filled with 'Provided packet is too small, needs to be 612'. ////////////////////// the decoder: pFormatCtxIn = avformat_alloc_context(); ret = avformat_open_input(&pFormatCtxIn, "bump.mp4", NULL, NULL); if(avformat_find_stream_info(pFormatCtxIn,NULL)<0) return -1; video_stream_idx = -1; for(i=0; inb_streams; i++){ if(pFormatCtxIn->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { video_stream_idx=i; } } if(video_stream_idx==-1) return -1; pCodecCtxIn = pFormatCtxIn->streams[video_stream_idx]->codec; pCodecIn = avcodec_find_decoder(pCodecCtxIn->codec_id); avcodec_open2(pCodecCtxIn,pCodecIn, NULL); if(pCodecCtxIn->time_base.num>1000 && pCodecCtxIn->time_base.den==1) pCodecCtxIn->time_base.den=1000; /////////////////// the encoder: pOfmtOut = av_guess_format(NULL, filename,NULL); pFormatCtxOut = avformat_alloc_context(); pOfmtOut->video_codec = AV_CODEC_ID_VP8; pFormatCtxOut->oformat = pOfmtOut; snprintf(pFormatCtxOut->filename,sizeof(pFormatCtxOut->filename),"%s",filename); strmVdoOut = avformat_new_stream(pFormatCtxOut,NULL); pCodecCtxOut = strmVdoOut->codec; pCodecCtxOut->codec_id = pOfmtOut->video_codec; pCodecCtxOut->codec_type = AVMEDIA_TYPE_VIDEO; pCodecCtxOut->bit_rate = 4000; /* open it */ pCodecCtxOut->pix_fmt = AV_PIX_FMT_YUV420P; pCodecCtxOut->width = 1360; pCodecCtxOut->height = 760; pCodecCtxOut->time_base= (AVRational){1,30}; if(pFormatCtxOut->oformat->flags & AVFMT_GLOBALHEADER) pCodecCtxOut->flags |= CODEC_FLAG_GLOBAL_HEADER; pCodecOut = avcodec_find_encoder(pCodecCtxOut->codec_id); avcodec_open2(pCodecCtxOut, pCodecOut,NULL); avio_open(&pFormatCtxOut->pb, filename, AVIO_FLAG_WRITE); ret = avformat_write_header(pFormatCtxOut, NULL); /////////////////// frame allocation frame = avcodec_alloc_frame(); frame->format = pCodecCtxOut->pix_fmt; frame->width = pCodecCtxOut->width; frame->height = pCodecCtxOut->height; ret = av_image_alloc(frame->data, frame->linesize, pCodecCtxOut->width, pCodecCtxOut->height,pCodecCtxOut->pix_fmt, 32); //////////////////// the transcoding i = 0; while(++i) { av_init_packet(&packet); ret = av_read_frame(pFormatCtxIn,&packet); if(ret < 0){ fprintf(stderr,"Error reading frame\n"); break; } if(packet.stream_index == video_stream_idx){ ret = avcodec_decode_video2(pCodecCtxIn,frame,&got_output,&packet); if (got_output) { frame->pts=i; ret = avcodec_encode_video2(pCodecCtxOut, &packet, frame, &got_output); if (got_output) { if (pCodecCtxOut->coded_frame->pts != (0x8000000000000000LL)) packet.pts = av_rescale_q(pCodecCtxOut->coded_frame->pts, pCodecCtxOut->time_base, strmVdoOut->time_base); if(pCodecCtxOut->coded_frame->key_frame) packet.flags |= AV_PKT_FLAG_KEY; if(av_interleaved_write_frame(pFormatCtxOut,&packet) < 0){ fprintf(stderr,"error writing frame"); exit(1); } } } } av_free_packet(&packet); } The full code is available here: https://www.dropbox.com/s/agltcde1o1mej7h/try.c From aw.wisch at googlemail.com Thu Jun 6 13:25:01 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Thu, 6 Jun 2013 19:25:01 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream Message-ID: Hello, i am having troubles to decode a h264 live stream provided by an HD ip camera. I tried first with the recent git version of ffmpeg on android and then later on my mac, the results always looks the same as below. Maybe someone can give me a hint what i am doing wrong. ffmpeg -v 9 -loglevel 99 -report -i " http://192.168.1.166:86/livestream/12?action=play&media=video" output.mp4 ffmpeg started on 2013-06-06 at 19:20:34 Report written to "ffmpeg-20130606-192034.log" ffmpeg version N-53869-gb26bcd0 Copyright (c) 2000-2013 the FFmpeg developers built on Jun 6 2013 17:59:32 with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration: --prefix=/usr/local libavutil 52. 35.100 / 52. 35.100 libavcodec 55. 15.100 / 55. 15.100 libavformat 55. 8.102 / 55. 8.102 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 75.101 / 3. 75.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-i' ... matched as input file with argument ' http://192.168.1.166:86/livestream/12?action=play&media=video'. Reading option 'output.mp4' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument 9. Applying option report (generate a report) with argument 1. Successfully parsed a group of options. Parsing a group of options: input file http://192.168.1.166:86/livestream/12?action=play&media=video. Successfully parsed a group of options. Opening an input file: http://192.168.1.166:86/livestream/12?action=play&media=video. [h264 @ 0x7f9f4b00f800] Format h264 probed with size=2048 and score=51 [h264 @ 0x7f9f4b00f800] File position before avformat_find_stream_info() is 0 [h264 @ 0x7f9f4b039a00] no picture [h264 @ 0x7f9f4b039a00] left block unavailable for requested intra4x4 mode -1 at 0 0 [h264 @ 0x7f9f4b039a00] error while decoding MB 0 0 [h264 @ 0x7f9f4b039a00] concealing 880 DC, 880 AC, 880 MV errors in I frame [h264 @ 0x7f9f4b039a00] missing picture in access unit with size 17 Last message repeated 1 times [h264 @ 0x7f9f4b039a00] sps_id out of range [h264 @ 0x7f9f4b039a00] chroma_format_idc 9 is illegal [h264 @ 0x7f9f4b039a00] chroma_format_idc 5 is illegal [h264 @ 0x7f9f4b039a00] missing picture in access unit with size 17 [h264 @ 0x7f9f4b039a00] illegal bit depth value (10, 8) [h264 @ 0x7f9f4b039a00] sps_id out of range [h264 @ 0x7f9f4b039a00] illegal bit depth value (11, 8) [h264 @ 0x7f9f4b039a00] sps_id out of range [h264 @ 0x7f9f4b039a00] pps_id out of range [h264 @ 0x7f9f4b039a00] sps_id out of range [h264 @ 0x7f9f4b039a00] illegal bit depth value (8, 14) [h264 @ 0x7f9f4b039a00] pps_id out of range [h264 @ 0x7f9f4b039a00] non-existing PPS referenced [h264 @ 0x7f9f4b00f800] max_analyze_duration 5000000 reached at 5000000 microseconds [h264 @ 0x7f9f4b00f800] File position after avformat_find_stream_info() is 133692 Input #0, h264, from ' http://192.168.1.166:86/livestream/12?action=play&media=video': Duration: N/A, bitrate: N/A Stream #0:0, 152, 1/1200000: Video: h264 (Baseline), yuvj420p, 640x352, 1/60, 30 fps, 30 tbr, 1200k tbn, 60 tbc Successfully opened the file. Parsing a group of options: output file output.mp4. Successfully parsed a group of options. Opening an output file: output.mp4. Successfully opened the file. detected 4 logical cores [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'video_size' to value '640x352' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'pix_fmt' to value '12' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'time_base' to value '1/1200000' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'frame_rate' to value '60/2' [graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] w:640 h:352 pixfmt:yuvj420p tb:1/1200000 fr:30/1 sar:0/1 sws_param:flags=2 [format @ 0x7f9f4b800a40] compat: called with args=[yuv420p] [format @ 0x7f9f4b800a40] Setting 'pix_fmts' to value 'yuv420p' [auto-inserted scaler 0 @ 0x7f9f4ac10d00] Setting 'flags' to value '0x4' [auto-inserted scaler 0 @ 0x7f9f4ac10d00] w:iw h:ih flags:'0x4' interl:0 [format @ 0x7f9f4b800a40] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format' [AVFilterGraph @ 0x7f9f4ac10e00] query_formats: 4 queried, 3 merged, 1 already done, 0 delayed [auto-inserted scaler 0 @ 0x7f9f4ac10d00] w:640 h:352 fmt:yuvj420p sar:0/1 -> w:640 h:352 fmt:yuv420p sar:0/1 flags:0x4 [mpeg4 @ 0x7f9f4b036600] intra_quant_bias = 0 inter_quant_bias = -64 Output #0, mp4, to 'output.mp4': Metadata: encoder : Lavf55.8.102 Stream #0:0, 0, 1/15360: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 640x352, 1/30, q=2-31, 200 kb/s, 15360 tbn, 30 tbc Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg4) Press [q] to stop, [?] for help [h264 @ 0x7f9f4b038e00] no picture [h264 @ 0x7f9f4b038e00] left block unavailable for requested intra4x4 mode -1 at 0 0 [h264 @ 0x7f9f4b038e00] error while decoding MB 0 0 [h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in I frame [h264 @ 0x7f9f4b023400] out of range intra chroma pred mode at 37 0 [h264 @ 0x7f9f4b023400] error while decoding MB 37 0 [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023a00] cbp too large (111) at 32 0 [h264 @ 0x7f9f4b023a00] error while decoding MB 32 0 [h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b025a00] P sub_mb_type 4 out of range at 10 4 [h264 @ 0x7f9f4b025a00] error while decoding MB 10 4 [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 759 DC, 759 AC, 759 MV errors in P frame [h264 @ 0x7f9f4b026000] mb_type 28 in P slice too large at 19 3 [h264 @ 0x7f9f4b026000] error while decoding MB 19 3 [h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment [h264 @ 0x7f9f4b026000] concealing 790 DC, 790 AC, 790 MV errors in P frame [h264 @ 0x7f9f4b038e00] top block unavailable for requested intra mode at 36 0 [h264 @ 0x7f9f4b038e00] error while decoding MB 36 0 [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023400] slice type too large (32) at 39 21 [h264 @ 0x7f9f4b023400] decode_slice_header error [h264 @ 0x7f9f4b023400] no frame! [h264 @ 0x7f9f4b023a00] mb_type 28 in P slice too large at 20 2 [h264 @ 0x7f9f4b023a00] error while decoding MB 20 2 [h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023a00] concealing 829 DC, 829 AC, 829 MV errors in P frame [h264 @ 0x7f9f4b025a00] cbp too large (88) at 22 0 [h264 @ 0x7f9f4b025a00] error while decoding MB 22 0 [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b026000] mb_type 28 in P slice too large at 12 1 [h264 @ 0x7f9f4b026000] error while decoding MB 12 1 [h264 @ 0x7f9f4b026000] Unknown NAL code: 17 (94 bits) [h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment [h264 @ 0x7f9f4b026000] concealing 877 DC, 877 AC, 877 MV errors in P frame Error while decoding stream #0:0: Operation not permitted [h264 @ 0x7f9f4b038e00] cbp too large (247) at 32 0 [h264 @ 0x7f9f4b038e00] error while decoding MB 32 0 [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023400] mb_type 29 in P slice too large at 19 4 [h264 @ 0x7f9f4b023400] error while decoding MB 19 4 [h264 @ 0x7f9f4b023400] Unknown NAL code: 24 (94 bits) [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023400] concealing 750 DC, 750 AC, 750 MV errors in P frame [h264 @ 0x7f9f4b023a00] P sub_mb_type 4 out of range at 14 1 [h264 @ 0x7f9f4b023a00] error while decoding MB 14 1 [h264 @ 0x7f9f4b023a00] Unknown NAL code: 17 (94 bits) [h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023a00] concealing 875 DC, 875 AC, 875 MV errors in P frame [h264 @ 0x7f9f4b025a00] P sub_mb_type 11 out of range at 5 3 [h264 @ 0x7f9f4b025a00] error while decoding MB 5 3 [h264 @ 0x7f9f4b025a00] Unknown NAL code: 23 (94 bits) [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 804 DC, 804 AC, 804 MV errors in P frame [h264 @ 0x7f9f4b026000] out of range intra chroma pred mode at 34 6 [h264 @ 0x7f9f4b026000] error while decoding MB 34 6 [h264 @ 0x7f9f4b026000] Unknown NAL code: 31 (94 bits) [h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment [h264 @ 0x7f9f4b026000] concealing 655 DC, 655 AC, 655 MV errors in P frame [h264 @ 0x7f9f4b038e00] mb_type 30 in P slice too large at 29 11 [h264 @ 0x7f9f4b038e00] error while decoding MB 29 11 [h264 @ 0x7f9f4b038e00] Unknown NAL code: 28 (94 bits) [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 460 DC, 460 AC, 460 MV errors in P frame [h264 @ 0x7f9f4b023400] out of range intra chroma pred mode at 28 2 [h264 @ 0x7f9f4b023400] error while decoding MB 28 2 [h264 @ 0x7f9f4b023400] Unknown NAL code: 26 (94 bits) [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023400] concealing 821 DC, 821 AC, 821 MV errors in P frame [h264 @ 0x7f9f4b023a00] top block unavailable for requested intra mode at 18 0 [h264 @ 0x7f9f4b023a00] error while decoding MB 18 0 [h264 @ 0x7f9f4b023a00] Unknown NAL code: 23 (94 bits) [h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b025a00] P sub_mb_type 6 out of range at 5 7 [h264 @ 0x7f9f4b025a00] error while decoding MB 5 7 [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 644 DC, 644 AC, 644 MV errors in P frame [h264 @ 0x7f9f4b026000] slice type too large (32) at 38 21 [h264 @ 0x7f9f4b026000] decode_slice_header error [h264 @ 0x7f9f4b026000] no frame! [h264 @ 0x7f9f4b038e00] P sub_mb_type 9 out of range at 39 4 [h264 @ 0x7f9f4b038e00] error while decoding MB 39 4 [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 730 DC, 730 AC, 730 MV errors in P frame [h264 @ 0x7f9f4b023400] P sub_mb_type 4 out of range at 6 0 [h264 @ 0x7f9f4b023400] error while decoding MB 6 0 [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023a00] left block unavailable for requested intra4x4 mode -1 at 0 0 [h264 @ 0x7f9f4b023a00] error while decoding MB 0 0 [h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in I frame Error while decoding stream #0:0: Operation not permitted [h264 @ 0x7f9f4b025a00] cbp too large (110) at 4 0 [h264 @ 0x7f9f4b025a00] error while decoding MB 4 0 [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b026000] top block unavailable for requested intra mode at 12 0 [h264 @ 0x7f9f4b026000] error while decoding MB 12 0 [h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment [h264 @ 0x7f9f4b026000] concealing 880 DC, 880 AC, 880 MV errors in P frame *** 1 dup! [h264 @ 0x7f9f4b038e00] P sub_mb_type 5 out of range at 19 5 [h264 @ 0x7f9f4b038e00] error while decoding MB 19 5 [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 710 DC, 710 AC, 710 MV errors in P frame [h264 @ 0x7f9f4b023400] top block unavailable for requested intra mode at 13 0 [h264 @ 0x7f9f4b023400] error while decoding MB 13 0 [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023a00] top block unavailable for requested intra mode at 32 0 [h264 @ 0x7f9f4b023a00] error while decoding MB 32 0 [h264 @ 0x7f9f4b023a00] Unknown NAL code: 25 (94 bits) [h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b025a00] mb_type 27 in P slice too large at 34 4 [h264 @ 0x7f9f4b025a00] error while decoding MB 34 4 [h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b025a00] concealing 735 DC, 735 AC, 735 MV errors in P frame [h264 @ 0x7f9f4b026000] P sub_mb_type 4 out of range at 12 3 [h264 @ 0x7f9f4b026000] error while decoding MB 12 3 [h264 @ 0x7f9f4b026000] Unknown NAL code: 31 (94 bits) [h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment [h264 @ 0x7f9f4b026000] concealing 797 DC, 797 AC, 797 MV errors in P frame [h264 @ 0x7f9f4b038e00] mb_type 28 in P slice too large at 13 0 [h264 @ 0x7f9f4b038e00] error while decoding MB 13 0 [h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment [h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame [h264 @ 0x7f9f4b023400] sps_id out of range [h264 @ 0x7f9f4b023400] P sub_mb_type 5 out of range at 16 3 [h264 @ 0x7f9f4b023400] error while decoding MB 16 3 [h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jun 6 13:35:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 6 Jun 2013 11:35:52 +0000 (UTC) Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream References: Message-ID: Alexander Wischnewski writes: > ffmpeg -v 9 -loglevel 99 -report -i > "http://192.168.1.166:86/livestream/12?action=play&media=video" > output.mp4 I you succeed in saving the incoming stream to a file (and if the problem is also reproducible with that file), please upload a sample. Carl Eugen From kalileo at universalx.net Thu Jun 6 14:14:16 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 6 Jun 2013 19:14:16 +0700 Subject: [Libav-user] Setting mpegts_pmt_start_pid for hls segment/mpegts muxer or programmatically ? Message-ID: The mpegts muxer has the options (in ffmpeg cli) -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid 0x150 -metadata service_provider="Some provider" -metadata service_name="Some Channel" If you use the mpegts muxer indirectly, through the -segment options to create HLS, these options are not / have not been passed on to the mpegts muxer. In http://trac.ffmpeg.org/ticket/2230 there is a (recent) fix which passes through the metadata options. However the options -mpegts_pmt_start_pid and -mpegts_start_pid are still not passed through. A scan through the source of avformat/segment.c shows only the passing through of the metadata, I see nothing about passing through the pid(s). Did I misunderstand and there is a way to set mpegts_pmt_start_pid when using the segment muxer (in ffmpeg cli)? Next question is, what is the equivalent to mpegts_pmt_start_pid when I don't use ffmpeg cli, but the libraries, in my own code. I only see AVFormatContext->ts_id, and that is not the PMT pid, but the Transport stream id, and it "will be moved into demuxer private options." Is there any way to set the PMT pid programmatically ? Thanks for any hints! From aw.wisch at googlemail.com Thu Jun 6 14:16:43 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Thu, 6 Jun 2013 20:16:43 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: Hello Carl, thanks for the fast reply. It is reproducible, i dumped the stream to a .avi file and uploaded it to upload.ffmpeg.org as described in the bug report online documentation. h264_ip_cam_decoding_issue.txt h264_ip_cam_input.avi Greetings, Alex 2013/6/6 Carl Eugen Hoyos > Alexander Wischnewski writes: > > > ffmpeg -v 9 -loglevel 99 -report -i > > "http://192.168.1.166:86/livestream/12?action=play&media=video" > > output.mp4 > > I you succeed in saving the incoming stream to a file > (and if the problem is also reproducible with that > file), please upload a sample. > > 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 i.like.privacy.too at gmail.com Thu Jun 6 14:19:50 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 06 Jun 2013 08:19:50 -0400 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: <51B07E66.4000102@gmail.com> An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Thu Jun 6 14:26:27 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 6 Jun 2013 15:26:27 +0300 Subject: [Libav-user] Setting mpegts_pmt_start_pid for hls segment/mpegts muxer or programmatically ? In-Reply-To: References: Message-ID: 2013/6/6 Kalileo : > Is there any way to set the PMT pid programmatically ? AVDictionary *opts = NULL; av_dict_set(&opts, "mpegts_pmt_start_pid", "0x2000" /* example value */, 0); /* more av_dict_set() calls same way */ int ret = avformat_write_header(muxer_context, &opts); av_dict_free(&opts); -- Andrey Utkin From andrey.krieger.utkin at gmail.com Thu Jun 6 14:34:18 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 6 Jun 2013 15:34:18 +0300 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: 2013/6/6 Alexander Wischnewski : > Input #0, h264, from > 'http://192.168.1.166:86/livestream/12?action=play&media=video': > Duration: N/A, bitrate: N/A > Stream #0:0, 152, 1/1200000: Video: h264 (Baseline), yuvj420p, 640x352, > 1/60, 30 fps, 30 tbr, 1200k tbn, 60 tbc Camera Man, this is HTTP, so no UDP-related problems. Topicstarter, is there possibility of fetching the stream slower than it is produced? If this is the case, camera may drop some content which it cannot transmit in time. -- Andrey Utkin From cehoyos at ag.or.at Thu Jun 6 14:47:09 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 6 Jun 2013 12:47:09 +0000 (UTC) Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream References: Message-ID: Alexander Wischnewski writes: > thanks for the fast reply. It is?reproducible, i > dumped the stream to a .avi file How did you produce the avi file? Carl Eugen From aw.wisch at googlemail.com Thu Jun 6 14:50:10 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Thu, 6 Jun 2013 20:50:10 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: I used this command: ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video" -vcodec copy h264_ip_cam_input.avi Was this the wrong way ? Greetings, Alex 2013/6/6 Carl Eugen Hoyos > Alexander Wischnewski writes: > > > thanks for the fast reply. It is reproducible, i > > dumped the stream to a .avi file > > How did you produce the avi file? > > 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 kalileo at universalx.net Thu Jun 6 15:09:15 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 6 Jun 2013 20:09:15 +0700 Subject: [Libav-user] Setting mpegts_pmt_start_pid for hls segment/mpegts muxer or programmatically ? In-Reply-To: References: Message-ID: <0E676B16-E6CF-4A64-A795-B453B8EA09C3@universalx.net> On Jun 6, 2013, at 19:26 , Andrey Utkin wrote: > 2013/6/6 Kalileo : >> Is there any way to set the PMT pid programmatically ? > > AVDictionary *opts = NULL; > av_dict_set(&opts, "mpegts_pmt_start_pid", "0x2000" /* example value */, 0); > /* more av_dict_set() calls same way */ > int ret = avformat_write_header(muxer_context, &opts); > av_dict_free(&opts); > Thanks Andrey, that's exactly what I needed! From cehoyos at ag.or.at Thu Jun 6 15:28:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 6 Jun 2013 13:28:22 +0000 (UTC) Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream References: Message-ID: Alexander Wischnewski writes: > ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video" > -vcodec copy?h264_ip_cam_input.avi > > Was this the wrong way ? Not necessarily, but it will likely not help showing if there is a bug in FFmpeg or not. Does wget work? Or is there maybe another program to simply dump the network packets? Carl Eugen From mhkgalvez at gmail.com Thu Jun 6 16:42:41 2013 From: mhkgalvez at gmail.com (Matheus Henrique Klem Galvez) Date: Thu, 6 Jun 2013 10:42:41 -0400 Subject: [Libav-user] Memory leak reading videos In-Reply-To: References: Message-ID: Does any one have an answer? On Tue, Jun 4, 2013 at 12:03 PM, Matheus Henrique Klem Galvez < mhkgalvez at gmail.com> wrote: > What do you mean, Carl? > > > On Tue, Jun 4, 2013 at 11:51 AM, Carl Eugen Hoyos wrote: > >> Matheus Henrique Klem Galvez writes: >> >> > The aim is simple: to read uncompressed .avi videos >> > with ffmpeg and send frames to OpenCV format in order >> > that OpenCV might be able to process these frames. >> >> (Unrelated to your problem:) >> You do know that this is possible with ffmpeg >> (the application)? >> >> Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > > > -- > -- > Matheus Henrique Klem Galvez > The Catholic University of America, Washington, DC > Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil > -- -- Matheus Henrique Klem Galvez The Catholic University of America, Washington, DC Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw.wisch at googlemail.com Thu Jun 6 17:47:32 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Thu, 6 Jun 2013 23:47:32 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: wget didnt worked, but i have a small test program to save the stream output. The saved file gets decoded well with ffmpeg, so it seems it is not a decoding issue. The test program is removing any RTSP / RTP header information, the camera with the working h264 http stream is sending the same RTSP / RTP headers, i dont think this is the cause. Now i am more confused .... When i recording the raw stream of both cameras on hard disk the only big difference is the file size, the stream not working is producing much more data. Is there a way to change the http buffer size for incoming packets in ffmpeg ? Greetings, Alex 2013/6/6 Carl Eugen Hoyos > Alexander Wischnewski writes: > > > ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video > " > > -vcodec copy h264_ip_cam_input.avi > > > > Was this the wrong way ? > > Not necessarily, but it will likely not help showing > if there is a bug in FFmpeg or not. > Does wget work? Or is there maybe another program to > simply dump the network packets? > > 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 andrey.krieger.utkin at gmail.com Thu Jun 6 17:54:17 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 6 Jun 2013 18:54:17 +0300 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: 2013/6/6 Alexander Wischnewski : > wget didnt worked, but i have a small test program to save the stream > output. > The saved file gets decoded well with ffmpeg, so it seems it is not a > decoding issue. > > The test program is removing any RTSP / RTP header information, the camera > with the working h264 http stream is sending the same RTSP / RTP headers, i > dont think this is the cause. Now i am more confused .... > > When i recording the raw stream of both cameras on hard disk the only big > difference is the file size, the stream not working is producing much more > data. Is there a way to change the http buffer size for incoming packets in > ffmpeg ? What i don't understand is why you talk about RTSP and RTP while your URL is HTTP? -- Andrey Utkin From aw.wisch at googlemail.com Thu Jun 6 17:55:20 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Thu, 6 Jun 2013 23:55:20 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: Actually thats not nonsense, i set the wrong framerate, file size is the same. 2013/6/6 Alexander Wischnewski > wget didnt worked, but i have a small test program to save the stream > output. > The saved file gets decoded well with ffmpeg, so it seems it is not a > decoding issue. > > The test program is removing any RTSP / RTP header information, the camera > with the working h264 http stream is sending the same RTSP / RTP headers, i > dont think this is the cause. Now i am more confused .... > > When i recording the raw stream of both cameras on hard disk the only big > difference is the file size, the stream not working is producing much more > data. Is there a way to change the http buffer size for incoming packets in > ffmpeg ? > > Greetings, > Alex > > 2013/6/6 Carl Eugen Hoyos > >> Alexander Wischnewski writes: >> >> > ffmpeg -i " >> http://192.168.1.166:86/livestream/12?action=play&media=video" >> > -vcodec copy h264_ip_cam_input.avi >> > >> > Was this the wrong way ? >> >> Not necessarily, but it will likely not help showing >> if there is a bug in FFmpeg or not. >> Does wget work? Or is there maybe another program to >> simply dump the network packets? >> >> 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 praks411 at gmail.com Thu Jun 6 17:36:46 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Thu, 6 Jun 2013 08:36:46 -0700 (PDT) Subject: [Libav-user] Saving video using ffmpeg from rtsp link Message-ID: <1370533006732-4657811.post@n4.nabble.com> Hi I'm trying to save video giev rtsp link using ffmpeg. The video copy continues for some time. But after 5mins it fails with unknown. I'm able to save only part of video. Is there any default timeout? My command ffmpeg -i rtsp:://input_video_link outputfile.3gp. Console log: warning, clipping 1 dct coefficients to -127..127.84 bitrate= 82.8kbits/s [h263 @ 00FE9980] warning, clipping 1 dct coefficients to -127..127 Last message repeated 7 times RTP: missed 2 packets=2.0 size= 188kB time=14.40 bitrate= 106.7kbits/s RTP: missed 1 packets=2.0 size= 539kB time=27.20 bitrate= 162.2kbits/s warning, clipping 1 dct coefficients to -127..127.20 bitrate= 163.4kbits/s warning, clipping 1 dct coefficients to -127..127.40 bitrate= 172.3kbits/s [h263 @ 00FE9980] warning, clipping 1 dct coefficients to -127..127 Last message repeated 27 times RTP: missed 1 packets=2.0 size= 978kB time=42.04 bitrate= 190.5kbits/s [mpeg4 @ 00F98B60] ac-tex damaged at 7 6 [mpeg4 @ 00F98B60] Error at MB: 79 [mpeg4 @ 00F98B60] concealing 99 DC, 99 AC, 99 MV errors [h263 @ 00FE9980] warning, clipping 1 dct coefficients to -127..127 warning, clipping 1 dct coefficients to -127..127.56 bitrate= 193.3kbits/s warning, clipping 1 dct coefficients to -127..127.04 bitrate= 197.6kbits/s RTP: missed 1 packets=2.0 size= 1062kB time=43.56 bitrate= 199.8kbits/s RTP: missed 1 packets=2.0 size= 1363kB time=51.96 bitrate= 214.8kbits/s RTP: missed 1 packets=2.0 size= 1493kB time=58.04 bitrate= 210.7kbits/s [NULL @ 00F608E0] RTP: missed 1 packets warning, clipping 1 dct coefficients to -127..127.12 bitrate= 211.9kbits/s [h263 @ 00FE9980] warning, clipping 1 dct coefficients to -127..127 Last message repeated 9 times RTP: missed 1 packets=3.9 size= 2257kB time=78.72 bitrate= 234.9kbits/s RTP: missed 2 packets=2.0 size= 2482kB time=87.96 bitrate= 231.2kbits/s RTP: missed 1 packets=2.6 size= 2868kB time=105.80 bitrate= 222.1kbits/s [NULL @ 00F608E0] RTP: missed 1 packets [mpeg4 @ 00F5E760] RTP: missed 1 packets [mpeg4 @ 00F52960] ac-tex damaged at 4 7 [mpeg4 @ 00F52960] Error at MB: 88 [mpeg4 @ 00F52960] concealing 99 DC, 99 AC, 99 MV errors RTP: missed 1 packets=2.9 size= 3000kB time=109.48 bitrate= 224.5kbits/s frame= 3239 fps= 25 q=13.2 size= 3543kB time=129.56 bitrate= 224.0kbits/s RTP: missed 1 packets=3.7 size= 3733kB time=138.20 bitrate= 221.3kbits/s RTP: missed 1 packets=2.6 size= 3879kB time=145.96 bitrate= 217.7kbits/s RTP: missed 1 packets=2.5 size= 4358kB time=164.48 bitrate= 217.1kbits/s RTP: missed 1 packets=3.1 size= 4456kB time=168.80 bitrate= 216.2kbits/s Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Saving-video-using-ffmpeg-from-rtsp-link-tp4657811.html Sent from the libav-users mailing list archive at Nabble.com. From aw.wisch at googlemail.com Thu Jun 6 18:00:02 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Fri, 7 Jun 2013 00:00:02 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: As i said before, the camera itself is streaming rtsp via http tunnel but i had no problems with this so far. 2013/6/6 Andrey Utkin > 2013/6/6 Alexander Wischnewski : > > wget didnt worked, but i have a small test program to save the stream > > output. > > The saved file gets decoded well with ffmpeg, so it seems it is not a > > decoding issue. > > > > The test program is removing any RTSP / RTP header information, the > camera > > with the working h264 http stream is sending the same RTSP / RTP > headers, i > > dont think this is the cause. Now i am more confused .... > > > > When i recording the raw stream of both cameras on hard disk the only big > > difference is the file size, the stream not working is producing much > more > > data. Is there a way to change the http buffer size for incoming packets > in > > ffmpeg ? > > What i don't understand is why you talk about RTSP and RTP while your > URL is HTTP? > > -- > Andrey Utkin > _______________________________________________ > 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 Jun 7 01:40:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 6 Jun 2013 23:40:52 +0000 (UTC) Subject: [Libav-user] Memory leak reading videos References: Message-ID: Matheus Henrique Klem Galvez writes: > On Tue, Jun 4, 2013 at 11:51 AM, Carl Eugen Hoyos wrote: > Matheus Henrique Klem Galvez ...> writes: > > > The aim is simple: to read uncompressed .avi videos > > > with ffmpeg and send frames to OpenCV format in order > > > that OpenCV might be able to process these frames. > > > > (Unrelated to your problem:) > > You do know that this is possible with ffmpeg > > (the application)? > > What do you mean, Carl? What I meant is that if you just want to send frames to OpenCV that were decoded with ffmpeg, you don't have to write new software, ffmpeg is able to send frames to OpenCV through the opencv video filter. Please do not top-post here, Carl Eugen From hs at tagtraum.com Fri Jun 7 12:28:36 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Fri, 7 Jun 2013 12:28:36 +0200 Subject: [Libav-user] How to tell if a mp3 file was encoded with VBR? In-Reply-To: References: <55E7BA0C-CED4-4662-BE2F-07409AC36E07@tagtraum.com> Message-ID: On Jun 5, 2013, at 8:04 PM, Hendrik Schreiber wrote: > On Jun 5, 2013, at 7:56 PM, Andrey Utkin wrote: >> What about demuxing file to AVPackets, and then analyzing sum of their >> sizes within sliding timestamp window? > > I was hoping for something easier :-) > Also, not having to scan through the entire file, would be preferable. Does that mean, there is no other way, but to actually scan through the file/stream? -hendrik From hs at tagtraum.com Fri Jun 7 12:40:17 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Fri, 7 Jun 2013 12:40:17 +0200 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: References: Message-ID: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> On Jun 4, 2013, at 1:34 PM, Paul B Mahol wrote: > On 6/4/13, Hendrik Schreiber wrote: >> >> 1. (SHIFTING) When decoding, 24bit audio is apparently shifted, i.e. 24bit >> become 32bit, as there is no 24bit AVSampleFormat. Am I right to assume that >> the data is shifted toward the most significant byte? I.e. the most >> significant 3 bytes are the same as the original 24bit? >> Or is the most significant byte simply "sign-extended" and the three least >> significant bytes are the original 24bit? The first statement is true. I did some tests and all libav does it shift the data toward the most significant byte. I.e. the least significant byte is 0. This means, that one has to apply dithering, *if* one wants to use this 4 bytes representation for anything other than extracting the most significant three bytes. If one just wants to dump 3-byte for each 24bit sample, one has to simply cut off that extra byte added before (encoding with, AV_CODEC_ID_PCM_S24LE see below). No dithering necessary. >> >> 2. (SWRESAMPLE) I'm using libswresample to, well, resample data, get rid of >> planar formats etc. It's working great. libswresample also accepts >> AVSampleFormat parameters for input and output format. This implies that it >> does not support any conversion to true 24bit, represented by 3 bytes. >> Correct? Yes. I fiddled with it some more. swresample does not support any true 24bit (i.e. 3byte per sample) output. It works strictly on the intermediate dataformats defined in AVSampleFormat. >> >> 3. (CODEC) What is the recommend way to produce 24bit audio? After decoding >> (and potentially resampling), should I use the corresponding codec (e.g. >> AV_CODEC_ID_PCM_S24LE) to produce the data in the format I'm interested in? >> Or is there another, better way? > > There should be dithering applied, see output_sample_bits option. I guess there is no other way (expect for perhaps filtering). It turns out that to produce 24bit audio in true a 24bit format, one has to use an appropriate encoder, e.g. AV_CODEC_ID_PCM_S24LE for signed 24bit little endian. Dithering is only necessary, when converting the data somewhere in between (e.g. changing the sample rate while it's in 32bit format), as the code in pcm.c (macro ENCODE) simply shifts the 32bit representation by 8bit, essentially just dropping the last 8bits. Since I got the answers to all my questions - I figured, I might as well post them. Hope it's useful to someone else. Cheers, -hendrik From onemda at gmail.com Fri Jun 7 13:12:02 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 7 Jun 2013 11:12:02 +0000 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: On 6/7/13, Hendrik Schreiber wrote: > On Jun 4, 2013, at 1:34 PM, Paul B Mahol wrote: > >> On 6/4/13, Hendrik Schreiber wrote: >>> >>> 1. (SHIFTING) When decoding, 24bit audio is apparently shifted, i.e. >>> 24bit >>> become 32bit, as there is no 24bit AVSampleFormat. Am I right to assume >>> that >>> the data is shifted toward the most significant byte? I.e. the most >>> significant 3 bytes are the same as the original 24bit? >>> Or is the most significant byte simply "sign-extended" and the three >>> least >>> significant bytes are the original 24bit? > > The first statement is true. > > I did some tests and all libav does it shift the data toward the most > significant byte. I.e. the least significant byte is 0. This means, that one > has to apply dithering, *if* one wants to use this 4 bytes representation > for anything other than extracting the most significant three bytes. > > If one just wants to dump 3-byte for each 24bit sample, one has to simply > cut off that extra byte added before (encoding with, AV_CODEC_ID_PCM_S24LE > see below). No dithering necessary. > >>> >>> 2. (SWRESAMPLE) I'm using libswresample to, well, resample data, get rid >>> of >>> planar formats etc. It's working great. libswresample also accepts >>> AVSampleFormat parameters for input and output format. This implies that >>> it >>> does not support any conversion to true 24bit, represented by 3 bytes. >>> Correct? > > Yes. I fiddled with it some more. swresample does not support any true 24bit > (i.e. 3byte per sample) output. It works strictly on the intermediate > dataformats defined in AVSampleFormat. > >>> >>> 3. (CODEC) What is the recommend way to produce 24bit audio? After >>> decoding >>> (and potentially resampling), should I use the corresponding codec (e.g. >>> AV_CODEC_ID_PCM_S24LE) to produce the data in the format I'm interested >>> in? >>> Or is there another, better way? >> >> There should be dithering applied, see output_sample_bits option. > > I guess there is no other way (expect for perhaps filtering). It turns out > that to produce 24bit audio in true a 24bit format, one has to use an > appropriate encoder, e.g. AV_CODEC_ID_PCM_S24LE for signed 24bit little > endian. Note that dithering should be done when doing 32bit to 24bit case and source audio have >24bits used. > > Dithering is only necessary, when converting the data somewhere in between > (e.g. changing the sample rate while it's in 32bit format), as the code in > pcm.c (macro ENCODE) simply shifts the 32bit representation by 8bit, > essentially just dropping the last 8bits. Because last 8bits are always zero for that particular case. > > Since I got the answers to all my questions - I figured, I might as well > post them. Hope it's useful to someone else. > > Cheers, > > -hendrik > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krueger at lesspain.de Fri Jun 7 13:46:31 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 7 Jun 2013 13:46:31 +0200 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: On Fri, Jun 7, 2013 at 12:40 PM, Hendrik Schreiber wrote: > On Jun 4, 2013, at 1:34 PM, Paul B Mahol wrote: > >> On 6/4/13, Hendrik Schreiber wrote: >>> >>> 1. (SHIFTING) When decoding, 24bit audio is apparently shifted, i.e. 24bit >>> become 32bit, as there is no 24bit AVSampleFormat. Am I right to assume that >>> the data is shifted toward the most significant byte? I.e. the most >>> significant 3 bytes are the same as the original 24bit? >>> Or is the most significant byte simply "sign-extended" and the three least >>> significant bytes are the original 24bit? > > The first statement is true. > > I did some tests and all libav does it shift the data toward the most significant byte. I.e. the least significant byte is 0. This means, that one has to apply dithering, *if* one wants to use this 4 bytes representation for anything other than extracting the most significant three bytes. > > If one just wants to dump 3-byte for each 24bit sample, one has to simply cut off that extra byte added before (encoding with, AV_CODEC_ID_PCM_S24LE see below). No dithering necessary. > >>> >>> 2. (SWRESAMPLE) I'm using libswresample to, well, resample data, get rid of >>> planar formats etc. It's working great. libswresample also accepts >>> AVSampleFormat parameters for input and output format. This implies that it >>> does not support any conversion to true 24bit, represented by 3 bytes. >>> Correct? > > Yes. I fiddled with it some more. swresample does not support any true 24bit (i.e. 3byte per sample) output. It works strictly on the intermediate dataformats defined in AVSampleFormat. > >>> >>> 3. (CODEC) What is the recommend way to produce 24bit audio? After decoding >>> (and potentially resampling), should I use the corresponding codec (e.g. >>> AV_CODEC_ID_PCM_S24LE) to produce the data in the format I'm interested in? >>> Or is there another, better way? >> >> There should be dithering applied, see output_sample_bits option. > > I guess there is no other way (expect for perhaps filtering). It turns out that to produce 24bit audio in true a 24bit format, one has to use an appropriate encoder, e.g. AV_CODEC_ID_PCM_S24LE for signed 24bit little endian. > > Dithering is only necessary, when converting the data somewhere in between (e.g. changing the sample rate while it's in 32bit format), as the code in pcm.c (macro ENCODE) simply shifts the 32bit representation by 8bit, essentially just dropping the last 8bits. > > Since I got the answers to all my questions - I figured, I might as well post them. Hope it's useful to someone else. > much appreciated. Thank you! From aw.wisch at googlemail.com Fri Jun 7 15:08:35 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Fri, 7 Jun 2013 21:08:35 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: I uploaded 2 new files, the stream input with header informations of two cameras with the same stream protocol for testing. The file h264_ip_cam_input.working of the first camera gets decoded well with the command: ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4 The file h264_ip_cam_input.nworking produces the errors as posted before. Greetings, Alex 2013/6/6 Carl Eugen Hoyos > Alexander Wischnewski writes: > > > ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video > " > > -vcodec copy h264_ip_cam_input.avi > > > > Was this the wrong way ? > > Not necessarily, but it will likely not help showing > if there is a bug in FFmpeg or not. > Does wget work? Or is there maybe another program to > simply dump the network packets? > > 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 Jun 7 15:07:35 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 7 Jun 2013 13:07:35 +0000 (UTC) Subject: [Libav-user] Saving video using ffmpeg from rtsp link References: <1370533006732-4657811.post@n4.nabble.com> Message-ID: Pradeep Karosiya writes: > ffmpeg -i rtsp:://input_video_link outputfile.3gp. > Console log: Unfortunately not =-( I don't find it completely unlikely that FFmpeg simply fails to save streams coming from unreliable network source (FFmpeg by default refuses to write invalid streams, that is at least how it is supposed to behave) but without a working command line and the complete console output (at least the first 50 and the last 50 lines) it is impossible to help you. Carl Eugen From cehoyos at ag.or.at Fri Jun 7 15:25:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 7 Jun 2013 13:25:49 +0000 (UTC) Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream References: Message-ID: Alexander Wischnewski writes: > The file?h264_ip_cam_input.working of the first > camera gets decoded well with the command: Do I understand correctly that one camera produces a stream that FFmpeg can decode but another one produces a stream that cannot be decoded? Or do I misunderstand? Mostly out of curiosity: How did you produce this file? > ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4 Is "-f h264" needed, ie does auto-detection not work? Please do not top-post here, Carl Eugen From aw.wisch at googlemail.com Fri Jun 7 15:33:21 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Fri, 7 Jun 2013 21:33:21 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: Its not needed but i am always using it for testing. Yes, the chipsets of the cameras are different, the protocol for the stream is the same. Thats at least what the documentation of the manufactor says.The camera with the working stream is an older model, i never had this kind of trouble before. I am using a small C program for fetching the stream and writing the received bytes to a file. Greeting, Alex 2013/6/7 Carl Eugen Hoyos > Alexander Wischnewski writes: > > > The file h264_ip_cam_input.working of the first > > camera gets decoded well with the command: > > Do I understand correctly that one camera produces > a stream that FFmpeg can decode but another one > produces a stream that cannot be decoded? > Or do I misunderstand? > > Mostly out of curiosity: > How did you produce this file? > > > ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4 > > Is "-f h264" needed, ie does auto-detection not work? > > Please do not 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 andrey.krieger.utkin at gmail.com Fri Jun 7 16:03:59 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Fri, 7 Jun 2013 17:03:59 +0300 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: 2013/6/6 Alexander Wischnewski : > As i said before, the camera itself is streaming rtsp via http tunnel but i > had no problems with this so far. Obviously tunneling application looses stream data, and that is actual problem. -- Andrey Utkin From aw.wisch at googlemail.com Fri Jun 7 17:17:22 2013 From: aw.wisch at googlemail.com (Alexander Wischnewski) Date: Fri, 7 Jun 2013 23:17:22 +0800 Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream In-Reply-To: References: Message-ID: 2013/6/7 Andrey Utkin > 2013/6/6 Alexander Wischnewski : > > As i said before, the camera itself is streaming rtsp via http tunnel > but i > > had no problems with this so far. > > Obviously tunneling application looses stream data, and that is actual > problem. > > -- > Andrey Utkin > Thats what i would assume too when tunneled streams generally would not work with ffmpeg, but they do actually. Greetings, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Jun 7 19:58:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 7 Jun 2013 17:58:01 +0000 (UTC) Subject: [Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream References: Message-ID: Alexander Wischnewski writes: > The file?h264_ip_cam_input.nworking produces the > errors as posted before. This does not look like a valid h264 file (afaict), at least the reference decoder refuses to decode it. Carl Eugen From night.rain.whisper at gmail.com Fri Jun 7 20:51:45 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Fri, 7 Jun 2013 22:51:45 +0400 Subject: [Libav-user] Decoding H.264 SPS Message-ID: Hi, I'm trying to implement hardware codec emulation by using libavcodec for doing actual coding. The hardware codec driver roughly operates as follows: 1. Send a command to decode sequence header 2. Get a stream info from the hardware 3. Knowing frame width, height, reference picture count allocate decoded picture buffers 4. Send a command to decode a frame 5. Process a decoded picture and repeat from 4 Now I have a trouble on the first two steps. I try to allocate AVCodecContext and set extradata and extradata_size to pass sequence header received from the driver. Then I call avcodec_open2() to allow the decoder to decode SPS from extradata. avcodec_open() succeeds but AVCodecContext is not updated with SPS info. So I can't provide the driver with necessary width, height and refs info. As I can see from the source code these fields are updated only when processing slice header. But I have nothing but SPS on the first command from the driver. How could I get SPS info on that stage? Thanks in advance! Sergey. From mhkgalvez at gmail.com Sat Jun 8 08:22:14 2013 From: mhkgalvez at gmail.com (Matheus Henrique Klem Galvez) Date: Sat, 8 Jun 2013 02:22:14 -0400 Subject: [Libav-user] Memory leak reading videos In-Reply-To: References: Message-ID: How do I do this? On Thu, Jun 6, 2013 at 7:40 PM, Carl Eugen Hoyos wrote: > Matheus Henrique Klem Galvez writes: > > > On Tue, Jun 4, 2013 at 11:51 AM, Carl Eugen Hoyos wrote: > > Matheus Henrique Klem Galvez ...> writes: > > > > The aim is simple: to read uncompressed .avi videos > > > > with ffmpeg and send frames to OpenCV format in order > > > > that OpenCV might be able to process these frames. > > > > > > (Unrelated to your problem:) > > > You do know that this is possible with ffmpeg > > > (the application)? > > > > What do you mean, Carl? > > What I meant is that if you just want to send frames > to OpenCV that were decoded with ffmpeg, you don't > have to write new software, ffmpeg is able to send > frames to OpenCV through the opencv video filter. > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- -- Matheus Henrique Klem Galvez The Catholic University of America, Washington, DC Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat Jun 8 12:10:03 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 8 Jun 2013 10:10:03 +0000 (UTC) Subject: [Libav-user] Memory leak reading videos References: Message-ID: Matheus Henrique Klem Galvez writes: > How do I do this? Please read the fine documentation: http://ffmpeg.org/ffmpeg-all.html#ocv Please stop top-posting, it is considered rude here! Carl Eugen From vkarthik at entrayn.com Sat Jun 8 16:37:17 2013 From: vkarthik at entrayn.com (Karthik Viswanathan) Date: Sat, 8 Jun 2013 20:07:17 +0530 Subject: [Libav-user] Provided packet is too small, needs to be x In-Reply-To: References: Message-ID: Any help would be appreciated. Thanks Karthik On 6 June 2013 15:51, Karthik Viswanathan wrote: > Hello, > > I got the ffmpeg builds from zeranoe[20130601-git-716dbc7] & used gcc > 4.8.0 on windows to compile. > > I am trying to convert a h264 video to webm. The output video is empty > and the console is filled with 'Provided packet is too small, needs to > be 612'. > > ////////////////////// the decoder: > > pFormatCtxIn = avformat_alloc_context(); > > ret = avformat_open_input(&pFormatCtxIn, "bump.mp4", NULL, NULL); > > if(avformat_find_stream_info(pFormatCtxIn,NULL)<0) > return -1; > > video_stream_idx = -1; > for(i=0; inb_streams; i++){ > if(pFormatCtxIn->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) > { > video_stream_idx=i; > } > } > > if(video_stream_idx==-1) > return -1; > > pCodecCtxIn = pFormatCtxIn->streams[video_stream_idx]->codec; > > pCodecIn = avcodec_find_decoder(pCodecCtxIn->codec_id); > > avcodec_open2(pCodecCtxIn,pCodecIn, NULL); > > if(pCodecCtxIn->time_base.num>1000 && pCodecCtxIn->time_base.den==1) > pCodecCtxIn->time_base.den=1000; > > /////////////////// the encoder: > > pOfmtOut = av_guess_format(NULL, filename,NULL); > > pFormatCtxOut = avformat_alloc_context(); > > pOfmtOut->video_codec = AV_CODEC_ID_VP8; > > pFormatCtxOut->oformat = pOfmtOut; > > snprintf(pFormatCtxOut->filename,sizeof(pFormatCtxOut->filename),"%s",filename); > > strmVdoOut = avformat_new_stream(pFormatCtxOut,NULL); > > pCodecCtxOut = strmVdoOut->codec; > > pCodecCtxOut->codec_id = pOfmtOut->video_codec; > pCodecCtxOut->codec_type = AVMEDIA_TYPE_VIDEO; > > pCodecCtxOut->bit_rate = 4000; /* open it */ > pCodecCtxOut->pix_fmt = AV_PIX_FMT_YUV420P; > pCodecCtxOut->width = 1360; > pCodecCtxOut->height = 760; > pCodecCtxOut->time_base= (AVRational){1,30}; > > if(pFormatCtxOut->oformat->flags & AVFMT_GLOBALHEADER) > pCodecCtxOut->flags |= CODEC_FLAG_GLOBAL_HEADER; > > pCodecOut = avcodec_find_encoder(pCodecCtxOut->codec_id); > > avcodec_open2(pCodecCtxOut, pCodecOut,NULL); > > avio_open(&pFormatCtxOut->pb, filename, AVIO_FLAG_WRITE); > > ret = avformat_write_header(pFormatCtxOut, NULL); > > /////////////////// frame allocation > > frame = avcodec_alloc_frame(); > > frame->format = pCodecCtxOut->pix_fmt; > frame->width = pCodecCtxOut->width; > frame->height = pCodecCtxOut->height; > > ret = av_image_alloc(frame->data, frame->linesize, > pCodecCtxOut->width, pCodecCtxOut->height,pCodecCtxOut->pix_fmt, 32); > > //////////////////// the transcoding > > i = 0; > while(++i) { > av_init_packet(&packet); > > ret = av_read_frame(pFormatCtxIn,&packet); > if(ret < 0){ > fprintf(stderr,"Error reading frame\n"); > break; > } > > if(packet.stream_index == video_stream_idx){ > > ret = avcodec_decode_video2(pCodecCtxIn,frame,&got_output,&packet); > > if (got_output) { > > frame->pts=i; > > ret = avcodec_encode_video2(pCodecCtxOut, &packet, frame, &got_output); > > if (got_output) { > > if (pCodecCtxOut->coded_frame->pts != (0x8000000000000000LL)) > packet.pts = av_rescale_q(pCodecCtxOut->coded_frame->pts, > pCodecCtxOut->time_base, strmVdoOut->time_base); > > if(pCodecCtxOut->coded_frame->key_frame) > packet.flags |= AV_PKT_FLAG_KEY; > > if(av_interleaved_write_frame(pFormatCtxOut,&packet) < 0){ > fprintf(stderr,"error writing frame"); > exit(1); > } > } > } > } > av_free_packet(&packet); > } > > The full code is available here: https://www.dropbox.com/s/agltcde1o1mej7h/try.c -- - Karthik From itwasntpete at ist-einmalig.de Sat Jun 8 18:06:20 2013 From: itwasntpete at ist-einmalig.de (itwasntpete at ist-einmalig.de) Date: Sat, 8 Jun 2013 18:06:20 +0200 (CEST) Subject: [Libav-user] segmetation fault while avcodec_encode_video2 Message-ID: An HTML attachment was scrubbed... URL: From battistel at gmail.com Sat Jun 8 19:19:39 2013 From: battistel at gmail.com (Massimo Battistel) Date: Sat, 8 Jun 2013 19:19:39 +0200 Subject: [Libav-user] (no subject) Message-ID: hello, I would like to know if there are some code samples and/or tutorials for programmatically output streaming (mpeg-ts over udp) using libavformat/avcodec. I can't find anything on ffmpeg web site. thanks, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Sat Jun 8 19:33:03 2013 From: kalileo at universalx.net (Kalileo) Date: Sun, 9 Jun 2013 00:33:03 +0700 Subject: [Libav-user] programmatically output streaming (mpeg-ts over udp) In-Reply-To: References: Message-ID: On Jun 9, 2013, at 00:19 , Massimo Battistel wrote: > hello, > I would like to know if there are some code samples and/or tutorials for programmatically output streaming (mpeg-ts over udp) using libavformat/avcodec. > I can't find anything on ffmpeg web site. Nothing special needed, because it's not different then writing to a file, select mpegts as muxer and your target udp url as filename. From andrey.krieger.utkin at gmail.com Sat Jun 8 19:34:32 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sat, 8 Jun 2013 20:34:32 +0300 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: 2013/6/8 Massimo Battistel : > hello, > I would like to know if there are some code samples and/or tutorials for > programmatically output streaming (mpeg-ts over udp) using > libavformat/avcodec. > I can't find anything on ffmpeg web site. An example of muxing. http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=7305cc6284a0e04aaddd3d79a0bc830b9dd53256;hb=HEAD Also read installed header files, they explain API usage. -- Andrey Utkin From battistel at gmail.com Sat Jun 8 19:48:17 2013 From: battistel at gmail.com (Massimo Battistel) Date: Sat, 8 Jun 2013 19:48:17 +0200 Subject: [Libav-user] programmatically output streaming (mpeg-ts over udp) In-Reply-To: References: Message-ID: ok, I started from mux sample here: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=7305cc6284a0e04aaddd3d79a0bc830b9dd53256;hb=HEAD I made these changes: 1. I forced mpegts as muxer 2. I set output file as udp://ipaddr:port 3. The while cicle that writes packets runs forever (it never checks if pts >= STREAM_DURATION). I test stream with: ffplay udp://ipaddr:port I can hear audio but no video (I can only see first frame), plus cpu is too high (> 65%) Do I have to control the speed at which I output packets? How? If adding Sleep(x) in the while cicle, it goes well for the first 10 seconds, then video starts loosing frames and audio becomes choppy. thanks 2013/6/8 Kalileo > > On Jun 9, 2013, at 00:19 , Massimo Battistel wrote: > > > hello, > > I would like to know if there are some code samples and/or tutorials for > programmatically output streaming (mpeg-ts over udp) using > libavformat/avcodec. > > I can't find anything on ffmpeg web site. > > Nothing special needed, because it's not different then writing to a file, > select mpegts as muxer and your target udp url as filename. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Massimo Battistel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Sat Jun 8 21:41:28 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Sat, 08 Jun 2013 12:41:28 -0700 Subject: [Libav-user] simple AVC format issue? Message-ID: <51B388E8.3030304@gmail.com> Hello, First time poster, long wrapper user. Ive used various avcodec wrappers and this is the first time Im using it directly. Im facing a rendering issue that I am assuming is just a rookie move. Pretty easy set up I have here. Let me describe a little context. Im pushing encoder output from a host to android's MediaCodec object in I think 'jelly bean' api level 16. So far I have used the x264 VFW interface directly with IC_Open and had successful rendering. Next I tried using the cuda C library, and passed the raw output to the android consumer and also had successful rendering. So now, Im trying lib avcodec using zeranoe's precompiled windows 32-bit builds, and Im not having successful rendering. If I write the output to disk as a .264 file and invoke ffmpeg , there seems to not be any issues with the content. My outputframes look good. My question is, what step, setting, or preparation am I missing with the AVCodec? DO I need to manually encapsulate the private data ahead of each key frame? Is there a setting that forces the same output that the VFW and cuda provide, I believe is annex-b? Is there any core issues such as endianess im over looking? Mucho thanks in advance! Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at hotmail.com Sat Jun 8 21:37:32 2013 From: bowljoman at hotmail.com (Andy Shaules) Date: Sat, 8 Jun 2013 12:37:32 -0700 Subject: [Libav-user] simple format trouble using avc ? Message-ID: Hello, First time poster, long wrapper user. Ive used various avcodec wrappers and this is the first time Im using it directly. Im facing a rendering issue that I am assuming is just a rookie move. Pretty easy set up I have here. Let me describe a little context. Im pushing encoder output from a host to android's MediaCodec object in I think 'jelly bean' api level 16. So far I have used the x264 VFW interface directly with IC_Open and had successful rendering. Next I tried using the cuda C library, and passed the raw output to the android consumer and also had successful rendering. So now, Im trying lib avcodec using zeranoe's precompiled windows 32-bit builds, and Im not having successful rendering. If I write the output to disk as a .264 file and invoke ffmpeg , there seems to not be any issues with the content. My outputframes look good. My question is, what step, setting, or preparation am I missing with the AVCodec? DO I need to manually encapsulate the private data ahead of each key frame? Is there a setting that forces the same output that the VFW and cuda provide, I believe is annex-b? Is there any core issues such as endianess im over looking? Mucho thanks in advance! Andy From bowljoman at gmail.com Sun Jun 9 08:25:05 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Sat, 08 Jun 2013 23:25:05 -0700 Subject: [Libav-user] simple format trouble using avc ? In-Reply-To: References: Message-ID: <51B41FC1.7050800@gmail.com> I think Im on to something here.. context->flags |= CODEC_FLAG_GLOBAL_HEADER; and use extra_data rather than private data. hrrmm Trying again :) Andy On 6/8/2013 12:37 PM, Andy Shaules wrote: > Hello, First time poster, long wrapper user. > > Ive used various avcodec wrappers and this is the first time Im using > it directly. > > Im facing a rendering issue that I am assuming is just a rookie move. > > Pretty easy set up I have here. Let me describe a little context. > > Im pushing encoder output from a host to android's MediaCodec object > in I think 'jelly bean' api level 16. So far I have used the x264 VFW > interface directly with IC_Open and had successful rendering. Next I > tried using the cuda C library, and passed the raw output to the > android consumer and also had successful rendering. > > So now, Im trying lib avcodec using zeranoe's precompiled windows > 32-bit builds, and Im not having successful rendering. If I write the > output to disk as a .264 file and invoke ffmpeg , there seems to not > be any issues with the content. My outputframes look good. > > My question is, what step, setting, or preparation am I missing with > the AVCodec? DO I need to manually encapsulate the private data ahead > of each key frame? Is there a setting that forces the same output that > the VFW and cuda provide, I believe is annex-b? > > Is there any core issues such as endianess im over looking? > > Mucho thanks in advance! > > Andy > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From battistel at gmail.com Sun Jun 9 19:19:27 2013 From: battistel at gmail.com (Massimo Battistel) Date: Sun, 9 Jun 2013 19:19:27 +0200 Subject: [Libav-user] programmatically output streaming (mpeg-ts over udp) In-Reply-To: References: Message-ID: I've finally made it work. I had to limit the speed at which I output packets and made a little change in "get_audio_frame". I have some questions: 1. How can I control packet output queue? Can I set its length? 2. Can someone tell me the point in ffmpeg source where the "-re" parameter logic is implemented? thanks a lot 2013/6/8 Massimo Battistel > ok, I started from mux sample here: > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=7305cc6284a0e04aaddd3d79a0bc830b9dd53256;hb=HEAD > > I made these changes: > 1. I forced mpegts as muxer > 2. I set output file as udp://ipaddr:port > 3. The while cicle that writes packets runs forever (it never checks if > pts >= STREAM_DURATION). > > I test stream with: ffplay udp://ipaddr:port > > I can hear audio but no video (I can only see first frame), plus cpu is > too high (> 65%) > > Do I have to control the speed at which I output packets? How? If adding > Sleep(x) in the while cicle, it goes well for the first 10 seconds, then > video starts loosing frames and audio becomes choppy. > > thanks > > > > 2013/6/8 Kalileo > >> >> On Jun 9, 2013, at 00:19 , Massimo Battistel wrote: >> >> > hello, >> > I would like to know if there are some code samples and/or tutorials >> for programmatically output streaming (mpeg-ts over udp) using >> libavformat/avcodec. >> > I can't find anything on ffmpeg web site. >> >> Nothing special needed, because it's not different then writing to a >> file, select mpegts as muxer and your target udp url as filename. >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > > > -- > Massimo Battistel. > -- Massimo Battistel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From boys21century at gmail.com Mon Jun 10 15:32:32 2013 From: boys21century at gmail.com (Ramu Chakravadhanula) Date: Mon, 10 Jun 2013 19:02:32 +0530 Subject: [Libav-user] generate encoded video file from .png files Message-ID: Hi, I have a series of png files and would like to encode them to a video file. most of the examples cover encoding a raw video file. However, I couldnt find one that covers using existing still images (especially PNG). Attached is the sample code that i found. can someone help me ? Thanks and Regards, Boys21. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vencoder.c Type: text/x-csrc Size: 4243 bytes Desc: not available URL: From faraz at screenhero.com Mon Jun 10 23:36:18 2013 From: faraz at screenhero.com (Faraz Khan) Date: Mon, 10 Jun 2013 14:36:18 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs Message-ID: Hi all, I'm trying to use ffmpeg as a decoder for a real-time x264 stream that I'm generating. It works fine if I try to decode entire frames, but if I try to decode a single NALU the decoder errors out saying 'no frame'. I've tried using the parser (av_parser_parse2) but the h264 decoder doesnt seem to like that output either. I'm using x264 with annex-b and repeat-headers on. The encoder config is as follows: x264params.b_sliced_threads = 1; x264params.i_slice_max_size = 1350; x264params.i_width = yuvSize.width; x264params.i_height = yuvSize.height; x264params.i_fps_num = 10; x264params.i_fps_den = 1; x264params.b_vfr_input = 0; x264params.rc.i_bitrate = 1500; // Intra refres: x264params.i_keyint_max = 50000000; x264params.b_intra_refresh = 1; //Rate control: x264params.rc.i_rc_method = X264_RC_ABR; x264params.rc.i_vbv_buffer_size = 300; x264params.rc.i_vbv_max_bitrate = 1500; //For streaming: x264params.b_repeat_headers = 1; x264params.b_annexb = 1; x264_param_apply_profile(&x264params, "baseline"); I do the encode with: int frame_size = x264_encoder_encode(x264Encoder, &nals, &i_nals, & pic_in, &pic_out); Now, since the max slice size is 1350, each packet output is a udp packet of size < MTU (this is true) and sent across the network. I iterate over the nals[i].p_payload and send them over to the ffmpeg side for decoding. I receive the correct packet on the remote side. If I assemble ALL the NALUs that were output in this frame and feed it directly to the decoder (even without the parser), it works fine! If I feed one NALU at a time, it fails (event with the parse). I'm sending it to the parser like: int plen = av_parser_parse2(codecParser, decoderContext, &outbuf, &outside, indata,inlength,0,0,0); plen always reports that it consumed the entire NALU that I gave it - after consuming a few NALUs, the outsize and outbuf are set to some value. Feeding it into the decoder using: int len = avcodec_decode_video2(decoderContext,decoderOutframe, &gotpic,&avpkt); Results in it saying 'No frame'. Again, if avpkt.data contains the entire frame (all NALUs concatenated) it will work! I'm obviously doing some obviously wrong - but I really cant figure out why it wont decode a single NALU. Or is this a limitation in ffmpeg? Thanks Guys! -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Mon Jun 10 23:40:49 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Mon, 10 Jun 2013 14:40:49 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: <51B647E1.3010007@gmail.com> I always had to decode from the latest key frame up to the desired stream time nal, On 6/10/2013 2:36 PM, Faraz Khan wrote: > Hi all, > I'm trying to use ffmpeg as a decoder for a real-time x264 stream that > I'm generating. It works fine if I try to decode entire frames, but if > I try to decode a single NALU the decoder errors out saying 'no > frame'. I've tried using the parser (av_parser_parse2) but the h264 > decoder doesnt seem to like that output either. I'm using x264 with > annex-b and repeat-headers on. > > The encoder config is as follows: > > x264params.b_sliced_threads = 1; > x264params.i_slice_max_size = 1350; > x264params.i_width = yuvSize.width; > x264params.i_height = yuvSize.height; > x264params.i_fps_num = 10; > x264params.i_fps_den = 1; > x264params.b_vfr_input = 0; > x264params.rc.i_bitrate = 1500; > > // Intra refres: > x264params.i_keyint_max = 50000000; > x264params.b_intra_refresh = 1; > > //Rate control: > > x264params.rc.i_rc_method = X264_RC_ABR; > x264params.rc.i_vbv_buffer_size = 300; > x264params.rc.i_vbv_max_bitrate = 1500; > > //For streaming: > x264params.b_repeat_headers = 1; > x264params.b_annexb = 1; > > x264_param_apply_profile(&x264params, "baseline"); > > > > I do the encode with: > > int frame_size = x264_encoder_encode(x264Encoder, &nals, &i_nals, > &pic_in, &pic_out); > > > Now, since the max slice size is 1350, each packet output is a udp > packet of size < MTU (this is true) and sent across the network. > > I iterate over the nals[i].p_payload and send them over to the ffmpeg > side for decoding. I receive the correct packet on the remote side. > > If I assemble ALL the NALUs that were output in this frame and feed it > directly to the decoder (even without the parser), it works fine! If I > feed one NALU at a time, it fails (event with the parse). I'm sending > it to the parser like: > > > int plen = av_parser_parse2(codecParser, decoderContext, &outbuf, > &outside, indata,inlength,0,0,0); > > > plen always reports that it consumed the entire NALU that I gave it - > after consuming a few NALUs, the outsize and outbuf are set to some > value. Feeding it into the decoder using: > > > int len = avcodec_decode_video2(decoderContext,decoderOutframe, > &gotpic,&avpkt); > > > Results in it saying 'No frame'. Again, if avpkt.data contains the > entire frame (all NALUs concatenated) it will work! > > > I'm obviously doing some obviously wrong - but I really cant figure > out why it wont decode a single NALU. Or is this a limitation in ffmpeg? > > > Thanks Guys! > > > > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > > > _______________________________________________ > 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 faraz at screenhero.com Mon Jun 10 23:57:36 2013 From: faraz at screenhero.com (Faraz Khan) Date: Mon, 10 Jun 2013 14:57:36 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: <51B647E1.3010007@gmail.com> References: <51B647E1.3010007@gmail.com> Message-ID: So the keyframe cannot be fed to the decoder one nal at a time? Is that what you are suggesting? On Mon, Jun 10, 2013 at 2:40 PM, Andy Shaules wrote: > I always had to decode from the latest key frame up to the desired > stream time nal, > > > On 6/10/2013 2:36 PM, Faraz Khan wrote: > > Hi all, > I'm trying to use ffmpeg as a decoder for a real-time x264 stream that I'm > generating. It works fine if I try to decode entire frames, but if I try to > decode a single NALU the decoder errors out saying 'no frame'. I've tried > using the parser (av_parser_parse2) but the h264 decoder doesnt seem to > like that output either. I'm using x264 with annex-b and repeat-headers on. > > The encoder config is as follows: > > x264params.b_sliced_threads = 1; > x264params.i_slice_max_size = 1350; > x264params.i_width = yuvSize.width; > x264params.i_height = yuvSize.height; > x264params.i_fps_num = 10; > x264params.i_fps_den = 1; > x264params.b_vfr_input = 0; > x264params.rc.i_bitrate = 1500; > > // Intra refres: > x264params.i_keyint_max = 50000000; > x264params.b_intra_refresh = 1; > > //Rate control: > > x264params.rc.i_rc_method = X264_RC_ABR; > x264params.rc.i_vbv_buffer_size = 300; > x264params.rc.i_vbv_max_bitrate = 1500; > > //For streaming: > x264params.b_repeat_headers = 1; > x264params.b_annexb = 1; > > x264_param_apply_profile(&x264params, "baseline"); > > > > I do the encode with: > > int frame_size = x264_encoder_encode(x264Encoder, &nals, &i_nals, & > pic_in, &pic_out); > > > Now, since the max slice size is 1350, each packet output is a udp > packet of size < MTU (this is true) and sent across the network. > > I iterate over the nals[i].p_payload and send them over to the ffmpeg side > for decoding. I receive the correct packet on the remote side. > > If I assemble ALL the NALUs that were output in this frame and feed it > directly to the decoder (even without the parser), it works fine! If I feed > one NALU at a time, it fails (event with the parse). I'm sending it to the > parser like: > > > int plen = av_parser_parse2(codecParser, decoderContext, &outbuf, > &outside, indata,inlength,0,0,0); > > > plen always reports that it consumed the entire NALU that I gave it - > after consuming a few NALUs, the outsize and outbuf are set to some value. > Feeding it into the decoder using: > > > int len = avcodec_decode_video2(decoderContext,decoderOutframe, > &gotpic,&avpkt); > > > Results in it saying 'No frame'. Again, if avpkt.data contains the > entire frame (all NALUs concatenated) it will work! > > > I'm obviously doing some obviously wrong - but I really cant figure out > why it wont decode a single NALU. Or is this a limitation in ffmpeg? > > > Thanks Guys! > > > > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > > > _______________________________________________ > Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From faraz at screenhero.com Tue Jun 11 00:43:28 2013 From: faraz at screenhero.com (Faraz Khan) Date: Mon, 10 Jun 2013 15:43:28 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: <51B647E1.3010007@gmail.com> Message-ID: So I got the decoder to work with the parser! It was a bug on my end - However it still seems that the parser waits for the entire frame to complete and then sets an outsize? Is this intentional? Is it possible to decode a single NALU? On Mon, Jun 10, 2013 at 2:57 PM, Faraz Khan wrote: > So the keyframe cannot be fed to the decoder one nal at a time? Is that > what you are suggesting? > > > > > On Mon, Jun 10, 2013 at 2:40 PM, Andy Shaules wrote: > >> I always had to decode from the latest key frame up to the desired >> stream time nal, >> >> >> On 6/10/2013 2:36 PM, Faraz Khan wrote: >> >> Hi all, >> I'm trying to use ffmpeg as a decoder for a real-time x264 stream that >> I'm generating. It works fine if I try to decode entire frames, but if I >> try to decode a single NALU the decoder errors out saying 'no frame'. I've >> tried using the parser (av_parser_parse2) but the h264 decoder doesnt seem >> to like that output either. I'm using x264 with annex-b and repeat-headers >> on. >> >> The encoder config is as follows: >> >> x264params.b_sliced_threads = 1; >> x264params.i_slice_max_size = 1350; >> x264params.i_width = yuvSize.width; >> x264params.i_height = yuvSize.height; >> x264params.i_fps_num = 10; >> x264params.i_fps_den = 1; >> x264params.b_vfr_input = 0; >> x264params.rc.i_bitrate = 1500; >> >> // Intra refres: >> x264params.i_keyint_max = 50000000; >> x264params.b_intra_refresh = 1; >> >> //Rate control: >> >> x264params.rc.i_rc_method = X264_RC_ABR; >> x264params.rc.i_vbv_buffer_size = 300; >> x264params.rc.i_vbv_max_bitrate = 1500; >> >> //For streaming: >> x264params.b_repeat_headers = 1; >> x264params.b_annexb = 1; >> >> x264_param_apply_profile(&x264params, "baseline"); >> >> >> >> I do the encode with: >> >> int frame_size = x264_encoder_encode(x264Encoder, &nals, &i_nals, & >> pic_in, &pic_out); >> >> >> Now, since the max slice size is 1350, each packet output is a udp >> packet of size < MTU (this is true) and sent across the network. >> >> I iterate over the nals[i].p_payload and send them over to the ffmpeg >> side for decoding. I receive the correct packet on the remote side. >> >> If I assemble ALL the NALUs that were output in this frame and feed it >> directly to the decoder (even without the parser), it works fine! If I feed >> one NALU at a time, it fails (event with the parse). I'm sending it to the >> parser like: >> >> >> int plen = av_parser_parse2(codecParser, decoderContext, &outbuf, >> &outside, indata,inlength,0,0,0); >> >> >> plen always reports that it consumed the entire NALU that I gave it - >> after consuming a few NALUs, the outsize and outbuf are set to some value. >> Feeding it into the decoder using: >> >> >> int len = avcodec_decode_video2(decoderContext,decoderOutframe, >> &gotpic,&avpkt); >> >> >> Results in it saying 'No frame'. Again, if avpkt.data contains the >> entire frame (all NALUs concatenated) it will work! >> >> >> I'm obviously doing some obviously wrong - but I really cant figure out >> why it wont decode a single NALU. Or is this a limitation in ffmpeg? >> >> >> Thanks Guys! >> >> >> >> >> -- >> Faraz Khan >> Simple Collaboration Screensharing >> www.screenhero.com >> >> >> _______________________________________________ >> Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From faraz at screenhero.com Tue Jun 11 01:27:06 2013 From: faraz at screenhero.com (Faraz Khan) Date: Mon, 10 Jun 2013 16:27:06 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: <51B647E1.3010007@gmail.com> Message-ID: Also - av_parser_parse2 doesnt seem to like out of order NAL packets - is this also a known issue? On Mon, Jun 10, 2013 at 3:43 PM, Faraz Khan wrote: > So I got the decoder to work with the parser! It was a bug on my end - > However it still seems that the parser waits for the entire frame to > complete and then sets an outsize? Is this intentional? Is it possible to > decode a single NALU? > > > > On Mon, Jun 10, 2013 at 2:57 PM, Faraz Khan wrote: > >> So the keyframe cannot be fed to the decoder one nal at a time? Is that >> what you are suggesting? >> >> >> >> >> On Mon, Jun 10, 2013 at 2:40 PM, Andy Shaules wrote: >> >>> I always had to decode from the latest key frame up to the desired >>> stream time nal, >>> >>> >>> On 6/10/2013 2:36 PM, Faraz Khan wrote: >>> >>> Hi all, >>> I'm trying to use ffmpeg as a decoder for a real-time x264 stream that >>> I'm generating. It works fine if I try to decode entire frames, but if I >>> try to decode a single NALU the decoder errors out saying 'no frame'. I've >>> tried using the parser (av_parser_parse2) but the h264 decoder doesnt seem >>> to like that output either. I'm using x264 with annex-b and repeat-headers >>> on. >>> >>> The encoder config is as follows: >>> >>> x264params.b_sliced_threads = 1; >>> x264params.i_slice_max_size = 1350; >>> x264params.i_width = yuvSize.width; >>> x264params.i_height = yuvSize.height; >>> x264params.i_fps_num = 10; >>> x264params.i_fps_den = 1; >>> x264params.b_vfr_input = 0; >>> x264params.rc.i_bitrate = 1500; >>> >>> // Intra refres: >>> x264params.i_keyint_max = 50000000; >>> x264params.b_intra_refresh = 1; >>> >>> //Rate control: >>> >>> x264params.rc.i_rc_method = X264_RC_ABR; >>> x264params.rc.i_vbv_buffer_size = 300; >>> x264params.rc.i_vbv_max_bitrate = 1500; >>> >>> //For streaming: >>> x264params.b_repeat_headers = 1; >>> x264params.b_annexb = 1; >>> >>> x264_param_apply_profile(&x264params, "baseline"); >>> >>> >>> >>> I do the encode with: >>> >>> int frame_size = x264_encoder_encode(x264Encoder, &nals, &i_nals, & >>> pic_in, &pic_out); >>> >>> >>> Now, since the max slice size is 1350, each packet output is a udp >>> packet of size < MTU (this is true) and sent across the network. >>> >>> I iterate over the nals[i].p_payload and send them over to the ffmpeg >>> side for decoding. I receive the correct packet on the remote side. >>> >>> If I assemble ALL the NALUs that were output in this frame and feed it >>> directly to the decoder (even without the parser), it works fine! If I feed >>> one NALU at a time, it fails (event with the parse). I'm sending it to the >>> parser like: >>> >>> >>> int plen = av_parser_parse2(codecParser, decoderContext, &outbuf, >>> &outside, indata,inlength,0,0,0); >>> >>> >>> plen always reports that it consumed the entire NALU that I gave it - >>> after consuming a few NALUs, the outsize and outbuf are set to some value. >>> Feeding it into the decoder using: >>> >>> >>> int len = avcodec_decode_video2(decoderContext,decoderOutframe, >>> &gotpic,&avpkt); >>> >>> >>> Results in it saying 'No frame'. Again, if avpkt.data contains the >>> entire frame (all NALUs concatenated) it will work! >>> >>> >>> I'm obviously doing some obviously wrong - but I really cant figure >>> out why it wont decode a single NALU. Or is this a limitation in ffmpeg? >>> >>> >>> Thanks Guys! >>> >>> >>> >>> >>> -- >>> Faraz Khan >>> Simple Collaboration Screensharing >>> www.screenhero.com >>> >>> >>> _______________________________________________ >>> Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> >> -- >> >> -- >> Faraz Khan >> Simple Collaboration Screensharing >> www.screenhero.com >> > > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhanndt_87 at yahoo.com Tue Jun 11 03:17:16 2013 From: nhanndt_87 at yahoo.com (thanh nhan thanh nhan) Date: Mon, 10 Jun 2013 18:17:16 -0700 (PDT) Subject: [Libav-user] Getting Video Information Message-ID: <1370913436.53568.YahooMailNeo@web121704.mail.ne1.yahoo.com> Hi everyone, I am developing an video app using ffmpeg libs.?After open video file by using avformat_open_input() function, i try to get the video information such as: total number of frames, frame rate.. But there is no such field in AVcodeccontext, AVStream, AVformatcontext... I hopely get advices from all of you guys. Thank you! From night.rain.whisper at gmail.com Tue Jun 11 05:30:29 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Tue, 11 Jun 2013 07:30:29 +0400 Subject: [Libav-user] Getting Video Information In-Reply-To: <1370913436.53568.YahooMailNeo@web121704.mail.ne1.yahoo.com> References: <1370913436.53568.YahooMailNeo@web121704.mail.ne1.yahoo.com> Message-ID: Hi, Try to use avformat_find_stream_info() . 2013/6/11 thanh nhan thanh nhan > Hi everyone, > I am developing an video app using ffmpeg libs. After open video file by > using avformat_open_input() function, i try to get the video information > such as: total number of frames, frame rate.. > But there is no such field in AVcodeccontext, AVStream, AVformatcontext... > I hopely get advices from all of you guys. Thank you! > _______________________________________________ > 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 night.rain.whisper at gmail.com Tue Jun 11 05:40:21 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Tue, 11 Jun 2013 07:40:21 +0400 Subject: [Libav-user] generate encoded video file from .png files In-Reply-To: References: Message-ID: Hi, I think you should first decode raw image data from PNG file. There is AV_CODEC_ID_PNG in libavcodec. 2013/6/10 Ramu Chakravadhanula > Hi, > > I have a series of png files and would like to encode them to a video > file. most of the examples cover encoding a raw video file. However, I > couldnt find one that covers using existing still images (especially PNG). > Attached is the sample code that i found. can someone help me ? > > Thanks and Regards, > Boys21. > > > > > _______________________________________________ > 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 boys21century at gmail.com Tue Jun 11 07:15:09 2013 From: boys21century at gmail.com (Ramu Chakravadhanula) Date: Tue, 11 Jun 2013 10:45:09 +0530 Subject: [Libav-user] generate encoded video file from .png files In-Reply-To: References: Message-ID: okay. 1. decode the png using ac_codec_id_png 2. give this raw information to encoder. is it like this? /Boys21 On 11 June 2013 09:10, Sergey Fedorov wrote: > Hi, > I think you should first decode raw image data from PNG file. There is > AV_CODEC_ID_PNG in libavcodec. > > > 2013/6/10 Ramu Chakravadhanula > >> Hi, >> >> I have a series of png files and would like to encode them to a video >> file. most of the examples cover encoding a raw video file. However, I >> couldnt find one that covers using existing still images (especially PNG). >> Attached is the sample code that i found. can someone help me ? >> >> Thanks and Regards, >> Boys21. >> >> >> >> >> _______________________________________________ >> 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 hs at tagtraum.com Tue Jun 11 10:50:07 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 11 Jun 2013 10:50:07 +0200 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: > > Note that dithering should be done when doing 32bit to 24bit case > and source audio have >24bits used. Yes - definitely. > >> >> Dithering is only necessary, when converting the data somewhere in between >> (e.g. changing the sample rate while it's in 32bit format), as the code in >> pcm.c (macro ENCODE) simply shifts the 32bit representation by 8bit, >> essentially just dropping the last 8bits. > > Because last 8bits are always zero for that particular case. Exactly. Thanks, Paul, for adding the extra clarifications for the more general case. I saw that you added some more documentation for output_sample_bits (http://patches.libav.org/patch/38964/). Unfortunately, I'm still not entirely sure how to use the parameter - a simple example would be great. Let's say I want to convert 32bit audio to 24bit. The input AVSampleFormat is AV_SAMPLE_FMT_S32, the output sample format as well. But, when writing the result to a file, I want to use AV_CODEC_ID_PCM_S24LE, i.e. the least significant byte is cut off. Therefore, for SWR, I'm calling: av_opt_set_int(swr_context, "dither_method", SWR_DITHER_TRIANGULAR, 0); av_opt_set_int(swr_context, "output_sample_bits", ???, 0); What should I set ??? to? 24, since I'm only using 24bit? Thanks, -hendrik From cehoyos at ag.or.at Tue Jun 11 11:31:30 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Jun 2013 09:31:30 +0000 (UTC) Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: Hendrik Schreiber writes: > But, when writing the result to a file, I want to use > AV_CODEC_ID_PCM_S24LE, i.e. the least significant > byte is cut off. AV_CODEC_ID_PCM_S24LE encoder only accepts AV_SAMPLE_FMT_S32 as input. Carl Eugen From hs at tagtraum.com Tue Jun 11 11:40:41 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 11 Jun 2013 11:40:41 +0200 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: On Jun 11, 2013, at 11:31 AM, Carl Eugen Hoyos wrote: > Hendrik Schreiber writes: > >> But, when writing the result to a file, I want to use >> AV_CODEC_ID_PCM_S24LE, i.e. the least significant >> byte is cut off. > > AV_CODEC_ID_PCM_S24LE encoder only accepts > AV_SAMPLE_FMT_S32 as input. The example I gave provides AV_SAMPLE_FMT_S32 as input, so that should not be a problem. -hendrik From onemda at gmail.com Tue Jun 11 12:26:46 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 11 Jun 2013 10:26:46 +0000 Subject: [Libav-user] Handling of 24 bit audio in libav* and libswresample In-Reply-To: References: <5480AE6E-D041-4A19-BEAD-5A1BB4180AC8@tagtraum.com> Message-ID: On 6/11/13, Hendrik Schreiber wrote: >> >> Note that dithering should be done when doing 32bit to 24bit case >> and source audio have >24bits used. > > Yes - definitely. > >> >>> >>> Dithering is only necessary, when converting the data somewhere in >>> between >>> (e.g. changing the sample rate while it's in 32bit format), as the code >>> in >>> pcm.c (macro ENCODE) simply shifts the 32bit representation by 8bit, >>> essentially just dropping the last 8bits. >> >> Because last 8bits are always zero for that particular case. > > Exactly. > > Thanks, Paul, for adding the extra clarifications for the more general > case. > > I saw that you added some more documentation for output_sample_bits > (http://patches.libav.org/patch/38964/). > Unfortunately, I'm still not entirely sure how to use the parameter - a > simple example would be great. > > Let's say I want to convert 32bit audio to 24bit. > The input AVSampleFormat is AV_SAMPLE_FMT_S32, the output sample format as > well. > But, when writing the result to a file, I want to use AV_CODEC_ID_PCM_S24LE, > i.e. the least significant byte is cut off. > > Therefore, for SWR, I'm calling: > > av_opt_set_int(swr_context, "dither_method", SWR_DITHER_TRIANGULAR, 0); > av_opt_set_int(swr_context, "output_sample_bits", ???, 0); > > What should I set ??? to? > 24, since I'm only using 24bit? Dunno, but if it does not work try to set dither_scale too. If it doesn't work feel free to open bug ticket, and/or bump this thread. > > Thanks, > > -hendrik > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From mtaha.ansari at gmail.com Tue Jun 11 15:18:23 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 11 Jun 2013 18:18:23 +0500 Subject: [Libav-user] Video encoding at fractional fps Message-ID: Hi all! I am trying to encode at fractional fps. Currently, I can encode video at 29 fps, or 30 fps, but cannot encode at fractional, like 29.97. I have a video mp4 file with me, probing it gives me the following: ---------------------- ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore- amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut - -enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger - -enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc -- enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab le-libxavs --enable-libxvid --enable-zlib libavutil 52. 9.100 / 52. 9.100 libavcodec 54. 77.100 / 54. 77.100 libavformat 54. 37.100 / 54. 37.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 23.102 / 3. 23.102 libswscale 2. 1.102 / 2. 1.102 libswresample 0. 17.101 / 0. 17.101 libpostproc 52. 2.100 / 52. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid_0.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 1970-01-01 00:00:00 encoder : Lavf53.27.0 Duration: 00:00:21.19, start: 0.000000, bitrate: 812 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [ SAR 1:1 DAR 4:3], 700 kb/s, 30.06 fps, 29.92 tbr, 748 tbn, 59.84 tbc Metadata: creation_time : 1970-01-01 00:00:00 handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 103 kb/s Metadata: creation_time : 1970-01-01 00:00:00 handler_name : SoundHandler ---------------------- Above video was probably encoded at 30.06 fps. I want to achieve something similar, but my 'open codec' related code is something like: --------------------------- /* Add a video output stream. */ static AVStream *add_video_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id) { AVCodecContext *c; AVStream *st; /* find the video encoder */ *codec = avcodec_find_encoder(codec_id); if (!(*codec)) { fprintf(stderr, "codec not found\n"); exit(1); } st = avformat_new_stream(oc, *codec); if (!st) { fprintf(stderr, "Could not alloc stream\n"); exit(1); } c = st->codec; avcodec_get_context_defaults3(c, *codec); c->codec_id = codec_id; /* Put sample parameters. */ c->bit_rate = 400000; /* Resolution must be a multiple of two. */ c->width = 352; c->height = 288; /* timebase: This is the fundamental unit of time (in seconds) in terms * of which frame timestamps are represented. For fixed-fps content, * timebase should be 1/framerate and timestamp increments should be * identical to 1. */ c->time_base.den = 30; c->time_base.num = 1; c->gop_size = 12; /* emit one intra frame every twelve frames at most */ c->pix_fmt = STREAM_PIX_FMT; if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { /* just for testing, we also add B frames */ c->max_b_frames = 2; } if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { /* Needed to avoid using macroblocks in which some coeffs overflow. * This does not happen with normal video, it just happens here as * the motion of the chroma plane does not match the luma plane. */ c->mb_decision = 2; } /* Some formats want stream headers to be separate. */ if (oc->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; return st; } --------------------------- (above, from muxing example) Here, noteworthy is: c->time_base.den = 30; c->time_base.num = 1; Which basically tells to encode at 30 fps. Both den, and num are integer values, so I cannot stuff something like 30.06 as den value. So the question is, how can I achieve same fractional fps while encoding a video? Can anyone kindly provide guidance for above? Thanks for your time... -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyrilapan at yahoo.fr Tue Jun 11 15:25:21 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Tue, 11 Jun 2013 14:25:21 +0100 (BST) Subject: [Libav-user] Video encoding at fractional fps In-Reply-To: References: Message-ID: <1370957121.1910.YahooMailNeo@web28803.mail.ir2.yahoo.com> Never tested it, but you should try with those values: ??? c->time_base.den = 2997; ??? c->time_base.num = 100; Regards, Cyril APAN. ________________________________ De?: Taha Ansari ??: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Envoy? le : Mardi 11 juin 2013 15h18 Objet?: [Libav-user] Video encoding at fractional fps Hi all! I am trying to encode at fractional fps. Currently, I can encode video at 29 fps, or 30 fps, but cannot encode at fractional, like 29.97. I have a video mp4 file with me, probing it gives me the following: ---------------------- ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers ? built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) ? configuration: --disable-static --enable-shared --enable-gpl --enable-version3 ?--disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore- amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut - -enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger - -enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc -- enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab le-libxavs --enable-libxvid --enable-zlib ? libavutil????? 52.? 9.100 / 52.? 9.100 ? libavcodec???? 54. 77.100 / 54. 77.100 ? libavformat??? 54. 37.100 / 54. 37.100 ? libavdevice??? 54.? 3.100 / 54.? 3.100 ? libavfilter???? 3. 23.102 /? 3. 23.102 ? libswscale????? 2.? 1.102 /? 2.? 1.102 ? libswresample?? 0. 17.101 /? 0. 17.101 ? libpostproc??? 52.? 2.100 / 52.? 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid_0.mp4': ? Metadata: ??? major_brand???? : isom ??? minor_version?? : 512 ??? compatible_brands: isomiso2avc1mp41 ??? creation_time?? : 1970-01-01 00:00:00 ??? encoder???????? : Lavf53.27.0 ? Duration: 00:00:21.19, start: 0.000000, bitrate: 812 kb/s ??? Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [ SAR 1:1 DAR 4:3], 700 kb/s, 30.06 fps, 29.92 tbr, 748 tbn, 59.84 tbc ??? Metadata: ????? creation_time?? : 1970-01-01 00:00:00 ????? handler_name??? : VideoHandler ??? Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 103 ?kb/s ??? Metadata: ????? creation_time?? : 1970-01-01 00:00:00 ????? handler_name??? : SoundHandler ---------------------- Above video was probably encoded at 30.06 fps. I want to achieve something similar, but my 'open codec' related code is something like: --------------------------- /* Add a video output stream. */ static AVStream *add_video_stream(AVFormatContext *oc, AVCodec **codec, ????????????????????????????????? enum AVCodecID codec_id) { ??? AVCodecContext *c; ??? AVStream *st; ??? /* find the video encoder */ ??? *codec = avcodec_find_encoder(codec_id); ??? if (!(*codec)) { ??????? fprintf(stderr, "codec not found\n"); ??????? exit(1); ??? } ??? st = avformat_new_stream(oc, *codec); ??? if (!st) { ??????? fprintf(stderr, "Could not alloc stream\n"); ??????? exit(1); ??? } ??? c = st->codec; ??? avcodec_get_context_defaults3(c, *codec); ??? c->codec_id = codec_id; ??? /* Put sample parameters. */ ??? c->bit_rate = 400000; ??? /* Resolution must be a multiple of two. */ ??? c->width??? = 352; ??? c->height?? = 288; ??? /* timebase: This is the fundamental unit of time (in seconds) in terms ???? * of which frame timestamps are represented. For fixed-fps content, ???? * timebase should be 1/framerate and timestamp increments should be ???? * identical to 1. */ ??? c->time_base.den = 30; ??? c->time_base.num = 1; ??? c->gop_size????? = 12; /* emit one intra frame every twelve frames at most */ ??? c->pix_fmt?????? = STREAM_PIX_FMT; ??? if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { ??????? /* just for testing, we also add B frames */ ??????? c->max_b_frames = 2; ??? } ??? if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { ??????? /* Needed to avoid using macroblocks in which some coeffs overflow. ???????? * This does not happen with normal video, it just happens here as ???????? * the motion of the chroma plane does not match the luma plane. */ ??????? c->mb_decision = 2; ??? } ??? /* Some formats want stream headers to be separate. */ ??? if (oc->oformat->flags & AVFMT_GLOBALHEADER) ??????? c->flags |= CODEC_FLAG_GLOBAL_HEADER; ??? return st; } --------------------------- (above, from muxing example) Here, noteworthy is: ??? c->time_base.den = 30; ??? c->time_base.num = 1; Which basically tells to encode at 30 fps. Both den, and num are integer values, so I cannot stuff something like 30.06 as den value. So the question is, how can I achieve same fractional fps while encoding a video? Can anyone kindly provide guidance for above? Thanks for your time... _______________________________________________ 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 h.leppkes at gmail.com Tue Jun 11 15:31:47 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Tue, 11 Jun 2013 15:31:47 +0200 Subject: [Libav-user] Video encoding at fractional fps In-Reply-To: <1370957121.1910.YahooMailNeo@web28803.mail.ir2.yahoo.com> References: <1370957121.1910.YahooMailNeo@web28803.mail.ir2.yahoo.com> Message-ID: On Tue, Jun 11, 2013 at 3:25 PM, cyril apan wrote: > Never tested it, but you should try with those values: > c->time_base.den = 2997; > c->time_base.num = 100; > > Regards, > > Cyril APAN. > > This should work. Note however that the 100% correct value for 29.97 is 30000/1001, because its not supposed to be *exactly* 29,97, but 29.97002997.... From night.rain.whisper at gmail.com Tue Jun 11 18:03:44 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Tue, 11 Jun 2013 20:03:44 +0400 Subject: [Libav-user] generate encoded video file from .png files In-Reply-To: References: Message-ID: Yes. I think you can use avformat_open_input_file() on png image to obtain a properly initialized AVCodecContext. It could simplify the decoding process. Best wishes, Sergey 2013/6/11 Ramu Chakravadhanula > okay. > > 1. decode the png using ac_codec_id_png > 2. give this raw information to encoder. is it like this? > > /Boys21 > > On 11 June 2013 09:10, Sergey Fedorov wrote: > >> Hi, >> I think you should first decode raw image data from PNG file. There is >> AV_CODEC_ID_PNG in libavcodec. >> >> >> 2013/6/10 Ramu Chakravadhanula >> >>> Hi, >>> >>> I have a series of png files and would like to encode them to a video >>> file. most of the examples cover encoding a raw video file. However, I >>> couldnt find one that covers using existing still images (especially PNG). >>> Attached is the sample code that i found. can someone help me ? >>> >>> Thanks and Regards, >>> Boys21. >>> >>> >>> >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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 boys21century at gmail.com Tue Jun 11 19:30:49 2013 From: boys21century at gmail.com (Ramu Chakravadhanula) Date: Tue, 11 Jun 2013 23:00:49 +0530 Subject: [Libav-user] generate encoded video file from .png files In-Reply-To: References: Message-ID: okay. thanks a lot. I will give it a try and revert back if I have any troubles. Thanks and Regards, Boys21 On 11 June 2013 21:33, Sergey Fedorov wrote: > Yes. I think you can use avformat_open_input_file() on png image to obtain > a properly initialized AVCodecContext. It could simplify the decoding > process. > > Best wishes, > Sergey > > > 2013/6/11 Ramu Chakravadhanula > >> okay. >> >> 1. decode the png using ac_codec_id_png >> 2. give this raw information to encoder. is it like this? >> >> /Boys21 >> >> On 11 June 2013 09:10, Sergey Fedorov wrote: >> >>> Hi, >>> I think you should first decode raw image data from PNG file. There is >>> AV_CODEC_ID_PNG in libavcodec. >>> >>> >>> 2013/6/10 Ramu Chakravadhanula >>> >>>> Hi, >>>> >>>> I have a series of png files and would like to encode them to a video >>>> file. most of the examples cover encoding a raw video file. However, I >>>> couldnt find one that covers using existing still images (especially PNG). >>>> Attached is the sample code that i found. can someone help me ? >>>> >>>> Thanks and Regards, >>>> Boys21. >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> _______________________________________________ >> 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 night.rain.whisper at gmail.com Tue Jun 11 20:09:42 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Tue, 11 Jun 2013 22:09:42 +0400 Subject: [Libav-user] generate encoded video file from .png files In-Reply-To: References: Message-ID: You may need to use avformat_find_stream_info() too. Best wishes, Sergey 2013/6/11 Ramu Chakravadhanula > okay. thanks a lot. I will give it a try and revert back if I have any > troubles. > > Thanks and Regards, > Boys21 > > On 11 June 2013 21:33, Sergey Fedorov wrote: > >> Yes. I think you can use avformat_open_input_file() on png image to >> obtain a properly initialized AVCodecContext. It could simplify the >> decoding process. >> >> Best wishes, >> Sergey >> >> >> 2013/6/11 Ramu Chakravadhanula >> >>> okay. >>> >>> 1. decode the png using ac_codec_id_png >>> 2. give this raw information to encoder. is it like this? >>> >>> /Boys21 >>> >>> On 11 June 2013 09:10, Sergey Fedorov wrote: >>> >>>> Hi, >>>> I think you should first decode raw image data from PNG file. There is >>>> AV_CODEC_ID_PNG in libavcodec. >>>> >>>> >>>> 2013/6/10 Ramu Chakravadhanula >>>> >>>>> Hi, >>>>> >>>>> I have a series of png files and would like to encode them to a video >>>>> file. most of the examples cover encoding a raw video file. However, I >>>>> couldnt find one that covers using existing still images (especially PNG). >>>>> Attached is the sample code that i found. can someone help me ? >>>>> >>>>> Thanks and Regards, >>>>> Boys21. >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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 olivier.daubry at gmail.com Tue Jun 11 14:41:10 2013 From: olivier.daubry at gmail.com (Olivier Daubry) Date: Tue, 11 Jun 2013 14:41:10 +0200 Subject: [Libav-user] Way to convert .wav file waveform into video .mjpeg file Message-ID: Hello, I'm searching for a way to convert an array of values (44100 samples coded on 16bits each every second) into a series of plot (graph) images (24 per seconds), and then make a video out of it so that I could have a converter from .wav to .mjpeg showing the waveform moving as if you were watching the file being read by any DAW with a fixed playhead. I've heard about ffmpeg while searching for a way to do this. Do you guys think it could help me achieving this? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue Jun 11 21:28:50 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 11 Jun 2013 19:28:50 +0000 Subject: [Libav-user] Way to convert .wav file waveform into video .mjpeg file In-Reply-To: References: Message-ID: On 6/11/13, Olivier Daubry wrote: > Hello, > > I'm searching for a way to convert an array of values (44100 samples coded > on 16bits each every second) into a series of plot (graph) images (24 per > seconds), and then make a video out of it so that I could have a converter > from .wav to .mjpeg showing the waveform moving as if you were watching the > file being read by any DAW with a fixed playhead. I've heard about ffmpeg > while searching for a way to do this. > > Do you guys think it could help me achieving this? There are many ways to visualize waveform. In what exact "visualization" you are interested? > > Thank you > From wagner.patriota at gmail.com Tue Jun 11 23:25:34 2013 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Tue, 11 Jun 2013 18:25:34 -0300 Subject: [Libav-user] Way to convert .wav file waveform into video .mjpeg file In-Reply-To: References: Message-ID: would it be something like this? http://stackoverflow.com/questions/16509906/ffmpeg-can-i-draw-an-audio-channel-as-an-image/16931776#16931776 On Tue, Jun 11, 2013 at 4:28 PM, Paul B Mahol wrote: > On 6/11/13, Olivier Daubry wrote: > > Hello, > > > > I'm searching for a way to convert an array of values (44100 samples > coded > > on 16bits each every second) into a series of plot (graph) images (24 per > > seconds), and then make a video out of it so that I could have a > converter > > from .wav to .mjpeg showing the waveform moving as if you were watching > the > > file being read by any DAW with a fixed playhead. I've heard about ffmpeg > > while searching for a way to do this. > > > > Do you guys think it could help me achieving this? > > > There are many ways to visualize waveform. In what exact > "visualization" you are interested? > > > > > Thank you > > > _______________________________________________ > 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 mtaha.ansari at gmail.com Wed Jun 12 06:20:55 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 12 Jun 2013 09:20:55 +0500 Subject: [Libav-user] Video encoding at fractional fps In-Reply-To: References: <1370957121.1910.YahooMailNeo@web28803.mail.ir2.yahoo.com> Message-ID: Hi guys! Thanks for you guidance, adopting your methods seems to have worked just fine! @Hendrik Leppkes Thanks for the insight; I will try to put it to effect as well (might have to think of a formula first). On Tue, Jun 11, 2013 at 6:31 PM, Hendrik Leppkes wrote: > On Tue, Jun 11, 2013 at 3:25 PM, cyril apan wrote: > > Never tested it, but you should try with those values: > > c->time_base.den = 2997; > > c->time_base.num = 100; > > > > Regards, > > > > Cyril APAN. > > > > > > This should work. > Note however that the 100% correct value for 29.97 is 30000/1001, > because its not supposed to be *exactly* 29,97, but 29.97002997.... > _______________________________________________ > 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 onemda at gmail.com Wed Jun 12 14:58:15 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 12 Jun 2013 12:58:15 +0000 Subject: [Libav-user] Way to convert .wav file waveform into video .mjpeg file In-Reply-To: References: Message-ID: On 6/11/13, Wagner Patriota wrote: > would it be something like this? > http://stackoverflow.com/questions/16509906/ffmpeg-can-i-draw-an-audio-channel-as-an-image/16931776#16931776 That link spread lies, ffmpeg have builltin "drawing audio channel as an image": see following filters: showspectrum showwaves avectorscope And others visualizations can be added to. > > > On Tue, Jun 11, 2013 at 4:28 PM, Paul B Mahol wrote: > >> On 6/11/13, Olivier Daubry wrote: >> > Hello, >> > >> > I'm searching for a way to convert an array of values (44100 samples >> coded >> > on 16bits each every second) into a series of plot (graph) images (24 >> > per >> > seconds), and then make a video out of it so that I could have a >> converter >> > from .wav to .mjpeg showing the waveform moving as if you were watching >> the >> > file being read by any DAW with a fixed playhead. I've heard about >> > ffmpeg >> > while searching for a way to do this. >> > >> > Do you guys think it could help me achieving this? >> >> >> There are many ways to visualize waveform. In what exact >> "visualization" you are interested? >> >> > >> > Thank you >> > >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > From dragoshiordache at gmail.com Thu Jun 13 10:47:29 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Thu, 13 Jun 2013 11:47:29 +0300 Subject: [Libav-user] H264+flv bad video stream Message-ID: Hi all, I am making a streaming app and I am using a third party H264 encoder and the libffmpeg for rtmp streaming in flv format. The stream is not showing and the recorded video does not allow seeking, it just freezes and cannot be played. I think the problem is because the AVPacket does not contain the correct fields. I am streaming to justin. Can you please tell me what fields should I complete. Now I set the data and size and then call write packet. Thank you for your input. Dragos -- dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Thu Jun 13 10:53:17 2013 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 13 Jun 2013 09:53:17 +0100 Subject: [Libav-user] JPEG decoder Message-ID: Hi All When using the JPEG decoder (CODEC_ID_MJPEG) sometimes I find that decoded frames are inverted/upside down/back to front. Having read into the problem I believe the issue is to do with the fact that bitmap is sometimes stored bottom-up in JPEG files. Does the decoder not realign the frame correctly or is this something that I would have to take care of after the decoding? If anyone can suggest the best way to deal with this I would appreciate it. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyrilapan at yahoo.fr Thu Jun 13 11:07:04 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Thu, 13 Jun 2013 10:07:04 +0100 (BST) Subject: [Libav-user] JPEG decoder In-Reply-To: References: Message-ID: <1371114424.32522.YahooMailNeo@web28802.mail.ir2.yahoo.com> >Hi All > >When using the JPEG decoder (CODEC_ID_MJPEG) sometimes I find that decoded frames are inverted/upside down/back to front. Having read into the problem I believe the issue is to do with the fact that bitmap is sometimes stored bottom-up in JPEG files. > >Does the decoder not realign the frame correctly or is this something that I would have to take care of after the decoding? If anyone can suggest the best way to deal with this I would appreciate it. > >Thanks, >Mark. You'll have to read metadata (Exif most of the time) to know what is the orientation of the stored bitmap and then process it to get the right rendering. I don't think ffmpeg has any facility to read Exif metadata but you can use filters to do the rotation/flipping job. Regards, Cyril APAN. _______________________________________________ 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 mark.kenna at sureviewsystems.com Thu Jun 13 11:09:05 2013 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 13 Jun 2013 10:09:05 +0100 Subject: [Libav-user] JPEG decoder In-Reply-To: <1371114424.32522.YahooMailNeo@web28802.mail.ir2.yahoo.com> References: <1371114424.32522.YahooMailNeo@web28802.mail.ir2.yahoo.com> Message-ID: > > You'll have to read metadata (Exif most of the time) to know what is the > orientation of the stored bitmap and then process it to get the right > rendering. > I don't think ffmpeg has any facility to read Exif metadata but you can > use filters to do the rotation/flipping job. > That's pretty much what I figured. Thought it was worth a check though. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhanndt_87 at yahoo.com Thu Jun 13 11:24:34 2013 From: nhanndt_87 at yahoo.com (thanh nhan thanh nhan) Date: Thu, 13 Jun 2013 02:24:34 -0700 (PDT) Subject: [Libav-user] Error while decoding .asf file! Message-ID: <1371115474.5522.YahooMailNeo@web121704.mail.ne1.yahoo.com> Dear everyone, I got the problem when i tried to decode .asf video file. here is my source code discription: ? ( source code for ffmpeg preparation) ... int len = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); if ( len < 0 ) { ??? fprintf(stderr, "Problems decoding frame\n"); ????fprintf(stderr, "len = %d\n", len );? ????return 1; } if(frameFinished) { ??? dosomething(); } The result of len variable?i got is always -1094995529 for .asf file. Other video files are decoded successfully. Does anybody know the solution for this issue? Thank you very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From vkarthik at entrayn.com Thu Jun 13 11:45:49 2013 From: vkarthik at entrayn.com (Karthik Viswanathan) Date: Thu, 13 Jun 2013 15:15:49 +0530 Subject: [Libav-user] Provided packet is too small, needs to be x In-Reply-To: References: Message-ID: Fixed it, my bad, used the same packet for decoding & encoding. av_free_packet(&packet); av_init_packet(&packet); ret = avcodec_encode_video2(pCodecCtxOut, &packet, frame, &got_output); fixes it. From cehoyos at ag.or.at Thu Jun 13 16:36:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Jun 2013 14:36:00 +0000 (UTC) Subject: [Libav-user] H264+flv bad video stream References: Message-ID: Dragos Iordache writes: > The stream is not showing and the recorded video does not > allow seeking, it just freezes and cannot be played. Can you reproduce the problem with ffmpeg (the application)? Carl Eugen From cehoyos at ag.or.at Thu Jun 13 16:37:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Jun 2013 14:37:53 +0000 (UTC) Subject: [Libav-user] JPEG decoder References: Message-ID: Mark Kenna writes: > When using the JPEG decoder (CODEC_ID_MJPEG) sometimes > I find that decoded frames are inverted/upside > down/back to front. Is this reproducible with ffmpeg? If yes, a sample may be nice. Carl Eugen From dragoshiordache at gmail.com Thu Jun 13 16:47:46 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Thu, 13 Jun 2013 17:47:46 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: No. I am using my own H264 encoder that produces the correct output, and I use libffmpeg for outputing as flv to a rtmp stream. I think the reason is that I do not set the right struct fields in the AVPacket. Regards, Dragos On Thu, Jun 13, 2013 at 5:36 PM, Carl Eugen Hoyos wrote: > Dragos Iordache writes: > > > The stream is not showing and the recorded video does not > > allow seeking, it just freezes and cannot be played. > > Can you reproduce the problem with ffmpeg (the application)? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- www.dragosiordache.ro dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jun 13 16:36:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Jun 2013 14:36:31 +0000 (UTC) Subject: [Libav-user] Error while decoding .asf file! References: <1371115474.5522.YahooMailNeo@web121704.mail.ne1.yahoo.com> Message-ID: thanh nhan thanh nhan writes: > I got the problem when i tried to decode .asf video file. Does ffmpeg (the application) decode the file? Carl Eugen From cehoyos at ag.or.at Thu Jun 13 16:52:13 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Jun 2013 14:52:13 +0000 (UTC) Subject: [Libav-user] H264+flv bad video stream References: Message-ID: Dragos Iordache writes: > On Thu, Jun 13, 2013 at 5:36 PM, Carl Eugen Hoyos wrote: > > Dragos Iordache ...> writes: > > > The stream is not showing and the recorded video does not > > > allow seeking, it just freezes and cannot be played. > > > > Can you reproduce the problem with ffmpeg (the application)? > > No. I am using my own H264 encoder that produces > the correct output Does that mean if you feed your encoders output into ffmpeg (the application), then everything works fine? Out of curiosity: Which h264 encoder works better for you than x264? Please do not top-post here, Carl Eugen From arvind_raman at yahoo.com Thu Jun 13 18:46:25 2013 From: arvind_raman at yahoo.com (Arvind Raman) Date: Thu, 13 Jun 2013 09:46:25 -0700 (PDT) Subject: [Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers Message-ID: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> Question - What is the format in which audio / video ES data is stored in (AVPacket*) pkt->data? I am trying to demux and decode AV data from a MP4 file using libavformat and libavcodec. More details 1. Using the sample application demuxing.c (http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried demuxing and decoding a MP4 file containing H.264 video and AAC audio.? 2. While the sample application worked fine, I wasn't able to interpret the content in the pkt.data?buffer?(line #66 in the above file). Since the video was H.264 I was hoping to see familiar "nal_unit_type" but I don't think I saw that for the stream I was trying to decode. If I remember the data correctly the first 4 bytes in the pkt.data buffer were "0x00 0x00 0x02 0x72" I haven't spent much time figuring this out yet but searching on the Internet / forum didn't help. I intend to dig deeper tomorrow, but just wanted to check if indeed ES was being passed in the pkt.data buffers in a special way. Appreciate any points that you can provide. Best regards Arvind -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Thu Jun 13 20:23:09 2013 From: er.anshul.maheshwari at gmail.com (Anshul maheshwari) Date: Thu, 13 Jun 2013 22:53:09 +0430 Subject: [Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers In-Reply-To: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> References: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> Message-ID: U can try using gdb, put a brk point on above line u provided, Print the pkt, If trouble using gdb, reply me I wud do fr u! It was never required to me! Anshul On Jun 13, 2013 10:16 PM, "Arvind Raman" wrote: > Question - What is the format in which audio / video ES data is stored in > (AVPacket*) pkt->data? I am trying to demux and decode AV data from a MP4 > file using libavformat and libavcodec. > > More details > > 1. Using the sample application demuxing.c ( > http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried > demuxing and decoding a MP4 file containing H.264 video and AAC audio. > 2. While the sample application worked fine, I wasn't able to > interpret the content in the pkt.data buffer (line #66 in the above file). > Since the video was H.264 I was hoping to see familiar "nal_unit_type" > but I don't think I saw that for the stream I was trying to decode. If I > remember the data correctly the first 4 bytes in the pkt.data buffer were > "0x00 0x00 0x02 0x72" > > I haven't spent much time figuring this out yet but searching on the > Internet / forum didn't help. I intend to dig deeper tomorrow, but just > wanted to check if indeed ES was being passed in the pkt.data buffers in a > special way. > > Appreciate any points that you can provide. > > Best regards > Arvind > > > _______________________________________________ > 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 Thu Jun 13 22:26:34 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 13 Jun 2013 17:26:34 -0300 Subject: [Libav-user] Reverse playback Message-ID: <51BA2AFA.7010505@gmail.com> I am wondering what is the best method to use in reverse playback. Currently I seek to some frame and decode all images/sounds that are smaller than that frame (keeping a cache of frames). This works rather well for most movies, except with the internal cached buffers of ffmpeg. I've tried flushing the buffers each time but this does not work well (I get green frames or noise frames). I assume I am not the first to attempt this, so any help is appreciated. From ggarra13 at gmail.com Thu Jun 13 23:03:34 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 13 Jun 2013 18:03:34 -0300 Subject: [Libav-user] Reverse playback In-Reply-To: <51BA2AFA.7010505@gmail.com> References: <51BA2AFA.7010505@gmail.com> Message-ID: <51BA33A6.2000003@gmail.com> On 13/06/13 17:26, Gonzalo Garramuno wrote: > I am wondering what is the best method to use in reverse playback. > Currently I seek to some frame and decode all images/sounds that are > smaller than that frame (keeping a cache of frames). > This works rather well for most movies, except with the internal > cached buffers of ffmpeg. I've tried flushing the buffers each time > but this does not work well (I get green frames or noise frames). > I assume I am not the first to attempt this, so any help is appreciated. > Never mind this. I found the bug that was causing incorrect frames to be stored. From night.rain.whisper at gmail.com Fri Jun 14 06:15:58 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Fri, 14 Jun 2013 08:15:58 +0400 Subject: [Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers In-Reply-To: References: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> Message-ID: H.264 Video Types: > The MP4 container format stores H.264 data without start codes. Instead, > each NALU is prefixed by a length field, which gives the length of the NALU > in bytes. The size of the length field can vary, but is typically 1, 2, or > 4 bytes. > See also: H.264 extradata (partially) explained - for dummies 2013/6/13 Anshul maheshwari > U can try using gdb, put a brk point on above line u provided, > Print the pkt, > If trouble using gdb, reply me I wud do fr u! > It was never required to me! > > Anshul > On Jun 13, 2013 10:16 PM, "Arvind Raman" wrote: > >> Question - What is the format in which audio / video ES data is stored >> in (AVPacket*) pkt->data? I am trying to demux and decode AV data from a >> MP4 file using libavformat and libavcodec. >> >> More details >> >> 1. Using the sample application demuxing.c ( >> http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried >> demuxing and decoding a MP4 file containing H.264 video and AACaudio. >> 2. While the sample application worked fine, I wasn't able to >> interpret the content in the pkt.data buffer (line #66 in the above file). >> Since the video was H.264 I was hoping to see familiar "nal_unit_type" >> but I don't think I saw that for the stream I was trying to decode. If I >> remember the data correctly the first 4 bytes in the pkt.data buffer were >> "0x00 0x00 0x02 0x72" >> >> I haven't spent much time figuring this out yet but searching on the >> Internet / forum didn't help. I intend to dig deeper tomorrow, but just >> wanted to check if indeed ES was being passed in the pkt.data buffers in a >> special way. >> >> Appreciate any points that you can provide. >> >> Best regards >> Arvind >> >> >> _______________________________________________ >> 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 night.rain.whisper at gmail.com Fri Jun 14 06:20:14 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Fri, 14 Jun 2013 08:20:14 +0400 Subject: [Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers In-Reply-To: References: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> Message-ID: By the way, you can find the stream header in AVCodecContext::extradata after avformat_find_stream_info() call. 2013/6/14 Sergey Fedorov > H.264 Video Types: > > >> The MP4 container format stores H.264 data without start codes. Instead, >> each NALU is prefixed by a length field, which gives the length of the NALU >> in bytes. The size of the length field can vary, but is typically 1, 2, or >> 4 bytes. >> > > See also: H.264 extradata (partially) explained - for dummies > > > > 2013/6/13 Anshul maheshwari > >> U can try using gdb, put a brk point on above line u provided, >> Print the pkt, >> If trouble using gdb, reply me I wud do fr u! >> It was never required to me! >> >> Anshul >> On Jun 13, 2013 10:16 PM, "Arvind Raman" wrote: >> >>> Question - What is the format in which audio / video ES data is stored >>> in (AVPacket*) pkt->data? I am trying to demux and decode AV data from >>> a MP4 file using libavformat and libavcodec. >>> >>> More details >>> >>> 1. Using the sample application demuxing.c ( >>> http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried >>> demuxing and decoding a MP4 file containing H.264 video and AACaudio. >>> 2. While the sample application worked fine, I wasn't able to >>> interpret the content in the pkt.data buffer (line #66 in the above file). >>> Since the video was H.264 I was hoping to see familiar "nal_unit_type" >>> but I don't think I saw that for the stream I was trying to decode. If I >>> remember the data correctly the first 4 bytes in the pkt.data buffer were >>> "0x00 0x00 0x02 0x72" >>> >>> I haven't spent much time figuring this out yet but searching on the >>> Internet / forum didn't help. I intend to dig deeper tomorrow, but just >>> wanted to check if indeed ES was being passed in the pkt.data buffers in a >>> special way. >>> >>> Appreciate any points that you can provide. >>> >>> Best regards >>> Arvind >>> >>> >>> _______________________________________________ >>> 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 bersac_1 at hotmail.fr Fri Jun 14 10:03:24 2013 From: bersac_1 at hotmail.fr (... ...) Date: Fri, 14 Jun 2013 08:03:24 +0000 Subject: [Libav-user] From version 0.8.6 to N-54015 Message-ID: Hi, I had a project which worked fined using the FFmpeg version 0.8.6. But it had few memory leaks due to FFmpeg so I decided to switch to the last version of FFmpeg so I compiled ffmpeg with the sources from the git repository (git://git.videolan.org/x264.git). Now my application doesn't work anymore.Bugs :after using avformat_find_stream_info, the AVFormatContext has nb_streams == 0 while, when I use it with av_find_best_stream, av_find_best_stream find one video stream.avcodec_find_decoder can't find a decoder which match with he stream I retrieved using av_find_best_stream. The informations I gathered about the stream I retrieved using av_find_best_stream are :print_info AVStream : Video: mpeg4 (Advanced Simple Profile), yuv420p, 640x480 [PAR 1:1 DAR 4:3] - Codec infos : coder_type : VIDEO codec :  size : 0x0 pix_fmt : PIX_FMT_YUV420P bit_rate : 0 timebase : 0/0 sample_aspect_ratio (SAR): 1145656920:1 display_aspect_ratio (DAR): 0:0 q=8--1781464128 gop_size : 0 min gop size : 0 max_b_frames : 0 b_frame_strategy (best nb B-frames) : 0 refs : 0 i_quant_factor : 0.000000 Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Fri Jun 14 12:51:58 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Fri, 14 Jun 2013 12:51:58 +0200 Subject: [Libav-user] flv/h264/rtmp live video streaming In-Reply-To: References: Message-ID: >> Is x264 capable of live video streaming, i.e. constant bitrate? I'm >> asking because I cannot get any acceptable quality from it when using >> bitrates < 1 Mbps, not even for static images. Only if I set qcompress >> to a very low value does the quality improve, but it also seems to >> skyrocket the bitrate considering the buffering I see in the >> downstream. > > Is someone willing & able to offer paid support? Does anyone know a better place to get support for ffmpeg, free or paid? Thanks, Mike From kalileo at universalx.net Fri Jun 14 14:56:57 2013 From: kalileo at universalx.net (Kalileo) Date: Fri, 14 Jun 2013 19:56:57 +0700 Subject: [Libav-user] flv/h264/rtmp live video streaming In-Reply-To: References: Message-ID: <60855EA9-5596-469D-83F4-E151865E4BA5@universalx.net> On May 11, 2013, at 22:14 , Mike Versteeg wrote: > Is x264 capable of live video streaming, i.e. constant bitrate? I'm > asking because I cannot get any acceptable quality from it when using > bitrates < 1 Mbps, not even for static images. Only if I set qcompress > to a very low value does the quality improve, but it also seems to > skyrocket the bitrate considering the buffering I see in the > downstream. Bitrate alone does not mean much, if you don't mention the resolution. in my opinion libx264 provides great quality, we use it a lot in streaming, and usually libx264 beats any other encoder at similar bitrates. In order to make it possible to help you you would have to be much more specific about what you do, which settings and options you use, and what result you get, or want. From ashvyrkin at gosniias.ru Fri Jun 14 16:27:21 2013 From: ashvyrkin at gosniias.ru (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA?=) Date: Fri, 14 Jun 2013 18:27:21 +0400 Subject: [Libav-user] avcodec_close() crash In-Reply-To: <51B007C9.7060009@gosniias.ru> References: <51AF0F51.7050309@gosniias.ru> <51B007C9.7060009@gosniias.ru> Message-ID: <51BB2849.4060407@gosniias.ru> 06.06.2013 7:53, ?????? ?????: > 05.06.2013 14:39, Andrey Utkin ?????: >> 2013/6/5 ?????? : >>> I use to compile the 32-bit version of ffmpeg visual studio 2012. I >>> used the >>> latter for now build from 5/29/13. >>> This is my test code that reproduces the problem: >>> >>> avcodec_register_all(); >>> >>> int width = 764, height = 480; >>> int got_output; >>> AVFrame *frame; >>> AVPacket pkt; >>> AVCodec *codec; >>> AVCodecContext *c = NULL; >>> >>> while(1) >>> { >>> frame = avcodec_alloc_frame(); >>> if (!frame) { >>> fprintf(stderr, "Could not allocate video frame\n"); >>> return -1; >>> } >>> frame->format = AV_PIX_FMT_YUV420P; >>> frame->width = width; >>> frame->height = height; >>> >>> /* the image can be allocated by any means and >>> av_image_alloc() is >>> * just the most convenient way if av_malloc() is to be >>> used */ >>> int ret = av_image_alloc(frame->data, frame->linesize, width, >>> height, >>> AV_PIX_FMT_YUV420P, 1); >>> if (ret < 0) { >>> fprintf(stderr, "Could not allocate raw picture >>> buffer\n"); >>> av_freep(&frame->data[0]); >>> avcodec_free_frame(&frame); >>> return -1; >>> } >>> >>> /* find the mpeg4 video encoder */ >>> codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); >>> if (!codec) { >>> fprintf(stderr, "Codec not found\n"); >>> return -1; >>> } >>> >>> c = avcodec_alloc_context3(codec); >>> if (!c) { >>> fprintf(stderr, "Could not allocate video codec >>> context\n"); >>> return -1; >>> } >>> >>> /* put sample parameters */ >>> c->profile = FF_PROFILE_MPEG4_SIMPLE; >>> /* resolution must be a multiple of two */ >>> c->width = width; >>> c->height = height; >>> /* frames per second */ >>> c->time_base.den = 25; >>> c->time_base.num = 1; >>> c->gop_size = 25; /* emit one intra frame every 25 frames */ >>> c->pix_fmt = AV_PIX_FMT_YUV420P; >>> c->qmax = 4; >>> c->qmin = 4; >>> >>> /* open it */ >>> if (avcodec_open2(c, codec, NULL) < 0) { >>> fprintf(stderr, "Could not open codec\n"); >>> avcodec_close(c); >> You shouldn't avcodec_close() here. I think this can cause a problem. >> >>> av_free(c); >>> return -1; >>> } >>> >>> for(int k = 0; k < 30; k++) >>> { >>> av_init_packet(&pkt); >>> pkt.data = NULL; // packet data will be allocated by >>> the >>> encoder >>> pkt.size = 0; >>> >>> frame->pts = c->frame_number; >>> >>> /* encode the image */ >>> if (avcodec_encode_video2(c, &pkt, frame, &got_output) >>> < 0) { >>> fprintf(stderr, "Error encoding frame\n"); >>> return -1; >>> } >>> >>> if (got_output) { >>> av_free_packet(&pkt); >>> } >>> } >>> >>> if(c) >>> { >>> avcodec_close(c); >>> av_free(c); >> Can't say for sure, but av_free() seems redundant. >> >>> } >>> if(frame) >>> { >>> av_freep(&frame->data[0]); >>> avcodec_free_frame(&frame); >> Maybe there also something is redundant. >> >>> } >>> } >>> >>> When you call function avcodec_close () throws an exception. Such an >>> error >>> is detected on the MPEG4 codec with a frame width in the range >>> 754-767 at an >>> altitude of 480. Perhaps at other resolutions, too. Help solve the >>> problem. >>> ...sorry for bad english >> You have more than one call to avcodec_close(), do you know, which one >> is executed? >> >> Your code snippet should be easily compiled on linux, there you can >> use valgrind memcheck tool, which makes debugging easy. >> Also i suggest you to re-read avcodec.h and avformat.h for >> explanations on how to release context objects correclty, some places >> in your code are suspicious for me. >> >> -- >> Andrey Utkin >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > Ok, for now I'm using video_encode_example from decoding_encoding.c > example: > > AVCodec *codec; > AVCodecContext *c = NULL; > int i, ret, x, y, got_output; > AVFrame *frame; > AVPacket pkt; > > /* register all the codecs */ > avcodec_register_all(); > > /* find the mpeg1 video encoder */ > codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4); > if (!codec) { > fprintf(stderr, "Codec not found\n"); > exit(1); > } > > c = avcodec_alloc_context3(codec); > if (!c) { > fprintf(stderr, "Could not allocate video codec context\n"); > exit(1); > } > > /* put sample parameters */ > c->bit_rate = 400000; > /* resolution must be a multiple of two */ > c->width = 764; > c->height = 480; > /* frames per second */ > c->time_base.den = 25; > c->time_base.num = 1; > c->gop_size = 10; /* emit one intra frame every ten frames */ > c->max_b_frames = 1; > c->pix_fmt = AV_PIX_FMT_YUV420P; > > /* open it */ > if (avcodec_open2(c, codec, NULL) < 0) { > fprintf(stderr, "Could not open codec\n"); > exit(1); > } > > frame = avcodec_alloc_frame(); > if (!frame) { > fprintf(stderr, "Could not allocate video frame\n"); > exit(1); > } > frame->format = c->pix_fmt; > frame->width = c->width; > frame->height = c->height; > > /* the image can be allocated by any means and av_image_alloc() is > * just the most convenient way if av_malloc() is to be used */ > ret = av_image_alloc(frame->data, frame->linesize, c->width, > c->height, > c->pix_fmt, 32); > if (ret < 0) { > fprintf(stderr, "Could not allocate raw picture buffer\n"); > exit(1); > } > > /* encode 1 second of video */ > for(i=0;i<25;i++) { > av_init_packet(&pkt); > pkt.data = NULL; // packet data will be allocated by the > encoder > pkt.size = 0; > > fflush(stdout); > /* prepare a dummy image */ > /* Y */ > for(y=0;yheight;y++) { > for(x=0;xwidth;x++) { > frame->data[0][y * frame->linesize[0] + x] = x + y + i > * 3; > } > } > > /* Cb and Cr */ > for(y=0;yheight/2;y++) { > for(x=0;xwidth/2;x++) { > frame->data[1][y * frame->linesize[1] + x] = 128 + y + > i * 2; > frame->data[2][y * frame->linesize[2] + x] = 64 + x + > i * 5; > } > } > > frame->pts = i; > > /* encode the image */ > ret = avcodec_encode_video2(c, &pkt, frame, &got_output); > if (ret < 0) { > fprintf(stderr, "Error encoding frame\n"); > exit(1); > } > > if (got_output) { > av_free_packet(&pkt); > } > } > > avcodec_close(c); > av_free(c); > av_freep(&frame->data[0]); > avcodec_free_frame(&frame); > > The problem is that the context is not released correctly when the > resolution is 764x480 and some other resolutions. If you use a > different codec instead of MPEG4, such as H264, no error occurs if any > resolution. I use the assembly under windows and unfortunately I do > not have the possibility to compile the example under Linux to > pinpoint the cause of the fall. *In the latest build of 14.06.13 the problem is solved.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From rj12461 at gmail.com Fri Jun 14 16:32:09 2013 From: rj12461 at gmail.com (rohit jaiswal) Date: Fri, 14 Jun 2013 20:02:09 +0530 Subject: [Libav-user] H.264 Decoding from the ethernet stream Message-ID: I have an ethernet stream which contains H.264 payload. I want to decode the payload by using ffmpeg Lib. I have successfully built the ffmpeg on 64 bit windows and I am able to decode a h.264 encoded video file using Visual Studio 2010. Please suggest me how to feed the data to ffmpeg from ethernet streams to get the video frames... -------------- next part -------------- An HTML attachment was scrubbed... URL: From arvind_raman at yahoo.com Fri Jun 14 17:43:06 2013 From: arvind_raman at yahoo.com (Arvind Raman) Date: Fri, 14 Jun 2013 08:43:06 -0700 (PDT) Subject: [Libav-user] Format in which ES data is stored in (AVPacket*) pkt->data buffers In-Reply-To: References: <1371141985.61287.YahooMailNeo@web122303.mail.ne1.yahoo.com> Message-ID: <1371224586.95616.YahooMailNeo@web122302.mail.ne1.yahoo.com> > From: Sergey Fedorov >By the way, you can find the stream header in AVCodecContext::extradata after avformat_find_stream_info() call. Thanks that was a life saver tip. I could review the code and see how extradata was being processed. For everyone's benefit I am copying the link to the blog post H.264 extradata (partially) explained for dummies?http://aviadr1.blogspot.in/2010/05/h264-extradata-partially-explained-for.html ~ Arvind >2013/6/14 Sergey Fedorov > >H.264 Video Types: >> >>The MP4 container format stores H.264 data without start codes. Instead, each NALU is prefixed by a length field, which gives the length of the NALU in bytes. The size of the length field can vary, but is typically 1, 2, or 4 bytes. >> >>See also: H.264 extradata (partially) explained - for dummies? >> >> >> >>2013/6/13 Anshul maheshwari >> >>U can try using gdb,? put a brk point on above line u provided, >>>Print the pkt, >>>If trouble using gdb,? reply me I wud do fr u! >>>It was never required to me! >>>Anshul >>>On Jun 13, 2013 10:16 PM, "Arvind Raman" wrote: >>> >>>Question - What is the format in which audio / video ES data is stored in (AVPacket*) pkt->data? I am trying to demux and decode AV data from a MP4 file using libavformat and libavcodec. >>>> >>>> >>>>More details >>>>????1. Using the sample application demuxing.c (http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html) I tried demuxing and decoding a MP4 file containing H.264 video and AAC audio.? >>>>????2. While the sample application worked fine, I wasn't able to interpret the content in the pkt.data?buffer?(line #66 in the above file). Since the video was H.264 I was hoping to see familiar "nal_unit_type" but I don't think I saw that for the stream I was trying to decode. If I remember the data correctly the first 4 bytes in the pkt.data buffer were "0x00 0x00 0x02 0x72" >>>>I haven't spent much time figuring this out yet but searching on the Internet / forum didn't help. I intend to dig deeper tomorrow, but just wanted to check if indeed ES was being passed in the pkt.data buffers in a special way. >>>> >>>> >>>>Appreciate any points that you can provide. >>>> >>>> >>>>Best regards >>>>Arvind >>>> >>>> >>>>_______________________________________________ >>>>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 >>> >>> >> > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user > > > From moiein2000 at gmail.com Fri Jun 14 22:56:10 2013 From: moiein2000 at gmail.com (Matthew Einhorn) Date: Fri, 14 Jun 2013 16:56:10 -0400 Subject: [Libav-user] IP cam accessing directly and from dshow speed differences. Message-ID: Hi, I have a WANSCAM IP camare (AJ-C2WA-C198) which I'm testing in ffplay/ffmpeg. I noticed that playing it through its http address is much slower than when playing it with direct show. I'm linking to logs for both as run in ffplay. ffplay displayed the video through direct http access very slow and choppy using this command :ffplay -report -loglevel debug -i http://user:pwd at IP:99/videostream.asf -an (see http://paste.ubuntu.com/5765942/). To use direct show, I installed a driver from http://alax.info/blog/1223which converts a IP cam to direct show and the ffplay speed was faster although still choppy, even with a large realy time buffer. The command line was "ffplay -loglevel debug -report -f dshow -i "video=wanscam" -an -rtbufsize 1000000" (see http://paste.ubuntu.com/5765952/) Finally, viewing the camera directly from Firefox was much faster than either method and it wasn't choppy at all. I am looking for recommendations as to what I can do in ffmpeg to speed it up so that it's as fast as Firefox. In the end I'd be using the API not ffplay. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From rj12461 at gmail.com Sat Jun 15 07:05:37 2013 From: rj12461 at gmail.com (rohit jaiswal) Date: Fri, 14 Jun 2013 22:05:37 -0700 Subject: [Libav-user] H.264 Decoding from the ethernet stream Message-ID: Hello friends, I have an ethernet stream which contains H.264 payload. I want to decode the payload by using ffmpeg Lib. I have successfully built the ffmpeg on 64 bit windows and I am able to decode a h.264 encoded video file using Visual Studio 2010 and ffmpeg Library. Please suggest me how to feed the data to ffmpeg from ethernet streams to get the video frame Thanks in Advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Sat Jun 15 11:01:05 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Sat, 15 Jun 2013 11:01:05 +0200 Subject: [Libav-user] flv/h264/rtmp live video streaming In-Reply-To: References: Message-ID: Thanks. Interesting, I must be doing something wrong then. All documentation I have found discusses settings meant for recording (i.e. VBR), do you know of any that discuss streaming? Resolution should be irrelevant for static images, but so far I've tried everything down to just 512*288. PS: As it has taken me over a month just to get a reply, I really do invite anyone to answer my support question. I'll gladly pay or donate to FFMPEG if someone can save me time figuring everything out. Great as it is, FFMPEG is not easy to understand and it severely lacks on the documentation front. Mike From aftnix at gmail.com Sat Jun 15 11:54:27 2013 From: aftnix at gmail.com (arif) Date: Sat, 15 Jun 2013 15:54:27 +0600 Subject: [Libav-user] What happened to libavcodec/api_example.c Message-ID: Hi, The file i'm talking about is listed here http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html But current git repo does not have it. And a "git log -- libavcodec/api-example.c" does not come up with anything. -- Cheers arif From h.leppkes at gmail.com Sat Jun 15 12:06:50 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Sat, 15 Jun 2013 12:06:50 +0200 Subject: [Libav-user] What happened to libavcodec/api_example.c In-Reply-To: References: Message-ID: On Sat, Jun 15, 2013 at 11:54 AM, arif wrote: > Hi, > > The file i'm talking about is listed here > http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html > > But current git repo does not have it. > > And a "git log -- libavcodec/api-example.c" does not come up with anything. > api-example is now in doc/examples/decoding_encoding.c, among other examples in the same folder. - Hendrik From kalileo at universalx.net Sat Jun 15 12:57:51 2013 From: kalileo at universalx.net (Kalileo) Date: Sat, 15 Jun 2013 17:57:51 +0700 Subject: [Libav-user] flv/h264/rtmp live video streaming In-Reply-To: References: Message-ID: <98BBDCF7-8008-4AE5-AED9-9F05EA5509ED@universalx.net> On Jun 15, 2013, at 16:01 , Mike Versteeg wrote: > Thanks. Interesting, I must be doing something wrong then. All > documentation I have found discusses settings meant for recording > (i.e. VBR), do you know of any that discuss streaming? There is not much difference if you write to a file (assuming 1 pass encoding) or if you write to a stream, especially concerning quality. > > Resolution should be irrelevant for static images, but so far I've > tried everything down to just 512*288. 512x288 as static images should be easy to fit in bitrates < 1 Mbps in excellent quality. Resolution can be very relevant, depending on your gop setting / how often you have key frames. > > PS: As it has taken me over a month just to get a reply, I really do > invite anyone to answer my support question. You make it impossible to help you as long as you keep secret what you do. That is why I asked you this: On Jun 14, 2013, at 19:56 , Kalileo wrote: > In order to make it possible to help you you would have to be much more specific about what you do, which settings and options you use, and what result you get, or want. From andrey.krieger.utkin at gmail.com Sat Jun 15 14:00:59 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sat, 15 Jun 2013 15:00:59 +0300 Subject: [Libav-user] IP cam accessing directly and from dshow speed differences. In-Reply-To: References: Message-ID: 2013/6/14 Matthew Einhorn : > Hi, > > I have a WANSCAM IP camare (AJ-C2WA-C198) which I'm testing in > ffplay/ffmpeg. I noticed that playing it through its http address is much > slower than when playing it with direct show. I'm linking to logs for both > as run in ffplay. > > ffplay displayed the video through direct http access very slow and choppy > using this command :ffplay -report -loglevel debug -i > http://user:pwd at IP:99/videostream.asf -an (see > http://paste.ubuntu.com/5765942/). > > To use direct show, I installed a driver from http://alax.info/blog/1223 > which converts a IP cam to direct show and the ffplay speed was faster > although still choppy, even with a large realy time buffer. The command line > was "ffplay -loglevel debug -report -f dshow -i "video=wanscam" -an > -rtbufsize 1000000" (see http://paste.ubuntu.com/5765952/) > > Finally, viewing the camera directly from Firefox was much faster than > either method and it wasn't choppy at all. I am looking for recommendations > as to what I can do in ffmpeg to speed it up so that it's as fast as > Firefox. In the end I'd be using the API not ffplay. I'd consider checking two things: 1. Available bandwidth of your connectivity with camera. If bandwidth is not sufficient, camera is not able to send full stream and probably skips some data which it should send. 2. Decoding capability of host CPU. If stream bandwidth is something like >= 1 MBytes/s, there is a chance your host cannot decode all the stream in real time, so it drops frames or produces other articacts. Try just downloading the stream, e.g. with wget, for several minutes, and playback the recorded file. If all players, not only ffplay, play it with artifacts, then bandwidth is the root of problem. If playback of recording with natural speed shows problems, but playback in slow motion (try sth like slowing down in 10 times to be sure) goes ok, then decoding capability causes the problem. Here i consider that camera itself sends HTTP stream. Recently somebody discussed his issue in this list, and he had RTSP-to-HTTP tunneling application between camera and ffmpeg, and i believe it caused the data loss. If you have any middleware like this, check it thoroughly. -- Andrey Utkin From aftnix at gmail.com Sat Jun 15 15:22:24 2013 From: aftnix at gmail.com (arif) Date: Sat, 15 Jun 2013 19:22:24 +0600 Subject: [Libav-user] [SOLVED]What happened to libavcodec/api_example.c In-Reply-To: References: Message-ID: <51BC6A90.3030305@gmail.com> On 06/15/2013 04:06 PM, Hendrik Leppkes wrote: > On Sat, Jun 15, 2013 at 11:54 AM, arif wrote: >> Hi, >> >> The file i'm talking about is listed here >> http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html >> >> But current git repo does not have it. >> >> And a "git log -- libavcodec/api-example.c" does not come up with anything. >> > > api-example is now in doc/examples/decoding_encoding.c, among other > examples in the same folder. > > - Hendrik > Thanks -- Cheers arif From donmoir at comcast.net Sat Jun 15 21:50:08 2013 From: donmoir at comcast.net (Don Moir) Date: Sat, 15 Jun 2013 15:50:08 -0400 Subject: [Libav-user] IP cam accessing directly and from dshow speeddifferences. References: Message-ID: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> > 2013/6/14 Matthew Einhorn : >> Hi, >> >> I have a WANSCAM IP camare (AJ-C2WA-C198) which I'm testing in >> ffplay/ffmpeg. I noticed that playing it through its http address is much >> slower than when playing it with direct show. I'm linking to logs for both >> as run in ffplay. >> >> ffplay displayed the video through direct http access very slow and choppy >> using this command :ffplay -report -loglevel debug -i >> http://user:pwd at IP:99/videostream.asf -an (see >> http://paste.ubuntu.com/5765942/). >> >> To use direct show, I installed a driver from http://alax.info/blog/1223 >> which converts a IP cam to direct show and the ffplay speed was faster >> although still choppy, even with a large realy time buffer. The command line >> was "ffplay -loglevel debug -report -f dshow -i "video=wanscam" -an >> -rtbufsize 1000000" (see http://paste.ubuntu.com/5765952/) >> >> Finally, viewing the camera directly from Firefox was much faster than >> either method and it wasn't choppy at all. I am looking for recommendations >> as to what I can do in ffmpeg to speed it up so that it's as fast as >> Firefox. In the end I'd be using the API not ffplay. It appears a filter is being used when using ffplay and could be a problem, but here's a few things I found when connecting to IP cam. Some of this might have changed since last time I checked which has been awhile. 1) the probe time may effect the timestamps of the video packets. In other words, if it takes 5 seconds to do the probe, packet times can be 5 seconds late. 2) audio can effect things quite a bit. For my IP camera its way out of sync and slowed things and so just did not bother with audio for the time being. It was way of sync with the installed software as well and not just ffmpeg. 3) When I got down and dirty with the camera IP API things got better. I still believe that to get the best possible performance you need to 'know' the camera, meaning some database would be useful. 4) I have a special interface for IP and USB cameras and not a generic interface. This is for a few reasons, but for one it is flagged to ignore timestamps. The timestamps are way off and I want to see the video in real time, not 5 to 10 seconds later. I have found there is a lot to check for IP cameras and various ways to interface. Normally there is going to be an optimal interface and you just need to play with it. From ggarra13 at gmail.com Mon Jun 17 02:17:40 2013 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Sun, 16 Jun 2013 21:17:40 -0300 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? Message-ID: <51BE55A4.7070402@gmail.com> I am on windows using zeranoe builds. I am using swresample. I have the following: 5.1(side), channels 6, format fltp, sample rate 48000 converting to: stereo, channels 2, format s16, sample rate 48000 The result is that I hear in my viewer: the left channel, the center channel, the left surround channel, the subwoofer (?) channel. However I hear nothing of either the right channel or the right surround channel. The sample I am using is m4 large of channel check from: http://www.dolby.com/us/en/consumer/technology/home-theater/dolby-digital-plus-download.html For your info, ffplay plays the file correctly, but it does not use swresample by default (and I don't know how to force it to). Thanks for your patience and help in this matter. From jona at visualblasters.com Sun Jun 16 17:08:33 2013 From: jona at visualblasters.com (jona) Date: Sun, 16 Jun 2013 08:08:33 -0700 (PDT) Subject: [Libav-user] Merging various audio and video sources into one using avfilter lib? Message-ID: <1371395312992-4657898.post@n4.nabble.com> Hello! I'm looking to merge various audio and video sources into one. The sources need to start at different time offsets. My guess is to use avfilter lib. Would that do the trick? Is that the right direction? If avfilter lib is the correct direction I would greatly appreciate if someone could provide some pseudo code on how I could be done? I'm having a hard time finding some documentation or examples about using filters. I have looked into the filtering_video.c example but I'm not 100% sure how to go about setting it up and all. How do I feed the various audio and video frames to the different input filter buffers? I'm not sure how the offsets are set or handled or if the avfilter lib handles that side of things. Thanks for any help or direction about this. - Jona -- View this message in context: http://libav-users.943685.n4.nabble.com/Merging-various-audio-and-video-sources-into-one-using-avfilter-lib-tp4657898.html Sent from the libav-users mailing list archive at Nabble.com. From ahmed.hmz at gmail.com Sun Jun 16 19:25:01 2013 From: ahmed.hmz at gmail.com (Ahmed Hamza) Date: Sun, 16 Jun 2013 10:25:01 -0700 Subject: [Libav-user] Decoder and Bitstream Switching Message-ID: Dear All, I'm using libavcodec in a project that I'm working to decode a received video stream. One of the requirements of this project is the ability to perform fast switching to a different stream. The new stream may be encoded at a different bitrate for example or a completely different video. I was wondering how to safely and quickly perform this stream switching and what I need to do to re-initialize or configure the decoder so that it would be able to start decoding the new stream? I believe a call to avcodec_flush_buffers() may be necessary, similar to what is done when seeking to a different timestamp. However, In the case of having the same video at different bitrates, I'm not sure how this would affect the smoothness of the transition between the two streams. Thanks in advance.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Mon Jun 17 09:07:17 2013 From: er.anshul.maheshwari at gmail.com (Anshul maheshwari) Date: Mon, 17 Jun 2013 12:37:17 +0530 Subject: [Libav-user] Merging various audio and video sources into one using avfilter lib? In-Reply-To: <1371395312992-4657898.post@n4.nabble.com> References: <1371395312992-4657898.post@n4.nabble.com> Message-ID: Isnt merging is same as muxing two elementry stream means audio n video in ur cases On Jun 17, 2013 12:32 PM, "jona" wrote: > Hello! > > I'm looking to merge various audio and video sources into one. The sources > need to start at different time offsets. My guess is to use avfilter lib. > Would that do the trick? Is that the right direction? > > If avfilter lib is the correct direction I would greatly appreciate if > someone could provide some pseudo code on how I could be done? I'm having a > hard time finding some documentation or examples about using filters. > > I have looked into the filtering_video.c example but I'm not 100% sure how > to go about setting it up and all. > > How do I feed the various audio and video frames to the different input > filter buffers? I'm not sure how the offsets are set or handled or if the > avfilter lib handles that side of things. > > Thanks for any help or direction about this. > - Jona > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Merging-various-audio-and-video-sources-into-one-using-avfilter-lib-tp4657898.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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.george at normalesup.org Mon Jun 17 09:47:59 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Mon, 17 Jun 2013 09:47:59 +0200 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <51BE55A4.7070402@gmail.com> References: <51BE55A4.7070402@gmail.com> Message-ID: <20130617074759.GA1261@phare.normalesup.org> L'octidi 28 prairial, an CCXXI, Gonzalo Garramu?o a ?crit?: > I am on windows using zeranoe builds. I am using swresample. I have > the following: > 5.1(side), channels 6, format fltp, sample rate 48000 > converting to: > stereo, channels 2, format s16, sample rate 48000 > > The result is that I hear in my viewer: the left channel, the center > channel, the left surround channel, the subwoofer (?) channel. > However I hear nothing of either the right channel or the right > surround channel. Can you reproduce the problem using the ffmpeg command-line tools? I just tried and the conversion works as expected. > The sample I am using is m4 large of channel check from: > http://www.dolby.com/us/en/consumer/technology/home-theater/dolby-digital-plus-download.html How can they make something so simple so useless? Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From dragoshiordache at gmail.com Mon Jun 17 10:33:09 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Mon, 17 Jun 2013 11:33:09 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: On Thu, Jun 13, 2013 at 5:52 PM, Carl Eugen Hoyos wrote: > Dragos Iordache writes: > > > On Thu, Jun 13, 2013 at 5:36 PM, Carl Eugen Hoyos wrote: > > > Dragos Iordache ...> writes: > > > > The stream is not showing and the recorded video does not > > > > allow seeking, it just freezes and cannot be played. > > > > > > Can you reproduce the problem with ffmpeg (the application)? > > > > No. I am using my own H264 encoder that produces > > the correct output > > Does that mean if you feed your encoders output into > ffmpeg (the application), then everything works fine? > > Out of curiosity: Which h264 encoder works better for > you than x264? > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Hi, I had some time to do some more tests. To answer your first question, I am using the ffmpeg on an Android and compress the frames with stagefright. If my output is a file ("test.h264") then everything works ok. I can play the video, seek to any point and it look ok. If I use a rtmp server as the output, then the live stream is black and if I record the stream, it cannot be played back. For the rtmp server I use justin.tv servers. After I capture the frames that leave my device (Shark app for root) they look nothing as the data I pass to the AVPacket. I open them with wireshark on desktop and the rtmp body does not contain the data I hoped. So, my encoder generates the right output, but when they are written on the network the packet doen not contain the frame. I think it is a problem with rtmp + flv + h264 encoder in ffmpeg, because I create the codec too. Do you have any ideas? Thanks, Dragos -- dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Jun 17 10:53:03 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 17 Jun 2013 08:53:03 +0000 (UTC) Subject: [Libav-user] H264+flv bad video stream References: Message-ID: Dragos Iordache writes: > If my output is a file ("test.h264") then everything > works ok. Does that mean if you feed test.h264 into ffmpeg to produce the rtmp stream that you need (is that correct?), it works fine, but if you call your application that uses the libav* libraries it does not work? Carl Eugen From dragoshiordache at gmail.com Mon Jun 17 12:12:55 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Mon, 17 Jun 2013 13:12:55 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: On Mon, Jun 17, 2013 at 11:53 AM, Carl Eugen Hoyos wrote: > Dragos Iordache writes: > > > If my output is a file ("test.h264") then everything > > works ok. > > Does that mean if you feed test.h264 into ffmpeg to > produce the rtmp stream that you need (is that correct?), > it works fine, but if you call your application that > uses the libav* libraries it does not work? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Hi, Thanks for your help. The answer is yes. With the following command the streams works ok. .\ffmpeg.exe -i .\test.h264 -f flv rtmp://live.justin.tv/app/live_**** What do I do wrong? Thanks, Dragos -- dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bersac_1 at hotmail.fr Mon Jun 17 13:38:36 2013 From: bersac_1 at hotmail.fr (... ...) Date: Mon, 17 Jun 2013 11:38:36 +0000 Subject: [Libav-user] Memory leaks Message-ID: Hi, I am using ffmpeg version git-2013-06-14-7fff3df and when I use valgrind on a program using ffmpeg, it displays the following messages : ==19153== 288 bytes in 1 blocks are possibly lost in loss record 112 of 223==19153== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)==19153== by 0x4012074: _dl_allocate_tls (dl-tls.c:297)==19153== by 0x4E3AABC: pthread_create@@GLIBC_2.2.5 (allocatestack.c:571)==19153== by 0x5444F63: ??? (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x5387EE3: ??? (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x5388005: ffurl_open (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x538A0FA: avio_open2 (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x544FAE7: avformat_open_input (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x401ACE: Capture::initFluxFFmpeg() (Capture.cpp:147)==19153== by 0x4017DA: Capture::Capture(std::string const&) (Capture.cpp:28)==19153== by 0x403BBE: main (test.cpp:43)==19153== ==19153== 1,440 bytes in 5 blocks are possibly lost in loss record 122 of 223==19153== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)==19153== by 0x4012074: _dl_allocate_tls (dl-tls.c:297)==19153== by 0x4E3AABC: pthread_create@@GLIBC_2.2.5 (allocatestack.c:571)==19153== by 0x5ABC21F: ??? (in /usr/local/lib/libavcodec.so.55.16.100)==19153== by 0x5B590DA: avcodec_open2 (in /usr/local/lib/libavcodec.so.55.16.100)==19153== by 0x401D65: Capture::initStreamVideo() (Capture.cpp:224)==19153== by 0x4017E6: Capture::Capture(std::string const&) (Capture.cpp:29)==19153== by 0x403BBE: main (test.cpp:43)==19153== ==19153== 212,866 (1,176 direct, 211,690 indirect) bytes in 49 blocks are definitely lost in loss record 212 of 223==19153== at 0x4C29BE8: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)==19153== by 0x4C29C97: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)==19153== by 0x772DEC1: av_malloc (in /usr/local/lib/libavutil.so.52.35.101)==19153== by 0x772E085: av_mallocz (in /usr/local/lib/libavutil.so.52.35.101)==19153== by 0x77238E7: av_buffer_create (in /usr/local/lib/libavutil.so.52.35.101)==19153== by 0x7723C79: av_buffer_realloc (in /usr/local/lib/libavutil.so.52.35.101)==19153== by 0x579874E: ??? (in /usr/local/lib/libavcodec.so.55.16.100)==19153== by 0x579884D: av_dup_packet (in /usr/local/lib/libavcodec.so.55.16.100)==19153== by 0x544AE68: ??? (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x544B19A: ??? (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x544CB0E: avformat_find_stream_info (in /usr/local/lib/libavformat.so.55.8.102)==19153== by 0x401B20: Capture::initFluxFFmpeg() (Capture.cpp:155) While using the functions : avformat_find_stream_info. I closed the AvFormatContext using avformat_free_context. avcodec_open2. I closed the AVCodecContext using avcodec_close.Are they known bugs ? How could I solve it ? Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks411 at gmail.com Mon Jun 17 15:02:09 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Mon, 17 Jun 2013 06:02:09 -0700 (PDT) Subject: [Libav-user] Using AV_CODEC_ID_RAWVIEO with images Message-ID: <1371474129433-4657907.post@n4.nabble.com> Hi, I'm trying to encode a video from image buffer. I want to encode it as raw video format, so I have used AV_CODEC_ID_RAWVIDEO as codec_id and also set format flags in AVFormatContext to AVFMT_RAWPICTURE. When I run the loop the generated video is blank it only show black screen. However when I used some other codec_id like AV_CODEC_ID_MP4 it works fine. I'm following decoding_encoding.c example. Please suggest something what could be going wrong. Snippet of code which is writing frame if (oc->oformat->flags & AVFMT_RAWPICTURE || video_st->codec->codec_id == CODEC_ID_JPEGLS ||video_st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) { /* raw video case. The API will change slightly in the near futur for that */ AVPacket pkt; av_init_packet(&pkt); pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index= video_st->index; pkt.data= (uint8_t *)picture; pkt.size= sizeof(AVPicture); pkt.destruct = NULL; PRINT_VAL("Size of Vid Pkt ", pkt.size) vid_pts++; pkt.pts = av_rescale_q(vid_pts, video_st->codec->time_base, video_st->time_base); pkt.dts = pkt.pts; pkt.duration = 0; if((ret = av_interleaved_write_frame(oc, &pkt)) < 0) { PRINT_MSG("Failed to Write Video Frame ") } } Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Using-AV-CODEC-ID-RAWVIEO-with-images-tp4657907.html Sent from the libav-users mailing list archive at Nabble.com. From andrey.krieger.utkin at gmail.com Mon Jun 17 15:40:46 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 17 Jun 2013 16:40:46 +0300 Subject: [Libav-user] Memory leaks In-Reply-To: References: Message-ID: 2013/6/17 ... ... : > Are they known bugs ? No. > How could I solve it ? Learn ffmpeg API, look at different examples of usage, debug reduced code cases. Good luck. -- Andrey Utkin From ggarra13 at gmail.com Mon Jun 17 16:24:10 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 17 Jun 2013 11:24:10 -0300 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <20130617074759.GA1261@phare.normalesup.org> References: <51BE55A4.7070402@gmail.com> <20130617074759.GA1261@phare.normalesup.org> Message-ID: <51BF1C0A.1020004@gmail.com> On 17/06/13 04:47, Nicolas George wrote: > Can you reproduce the problem using the ffmpeg command-line tools? I > just tried and the conversion works as expected. How do I force ffmpeg to use s16 output? From ggarra13 at gmail.com Mon Jun 17 16:28:28 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 17 Jun 2013 11:28:28 -0300 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <20130617074759.GA1261@phare.normalesup.org> References: <51BE55A4.7070402@gmail.com> <20130617074759.GA1261@phare.normalesup.org> Message-ID: <51BF1D0C.5@gmail.com> On 17/06/13 04:47, Nicolas George wrote: > Can you reproduce the problem using the ffmpeg command-line tools? I just > tried and the conversion works as expected. I find ffmpeg does not rely on swresample for the conversion (at least there's no swr_init in the code). ffplay does use swresample, but only if avfilter is not used, it seems. From h.leppkes at gmail.com Mon Jun 17 16:33:51 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Mon, 17 Jun 2013 16:33:51 +0200 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <51BF1D0C.5@gmail.com> References: <51BE55A4.7070402@gmail.com> <20130617074759.GA1261@phare.normalesup.org> <51BF1D0C.5@gmail.com> Message-ID: On Mon, Jun 17, 2013 at 4:28 PM, Gonzalo Garramuno wrote: > On 17/06/13 04:47, Nicolas George wrote: >> >> Can you reproduce the problem using the ffmpeg command-line tools? I just >> tried and the conversion works as expected. > > I find ffmpeg does not rely on swresample for the conversion (at least > there's no swr_init in the code). > ffplay does use swresample, but only if avfilter is not used, it seems. > ffmpeg uses avfilter, which in turn uses swresample. From gedikmert89 at gmail.com Mon Jun 17 17:43:33 2013 From: gedikmert89 at gmail.com (Mert Gedik) Date: Mon, 17 Jun 2013 18:43:33 +0300 Subject: [Libav-user] iPhone 5 and rtsp UDP streaming Message-ID: Hello everyone, I 'm having a strange behaviour which is When I try to stream from an rtsp server on UDP transport with ffplay (the latest one 1.2.1), there are only a few packet drops, and it works well. But when I try to do same test with iPhone 5 (same ffmpeg configuration), many packets drops and so the stream can not be watched because of many corrupted frames. TCP works well in iPhone 5. ffplay and iphone 5 are in the same network, so there is a wrong with the iPhone 5, according to my searches on the net, I think this problem is caused by the maximum UDP buffer receive size. I've read that If the buffer size of operating system is lower than the server sends then packets will be dropped. Is that right? Also, I modified the udp.c file to increase the udp buffer size but this did not change anything on the iphone 5. Does anyone have any idea about this situation ? Regards, - MG -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Mon Jun 17 18:38:21 2013 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Mon, 17 Jun 2013 13:38:21 -0300 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <51BF1D0C.5@gmail.com> References: <51BE55A4.7070402@gmail.com> <20130617074759.GA1261@phare.normalesup.org> <51BF1D0C.5@gmail.com> Message-ID: <51BF3B7D.6080300@gmail.com> El 17/06/2013 11:28 a.m., Gonzalo Garramuno escribi?: > On 17/06/13 04:47, Nicolas George wrote: >> Can you reproduce the problem using the ffmpeg command-line tools? I >> just >> tried and the conversion works as expected. I found out the problem. It was a bad jack for headphones. Drove me nuts. From danielglass4 at aol.de Mon Jun 17 09:19:34 2013 From: danielglass4 at aol.de (=?utf-8?Q?Daniel_Gla=C3=9F?=) Date: Mon, 17 Jun 2013 03:19:34 -0400 (EDT) Subject: [Libav-user] mp3 decoding with ffmpeg Message-ID: <8D03942271F8E5D-17AC-1916C@webmail-vd016.sysops.aol.com> I want to decode an mp3-File with the ffmpeg library. #include #include #include #include #include #include #include #include #define INBUF_SIZE 4096 #define AUDIO_INBUF_SIZE 20480 #define AUDIO_REFILL_THRESH 4096 static void audio_decode_example(const char *outfilename, const char *filename) { AVCodec *codec; AVCodecContext *c= NULL; int len; FILE *f, *outfile; uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; AVPacket avpkt; AVFrame *decoded_frame = NULL; av_init_packet(&avpkt); printf("Decode audio file %s to %s\n", filename, outfilename); /* find the mpeg audio decoder */ codec = avcodec_find_decoder(AV_CODEC_ID_MP3); if (!codec) { fprintf(stderr, "Codec not found\n"); exit(1); } c = avcodec_alloc_context3(codec); if (!c) { fprintf(stderr, "Could not allocate audio codec context\n"); exit(1); } /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); exit(1); } f = fopen(filename, "rb"); if (!f) { fprintf(stderr, "Could not open %s\n", filename); exit(1); } outfile = fopen(outfilename, "wb"); if (!outfile) { av_free(c); exit(1); } /* decode until eof */ avpkt.data = inbuf; avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f); while (avpkt.size > 0) { int got_frame = 0; if (!decoded_frame) { if (!(decoded_frame = avcodec_alloc_frame())) { fprintf(stderr, "Could not allocate audio frame\n"); exit(1); } } else avcodec_get_frame_defaults(decoded_frame); len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt); if (len < 0) { fprintf(stderr, "Error while decoding\n"); exit(1); } if (got_frame) { /* if a frame has been decoded, output it */ int data_size = av_samples_get_buffer_size(NULL, c->channels, decoded_frame->nb_samples, c->sample_fmt, 1); fwrite(decoded_frame->data[0], 1, data_size, outfile); } avpkt.size -= len; avpkt.data += len; avpkt.dts = avpkt.pts = AV_NOPTS_VALUE; if (avpkt.size < AUDIO_REFILL_THRESH) { memmove(inbuf, avpkt.data, avpkt.size); avpkt.data = inbuf; len = fread(avpkt.data + avpkt.size, 1, AUDIO_INBUF_SIZE - avpkt.size, f); if (len > 0) avpkt.size += len; } } fclose(outfile); fclose(f); avcodec_close(c); av_free(c); avcodec_free_frame(&decoded_frame); } int main(int argc, char **argv) { const char* filename; /* register all the codecs */ avcodec_register_all(); filename = argv[1]; audio_decode_example("ausgabe.sw", filename); return 0; } And here is my problem: When i start my program, the decoding from the mp3-File into this raw data file succeed with no problem. But when I play this output file with my Alsa driver I have an distorted sound, its the original sound, but i sounds like the smurfs and its distorted.Have anyone here an idea? The Code is from the original encoding_decoding.c example from ffmpeg. The only thing I changed is the AV_CODEC_ID, because I need .mp3.Sorry for my partially bad englisch. Thanks for every help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Mon Jun 17 19:46:45 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 17 Jun 2013 20:46:45 +0300 Subject: [Libav-user] mp3 decoding with ffmpeg In-Reply-To: <8D03942271F8E5D-17AC-1916C@webmail-vd016.sysops.aol.com> References: <8D03942271F8E5D-17AC-1916C@webmail-vd016.sysops.aol.com> Message-ID: 2013/6/17 Daniel Gla? : > original sound, but i sounds like the smurfs and its distorted. Have anyone > here an idea? Does "sounding like smurf" means something like "childish" voice with going faster than original? Then it may be played back at sample rate higher than original recording. Check your original sample rate and the one used by your player. I'd suggest you producing a file in a media container, which holds such metadata as sample rate, channels number etc., this avoids such problems. You may produce formatted media files using libavformat. -- Andrey Utkin From andrey.krieger.utkin at gmail.com Mon Jun 17 19:47:59 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 17 Jun 2013 20:47:59 +0300 Subject: [Libav-user] mp3 decoding with ffmpeg In-Reply-To: <8D03942271F8E5D-17AC-1916C@webmail-vd016.sysops.aol.com> References: <8D03942271F8E5D-17AC-1916C@webmail-vd016.sysops.aol.com> Message-ID: Does "sounding like smurf" means something like "childish" voice with going faster than original? Then it may be played back at sample rate higher than original recording. Check your original sample rate and the one used by your player. I'd suggest you producing a file in a media container, which holds such metadata as sample rate, channels number etc., this avoids such problems. You may produce formatted media files using libavformat. -- Andrey Utkin From bowljoman at gmail.com Mon Jun 17 20:52:34 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Mon, 17 Jun 2013 11:52:34 -0700 Subject: [Libav-user] Audio 5.1 downsample to stereo broken in swresample? In-Reply-To: <51BF3B7D.6080300@gmail.com> References: <51BE55A4.7070402@gmail.com> <20130617074759.GA1261@phare.normalesup.org> <51BF1D0C.5@gmail.com> <51BF3B7D.6080300@gmail.com> Message-ID: <51BF5AF2.7050909@gmail.com> On 6/17/2013 9:38 AM, Gonzalo Garramu?o wrote: > El 17/06/2013 11:28 a.m., Gonzalo Garramuno escribi?: >> On 17/06/13 04:47, Nicolas George wrote: >>> Can you reproduce the problem using the ffmpeg command-line tools? I >>> just >>> tried and the conversion works as expected. > I found out the problem. It was a bad jack for headphones. Drove me > nuts. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user You made my day Thanks Andy From faraz at screenhero.com Tue Jun 18 05:41:23 2013 From: faraz at screenhero.com (Faraz Khan) Date: Mon, 17 Jun 2013 20:41:23 -0700 Subject: [Libav-user] Making avcodec_decoder_video2 error out on bad bitstream Message-ID: Guys, I have set: decoderContext->err_recognition = AV_EF_EXPLODE; but the call to avcodec_decoder_video2 never returns an error (though I can clearly see artifacts on my screen). I'm feeding fully encoded frames using my rtp library and this happens after packet loss. I have other ways of figuring out whether the frame provided was complete or not but it would be a lot easier if the decoder can just indicate when it was in a error state. I've also tried to use: int errors = av_frame_get_decode_error_flags(decoderOutFrame); without any luck. Thanks! -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamidi at gmail.com Tue Jun 18 07:25:28 2013 From: hamidi at gmail.com (hamidi) Date: Tue, 18 Jun 2013 09:55:28 +0430 Subject: [Libav-user] 920328 - replacement for av_set_parameters Message-ID: hi we're going to port from ffmpeg 0.8.6 to the latest version and it seems that av_set_parameters has become deprecated and is removed from the libraries. i need to know how to replace its functionality. is it required to be called anymore? how can i set parameters?... thx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Jun 18 09:31:56 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 18 Jun 2013 17:31:56 +1000 Subject: [Libav-user] a question for av_seek_frame Message-ID: Hi friends, I have a very basic question about av_seek_frame. Say if my video has 1 video stream and 1 audio stream, and I called av_seek_frame to seek to 3rd second in the video (and suppose seek succeed). Then will my subsequent call of av_read_frame read data from where the video was previously seeked to? I mean, if I call av_read_frame after av_seek_frame is called to seek to 3rd second in the video stream, will I get sound packets starting from 3rd second in the movie? I guess the answer is yes, can anyone confirm with me? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From hs at tagtraum.com Tue Jun 18 10:43:05 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 18 Jun 2013 10:43:05 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows Message-ID: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> Hi, I have searched the archive and the bug database, but haven't found any references to this... If this is an old hat, please ignore. as far as I remember, in the dev documentation it is mentioned that one can open resources either via a filename, a URL or some other form of custom AVIOContext. But in its current form FFmpeg does not seem to support well formed Windows file URLs. On Windows, the scheme part (file:) is always followed by a bunch of slashes, usually three (file:///), before the drive designator. A correct local file URL is e.g.: file:///C:/somePath/someFile.mp3 A more complete explanation can be found at http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx Contrary to this, in libavformat/file.c (static int file_open(URLContext *h, const char *filename, int flags), line 112) FFmpeg simply cuts off "file:" in line 119 and thinks it is done. Unfortunately, open("///C:/somePath/someFile.mp3", access, 0666); // line 135 leads to EINVAL/Invalid Argument. This function is called via avio_open2, which is called by avformat_open_input. Is this a known issue? Or should I file a bug report? Cheers, -hendrik From cehoyos at ag.or.at Tue Jun 18 11:16:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 18 Jun 2013 09:16:49 +0000 (UTC) Subject: [Libav-user] Faulty handling of file: protocol on Windows References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> Message-ID: Hendrik Schreiber writes: > On Windows, the scheme part (file:) is always followed > by a bunch of slashes, usually three (file:///), three sounds like a very unlikely number to me. Carl Eugen From hs at tagtraum.com Tue Jun 18 11:47:06 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 18 Jun 2013 11:47:06 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> Message-ID: <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> On Jun 18, 2013, at 11:16 AM, Carl Eugen Hoyos wrote: > Hendrik Schreiber writes: > >> On Windows, the scheme part (file:) is always followed >> by a bunch of slashes, usually three (file:///), > > three sounds like a very unlikely number to me. Yes, it sounds odd, but please read http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx That said - Java only uses one slash for these kinds of URLs on Windows... and I guess, misbehaves. -hendrik From bersac_1 at hotmail.fr Tue Jun 18 12:51:56 2013 From: bersac_1 at hotmail.fr (... ...) Date: Tue, 18 Jun 2013 10:51:56 +0000 Subject: [Libav-user] Do we need to link to lib shroedinger gsm and others ? Message-ID: Hi, I am trying to compile a code using ffmpeg. I get the following message error : g++ -o test Capture.o ffmpegTools.o FluxVideoModifie.o test.o vizILogger.o -lz -lpthread -ldl -lm -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video -lopencv_objdetect -lz -lpthread -ldl -lm /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_flush':(.text+0x28): undefined reference to `gsm_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_flush':(.text+0x2d): undefined reference to `gsm_create'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_flush':(.text+0x66): undefined reference to `gsm_option'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_decode_frame':(.text+0x11c): undefined reference to `gsm_decode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_frame':(.text+0x1db): undefined reference to `gsm_encode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_frame':(.text+0x1f7): undefined reference to `gsm_encode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_frame':(.text+0x21e): undefined reference to `gsm_encode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_decode_close':(.text.unlikely+0x10): undefined reference to `gsm_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_decode_init':(.text.unlikely+0x74): undefined reference to `gsm_create'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_decode_init':(.text.unlikely+0xc0): undefined reference to `gsm_option'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_close':(.text.unlikely+0x105): undefined reference to `gsm_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_init':(.text.unlikely+0x1a5): undefined reference to `gsm_create'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libgsm.o): In function `libgsm_encode_init':(.text.unlikely+0x1f1): undefined reference to `gsm_option'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_flush':(.text+0x33): undefined reference to `schro_decoder_reset'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_handle_first_access_unit':(.text+0xa5): undefined reference to `schro_decoder_get_video_format'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x2c7): undefined reference to `schro_buffer_new_with_data'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x2f9): undefined reference to `schro_decoder_push'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x30c): undefined reference to `schro_decoder_wait'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x350): undefined reference to `schro_decoder_reset'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x3cc): undefined reference to `schro_frame_unref'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x3f4): undefined reference to `schro_decoder_pull'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x42b): undefined reference to `schro_decoder_add_output_picture'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame':(.text+0x454): undefined reference to `schro_decoder_push_end_of_stream'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_frame_free':(.text+0x61): undefined reference to `schro_frame_unref'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_close':(.text.unlikely+0xd): undefined reference to `schro_decoder_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_init':(.text.unlikely+0x42): undefined reference to `schro_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_init':(.text.unlikely+0x4d): undefined reference to `schro_debug_set_level'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_init':(.text.unlikely+0x52): undefined reference to `schro_decoder_new'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerdec.o): In function `libschroedinger_decode_init':(.text.unlikely+0x66): undefined reference to `schro_decoder_set_skip_ratio'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_frame':(.text+0x6e): undefined reference to `speex_bits_remaining'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_frame':(.text+0xc7): undefined reference to `speex_bits_read_from'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_frame':(.text+0xdb): undefined reference to `speex_decode_int'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_frame':(.text+0x14b): undefined reference to `speex_decode_stereo_int'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_close':(.text.unlikely+0x23): undefined reference to `speex_header_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_close':(.text.unlikely+0x2f): undefined reference to `speex_bits_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_close':(.text.unlikely+0x3b): undefined reference to `speex_decoder_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x47): undefined reference to `speex_nb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x6c): undefined reference to `speex_wb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x71): undefined reference to `speex_uwb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x86): undefined reference to `speex_packet_to_header'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0xce): undefined reference to `speex_nb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0xd7): undefined reference to `speex_lib_get_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x14b): undefined reference to `speex_bits_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x153): undefined reference to `speex_decoder_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x197): undefined reference to `speex_decoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x202): undefined reference to `speex_std_stereo_request_handler'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_init':(.text.unlikely+0x20c): undefined reference to `speex_decoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexdec.o): In function `libspeex_decode_flush':(.text.unlikely+0xf): undefined reference to `speex_bits_reset'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x56): undefined reference to `speex_encode_int'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x100): undefined reference to `speex_bits_nbytes'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x115): undefined reference to `speex_bits_write'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x121): undefined reference to `speex_bits_reset'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x166): undefined reference to `speex_bits_pack'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_frame':(.text+0x1a0): undefined reference to `speex_encode_stereo_int'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_close':(.text.unlikely+0x12): undefined reference to `speex_bits_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_close':(.text.unlikely+0x1e): undefined reference to `speex_encoder_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x85): undefined reference to `speex_uwb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0xa6): undefined reference to `speex_nb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0xae): undefined reference to `speex_wb_mode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0xb6): undefined reference to `speex_encoder_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0xf1): undefined reference to `speex_init_header'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x113): undefined reference to `speex_encoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x16f): undefined reference to `speex_encoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x198): undefined reference to `speex_encoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x1ac): undefined reference to `speex_encoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x1b8): undefined reference to `speex_encoder_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o):(.text.unlikely+0x1cc): more undefined references to `speex_encoder_ctl' follow/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x29f): undefined reference to `speex_header_to_packet'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x2d7): undefined reference to `speex_header_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x2e3): undefined reference to `speex_encoder_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x31d): undefined reference to `speex_header_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libspeexenc.o): In function `encode_init':(.text.unlikely+0x326): undefined reference to `speex_bits_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `submit_stats':(.text+0x56): undefined reference to `th_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `get_stats':(.text+0x118): undefined reference to `th_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_frame':(.text+0x2e3): undefined reference to `th_encode_ycbcr_in'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_frame':(.text+0x318): undefined reference to `th_encode_packetout'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_frame':(.text+0x3f2): undefined reference to `th_encode_packetout'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_close':(.text.unlikely+0x12): undefined reference to `th_encode_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x76): undefined reference to `th_info_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x1ad): undefined reference to `th_encode_alloc'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x1ea): undefined reference to `th_info_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x205): undefined reference to `th_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x26f): undefined reference to `th_comment_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x2e6): undefined reference to `th_encode_flushheader'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libtheoraenc.o): In function `encode_init':(.text.unlikely+0x2f2): undefined reference to `th_comment_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0x3f): undefined reference to `vorbis_analysis_buffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0xc4): undefined reference to `vorbis_analysis_wrote'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0xd7): undefined reference to `vorbis_analysis_blockout'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0xea): undefined reference to `vorbis_analysis'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0xf2): undefined reference to `vorbis_bitrate_addblock'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0xff): undefined reference to `vorbis_bitrate_flushpacket'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_frame':(.text+0x2a9): undefined reference to `vorbis_analysis_wrote'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_close':(.text.unlikely+0x18): undefined reference to `vorbis_analysis_wrote'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_close':(.text.unlikely+0x24): undefined reference to `vorbis_block_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_close':(.text.unlikely+0x2c): undefined reference to `vorbis_dsp_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_close':(.text.unlikely+0x35): undefined reference to `vorbis_info_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x78): undefined reference to `vorbis_info_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0xc6): undefined reference to `vorbis_encode_setup_vbr'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x107): undefined reference to `vorbis_encode_setup_managed'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x128): undefined reference to `vorbis_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x160): undefined reference to `vorbis_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x188): undefined reference to `vorbis_encode_ctl'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x190): undefined reference to `vorbis_encode_setup_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x1bf): undefined reference to `vorbis_analysis_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x1d5): undefined reference to `vorbis_block_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x1dd): undefined reference to `vorbis_comment_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x1ef): undefined reference to `vorbis_comment_add_tag'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x209): undefined reference to `vorbis_analysis_headerout'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvorbis.o): In function `oggvorbis_encode_init':(.text.unlikely+0x2dc): undefined reference to `vorbis_comment_clear'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_decode':(.text+0x4e): undefined reference to `vpx_codec_decode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_decode':(.text+0x60): undefined reference to `vpx_codec_error'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_decode':(.text+0x6b): undefined reference to `vpx_codec_error_detail'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_decode':(.text+0xd9): undefined reference to `vpx_codec_get_frame'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_free':(.text.unlikely+0x9): undefined reference to `vpx_codec_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_init':(.text.unlikely+0x44): undefined reference to `vpx_codec_version_str'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_init':(.text.unlikely+0x60): undefined reference to `vpx_codec_build_config'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_init':(.text.unlikely+0x89): undefined reference to `vpx_codec_vp8_dx_algo'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_init':(.text.unlikely+0x91): undefined reference to `vpx_codec_dec_init_ver'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxdec.o): In function `vp8_init':(.text.unlikely+0x9d): undefined reference to `vpx_codec_error'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_encode':(.text+0x7e): undefined reference to `vpx_codec_encode'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_encode':(.text+0x1cb): undefined reference to `vpx_codec_get_cx_data'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_free':(.text.unlikely+0x15): undefined reference to `vpx_codec_destroy'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `log_encoder_error':(.text.unlikely+0x402): undefined reference to `vpx_codec_error'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `log_encoder_error':(.text.unlikely+0x40d): undefined reference to `vpx_codec_error_detail'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `codecctl_int':(.text.unlikely+0x4e0): undefined reference to `vpx_codec_control_'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x55b): undefined reference to `vpx_codec_version_str'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x577): undefined reference to `vpx_codec_build_config'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x59a): undefined reference to `vpx_codec_vp8_cx_algo'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x59f): undefined reference to `vpx_codec_enc_config_default'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x5aa): undefined reference to `vpx_codec_err_to_string'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x843): undefined reference to `vpx_codec_vp8_cx_algo'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x848): undefined reference to `vpx_codec_enc_init_ver'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libvpxenc.o): In function `vp8_init':(.text.unlikely+0x957): undefined reference to `vpx_img_wrap'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavformat.a(matroskadec.o): In function `matroska_decode_buffer.isra.2':(.text+0x619): undefined reference to `BZ2_bzDecompressInit'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavformat.a(matroskadec.o): In function `matroska_decode_buffer.isra.2':(.text+0x684): undefined reference to `BZ2_bzDecompress'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavformat.a(matroskadec.o): In function `matroska_decode_buffer.isra.2':(.text+0x69d): undefined reference to `BZ2_bzDecompressEnd'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavformat.a(matroskadec.o): In function `matroska_decode_buffer.isra.2':(.text+0x6d6): undefined reference to `BZ2_bzDecompressEnd'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_close':(.text+0x10): undefined reference to `schro_encoder_free'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x7f): undefined reference to `schro_init'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x84): undefined reference to `schro_encoder_new'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0xab): undefined reference to `schro_encoder_get_video_format'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0xba): undefined reference to `schro_video_format_set_std_video_format'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x1d3): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x212): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x241): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x24f): undefined reference to `schro_video_format_set_std_signal_range'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x25f): undefined reference to `schro_encoder_set_video_format'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x26a): undefined reference to `schro_debug_set_level'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x276): undefined reference to `schro_encoder_start'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x2a1): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x2ce): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x2e4): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x30b): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_init':(.text+0x32e): undefined reference to `schro_encoder_setting_set_double'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o):(.text+0x365): more undefined references to `schro_encoder_setting_set_double' follow/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_frame':(.text+0x4cd): undefined reference to `schro_encoder_push_frame'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_frame':(.text+0x4ed): undefined reference to `schro_encoder_wait'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_frame':(.text+0x609): undefined reference to `schro_encoder_pull'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_frame':(.text+0x6c8): undefined reference to `schro_buffer_unref'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedingerenc.o): In function `libschroedinger_encode_frame':(.text+0x6f4): undefined reference to `schro_encoder_end_of_stream'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedinger.o): In function `ff_create_schro_frame':(.text+0xff): undefined reference to `schro_frame_new'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(libschroedinger.o): In function `ff_create_schro_frame':(.text+0x11f): undefined reference to `schro_frame_set_free_callback'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `commit_slices.part.1':(.text+0x60): undefined reference to `vaCreateBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `commit_slices.part.1':(.text+0x99): undefined reference to `vaCreateBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_pic_param':(.text+0x124): undefined reference to `vaCreateBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_pic_param':(.text+0x138): undefined reference to `vaMapBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_iq_matrix':(.text+0x187): undefined reference to `vaCreateBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_iq_matrix':(.text+0x19b): undefined reference to `vaMapBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_bitplane':(.text+0x1e7): undefined reference to `vaCreateBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_alloc_bitplane':(.text+0x1fb): undefined reference to `vaMapBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x323): undefined reference to `vaDestroyBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x376): undefined reference to `vaDestroyBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x3d4): undefined reference to `vaDestroyBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x3f4): undefined reference to `vaDestroyBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x422): undefined reference to `vaUnmapBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x45e): undefined reference to `vaBeginPicture'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x477): undefined reference to `vaRenderPicture'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x491): undefined reference to `vaRenderPicture'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x4a4): undefined reference to `vaEndPicture'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x503): undefined reference to `vaUnmapBuffer'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libavcodec.a(vaapi.o): In function `ff_vaapi_common_end_frame':(.text+0x523): undefined reference to `vaUnmapBuffer'collect2: ld returned 1 exit statusmake: *** [test] Error 1 It seems like my compiler can't find the path to the libraries that are used by ffmpeg. Does it mean I need to install this libraries ? I compiled ffmpeg myself, did I made a mistake ? Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hs at tagtraum.com Tue Jun 18 13:22:25 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 18 Jun 2013 13:22:25 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> Message-ID: <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> On Jun 18, 2013, at 11:47 AM, Hendrik Schreiber wrote: > On Jun 18, 2013, at 11:16 AM, Carl Eugen Hoyos wrote: > >> Hendrik Schreiber writes: >> >>> On Windows, the scheme part (file:) is always followed >>> by a bunch of slashes, usually three (file:///), >> >> three sounds like a very unlikely number to me. > > Yes, it sounds odd, but please read http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx Anyhow - the only Windows file URL FFmpeg accepts is something like: file:C:/somePath/someFile.mp3 And that is definitely not a valid URL by any standard I am aware of. -hendrik From h.leppkes at gmail.com Tue Jun 18 13:25:36 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Tue, 18 Jun 2013 13:25:36 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> Message-ID: On Tue, Jun 18, 2013 at 1:22 PM, Hendrik Schreiber wrote: > On Jun 18, 2013, at 11:47 AM, Hendrik Schreiber wrote: > >> On Jun 18, 2013, at 11:16 AM, Carl Eugen Hoyos wrote: >> >>> Hendrik Schreiber writes: >>> >>>> On Windows, the scheme part (file:) is always followed >>>> by a bunch of slashes, usually three (file:///), >>> >>> three sounds like a very unlikely number to me. >> >> Yes, it sounds odd, but please read http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx > > Anyhow - the only Windows file URL FFmpeg accepts is something like: > > file:C:/somePath/someFile.mp3 > > And that is definitely not a valid URL by any standard I am aware of. > While it may be bugged, why even use a file: URL and not just a plain path to the file, and avoid this whole mess? From hs at tagtraum.com Tue Jun 18 13:35:27 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Tue, 18 Jun 2013 13:35:27 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> Message-ID: <8A554471-F4AD-4A14-8890-DE5686A73F03@tagtraum.com> On Jun 18, 2013, at 1:25 PM, Hendrik Leppkes wrote: > > While it may be bugged, why even use a file: URL and not just a plain > path to the file, and avoid this whole mess? Certainly you can work around the whole issue and I did. So this is nothing urgent. But. To me it makes a whole lot of sense to pretty much always use URLs. That saves me the trouble to distinguish between local files and other resources, like e.g. a file hosted on a web server. URLs/URIs are simply a great abstractions, making your code simpler. But only, if they work. And in the case of FFmpeg, the file:-scheme, and Windows, the documentation says, feel free to use URLs, but the implementation isn't able to handle them. I think, it would be nice to resolve this discrepancy. I spent the better part of a day figuring out, why FFmpeg does not understand correct URLs. I would like to spare others this frustrating experience. -hendrik From dribas at cenatav.co.cu Tue Jun 18 15:35:32 2013 From: dribas at cenatav.co.cu (Dayana) Date: Tue, 18 Jun 2013 09:35:32 -0400 Subject: [Libav-user] sox avg Message-ID: <51C06224.9080906@cenatav.co.cu> Hi!! I have a doubt but about sox... I want to obtain the right channel of an stereo audio signal and the usual way do not function for me know, I should do something wrong or the command have been change .... >> sox sx.wav -c 1 sxright.wav avg -r any help please?? best Dayana From nicolas.george at normalesup.org Tue Jun 18 19:37:42 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Tue, 18 Jun 2013 19:37:42 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> Message-ID: <20130618173742.GA11701@phare.normalesup.org> Le decadi 30 prairial, an CCXXI, Carl Eugen Hoyos a ?crit?: > three sounds like a very unlikely number to me. The standard syntax is proto://host/full/path; if host is empty with the file: protocol, that gives file:///full/path, that is correct. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From Jamal.Waseem at de.bosch.com Tue Jun 18 13:28:56 2013 From: Jamal.Waseem at de.bosch.com (Jamal Waseem (RBEI/EAP3)) Date: Tue, 18 Jun 2013 19:28:56 +0800 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> Message-ID: Feeding a file is fine to ffmpeg but what if I want to feed a payload to ffmpeg?? How can I give this payload which is stored in char array to ffmpeg for decoding? This char array contains H.264 data. Your help will be highly appreciated. -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Hendrik Leppkes Sent: Tuesday, June 18, 2013 4:56 PM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] Faulty handling of file: protocol on Windows On Tue, Jun 18, 2013 at 1:22 PM, Hendrik Schreiber wrote: > On Jun 18, 2013, at 11:47 AM, Hendrik Schreiber wrote: > >> On Jun 18, 2013, at 11:16 AM, Carl Eugen Hoyos wrote: >> >>> Hendrik Schreiber writes: >>> >>>> On Windows, the scheme part (file:) is always followed >>>> by a bunch of slashes, usually three (file:///), >>> >>> three sounds like a very unlikely number to me. >> >> Yes, it sounds odd, but please read http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx > > Anyhow - the only Windows file URL FFmpeg accepts is something like: > > file:C:/somePath/someFile.mp3 > > And that is definitely not a valid URL by any standard I am aware of. > While it may be bugged, why even use a file: URL and not just a plain path to the file, and avoid this whole mess? _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From er.anshul.maheshwari at gmail.com Wed Jun 19 07:43:51 2013 From: er.anshul.maheshwari at gmail.com (Anshul) Date: Wed, 19 Jun 2013 11:13:51 +0530 Subject: [Libav-user] avio_alloc_context api comments Message-ID: <51C14517.4090304@gmail.com> HI I was using ffmpeg version 1.2.1 I wanted to use avio_alloc_context api. there was confusion about third argument of avio_alloc_context in comment above the api, developers had said that:: " @param write_flag Set to 1 if the buffer should be writable, 0 otherwise." *but when i debug the code of muxing example,then i found that they **flags value is 2 * ( (gdb) print h->flags ; $4 = 2) *through gdb also it look like 2 * Breakpoint 3, avio_alloc_context (buffer=0x8f6e980 "\310\347\366\b", buffer_size=32768, write_flag=2, opaque=0x8f6e940, read_packet=0x805faf7 , write_packet=0x805fb8a , seek=0x805fbef ) at libavformat/aviobuf.c:118 118 AVIOContext *s = av_mallocz(sizeof(AVIOContext)); *Do any one know what should i pass as third argument 1 or 2, if i am allocating io of output ** **means i need to write ** * thanks anshul -------------- next part -------------- An HTML attachment was scrubbed... URL: From hs at tagtraum.com Wed Jun 19 09:37:02 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Wed, 19 Jun 2013 09:37:02 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> Message-ID: On Jun 18, 2013, at 1:28 PM, Jamal Waseem (RBEI/EAP3) wrote: > Feeding a file is fine to ffmpeg but what if I want to feed a payload to ffmpeg?? > How can I give this payload which is stored in char array to ffmpeg for decoding? I'm not sure highjacking a thread is looked upon kindly here. Neither is topposting. But in any case: AVIOContext *io; AVFormatContext *format_context; format_context = avformat_alloc_context(); io = avio_alloc_context(buffer, buffer_size, 0, your_custom_pointer, read_callback, write_callback, seek_callback); format_context->pb = io; Then proceed with avformat_open_input(..) as you normally would. As filename/URL simply use something like "MyCustomIO". read_callback, write_callback, and seek_callback are function pointers defined in http://www.ffmpeg.org/doxygen/trunk/structAVIOContext.html If you choose not to implement the seek_callback (perhaps because you are streaming), make sure to call io->seekable = 0; Otherwise funny things happen (it would be nice, if avio_alloc_context did that automatically, when seek_callback is NULL). http://stackoverflow.com/questions/13634539/how-can-libavformat-be-used-without-using-other-libav-libraries/13642438#13642438 may also be useful to you. Good luck. -hendrik From bersac_1 at hotmail.fr Wed Jun 19 17:43:48 2013 From: bersac_1 at hotmail.fr (... ...) Date: Wed, 19 Jun 2013 15:43:48 +0000 Subject: [Libav-user] Retrieving informations for encoding Message-ID: Hi, I want to decode a video. The decoded datas are embedded in a AVFrame, and the encode data will be encode in a AVPacket. In order to decode my video, I need to tweak the AVCodecContex. The problem is that I don't know how to get the informations I need to fill the AVCodecContext. Here is the sample of code : AVFrame* dataDecode;//frame fill with the decoded data codecContext->bit_rate = ???; codecContext->width = dataDecode->width; codecContext->height = dataDecode->height; codecContext->pix_fmt = (enum AVPixelFormat)dataDecode->format; /* frames per second */ codecContext->time_base= dataDecode->???; codecContext->gop_size = ???; /* emit one intra frame every ??? frames */ codecContext->max_b_frames= ???; How could I fill this attributes ? Do we need to fill this attributes if we want to encode to a image ? By the way, which AVPixelFormat match with the AV_CODEC_ID_JPEGLS codec ? Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From moiein2000 at gmail.com Thu Jun 20 00:30:02 2013 From: moiein2000 at gmail.com (Matthew Einhorn) Date: Wed, 19 Jun 2013 18:30:02 -0400 Subject: [Libav-user] IP cam accessing directly and from dshow speeddifferences. In-Reply-To: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> References: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> Message-ID: On Sat, Jun 15, 2013 at 3:50 PM, Don Moir wrote: > 2013/6/14 Matthew Einhorn : >> >>> Hi, >>> >>> I have a WANSCAM IP camare (AJ-C2WA-C198) which I'm testing in >>> ffplay/ffmpeg. I noticed that playing it through its http address is much >>> slower than when playing it with direct show. I'm linking to logs for >>> both >>> as run in ffplay. >>> >>> ffplay displayed the video through direct http access very slow and >>> choppy >>> using this command :ffplay -report -loglevel debug -i >>> http://user:pwd at IP:99/**videostream.asf -an (see >>> http://paste.ubuntu.com/**5765942/ ). >>> >>> To use direct show, I installed a driver from http://alax.info/blog/1223 >>> which converts a IP cam to direct show and the ffplay speed was faster >>> although still choppy, even with a large realy time buffer. The command >>> line >>> was "ffplay -loglevel debug -report -f dshow -i "video=wanscam" -an >>> -rtbufsize 1000000" (see http://paste.ubuntu.com/**5765952/ >>> ) >>> >>> Finally, viewing the camera directly from Firefox was much faster than >>> either method and it wasn't choppy at all. I am looking for >>> recommendations >>> as to what I can do in ffmpeg to speed it up so that it's as fast as >>> Firefox. In the end I'd be using the API not ffplay. >>> >> > It appears a filter is being used when using ffplay and could be a > problem, but here's a few things I found when connecting to IP cam. > > Some of this might have changed since last time I checked which has been > awhile. > > 1) the probe time may effect the timestamps of the video packets. In other > words, if it takes 5 seconds to do the probe, packet times can be 5 seconds > late. > > 2) audio can effect things quite a bit. For my IP camera its way out of > sync and slowed things and so just did not bother with audio for the time > being. It was way of sync with the installed software as well and not just > ffmpeg. > > 3) When I got down and dirty with the camera IP API things got better. I > still believe that to get the best possible performance you need to 'know' > the camera, meaning some database would be useful. > > 4) I have a special interface for IP and USB cameras and not a generic > interface. This is for a few reasons, but for one it is flagged to ignore > timestamps. The timestamps are way off and I want to see the video in real > time, not 5 to 10 seconds later. > > I have found there is a lot to check for IP cameras and various ways to > interface. Normally there is going to be an optimal interface and you just > need to play with it. > > > Thanks for the replies. I believe I partially figured out how to get a nice fps, at least in vlc, now the question is how to achieve it in ffmpeg. I know very little about network protocols so I'm partially walking in the dark here. But this time I'm using the cam directly without any middleware. Anyway, before,I streamed with http://xxx/videostream.*asf* which resulted in slow speeds, even in VLC. Using http://xxx/videostream.*cgi* instead (which is what firefox uses) with :network-caching=0 resulted in speeds as fast as firefox. The problem is that when trying "ffplay -loglevel debug -analyzeduration 999999999 -probesize 999999999 http://CPL:lab at 169.254.5.105:99/videostream.cgi" I get Format ingenient probed with size=2048 and score=50q= 0B f=0/0 [ingenient @ 000000000277a2c0] File position before avformat_find_stream_info() is 0 [ingenient @ 000000000277a2c0] Could not find codec parameters for stream 0 (Video: mjpeg): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [ingenient @ 000000000277a2c0] File position after avformat_find_stream_info() is 4 http://CPL:lab at 169.254.5.105:99/videostream.cgi: could not find codec parameters [AVIOContext @ 0000000002779dc0] Statistics: 27 bytes read, 0 seeks When I tried wgets on the link I get a 27 byte file (attached). I guess something is wrong with the stream, but vlc is able to read it so I'm wondering how I can get ffmpeg to read it as well? increasing probesize and analyzeduration has no effect. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: videostream Type: application/octet-stream Size: 27 bytes Desc: not available URL: From andrey.krieger.utkin at gmail.com Thu Jun 20 00:51:06 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 20 Jun 2013 01:51:06 +0300 Subject: [Libav-user] IP cam accessing directly and from dshow speeddifferences. In-Reply-To: References: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> Message-ID: 2013/6/20 Matthew Einhorn : > When I tried wgets on the link I get a 27 byte file (attached). Did you look into it? -- Andrey Utkin From moiein2000 at gmail.com Thu Jun 20 01:20:51 2013 From: moiein2000 at gmail.com (Matthew Einhorn) Date: Wed, 19 Jun 2013 19:20:51 -0400 Subject: [Libav-user] IP cam accessing directly and from dshow speeddifferences. In-Reply-To: References: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> Message-ID: On Wed, Jun 19, 2013 at 6:51 PM, Andrey Utkin < andrey.krieger.utkin at gmail.com> wrote: > 2013/6/20 Matthew Einhorn : > > When I tried wgets on the link I get a 27 byte file (attached). > > Did you look into it? > > _red in the face_ I just assumed it'd be binary data. I'll know nexttime to at least open the file with notepad. I did it again properly with wgets which downloaded the actual video now. When I open the file in notepad I see this sequence repeatedly: --ipcamera Content-Type: image/jpeg Content-Length: 38416 followed after a newline with binary data. calling ffplay on this "ffplay -loglevel debug -analyzeduration 9999999 -probesize 9999999 videostream.cgi" I still get this: [ingenient @ 00000000025ea480] Format ingenient probed with size=2048 and score=50 File position before avformat_find_stream_info() is 0 0B f=0/0 [ingenient @ 00000000025ea480] Could not find codec parameters for stream 0 (Video: mjpeg): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [ingenient @ 00000000025ea480] File position after avformat_find_stream_info() is 4 C:\FFmpeg\videostream.cgi: could not find codec parameters [AVIOContext @ 00000000025e9ec0] Statistics: 32768 bytes read, 0 seeks Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From moiein2000 at gmail.com Thu Jun 20 01:49:08 2013 From: moiein2000 at gmail.com (Matthew Einhorn) Date: Wed, 19 Jun 2013 19:49:08 -0400 Subject: [Libav-user] IP cam accessing directly and from dshow speeddifferences. In-Reply-To: References: <2E7DE7C7DB5E499EBC407919559C4F10@MANLAP> Message-ID: ... > > I did it again properly with wgets which downloaded the actual video now. > When I open the file in notepad I see this sequence repeatedly: > --ipcamera > Content-Type: image/jpeg > Content-Length: 38416 > followed after a newline with binary data. > > calling ffplay on this "ffplay -loglevel debug -analyzeduration 9999999 > -probesize 9999999 videostream.cgi" > > I still get this: > [ingenient @ 00000000025ea480] Format ingenient probed with size=2048 and > score=50 > File position before avformat_find_stream_info() is 0 0B f=0/0 > [ingenient @ 00000000025ea480] Could not find codec parameters for stream > 0 (Video: mjpeg): unspecified size > > Consider increasing the value for the 'analyzeduration' and 'probesize' > options > [ingenient @ 00000000025ea480] File position after > avformat_find_stream_info() is 4 > C:\FFmpeg\videostream.cgi: could not find codec parameters > [AVIOContext @ 00000000025e9ec0] Statistics: 32768 bytes read, 0 seeks > > > Thanks, > Matt > Simply adding x.mjpeg after blah.cgi, e.g. http://blah.cgi?x.mjpeg as described here: http://code.opencv.org/issues/2474 was enough to enable ffmpeg to figure out that it's supposed to be a mjpeg stream and now it works beautifully! Thanks all, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jamal.Waseem at de.bosch.com Thu Jun 20 06:51:56 2013 From: Jamal.Waseem at de.bosch.com (Jamal Waseem (RBEI/EAP3)) Date: Thu, 20 Jun 2013 12:51:56 +0800 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <34CCCFEB-2978-414E-86FD-BEC47199E428@tagtraum.com> <21C8EE49-9134-4588-B95E-CE1C87CFDB04@tagtraum.com> Message-ID: Thanks a lot hendrik. I will try this and will let you know the results. Thanks again :) -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Hendrik Schreiber Sent: Wednesday, June 19, 2013 1:07 PM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] Faulty handling of file: protocol on Windows On Jun 18, 2013, at 1:28 PM, Jamal Waseem (RBEI/EAP3) wrote: > Feeding a file is fine to ffmpeg but what if I want to feed a payload to ffmpeg?? > How can I give this payload which is stored in char array to ffmpeg for decoding? I'm not sure highjacking a thread is looked upon kindly here. Neither is topposting. But in any case: AVIOContext *io; AVFormatContext *format_context; format_context = avformat_alloc_context(); io = avio_alloc_context(buffer, buffer_size, 0, your_custom_pointer, read_callback, write_callback, seek_callback); format_context->pb = io; Then proceed with avformat_open_input(..) as you normally would. As filename/URL simply use something like "MyCustomIO". read_callback, write_callback, and seek_callback are function pointers defined in http://www.ffmpeg.org/doxygen/trunk/structAVIOContext.html If you choose not to implement the seek_callback (perhaps because you are streaming), make sure to call io->seekable = 0; Otherwise funny things happen (it would be nice, if avio_alloc_context did that automatically, when seek_callback is NULL). http://stackoverflow.com/questions/13634539/how-can-libavformat-be-used-without-using-other-libav-libraries/13642438#13642438 may also be useful to you. Good luck. -hendrik _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From dragoshiordache at gmail.com Thu Jun 20 10:12:56 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Thu, 20 Jun 2013 11:12:56 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: On Mon, Jun 17, 2013 at 1:12 PM, Dragos Iordache wrote: > On Mon, Jun 17, 2013 at 11:53 AM, Carl Eugen Hoyos wrote: > >> Dragos Iordache writes: >> >> > If my output is a file ("test.h264") then everything >> > works ok. >> >> Does that mean if you feed test.h264 into ffmpeg to >> produce the rtmp stream that you need (is that correct?), >> it works fine, but if you call your application that >> uses the libav* libraries it does not work? >> >> Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > Hi, > > Thanks for your help. The answer is yes. With the following command the > streams works ok. > > .\ffmpeg.exe -i .\test.h264 -f flv rtmp://live.justin.tv/app/live_**** > > What do I do wrong? > > Thanks, > Dragos > > -- > > dragoshiordache at gmail.com > 0726736376 > Hi again, So I tested some more and the stream works ok with .\ffmpeg.exe -i .\test.h264 -c:v copy -f flv rtmp://live.justin.tv/app/live_**** But the stream does not work with my implementation using libffmpeg. I tried different methods for sending the stream with libffmpeg but none worked ok. What I do now: -create an oformat of flv -create a context for flv and filename=rtmp:/... -initialize a stream of h264 codec -write header -encode using stagefright -create a packet -write the packet The test.h264 in the ffmpeg line is created using this method and filename is set to "test.h264" and not a rtmp server, so I think this is ok. The captured frame data differs slightly between the command I run with ffmpeg and my code using libffmpeg. One of the diferences if that the NAL header "00 00 00 01" is not like this in the ffmpeg method. What do you think is not right? Thanks for your help. Dragos -- dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark39518 at cesinst.com Thu Jun 20 15:55:12 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Thu, 20 Jun 2013 06:55:12 -0700 Subject: [Libav-user] FLV logic question Message-ID: <51C309C0.5070706@cesinst.com> Frankly, I'm baffled by lines 445-457 of the trunk version of "libavformat/flvdec.c". Can anyone explain their purpose? Thanks! MLS From h.leppkes at gmail.com Thu Jun 20 15:59:50 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Thu, 20 Jun 2013 15:59:50 +0200 Subject: [Libav-user] FLV logic question In-Reply-To: <51C309C0.5070706@cesinst.com> References: <51C309C0.5070706@cesinst.com> Message-ID: On Thu, Jun 20, 2013 at 3:55 PM, Mark Stevans wrote: > Frankly, I'm baffled by lines 445-457 of the trunk version of > "libavformat/flvdec.c". Can anyone explain their purpose? Thanks! > These metadata properties are already stored in the codec/stream config structures, so it doesn't make any sense to duplicate them into the metadata, and are therefor skipped. From mark39518 at cesinst.com Thu Jun 20 16:16:56 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Thu, 20 Jun 2013 07:16:56 -0700 Subject: [Libav-user] FLV logic question In-Reply-To: References: <51C309C0.5070706@cesinst.com> Message-ID: <51C30ED8.6050908@cesinst.com> Thanks for the quick reply, Hendrik. But you say that the data is *already* stored somewhere: I just don't see how that is possible. When you open a random FLV clip file, the first thing you usually encounter is the Metadata packet. How can you know what codec is being used, the height/width, etc. without parsing that metadata? I mean, isn't that why it's put there at the start of the file? Or does FFMPEG rely on elaborate probing methods to deduce that metadata in the case where no header is present, and so, for consistency, it just ignores the header metadata if it *is* present? On 6/20/2013 6:59 AM, Hendrik Leppkes wrote: > On Thu, Jun 20, 2013 at 3:55 PM, Mark Stevans wrote: >> Frankly, I'm baffled by lines 445-457 of the trunk version of >> "libavformat/flvdec.c". Can anyone explain their purpose? Thanks! >> > > These metadata properties are already stored in the codec/stream > config structures, so it doesn't make any sense to duplicate them into > the metadata, and are therefor skipped. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From h.leppkes at gmail.com Thu Jun 20 16:31:06 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Thu, 20 Jun 2013 16:31:06 +0200 Subject: [Libav-user] FLV logic question In-Reply-To: <51C30ED8.6050908@cesinst.com> References: <51C309C0.5070706@cesinst.com> <51C30ED8.6050908@cesinst.com> Message-ID: On Thu, Jun 20, 2013 at 4:16 PM, Mark Stevans wrote: > Thanks for the quick reply, Hendrik. But you say that the data is *already* > stored somewhere: I just don't see how that is possible. When you open a > random FLV clip file, the first thing you usually encounter is the Metadata > packet. How can you know what codec is being used, the height/width, etc. > without parsing that metadata? I mean, isn't that why it's put there at the > start of the file? > > Or does FFMPEG rely on elaborate probing methods to deduce that metadata in > the case where no header is present, and so, for consistency, it just > ignores the header metadata if it *is* present? > > Please don't top post on this mailing list. Regarding your question, the metadata that is being skipped here is processed in the block above. It is used to set the various properties in the acodec and vcodec structures, so there is no need to put it into the generic metadata anymore. From mark39518 at cesinst.com Thu Jun 20 17:47:39 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Thu, 20 Jun 2013 08:47:39 -0700 Subject: [Libav-user] FLV logic question In-Reply-To: References: <51C309C0.5070706@cesinst.com> <51C30ED8.6050908@cesinst.com> Message-ID: <51C3241B.7050600@cesinst.com> On 6/20/2013 7:31 AM, Hendrik Leppkes wrote: > On Thu, Jun 20, 2013 at 4:16 PM, Mark Stevans wrote: >> Thanks for the quick reply, Hendrik. But you say that the data is *already* >> stored somewhere: I just don't see how that is possible. When you open a >> random FLV clip file, the first thing you usually encounter is the Metadata >> packet. How can you know what codec is being used, the height/width, etc. >> without parsing that metadata? I mean, isn't that why it's put there at the >> start of the file? >> >> Or does FFMPEG rely on elaborate probing methods to deduce that metadata in >> the case where no header is present, and so, for consistency, it just >> ignores the header metadata if it *is* present? >> >> > > Please don't top post on this mailing list. > > Regarding your question, the metadata that is being skipped here is > processed in the block above. > It is used to set the various properties in the acodec and vcodec > structures, so there is no need to put it into the generic metadata > anymore. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > No top-posting, got it. Thanks again for your replies -- it's hard to pick up the philosophies just by reading the code. My only remaining point is that the metadata is not always saved on the codec structures or in AVFormatContext. If, for example, you don't trust the metadata (flv->trust_metadata is false), the metadata isn't saved for any sort of subsequent "untrusted" processing. I am not sure if there are any guarantees as to the order in which keys appear in header metadata: I would hope that, for example, the audio codec ID would appear before the audio sample rate, but if it doesn't, it is ignored (as are most others if out-of-order). Filesize metadata could (obviously) be a valuable check against truncated input files, but it's discarded. The official frame rate is also very helpful (though I know it could be estimated from timestamps, etc.) -- but it's also thrown away. Frankly, it just seems like an optimization, where the skipping of the storage of those dozen metadata fields saves a few hundred bytes. IMHO, the potential usefulness of that original metadata outweighs the savings.... Mark From arvind_raman at yahoo.com Thu Jun 20 18:53:09 2013 From: arvind_raman at yahoo.com (Arvind Raman) Date: Thu, 20 Jun 2013 09:53:09 -0700 (PDT) Subject: [Libav-user] Support for HEVC / H.265 in libavformat Message-ID: <1371747189.55921.YahooMailNeo@web122304.mail.ne1.yahoo.com> Could you please let me know if there is any experimental branch of libavformat that supports muxing / demuxing HEVC ES? If not, any pointers on what this might entail if I were to implement such a support would be highly appreciated. I understand the gpac libraries support HEVC and therefore wanted to check if a similar effort had already been put on the libavformat library as well. Best regards Arvind From alexcohn at netvision.net.il Fri Jun 21 01:51:26 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 21 Jun 2013 02:51:26 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: On 20 Jun 2013 11:13, "Dragos Iordache" wrote: > > Hi again, > > So I tested some more and the stream works ok with .\ffmpeg.exe -i .\test.h264 -c:v copy -f flv rtmp://live.justin.tv/app/live_**** > But the stream does not work with my implementation using libffmpeg. > > I tried different methods for sending the stream with libffmpeg but none worked ok. What I do now: > > -create an oformat of flv > -create a context for flv and filename=rtmp:/... > -initialize a stream of h264 codec > -write header > -encode using stagefright > -create a packet > -write the packet > > The test.h264 in the ffmpeg line is created using this method and filename is set to "test.h264" and not a rtmp server, so I think this is ok. > > The captured frame data differs slightly between the command I run with ffmpeg and my code using libffmpeg. One of the diferences if that the NAL header "00 00 00 01" is not like this in the ffmpeg method. Absolutely. FLV uses the AVCC format to store h264 NALUs. See for example an excellent explanation at http://livertmpjavapublisher.blogspot.co.il/2011/06/h264-avcvideopacket.html . > What do you think is not right? Stagefright encoder produces packets in annex-b format. It could be enough to change their headers to AVCC format to make your rtmp happy. > Thanks for your help. > > Dragos Regards, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From harip.cs10 at gmail.com Fri Jun 21 06:51:48 2013 From: harip.cs10 at gmail.com (hari prasad) Date: Fri, 21 Jun 2013 10:21:48 +0530 Subject: [Libav-user] hls segmentation Message-ID: hi guys, avformat_alloc_output_context2(&oc, NULL, "hls", filename); oc is pointer to a AVFormatContext. Now to change the hls parameters like time,wrap etc in the context. regards hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From talk-noreply at google.com Fri Jun 21 06:59:06 2013 From: talk-noreply at google.com (Google Talk) Date: Thu, 20 Jun 2013 21:59:06 -0700 Subject: [Libav-user] Invitation to use Google Talk Message-ID: ----------------------------------------------------------------------- You've been invited by hari prasad to use Google Talk. If you already have a Google account, login to Gmail and accept this chat invitation: http://mail.google.com/mail/b-26f1edaa4e-cca81ea17d-A8QM2sCcTs2Fzmw6r3qQFk3puW0 To sign up for a Google account and get started with Google Talk, you can visit: http://mail.google.com/mail/a-26f1edaa4e-cca81ea17d-A8QM2sCcTs2Fzmw6r3qQFk3puW0?pc=en-rf---a Learn more at: http://www.google.com/intl/en/landing/accounts/ Thanks, The Google Team From mark39518 at cesinst.com Fri Jun 21 07:43:20 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Thu, 20 Jun 2013 22:43:20 -0700 Subject: [Libav-user] Possible fix for rare core-dumps in H264 Message-ID: <51C3E7F8.1090204@cesinst.com> When playing unreliable H264 streams with FFPlay, I seem to get core-dumps randomly every few hours. The exact location is usually the second instruction of "pred8x8_top_dc_8_mmxext" in "h264_intrapred.asm", where it dereferences "dest_cr" after subtracting "uvlinesize" from it, as called from the line reading h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize); in "h264_mb_template.c". "uvlinesize" is typically something like 320 at the time of crash, with "mb_y" zero. My take on this is that, when presented with garbaged stream data, the H264 frame decoder sometimes tries to perform predictions that involve higher rows (lower memory addresses): if "mb_y" happens to be zero (the top row), this means that it tries to read memory from "negative rows", addresses a few hundred bytes before the beginning of the legitimate frame data. Often, those addresses point to harmless random bytes, but occasionally it actually points to unmapped memory pages, causing Access Violations. My fix is crude: changing the code to read if (mb_y <= 0 && ( h->chroma_pred_mode == TOP_DC_PRED8x8 || h->chroma_pred_mode == DC_PRED8x8 || h->chroma_pred_mode == VERT_PRED8x8) ) { av_log(NULL, AV_LOG_WARNING, "Skipping prediction involving previous data rows because mb_y is zero\n"); } else { h->hpc.pred8x8[h->chroma_pred_mode](dest_cb, uvlinesize); h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize); } (I got the list of modes from searching the assembly language for cases where "uvlinesize" was subtracted from the destination). So far, this patch seems to avoid the crashing, though I can't be totally sure without days of testing. At any rate, there's probably a similar fix for "mb_x" being zero and horizontal predictions, though that wouldn't cause core-dumps. And there might be similar fixes needed in other codecs. Is this a sensible diagnosis, or a sensible fix? Can I do something better to avoid these crashes? Thanks for any comments anyone cares to make.... MLS From cehoyos at ag.or.at Fri Jun 21 08:53:19 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 06:53:19 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> Message-ID: Mark Stevans writes: > When playing unreliable H264 streams with FFPlay, I > seem to get core-dumps randomly every few hours. This sounds important, please provide the necessary information as explained on http://ffmpeg.org/bugreports.html A sample would be useful (the size limitation mentioned in above page is irrelevant in this case), you may also only upload a sample, a developer will probably look at it (every crash is important). If you want comments on your patch, use git format-patch and send the commit to ffmpeg-devel where patches are discussed. Carl Eugen From cehoyos at ag.or.at Fri Jun 21 10:17:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 08:17:29 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> Message-ID: Carl Eugen Hoyos writes: > Mark Stevans ...> writes: > > > When playing unreliable H264 streams with FFPlay, I > > seem to get core-dumps randomly every few hours. > > This sounds important, please provide the necessary > information as explained on > http://ffmpeg.org/bugreports.html I apparently forgot to explain that it makes no sense to open a ticket if you can neither provide the necessary information as explained on http://ffmpeg.org/bugreports.html nor a sample. > A sample would be useful (the size limitation > mentioned in above page is irrelevant in this case), > you may also only upload a sample, a developer will > probably look at it (every crash is important). > If you want comments on your patch, use > git format-patch and send the commit to ffmpeg-devel > where patches are discussed. I apparently forgot to explain that it makes no sense to post patches on the bug tracker, they are usually ignored there. Sorry, Carl Eugen From mark39518 at cesinst.com Fri Jun 21 10:29:06 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Fri, 21 Jun 2013 01:29:06 -0700 Subject: [Libav-user] Possible fix for rare core-dumps in H264 In-Reply-To: References: <51C3E7F8.1090204@cesinst.com> Message-ID: <51C40ED2.5050804@cesinst.com> You explained -- just not strongly enough to make me understand. It takes hours of testing to generate a stack trace, but I wrote down the most import part -- the last two frames. And it's very difficult to get a clip for reproduction, as this is a live stream running for hours. To be honest, I think the description is adequate. Anyone that knows the H264 code should be able to determine quickly whether the report is valid or not.... Mark On 6/21/2013 1:17 AM, Carl Eugen Hoyos wrote: > Carl Eugen Hoyos writes: > >> Mark Stevans ...> writes: >> >>> When playing unreliable H264 streams with FFPlay, I >>> seem to get core-dumps randomly every few hours. >> >> This sounds important, please provide the necessary >> information as explained on >> http://ffmpeg.org/bugreports.html > > I apparently forgot to explain that it makes no sense > to open a ticket if you can neither provide the > necessary information as explained on > http://ffmpeg.org/bugreports.html nor a sample. > >> A sample would be useful (the size limitation >> mentioned in above page is irrelevant in this case), >> you may also only upload a sample, a developer will >> probably look at it (every crash is important). > >> If you want comments on your patch, use >> git format-patch and send the commit to ffmpeg-devel >> where patches are discussed. > > I apparently forgot to explain that it makes no > sense to post patches on the bug tracker, they > are usually ignored there. > > Sorry, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From cehoyos at ag.or.at Fri Jun 21 10:36:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 08:36:29 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> Message-ID: Mark Stevans writes: > It takes hours of testing to generate a stack trace I am not sure I understand: The additional effort should be far below five minutes, could you elaborate? > And it's very difficult to get a clip for reproduction, > as this is a live stream running for hours. rtmpdump should allow to record a sample. Allow me to explain that it is extremely unlikely that a developer will work on a ticket that does not nearly contain enough information to allow fixing it, as you may have seen there is a large number of open and reproducible tickets. Posting your patch on ffmpeg-devel could be an alternative (as said, there is a very long history of patches that are ignored on trac, this is why the New Ticket page says "Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker." - if you believe this sentence can be improved, please tell us). Carl Eugen From mark39518 at cesinst.com Fri Jun 21 11:14:57 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Fri, 21 Jun 2013 02:14:57 -0700 Subject: [Libav-user] Possible fix for rare core-dumps in H264 In-Reply-To: References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> Message-ID: <51C41991.7040306@cesinst.com> On 6/21/2013 1:36 AM, Carl Eugen Hoyos wrote: > Mark Stevans writes: > >> It takes hours of testing to generate a stack trace > > I am not sure I understand: The additional effort > should be far below five minutes, could you > elaborate? Ah, I wasn't clear yet again: when I said "core-dump", I don't mean an actual core-dump on disk. I'm running under Windows 7 here, debugging with WinDbg.... I have to run FFPlay for anywhere up to 12 hours to get an Access Violation under the debugger, at which point it's easy to include a stack trace. But if I didn't copy out any of my complete stack traces from earlier crashes, I would have to get the bug to happen again.... >> And it's very difficult to get a clip for reproduction, >> as this is a live stream running for hours. > > rtmpdump should allow to record a sample. "rtmpdump" can indeed record a sample of the stream. But if it takes six hours to happen to land on a place that evokes the crash, that's 100 KB/s times six hours, or 2.1 GB of stream. I *could* try to partition it down, just taking the last few MB, hoping that that, in isolation, would cause the crash, but it doesn't sound like I could replicate it reliably. > Allow me to explain that it is extremely unlikely > that a developer will work on a ticket that does > not nearly contain enough information to allow > fixing it, as you may have seen there is a large > number of open and reproducible tickets. Contain not nearly enough information to allow fixing it? Not to be argumentative, but I provided a patch. How much more information is required? This is not a hard bug to understand, to be frank: if you're decoding and hit a directive that tells you to look at the previous row's data, but you're on the first row, just ignore it. Obviously, that should never happen in a normal stream, but with bad data, anything is possible. > Posting your patch on ffmpeg-devel could be an > alternative (as said, there is a very long history > of patches that are ignored on trac, this is why > the New Ticket page says "Patches should be > submitted to the ffmpeg-devel mailing list and not > this bug tracker." - if you believe this sentence > can be improved, please tell us). Frankly, I don't understand how patches could be ignored on TRAC, yet observed in "ffmpeg-devel". But I will send my patch there, nevertheless. Thanks again for your help.... MLS From cehoyos at ag.or.at Fri Jun 21 11:39:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 09:39:15 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: Mark Stevans writes: > when I said "core-dump", I don't mean an actual > core-dump on disk. I'm running under Windows 7 > here, debugging with WinDbg.... gdb works fine on Windows (7), it would also allow to produce a useful backtrace (and disassembly and register content) for a recorded stream. (You are probably right that it may not be possible to cut the stream.) Carl Eugen From cehoyos at ag.or.at Fri Jun 21 11:44:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 09:44:00 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: Mark Stevans writes: > Frankly, I don't understand how patches could be > ignored on TRAC, yet observed in "ffmpeg-devel". I was just describing what experience tells me. > But I will send my patch there It appears that I was unclear again, sorry about that! Bug reports are not welcome on ffmpeg-devel, we tried to explain this on http://ffmpeg.org/contact.html Since I am not an English native speaker, please allow me to repeat that suggestions on how to improve the wording are very welcome! Patches are welcome on ffmpeg-devel, and in a case such as this one, the mail should of course include as much information as possible, but this information cannot replace the actual patch made with git format-patch as explained on http://ffmpeg.org/developer.html#Submitting-patches-1 Carl Eugen From onemda at gmail.com Fri Jun 21 11:49:12 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 21 Jun 2013 09:49:12 +0000 Subject: [Libav-user] Possible fix for rare core-dumps in H264 In-Reply-To: References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: On 6/21/13, Carl Eugen Hoyos wrote: > Mark Stevans writes: > >> Frankly, I don't understand how patches could be >> ignored on TRAC, yet observed in "ffmpeg-devel". > > I was just describing what experience tells me. > >> But I will send my patch there > > It appears that I was unclear again, sorry about that! > Bug reports are not welcome on ffmpeg-devel, we tried > to explain this on http://ffmpeg.org/contact.html > Since I am not an English native speaker, please allow > me to repeat that suggestions on how to improve the > wording are very welcome! > > Patches are welcome on ffmpeg-devel, and in a case > such as this one, the mail should of course include as > much information as possible, but this information > cannot replace the actual patch made with > git format-patch as explained on > http://ffmpeg.org/developer.html#Submitting-patches-1 Are you enjoying yourself? From cehoyos at ag.or.at Fri Jun 21 11:50:10 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 09:50:10 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: Paul B Mahol writes: > Are you enjoying yourself? You mean compared to you when you (intentionally!) commit other people's patches? Carl Eugen From mtaha.ansari at gmail.com Fri Jun 21 11:53:08 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Fri, 21 Jun 2013 14:53:08 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem Message-ID: Hi! I have made a small application to extract audio from an mp4 file, or simply convert an existing audio file to AAC/mp4 format (both raw AAC, or inside mp4 container). I have run this application with existing mp4 files as input, and it properly extracts audio, and encodes to mp4 (audio only:AAC), or even directly in AAC format (i.e. test.aac also works). But when I tried running it on mp3 files, output clip plays faster than it should be (a clip of 1:12 seconds plays back till 1:05 seconds only, and is also noisy). Here is the code I have written to achieve this: //////////////////////////////////////////////// #include "stdafx.h" #include #include #include #include #include #include #include #include #include #include #include extern "C" { #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavdevice/avdevice.h" #include "libswscale/swscale.h" #include "libavutil/dict.h" #include "libavutil/error.h" #include "libavutil/opt.h" #include #include #include } AVFormatContext* fmt_ctx= NULL; int audio_stream_index = -1; AVCodecContext *codec_ctx_audio = NULL; AVCodec* codec_audio = NULL; AVFrame* decoded_frame = NULL; uint8_t** audio_dst_data = NULL; int got_frame = 0; int audiobufsize = 0; AVPacket input_packet; int audio_dst_linesize = 0; int audio_dst_bufsize = 0; AVOutputFormat *output_format = NULL ; AVFormatContext *output_fmt_ctx = NULL; AVStream *audio_st = NULL; AVCodec *audio_codec = NULL; double audio_pts = 0.0; int audio_input_frame_size = 0; uint8_t *audio_data_buf = NULL; uint8_t *audio_out = NULL; int audio_bit_rate; int audio_sample_rate; int audio_channels; int decode_packet(); int open_audio_input(char* src_filename); int decode_frame(); int open_encoder(char* output_filename); AVStream *add_audio_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id); int open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st); void close_audio(AVFormatContext *oc, AVStream *st); void write_audio_frame(uint8_t ** audio_src_data, int audio_src_bufsize); int open_audio_input(char* src_filename) { int i =0; /* open input file, and allocate format context */ if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { fprintf(stderr, "Could not open source file %s\n", src_filename); exit(1); } // Retrieve stream information if(avformat_find_stream_info(fmt_ctx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(fmt_ctx, 0, src_filename, 0); // Find the first video stream for(i=0; inb_streams; i++) { if(fmt_ctx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO) { audio_stream_index=i; break; } } if ( audio_stream_index != -1 ) { // Get a pointer to the codec context for the audio stream codec_ctx_audio=fmt_ctx->streams[audio_stream_index]->codec; // Find the decoder for the video stream codec_audio=avcodec_find_decoder(codec_ctx_audio->codec_id); if(codec_audio==NULL) { fprintf(stderr, "Unsupported audio codec!\n"); return -1; // Codec not found } // Open codec AVDictionary *codecDictOptions = NULL; if(avcodec_open2(codec_ctx_audio, codec_audio, &codecDictOptions)<0) return -1; // Could not open codec // Allocate audio frame if ( decoded_frame == NULL ) decoded_frame = avcodec_alloc_frame(); int nb_planes = 0; AVStream* audio_stream = fmt_ctx->streams[audio_stream_index]; nb_planes = av_sample_fmt_is_planar(codec_ctx_audio->sample_fmt) ? codec_ctx_audio->channels : 1; int tempSize = sizeof(uint8_t *) * nb_planes; audio_dst_data = (uint8_t**)av_mallocz(tempSize); if (!audio_dst_data) { fprintf(stderr, "Could not allocate audio data buffers\n"); } else { for ( int i = 0 ; i < nb_planes ; i ++ ) { audio_dst_data[i] = NULL; } } } } int decode_frame() { int rv = 0; got_frame = 0; if ( fmt_ctx == NULL ) { return rv; } int ret = 0; audiobufsize = 0; rv = av_read_frame(fmt_ctx, &input_packet); if ( rv < 0 ) { return rv; } rv = decode_packet(); // Free the input_packet that was allocated by av_read_frame av_free_packet(&input_packet); return rv; } int decode_packet() { int rv = 0; int ret = 0; //audio stream? if(input_packet.stream_index == audio_stream_index) { /* decode audio frame */ rv = avcodec_decode_audio4(codec_ctx_audio, decoded_frame, &got_frame, &input_packet); if (rv < 0) { fprintf(stderr, "Error decoding audio frame\n"); //return ret; } else { if (got_frame) { if ( audio_dst_data[0] == NULL ) { ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, decoded_frame->channels, decoded_frame->nb_samples, (AVSampleFormat)decoded_frame->format, 1); if (ret < 0) { fprintf(stderr, "Could not allocate audio buffer\n"); return AVERROR(ENOMEM); } /* TODO: extend return code of the av_samples_* functions so that this call is not needed */ audio_dst_bufsize = av_samples_get_buffer_size(NULL, decoded_frame->channels, decoded_frame->nb_samples, (AVSampleFormat)decoded_frame->format, 1); } /* copy audio data to destination buffer: * this is required since rawaudio expects non aligned data */ av_samples_copy(audio_dst_data, decoded_frame->data, 0, 0, decoded_frame->nb_samples, decoded_frame->channels, (AVSampleFormat)decoded_frame->format); } } } return rv; } int open_encoder(char* output_filename ) { int rv = 0; /* allocate the output media context */ AVOutputFormat *opfmt = NULL; avformat_alloc_output_context2(&output_fmt_ctx, opfmt, NULL, output_filename); if (!output_fmt_ctx) { printf("Could not deduce output format from file extension: using MPEG.\n"); avformat_alloc_output_context2(&output_fmt_ctx, NULL, "mpeg", output_filename); } if (!output_fmt_ctx) { rv = -1; } else { output_format = output_fmt_ctx->oformat; } /* Add the audio stream using the default format codecs * and initialize the codecs. */ audio_st = NULL; if ( output_fmt_ctx ) { if (output_format->audio_codec != AV_CODEC_ID_NONE) { audio_st = add_audio_stream(output_fmt_ctx, &audio_codec, output_format->audio_codec); } /* Now that all the parameters are set, we can open the audio and * video codecs and allocate the necessary encode buffers. */ if (audio_st) { rv = open_audio(output_fmt_ctx, audio_codec, audio_st); if ( rv < 0 ) return rv; } av_dump_format(output_fmt_ctx, 0, output_filename, 1); /* open the output file, if needed */ if (!(output_format->flags & AVFMT_NOFILE)) { if (avio_open(&output_fmt_ctx->pb, output_filename, AVIO_FLAG_WRITE) < 0) { fprintf(stderr, "Could not open '%s'\n", output_filename); rv = -1; } else { /* Write the stream header, if any. */ if (avformat_write_header(output_fmt_ctx, NULL) < 0) { fprintf(stderr, "Error occurred when opening output file\n"); rv = -1; } } } } return rv; } AVStream *add_audio_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id) { AVCodecContext *c; AVStream *st; /* find the audio encoder */ *codec = avcodec_find_encoder(codec_id); if (!(*codec)) { fprintf(stderr, "Could not find codec\n"); exit(1); } st = avformat_new_stream(oc, *codec); if (!st) { fprintf(stderr, "Could not allocate stream\n"); exit(1); } st->id = 1; c = st->codec; /* put sample parameters */ c->sample_fmt = AV_SAMPLE_FMT_S16; c->bit_rate = audio_bit_rate; c->sample_rate = audio_sample_rate; c->channels = audio_channels; // some formats want stream headers to be separate if (oc->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; return st; } int open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st) { int ret=0; AVCodecContext *c; c = st->codec; /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "could not open codec\n"); return -1; //exit(1); } if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) audio_input_frame_size = 10000; else audio_input_frame_size = c->frame_size; int tempSize = audio_input_frame_size * av_get_bytes_per_sample(c->sample_fmt) * c->channels; return ret; } void close_audio(AVFormatContext *oc, AVStream *st) { avcodec_close(st->codec); } void write_audio_frame(uint8_t ** audio_src_data, int audio_src_bufsize) { AVFormatContext *oc = output_fmt_ctx; AVStream *st = audio_st; if ( oc == NULL || st == NULL ) return; AVCodecContext *c; AVPacket pkt = { 0 }; // data and size must be 0; AVFrame *frame = avcodec_alloc_frame(); int got_packet; av_init_packet(&pkt); c = st->codec; frame->nb_samples = audio_input_frame_size; int buf_size = audio_src_bufsize * av_get_bytes_per_sample(c->sample_fmt) * c->channels; avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt, (uint8_t *) *audio_src_data, buf_size, 1); avcodec_encode_audio2(c, &pkt, frame, &got_packet); if (!got_packet) { avcodec_free_frame(&frame); } else { pkt.stream_index = st->index; /* Write the compressed frame to the media file. */ if (av_interleaved_write_frame(oc, &pkt) != 0) { fprintf(stderr, "Error while writing audio frame\n"); exit(1); } avcodec_free_frame(&frame); } av_free_packet(&pkt); } void write_delayed_frames(AVFormatContext *oc, AVStream *st) { AVCodecContext *c = st->codec; int got_output = 0; int ret = 0; AVPacket pkt; pkt.data = NULL; pkt.size = 0; av_init_packet(&pkt); int i = 0; //int got_packet; for (got_output = 1; got_output; i++) { ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output); if (ret < 0) { fprintf(stderr, "error encoding frame\n"); exit(1); } static int64_t tempPts = 0; static int64_t tempDts = 0; /* If size is zero, it means the image was buffered. */ if (got_output) { if (pkt.pts != AV_NOPTS_VALUE) pkt.pts = av_rescale_q(pkt.pts, st->codec->time_base, st->time_base); if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, st->codec->time_base, st->time_base); if (c->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = st->index; /* Write the compressed frame to the media file. */ ret = av_interleaved_write_frame(oc, &pkt); } else { ret = 0; } av_free_packet(&pkt); } } int main (int argc, char **argv) { /* register all formats and codecs */ av_register_all(); int i =0; char src_filename[90] = "test.mp3"; char dst_filename[90] = "test.mp4"; open_audio_input(src_filename); audio_bit_rate = codec_ctx_audio->bit_rate; audio_sample_rate = codec_ctx_audio->sample_rate; audio_channels = codec_ctx_audio->channels; open_encoder( dst_filename ); while(1) { int rv = decode_frame(); if ( rv < 0 ) { break; } if (audio_st) { audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den; } else { audio_pts = 0.0; } printf("\naudio_pts: %.3f",audio_pts); if ( codec_ctx_audio ) { if ( got_frame) { write_audio_frame( audio_dst_data, audio_dst_bufsize ); } } if ( audio_dst_data[0] ) { av_freep(&audio_dst_data[0]); audio_dst_data[0] = NULL; } } write_delayed_frames( output_fmt_ctx, audio_st ); av_write_trailer(output_fmt_ctx); close_audio( output_fmt_ctx, audio_st); return 0; } /////////////////////////////////////////////// I have been looking at this problem from many angles since about two days now, but cant seem to figure out what I'm doing wrong. Note also: the printf() statement I've inserted shows audio_pts up to 64.551 (that's about 1:05 seconds that also proves encoder is not going to full duration of input file: 1:12 secs): ....... ....... ....... audio_pts: 63.808 audio_pts: 63.832 audio_pts: 63.855 audio_pts: 63.878 audio_pts: 63.901 audio_pts: 63.925 audio_pts: 63.948 audio_pts: 63.971 audio_pts: 63.994 audio_pts: 64.017 audio_pts: 64.041 audio_pts: 64.064 audio_pts: 64.087 audio_pts: 64.110 audio_pts: 64.134 audio_pts: 64.157 audio_pts: 64.180 audio_pts: 64.203 audio_pts: 64.226 audio_pts: 64.250 audio_pts: 64.273 audio_pts: 64.296 audio_pts: 64.319 audio_pts: 64.342 audio_pts: 64.366 audio_pts: 64.389 audio_pts: 64.412 audio_pts: 64.435 audio_pts: 64.459 audio_pts: 64.482 audio_pts: 64.505 audio_pts: 64.528 audio_pts: 64.551 Can anyone please guide me what I may be doing wrong? Thanks in advance for any guidance! p.s. when run through command line like: ffmpeg -i test.mp3 test.mp4, it converts the file just fine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark39518 at cesinst.com Fri Jun 21 11:52:53 2013 From: mark39518 at cesinst.com (Mark Stevans) Date: Fri, 21 Jun 2013 02:52:53 -0700 Subject: [Libav-user] Possible fix for rare core-dumps in H264 In-Reply-To: References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: <51C42275.5050002@cesinst.com> On 6/21/2013 2:39 AM, Carl Eugen Hoyos wrote: > Mark Stevans writes: > >> when I said "core-dump", I don't mean an actual >> core-dump on disk. I'm running under Windows 7 >> here, debugging with WinDbg.... > > gdb works fine on Windows (7), it would also allow > to produce a useful backtrace (and disassembly and > register content) for a recorded stream. > (You are probably right that it may not be possible > to cut the stream.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user I spent days trying to debug earlier bugs with Windows GDB, but couldn't get decent stack traces -- I tried every possible debugging flag and symbol format to no avail. I'm now building FFPlay with Visual Studio, so GDB isn't an option anymore, sorry.... MLS From cehoyos at ag.or.at Fri Jun 21 11:58:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 09:58:52 +0000 (UTC) Subject: [Libav-user] Possible fix for rare core-dumps in H264 References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> <51C42275.5050002@cesinst.com> Message-ID: Mark Stevans writes: > > gdb works fine on Windows (7) > > I spent days trying to debug earlier bugs with > Windows GDB, but couldn't get decent stack > traces -- I tried every possible debugging > flag and symbol format to no avail. That surprises me: I am regularly using gdb to debug on Windows 7 and I do no remember that it ever worked worse than on Linux. Or in other words: It is possible that no backtrace is available (for example because the stack was corrupted) but generally I get all necessary debug information (just as on a Posix system) and I usually get backtrace etc. to be used for FFmpeg bug reports. What did not work for you? Did you maybe use gdb on a stripped ffmpeg.exe? Carl Eugen From cehoyos at ag.or.at Fri Jun 21 12:06:36 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Jun 2013 10:06:36 +0000 (UTC) Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem References: Message-ID: Taha Ansari writes: > I have run this application with existing mp4 > files as input, and it properly extracts audio, > and encodes to mp4 (audio only:AAC), or even > directly in AAC format (i.e. test.aac also > works). But when I tried running it on mp3 > files, output clip plays faster than it should > be (a clip of 1:12 seconds plays back till > 1:05 seconds only, and is also noisy). I did not look at your code but did you consider that the AAC decoder outputs AV_SAMPLE_FMT_FLTP and the MP3 decoder signed 16 bit values (I believe you can request planar or not)? Carl Eugen From onemda at gmail.com Fri Jun 21 12:09:55 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 21 Jun 2013 10:09:55 +0000 Subject: [Libav-user] Possible fix for rare core-dumps in H264 In-Reply-To: References: <51C3E7F8.1090204@cesinst.com> <51C40ED2.5050804@cesinst.com> <51C41991.7040306@cesinst.com> Message-ID: On 6/21/13, Carl Eugen Hoyos wrote: > Paul B Mahol writes: > >> Are you enjoying yourself? > > You mean compared to you when you (intentionally!) > commit other people's patches? What other people's patches? From mtaha.ansari at gmail.com Fri Jun 21 12:28:38 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Fri, 21 Jun 2013 15:28:38 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On Fri, Jun 21, 2013 at 3:06 PM, Carl Eugen Hoyos wrote: > Taha Ansari writes: > > > I have run this application with existing mp4 > > files as input, and it properly extracts audio, > > and encodes to mp4 (audio only:AAC), or even > > directly in AAC format (i.e. test.aac also > > works). But when I tried running it on mp3 > > files, output clip plays faster than it should > > be (a clip of 1:12 seconds plays back till > > 1:05 seconds only, and is also noisy). > > I did not look at your code but did you consider > that the AAC decoder outputs AV_SAMPLE_FMT_FLTP > and the MP3 decoder signed 16 bit values (I > believe you can request planar or not)? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Hi Carl! As a matter of fact, I never knew about this, till now. In fact, when I was probing the two files, I got s16 indication, so I thought they were similar, maybe: ---------------------------------------------------------------------------------------------------- FFprobe from test.mp3 (input file): ---------------------------------------------------------------------------------------------------- ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore- amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut - -enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger - -enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc -- enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab le-libxavs --enable-libxvid --enable-zlib libavutil 52. 9.100 / 52. 9.100 libavcodec 54. 77.100 / 54. 77.100 libavformat 54. 37.100 / 54. 37.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 23.102 / 3. 23.102 libswscale 2. 1.102 / 2. 1.102 libswresample 0. 17.101 / 0. 17.101 libpostproc 52. 2.100 / 52. 2.100 [mp3 @ 007b2a60] max_analyze_duration 5000000 reached at 5015510 Input #0, mp3, from 'test.mp3': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.37.100 Duration: 00:01:12.67, start: 0.000000, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- FFprobe from test.mp4 (converted file): ---------------------------------------------------------------------------------------------------- ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore- amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut - -enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger - -enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc -- enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab le-libxavs --enable-libxvid --enable-zlib libavutil 52. 9.100 / 52. 9.100 libavcodec 54. 77.100 / 54. 77.100 libavformat 54. 37.100 / 54. 37.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 23.102 / 3. 23.102 libswscale 2. 1.102 / 2. 1.102 libswresample 0. 17.101 / 0. 17.101 libpostproc 52. 2.100 / 52. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf54.37.100 Duration: 00:01:04.62, start: 0.000000, bitrate: 129 kb/s Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128 kb/s Metadata: handler_name : SoundHandler ---------------------------------------------------------------------------------------------------- Hence the reason I was supplying: c->sample_fmt = AV_SAMPLE_FMT_S16; (in add_audio_stream() function). If I'm not wasting too much of your time, can you please guide how I can co relate the two formats, pragmatically? Thanks for your time! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bersac_1 at hotmail.fr Fri Jun 21 16:45:46 2013 From: bersac_1 at hotmail.fr (... ...) Date: Fri, 21 Jun 2013 14:45:46 +0000 Subject: [Libav-user] What define the quality of a decoded video Message-ID: HI, I have a basic .avi video. I decode it, reencode it using the same type of encoder without modifying the decoded data and finally I save it on one file of my computer. The saved video has a good framerate but it had lost a lot of quality in the process (it's now with a lot of pixel). I kwon that the image has been decoded without losing quality. The lost of quality appeared during the decoding and saving process.What define the quality of a decoded video ? Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From audionuma at gmail.com Fri Jun 21 19:23:59 2013 From: audionuma at gmail.com (Manu N) Date: Fri, 21 Jun 2013 19:23:59 +0200 Subject: [Libav-user] What define the quality of a decoded video In-Reply-To: References: Message-ID: Hello 2013/6/21 ... ... > HI, > > I have a basic .avi video. I decode it, reencode it using the same type of > encoder without modifying the decoded data and finally I save it on one > file of my computer. The saved video has a good framerate but it had lost a > lot of quality in the process (it's now with a lot of pixel). I kwon that > the image has been decoded without losing quality. The lost of quality > appeared during the decoding and saving process. > What define the quality of a decoded video ? > > http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio is one way to evaluate this. Basically, lossy encoding-decoding quickly leads to a quality degradation. Manuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Fri Jun 21 21:07:10 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Fri, 21 Jun 2013 12:07:10 -0700 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: References: Message-ID: <51C4A45E.5080706@gmail.com> On 6/20/2013 4:51 PM, Alex Cohn wrote: > > On 20 Jun 2013 11:13, "Dragos Iordache" > wrote: > > > > Hi again, > > > > So I tested some more and the stream works ok with .\ffmpeg.exe -i > .\test.h264 -c:v copy -f flv rtmp://live.justin.tv/app/live_**** > > > But the stream does not work with my implementation using libffmpeg. > > > > I tried different methods for sending the stream with libffmpeg but > none worked ok. What I do now: > > > > -create an oformat of flv > > -create a context for flv and filename=rtmp:/... > > -initialize a stream of h264 codec > > -write header > > -encode using stagefright > > -create a packet > > -write the packet > > > > The test.h264 in the ffmpeg line is created using this method and > filename is set to "test.h264" and not a rtmp server, so I think this > is ok. > > > > The captured frame data differs slightly between the command I run > with ffmpeg and my code using libffmpeg. One of the diferences if that > the NAL header "00 00 00 01" is not like this in the ffmpeg method. > > Absolutely. FLV uses the AVCC format to store h264 NALUs. See for > example an excellent explanation at > http://livertmpjavapublisher.blogspot.co.il/2011/06/h264-avcvideopacket.html. > > > What do you think is not right? > > Stagefright encoder produces packets in annex-b format. It could be > enough to change their headers to AVCC format to make your rtmp happy. > > > Thanks for your help. > > > > Dragos > > Regards, > Alex > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Yes, Take the annex-b stream nals, typically sps,pps,idr,slice,slice...... extract the sps and pps from the stream and create the flv avc config packet. For the rest of the frames, the idr and slices. Swap the marker bytes for size values, pre-pend pts offset and then wrap with the AMF flv audio block header. I often refer to this java class which transcodes annex-b into AMF flash live streams for the red5 server. http://code.google.com/p/comserver/source/browse/trunk/plugins/shoutcast/src/org/red5/server/plugin/shoutcast/marshal/transpose/VideoFramer.java#421 Although the raw frame parsing code is old, the beef of the critical packets and format of the AMF payload is still valid. If writing a file, those AMF packets will need to be wrapped with the FLV context tag header and trailing size marker, but for rtmp they are ready to fly.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Fri Jun 21 22:45:19 2013 From: abelalon at gmail.com (Abel Alonso) Date: Fri, 21 Jun 2013 22:45:19 +0200 Subject: [Libav-user] HW decoding on Android Message-ID: Hi! I'm developing a video player for Android devices using FFmpeg. This video player is already capable to play videos without hardware acceleration. As far as I know, since 0.9 version, FFmpeg can H/W decode H.264 files on Android devices, but I didn't found documentation on this subject. I guess that the way to do it, is using --enable-libstagefrihgt-h264 during FFmpeg compilation and link against the needed Android's .so files. But once I get FFmpeg compiled. Have I to change my current code to ask FFmpeg for use libstagefright decoder? Is there any other way to decode H.264 files on Android devices using H/W acceleration (libva or libvdpau)? Any suggestions? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Sat Jun 22 00:46:19 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Fri, 21 Jun 2013 15:46:19 -0700 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: Message-ID: <51C4D7BB.5090904@gmail.com> On 6/21/2013 1:45 PM, Abel Alonso wrote: > Hi! > > I'm developing a video player for Android devices using FFmpeg. This > video player is already capable to play videos without hardware > acceleration. As far as I know, since 0.9 version, FFmpeg can H/W > decode H.264 files on Android devices, but I didn't found > documentation on this subject. I guess that the way to do it, is using > --enable-libstagefrihgt-h264 during FFmpeg compilation and link > against the needed Android's .so files. > > But once I get FFmpeg compiled. Have I to change my current code to > ask FFmpeg for use libstagefright decoder? Is there any other way to > decode H.264 files on Android devices using H/W acceleration (libva or > libvdpau)? Any suggestions? > > Thanks! > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Its on jelly bean, but I used this. Got pretty darn low latency. went direct from av_codec to that http://developer.android.com/reference/android/media/MediaCodec.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Sat Jun 22 14:26:43 2013 From: abelalon at gmail.com (Abel Alonso) Date: Sat, 22 Jun 2013 14:26:43 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: <51C4D7BB.5090904@gmail.com> References: <51C4D7BB.5090904@gmail.com> Message-ID: This solution is not valid for my purposes, because the application I'm developing must run on all android versions since Gingerbread. That is why I'm asking about how to use libstagefright with FFmpeg. El 22/06/2013 00:45, "Andy Shaules" escribi?: > On 6/21/2013 1:45 PM, Abel Alonso wrote: > > Hi! > > I'm developing a video player for Android devices using FFmpeg. This > video player is already capable to play videos without hardware > acceleration. As far as I know, since 0.9 version, FFmpeg can H/W decode > H.264 files on Android devices, but I didn't found documentation on this > subject. I guess that the way to do it, is using > --enable-libstagefrihgt-h264 during FFmpeg compilation and link against the > needed Android's .so files. > > But once I get FFmpeg compiled. Have I to change my current code to ask > FFmpeg for use libstagefright decoder? Is there any other way to decode > H.264 files on Android devices using H/W acceleration (libva or libvdpau)? > Any suggestions? > > Thanks! > > > _______________________________________________ > Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user > > Its on jelly bean, but I used this. Got pretty darn low latency. went > direct from av_codec to that > > http://developer.android.com/reference/android/media/MediaCodec.html > > > > _______________________________________________ > 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 niulicheng at gmail.com Sat Jun 22 15:40:17 2013 From: niulicheng at gmail.com (Niu Licheng) Date: Sat, 22 Jun 2013 21:40:17 +0800 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> Message-ID: <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> i don't suggest using libstagefright in ffmpeg. i guess there would be oncompatible on many devices. i used to develop an android by using openmax il api directly. many work had been done to fix incompatible. Abel Alonso ??? >This solution is not valid for my purposes, because the application I'm >developing must run on all android versions since Gingerbread. That is >why >I'm asking about how to use libstagefright with FFmpeg. >El 22/06/2013 00:45, "Andy Shaules" escribi?: > >> On 6/21/2013 1:45 PM, Abel Alonso wrote: >> >> Hi! >> >> I'm developing a video player for Android devices using FFmpeg. This >> video player is already capable to play videos without hardware >> acceleration. As far as I know, since 0.9 version, FFmpeg can H/W >decode >> H.264 files on Android devices, but I didn't found documentation on >this >> subject. I guess that the way to do it, is using >> --enable-libstagefrihgt-h264 during FFmpeg compilation and link >against the >> needed Android's .so files. >> >> But once I get FFmpeg compiled. Have I to change my current code to >ask >> FFmpeg for use libstagefright decoder? Is there any other way to >decode >> H.264 files on Android devices using H/W acceleration (libva or >libvdpau)? >> Any suggestions? >> >> Thanks! >> >> >> _______________________________________________ >> Libav-user mailing >listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user >> >> Its on jelly bean, but I used this. Got pretty darn low latency. >went >> direct from av_codec to that >> >> http://developer.android.com/reference/android/media/MediaCodec.html >> >> >> >> _______________________________________________ >> 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 -- ?????????????????????Gmail????Android???????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dragoshiordache at gmail.com Sat Jun 22 15:46:07 2013 From: dragoshiordache at gmail.com (Dragos Iordache) Date: Sat, 22 Jun 2013 16:46:07 +0300 Subject: [Libav-user] H264+flv bad video stream In-Reply-To: <51C4A45E.5080706@gmail.com> References: <51C4A45E.5080706@gmail.com> Message-ID: On Fri, Jun 21, 2013 at 10:07 PM, Andy Shaules wrote: > On 6/20/2013 4:51 PM, Alex Cohn wrote: > > On 20 Jun 2013 11:13, "Dragos Iordache" wrote: > > > > Hi again, > > > > So I tested some more and the stream works ok with .\ffmpeg.exe -i > .\test.h264 -c:v copy -f flv rtmp://live.justin.tv/app/live_**** > > But the stream does not work with my implementation using libffmpeg. > > > > I tried different methods for sending the stream with libffmpeg but none > worked ok. What I do now: > > > > -create an oformat of flv > > -create a context for flv and filename=rtmp:/... > > -initialize a stream of h264 codec > > -write header > > -encode using stagefright > > -create a packet > > -write the packet > > > > The test.h264 in the ffmpeg line is created using this method and > filename is set to "test.h264" and not a rtmp server, so I think this is ok. > > > > The captured frame data differs slightly between the command I run with > ffmpeg and my code using libffmpeg. One of the diferences if that the NAL > header "00 00 00 01" is not like this in the ffmpeg method. > > Absolutely. FLV uses the AVCC format to store h264 NALUs. See for example > an excellent explanation at > http://livertmpjavapublisher.blogspot.co.il/2011/06/h264-avcvideopacket.html > . > > > What do you think is not right? > > Stagefright encoder produces packets in annex-b format. It could be enough > to change their headers to AVCC format to make your rtmp happy. > > > Thanks for your help. > > > > Dragos > > Regards, > Alex > > > _______________________________________________ > Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user > > > > Yes, > > Take the annex-b stream nals, typically sps,pps,idr,slice,slice...... > > extract the sps and pps from the stream and create the flv avc config > packet. For the rest of the frames, the idr and slices. Swap the marker > bytes for size values, pre-pend pts offset and then wrap with the AMF flv > audio block header. > > I often refer to this java class which transcodes annex-b into AMF flash > live streams for the red5 server. > > > http://code.google.com/p/comserver/source/browse/trunk/plugins/shoutcast/src/org/red5/server/plugin/shoutcast/marshal/transpose/VideoFramer.java#421 > > Although the raw frame parsing code is old, the beef of the critical > packets and format of the AMF payload is still valid. > > If writing a file, those AMF packets will need to be wrapped with the FLV > context tag header and trailing size marker, but for rtmp they are ready to > fly.. > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > Thanks. Alex and Carl you helped me a lot and now my app streams like a charm. Great help guys. Now that everything starts to take a shape I will share my project with all of you. It is called Colosseo. And you can check it over here colosseoapp.com Thanks again, Dragos -- dragoshiordache at gmail.com 0726736376 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt at gmail.com Sun Jun 23 02:32:23 2013 From: pablo.platt at gmail.com (pablo platt) Date: Sun, 23 Jun 2013 03:32:23 +0300 Subject: [Libav-user] mp3 live stream to stdout Message-ID: Hi, I'm trying to transcode a live RTMP stream to mp3. I can't make avconv write the output to stdout. I was trying: avconv -i rtmp://127.0.0.1/audio/test -f mp3 - and avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 But all I'm getting is a message that the speex header is missing. When I'm stopping the RTMP server I see some more message but not getting mp3 packets. I'm using ubuntu 12.04 64bit with the libav-tools deb package. For testing I'm using the python rtmp server http://code.google.com/p/rtmplite/ How can I make the output go to stdout? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Sun Jun 23 02:42:02 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 23 Jun 2013 00:42:02 +0000 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: On 6/23/13, pablo platt wrote: > Hi, > > I'm trying to transcode a live RTMP stream to mp3. > I can't make avconv write the output to stdout. > > I was trying: > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - > and > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > > But all I'm getting is a message that the speex header is missing. > When I'm stopping the RTMP server I see some more message but not getting > mp3 packets. > > I'm using ubuntu 12.04 64bit with the libav-tools deb package. > For testing I'm using the python rtmp server > http://code.google.com/p/rtmplite/ > > How can I make the output go to stdout? You are asking for help on ffmpeg mailing list for avconv which is from libav (ffmpeg fork). If you want help for avconv don't ask here as this is mailing list for ffmpeg only (real ffmpeg not fake one). From pablo.platt at gmail.com Sun Jun 23 02:57:35 2013 From: pablo.platt at gmail.com (pablo platt) Date: Sun, 23 Jun 2013 03:57:35 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: Sorry but the mailing list is called libav. How can I install ffmpeg on ubuntu 12.04 and above? On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol wrote: > On 6/23/13, pablo platt wrote: > > Hi, > > > > I'm trying to transcode a live RTMP stream to mp3. > > I can't make avconv write the output to stdout. > > > > I was trying: > > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - > > and > > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > > > > But all I'm getting is a message that the speex header is missing. > > When I'm stopping the RTMP server I see some more message but not getting > > mp3 packets. > > > > I'm using ubuntu 12.04 64bit with the libav-tools deb package. > > For testing I'm using the python rtmp server > > http://code.google.com/p/rtmplite/ > > > > How can I make the output go to stdout? > > You are asking for help on ffmpeg mailing list for avconv > which is from libav (ffmpeg fork). > > If you want help for avconv don't ask here as this is > mailing list for ffmpeg only (real ffmpeg not fake one). > _______________________________________________ > 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 pablo.platt at gmail.com Sun Jun 23 03:33:13 2013 From: pablo.platt at gmail.com (pablo platt) Date: Sun, 23 Jun 2013 04:33:13 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: I'm using static builds from: http://ffmpeg.gusari.org/static/ I've tried: ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - and ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 I don't see anything in the shell On Sun, Jun 23, 2013 at 3:57 AM, pablo platt wrote: > Sorry but the mailing list is called libav. > How can I install ffmpeg on ubuntu 12.04 and above? > > > On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol wrote: > >> On 6/23/13, pablo platt wrote: >> > Hi, >> > >> > I'm trying to transcode a live RTMP stream to mp3. >> > I can't make avconv write the output to stdout. >> > >> > I was trying: >> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - >> > and >> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >> > >> > But all I'm getting is a message that the speex header is missing. >> > When I'm stopping the RTMP server I see some more message but not >> getting >> > mp3 packets. >> > >> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. >> > For testing I'm using the python rtmp server >> > http://code.google.com/p/rtmplite/ >> > >> > How can I make the output go to stdout? >> >> You are asking for help on ffmpeg mailing list for avconv >> which is from libav (ffmpeg fork). >> >> If you want help for avconv don't ask here as this is >> mailing list for ffmpeg only (real ffmpeg not fake one). >> _______________________________________________ >> 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 onemda at gmail.com Sun Jun 23 19:31:35 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 23 Jun 2013 17:31:35 +0000 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: On 6/23/13, pablo platt wrote: > I'm using static builds from: > http://ffmpeg.gusari.org/static/ > > I've tried: > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - > and > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > > I don't see anything in the shell Really? Paste full uncut console output. > > > On Sun, Jun 23, 2013 at 3:57 AM, pablo platt wrote: > >> Sorry but the mailing list is called libav. >> How can I install ffmpeg on ubuntu 12.04 and above? >> >> >> On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol wrote: >> >>> On 6/23/13, pablo platt wrote: >>> > Hi, >>> > >>> > I'm trying to transcode a live RTMP stream to mp3. >>> > I can't make avconv write the output to stdout. >>> > >>> > I was trying: >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - >>> > and >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>> > >>> > But all I'm getting is a message that the speex header is missing. >>> > When I'm stopping the RTMP server I see some more message but not >>> getting >>> > mp3 packets. >>> > >>> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. >>> > For testing I'm using the python rtmp server >>> > http://code.google.com/p/rtmplite/ >>> > >>> > How can I make the output go to stdout? >>> >>> You are asking for help on ffmpeg mailing list for avconv >>> which is from libav (ffmpeg fork). >>> >>> If you want help for avconv don't ask here as this is >>> mailing list for ffmpeg only (real ffmpeg not fake one). >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> >> > From cehoyos at ag.or.at Sun Jun 23 20:07:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 23 Jun 2013 18:07:49 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Niu Licheng writes: > i don't suggest using libstagefright in ffmpeg. i > guess there would be oncompatible on many devices. Could you elaborate? I don't know much about Android and libstagefright but I don't remember any reports that it does not work. Carl Eugen From cehoyos at ag.or.at Sun Jun 23 20:06:43 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 23 Jun 2013 18:06:43 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: Message-ID: Abel Alonso writes: > But once I get FFmpeg compiled. Have I to change > my current code to ask FFmpeg for use > libstagefright decoder? I have never tried it, but isn't it sufficient to request the decoder "libstagefright_h264" instead of the decoder "h264" ? Carl Eugen From alexcohn at netvision.net.il Sun Jun 23 22:49:17 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 23 Jun 2013 23:49:17 +0300 Subject: [Libav-user] What define the quality of a decoded video In-Reply-To: References: Message-ID: On Fri, Jun 21, 2013 at 5:45 PM, Guillaume Bersac wrote: > HI, > > I have a basic .avi video. I decode it, reencode it using the same type of > encoder without modifying the decoded data and finally I save it on one file > of my computer. The saved video has a good framerate but it had lost a lot > of quality in the process (it's now with a lot of pixel). I kwon that the > image has been decoded without losing quality. The lost of quality appeared > during the decoding and saving process. > What define the quality of a decoded video ? > > Thanks, > Guillaume Bersac > 237bis rue de Pessac > 33000 Bordeaux > 06.65.30.89.43 The quality was lost because of re-encoding. Video encoders involve irreversible transformations, e.g. quantization. Applying this kind of transformation several times may easily result in bad visual. Luckily, you don't need to go through this process if your goal is to store some video file in a different format. ffmpeg accepts "-vcodec copy" parameter, which will bypass decoding and re-encoding, and keep the quality of the original. Same can be easily achieved programmatically using libavformat and libavcodec, if you are writing your program (implied by your posting to the libav-user list, and not to ffmpeg-user list). Note however that not all container formats are compatible with all codecs, so in some use cases "-vcodec copy" is invalid. Sincerely, Alex From pablo.platt at gmail.com Sun Jun 23 23:36:30 2013 From: pablo.platt at gmail.com (pablo platt) Date: Mon, 24 Jun 2013 00:36:30 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: Tested with ffmpeg.static.32bit.2013-06-14.tar.gz from http://ffmpeg.gusari.org/static/ under ubuntu 12.04 32bit. I'm using rtmplite with the test client. test:~/rtmplite$ python rtmp.py -d I'm Using the textClient that comes with rtmplite to create a video+audio stream: test:~/rtmplite/testClient/bin-debug$ python -m SimpleHTTPServer I open the testClient example with Firefox in http://localhost:8000/testClient.html Result: ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx libavutil 52. 35.101 / 52. 35.101 libavcodec 55. 16.100 / 55. 16.100 libavformat 55. 8.102 / 55. 8.102 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 77.101 / 3. 77.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-i' ... matched as input file with argument 'rtmp://127.0.0.1/audio/test'. Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'. Reading option 'pipe:1' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file rtmp://127.0.0.1/audio/test. Successfully parsed a group of options. Opening an input file: rtmp://127.0.0.1/audio/test. [rtmp @ 0xa8a7460] Handshaking... [rtmp @ 0xa8a7460] Type answer 3 [rtmp @ 0xa8a7460] Server version 1.2.3.4 [rtmp @ 0xa8a7460] Proto = rtmp, path = /audio/test, app = audio, fname = test [rtmp @ 0xa8a7460] Server bandwidth = 1073741824 [rtmp @ 0xa8a7460] Creating stream... [rtmp @ 0xa8a7460] Sending play command for 'test' [rtmp @ 0xa8a7460] New incoming chunk size = 4096 On Sun, Jun 23, 2013 at 8:31 PM, Paul B Mahol wrote: > On 6/23/13, pablo platt wrote: > > I'm using static builds from: > > http://ffmpeg.gusari.org/static/ > > > > I've tried: > > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - > > and > > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > > > > I don't see anything in the shell > > Really? Paste full uncut console output. > > > > > > > On Sun, Jun 23, 2013 at 3:57 AM, pablo platt > wrote: > > > >> Sorry but the mailing list is called libav. > >> How can I install ffmpeg on ubuntu 12.04 and above? > >> > >> > >> On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol wrote: > >> > >>> On 6/23/13, pablo platt wrote: > >>> > Hi, > >>> > > >>> > I'm trying to transcode a live RTMP stream to mp3. > >>> > I can't make avconv write the output to stdout. > >>> > > >>> > I was trying: > >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - > >>> > and > >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > >>> > > >>> > But all I'm getting is a message that the speex header is missing. > >>> > When I'm stopping the RTMP server I see some more message but not > >>> getting > >>> > mp3 packets. > >>> > > >>> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. > >>> > For testing I'm using the python rtmp server > >>> > http://code.google.com/p/rtmplite/ > >>> > > >>> > How can I make the output go to stdout? > >>> > >>> You are asking for help on ffmpeg mailing list for avconv > >>> which is from libav (ffmpeg fork). > >>> > >>> If you want help for avconv don't ask here as this is > >>> mailing list for ffmpeg only (real ffmpeg not fake one). > >>> _______________________________________________ > >>> 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 pablo.platt at gmail.com Mon Jun 24 00:22:43 2013 From: pablo.platt at gmail.com (pablo platt) Date: Mon, 24 Jun 2013 01:22:43 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: When I'm trying to output to a file it gets stuck at [rtmp @ 0xb481460] New incoming chunk size = 4096 and when I stop rtmplite I'm getting the rest. ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 test.mp3 ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx libavutil 52. 35.101 / 52. 35.101 libavcodec 55. 16.100 / 55. 16.100 libavformat 55. 8.102 / 55. 8.102 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 77.101 / 3. 77.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-i' ... matched as input file with argument 'rtmp:// 127.0.0.1/audio/test'. Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'. Reading option 'test.mp3' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file rtmp://127.0.0.1/audio/test. Successfully parsed a group of options. Opening an input file: rtmp://127.0.0.1/audio/test. [rtmp @ 0xb481460] Handshaking... [rtmp @ 0xb481460] Type answer 3 [rtmp @ 0xb481460] Server version 1.2.3.4 [rtmp @ 0xb481460] Proto = rtmp, path = /audio/test, app = audio, fname = test [rtmp @ 0xb481460] Server bandwidth = 1073741824 [rtmp @ 0xb481460] Creating stream... [rtmp @ 0xb481460] Sending play command for 'test' [rtmp @ 0xb481460] New incoming chunk size = 4096 [flv @ 0xb480f40] Format flv probed with size=2048 and score=100 [flv @ 0xb480f40] File position before avformat_find_stream_info() is 13 [flv @ 0xb480f40] Could not find codec parameters for stream 0 (Video: none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [flv @ 0xb480f40] Could not find codec parameters for stream 1 (Audio: none, 0 channels): unspecified sample format Consider increasing the value for the 'analyzeduration' and 'probesize' options [flv @ 0xb480f40] File position after avformat_find_stream_info() is 13 rtmp://127.0.0.1/audio/test: could not find codec parameters [AVIOContext @ 0xb481e00] Statistics: 13 bytes read, 0 seeks [rtmp @ 0xb481460] Deleting stream... On Mon, Jun 24, 2013 at 12:36 AM, pablo platt wrote: > Tested with ffmpeg.static.32bit.2013-06-14.tar.gz from http://ffmpeg.gusari.org/static/ under ubuntu 12.04 32bit. > > I'm using rtmplite with the test client. > > test:~/rtmplite$ python rtmp.py -d > > I'm Using the textClient that comes with rtmplite to create a video+audio stream: > test:~/rtmplite/testClient/bin-debug$ python -m SimpleHTTPServer > > I open the testClient example with Firefox in > http://localhost:8000/testClient.html > > Result: > > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 > > ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers > built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) > configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx > > libavutil 52. 35.101 / 52. 35.101 > libavcodec 55. 16.100 / 55. 16.100 > libavformat 55. 8.102 / 55. 8.102 > libavdevice 55. 2.100 / 55. 2.100 > libavfilter 3. 77.101 / 3. 77.101 > libswscale 2. 3.100 / 2. 3.100 > > libswresample 0. 17.102 / 0. 17.102 > libpostproc 52. 3.100 / 52. 3.100 > Splitting the commandline. > Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. > > Reading option '-i' ... matched as input file with argument 'rtmp://127.0.0.1/audio/test'. > Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'. > > Reading option 'pipe:1' ... matched as output file. > Finished splitting the commandline. > Parsing a group of options: global . > Applying option loglevel (set logging level) with argument debug. > Successfully parsed a group of options. > > Parsing a group of options: input file rtmp://127.0.0.1/audio/test. > Successfully parsed a group of options. > Opening an input file: rtmp://127.0.0.1/audio/test. > > [rtmp @ 0xa8a7460] Handshaking... > [rtmp @ 0xa8a7460] Type answer 3 > [rtmp @ 0xa8a7460] Server version 1.2.3.4 > [rtmp @ 0xa8a7460] Proto = rtmp, path = /audio/test, app = audio, fname = test > [rtmp @ 0xa8a7460] Server bandwidth = 1073741824 > > [rtmp @ 0xa8a7460] Creating stream... > [rtmp @ 0xa8a7460] Sending play command for 'test' > [rtmp @ 0xa8a7460] New incoming chunk size = 4096 > > > > On Sun, Jun 23, 2013 at 8:31 PM, Paul B Mahol wrote: > >> On 6/23/13, pablo platt wrote: >> > I'm using static builds from: >> > http://ffmpeg.gusari.org/static/ >> > >> > I've tried: >> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - >> > and >> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >> > >> > I don't see anything in the shell >> >> Really? Paste full uncut console output. >> >> > >> > >> > On Sun, Jun 23, 2013 at 3:57 AM, pablo platt >> wrote: >> > >> >> Sorry but the mailing list is called libav. >> >> How can I install ffmpeg on ubuntu 12.04 and above? >> >> >> >> >> >> On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol >> wrote: >> >> >> >>> On 6/23/13, pablo platt wrote: >> >>> > Hi, >> >>> > >> >>> > I'm trying to transcode a live RTMP stream to mp3. >> >>> > I can't make avconv write the output to stdout. >> >>> > >> >>> > I was trying: >> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - >> >>> > and >> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >> >>> > >> >>> > But all I'm getting is a message that the speex header is missing. >> >>> > When I'm stopping the RTMP server I see some more message but not >> >>> getting >> >>> > mp3 packets. >> >>> > >> >>> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. >> >>> > For testing I'm using the python rtmp server >> >>> > http://code.google.com/p/rtmplite/ >> >>> > >> >>> > How can I make the output go to stdout? >> >>> >> >>> You are asking for help on ffmpeg mailing list for avconv >> >>> which is from libav (ffmpeg fork). >> >>> >> >>> If you want help for avconv don't ask here as this is >> >>> mailing list for ffmpeg only (real ffmpeg not fake one). >> >>> _______________________________________________ >> >>> 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 pablo.platt at gmail.com Mon Jun 24 00:34:48 2013 From: pablo.platt at gmail.com (pablo platt) Date: Mon, 24 Jun 2013 01:34:48 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: Sometimes when I'm stopping the media server I suddenly see many packets in the terminal. It seems that ffmpeg is buffering the output and doesn't stream it. On Mon, Jun 24, 2013 at 1:22 AM, pablo platt wrote: > When I'm trying to output to a file it gets stuck at > [rtmp @ 0xb481460] New incoming chunk size = 4096 > and when I stop rtmplite I'm getting the rest. > > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 test.mp3 > > ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg > developers > built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) > configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 > --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' > --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' > --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared > --disable-ffserver --disable-doc --enable-bzlib --enable-zlib > --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl > --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray > --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex > --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 > --enable-libvpx > libavutil 52. 35.101 / 52. 35.101 > libavcodec 55. 16.100 / 55. 16.100 > libavformat 55. 8.102 / 55. 8.102 > libavdevice 55. 2.100 / 55. 2.100 > libavfilter 3. 77.101 / 3. 77.101 > libswscale 2. 3.100 / 2. 3.100 > libswresample 0. 17.102 / 0. 17.102 > libpostproc 52. 3.100 / 52. 3.100 > Splitting the commandline. > Reading option '-loglevel' ... matched as option 'loglevel' (set logging > level) with argument 'debug'. > Reading option '-i' ... matched as input file with argument 'rtmp:// > 127.0.0.1/audio/test'. > Reading option '-f' ... matched as option 'f' (force format) with argument > 'mp3'. > Reading option 'test.mp3' ... matched as output file. > > Finished splitting the commandline. > Parsing a group of options: global . > Applying option loglevel (set logging level) with argument debug. > Successfully parsed a group of options. > Parsing a group of options: input file rtmp://127.0.0.1/audio/test. > Successfully parsed a group of options. > Opening an input file: rtmp://127.0.0.1/audio/test. > [rtmp @ 0xb481460] Handshaking... > [rtmp @ 0xb481460] Type answer 3 > [rtmp @ 0xb481460] Server version 1.2.3.4 > [rtmp @ 0xb481460] Proto = rtmp, path = /audio/test, app = audio, fname = > test > [rtmp @ 0xb481460] Server bandwidth = 1073741824 > [rtmp @ 0xb481460] Creating stream... > [rtmp @ 0xb481460] Sending play command for 'test' > [rtmp @ 0xb481460] New incoming chunk size = 4096 > [flv @ 0xb480f40] Format flv probed with size=2048 and score=100 > [flv @ 0xb480f40] File position before avformat_find_stream_info() is 13 > [flv @ 0xb480f40] Could not find codec parameters for stream 0 (Video: > none): unspecified size > Consider increasing the value for the 'analyzeduration' and 'probesize' > options > [flv @ 0xb480f40] Could not find codec parameters for stream 1 (Audio: > none, 0 channels): unspecified sample format > Consider increasing the value for the 'analyzeduration' and 'probesize' > options > [flv @ 0xb480f40] File position after avformat_find_stream_info() is 13 > rtmp://127.0.0.1/audio/test: could not find codec parameters > [AVIOContext @ 0xb481e00] Statistics: 13 bytes read, 0 seeks > [rtmp @ 0xb481460] Deleting stream... > > > On Mon, Jun 24, 2013 at 12:36 AM, pablo platt wrote: > >> Tested with ffmpeg.static.32bit.2013-06-14.tar.gz from http://ffmpeg.gusari.org/static/ under ubuntu 12.04 32bit. >> >> I'm using rtmplite with the test client. >> >> test:~/rtmplite$ python rtmp.py -d >> >> I'm Using the textClient that comes with rtmplite to create a video+audio stream: >> test:~/rtmplite/testClient/bin-debug$ python -m SimpleHTTPServer >> >> I open the testClient example with Firefox in >> >> http://localhost:8000/testClient.html >> >> Result: >> >> ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >> >> ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers >> built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) >> configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx >> >> >> libavutil 52. 35.101 / 52. 35.101 >> libavcodec 55. 16.100 / 55. 16.100 >> libavformat 55. 8.102 / 55. 8.102 >> libavdevice 55. 2.100 / 55. 2.100 >> >> libavfilter 3. 77.101 / 3. 77.101 >> libswscale 2. 3.100 / 2. 3.100 >> >> libswresample 0. 17.102 / 0. 17.102 >> libpostproc 52. 3.100 / 52. 3.100 >> Splitting the commandline. >> Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. >> >> >> Reading option '-i' ... matched as input file with argument 'rtmp://127.0.0.1/audio/test'. >> Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'. >> >> >> Reading option 'pipe:1' ... matched as output file. >> Finished splitting the commandline. >> Parsing a group of options: global . >> Applying option loglevel (set logging level) with argument debug. >> Successfully parsed a group of options. >> >> >> Parsing a group of options: input file rtmp://127.0.0.1/audio/test. >> Successfully parsed a group of options. >> Opening an input file: rtmp://127.0.0.1/audio/test. >> >> >> [rtmp @ 0xa8a7460] Handshaking... >> [rtmp @ 0xa8a7460] Type answer 3 >> [rtmp @ 0xa8a7460] Server version 1.2.3.4 >> [rtmp @ 0xa8a7460] Proto = rtmp, path = /audio/test, app = audio, fname = test >> [rtmp @ 0xa8a7460] Server bandwidth = 1073741824 >> >> >> [rtmp @ 0xa8a7460] Creating stream... >> [rtmp @ 0xa8a7460] Sending play command for 'test' >> [rtmp @ 0xa8a7460] New incoming chunk size = 4096 >> >> >> >> On Sun, Jun 23, 2013 at 8:31 PM, Paul B Mahol wrote: >> >>> On 6/23/13, pablo platt wrote: >>> > I'm using static builds from: >>> > http://ffmpeg.gusari.org/static/ >>> > >>> > I've tried: >>> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - >>> > and >>> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>> > >>> > I don't see anything in the shell >>> >>> Really? Paste full uncut console output. >>> >>> > >>> > >>> > On Sun, Jun 23, 2013 at 3:57 AM, pablo platt >>> wrote: >>> > >>> >> Sorry but the mailing list is called libav. >>> >> How can I install ffmpeg on ubuntu 12.04 and above? >>> >> >>> >> >>> >> On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol >>> wrote: >>> >> >>> >>> On 6/23/13, pablo platt wrote: >>> >>> > Hi, >>> >>> > >>> >>> > I'm trying to transcode a live RTMP stream to mp3. >>> >>> > I can't make avconv write the output to stdout. >>> >>> > >>> >>> > I was trying: >>> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - >>> >>> > and >>> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>> >>> > >>> >>> > But all I'm getting is a message that the speex header is missing. >>> >>> > When I'm stopping the RTMP server I see some more message but not >>> >>> getting >>> >>> > mp3 packets. >>> >>> > >>> >>> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. >>> >>> > For testing I'm using the python rtmp server >>> >>> > http://code.google.com/p/rtmplite/ >>> >>> > >>> >>> > How can I make the output go to stdout? >>> >>> >>> >>> You are asking for help on ffmpeg mailing list for avconv >>> >>> which is from libav (ffmpeg fork). >>> >>> >>> >>> If you want help for avconv don't ask here as this is >>> >>> mailing list for ffmpeg only (real ffmpeg not fake one). >>> >>> _______________________________________________ >>> >>> 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 mtaha.ansari at gmail.com Mon Jun 24 06:50:27 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 09:50:27 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: Hi everyone! I am trying to get this puzzle solved, but no success so far. Can anyone please guide me further? Thanks in advance for your time! On Fri, Jun 21, 2013 at 3:28 PM, Taha Ansari wrote: > > > > On Fri, Jun 21, 2013 at 3:06 PM, Carl Eugen Hoyos wrote: > >> Taha Ansari writes: >> >> > I have run this application with existing mp4 >> > files as input, and it properly extracts audio, >> > and encodes to mp4 (audio only:AAC), or even >> > directly in AAC format (i.e. test.aac also >> > works). But when I tried running it on mp3 >> > files, output clip plays faster than it should >> > be (a clip of 1:12 seconds plays back till >> > 1:05 seconds only, and is also noisy). >> >> I did not look at your code but did you consider >> that the AAC decoder outputs AV_SAMPLE_FMT_FLTP >> and the MP3 decoder signed 16 bit values (I >> believe you can request planar or not)? >> >> Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > Hi Carl! > > As a matter of fact, I never knew about this, till now. In fact, when I > was probing the two files, I got s16 indication, so I thought they were > similar, maybe: > > > ---------------------------------------------------------------------------------------------------- > FFprobe from test.mp3 (input file): > > ---------------------------------------------------------------------------------------------------- > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg > developers > built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) > configuration: --disable-static --enable-shared --enable-gpl > --enable-version3 > --disable-pthreads --enable-runtime-cpudetect --enable-avisynth > --enable-bzlib > --enable-frei0r --enable-libass --enable-libopencore-amrnb > --enable-libopencore- > amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame > --enable-libnut - > -enable-libopenjpeg --enable-libopus --enable-librtmp > --enable-libschroedinger - > -enable-libspeex --enable-libtheora --enable-libutvideo > --enable-libvo-aacenc -- > enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 > --enab > le-libxavs --enable-libxvid --enable-zlib > libavutil 52. 9.100 / 52. 9.100 > libavcodec 54. 77.100 / 54. 77.100 > libavformat 54. 37.100 / 54. 37.100 > libavdevice 54. 3.100 / 54. 3.100 > libavfilter 3. 23.102 / 3. 23.102 > libswscale 2. 1.102 / 2. 1.102 > libswresample 0. 17.101 / 0. 17.101 > libpostproc 52. 2.100 / 52. 2.100 > [mp3 @ 007b2a60] max_analyze_duration 5000000 reached at 5015510 > Input #0, mp3, from 'test.mp3': > Metadata: > major_brand : isom > minor_version : 512 > compatible_brands: isomiso2avc1mp41 > encoder : Lavf54.37.100 > Duration: 00:01:12.67, start: 0.000000, bitrate: 128 kb/s > Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s > > ---------------------------------------------------------------------------------------------------- > > > ---------------------------------------------------------------------------------------------------- > FFprobe from test.mp4 (converted file): > > ---------------------------------------------------------------------------------------------------- > > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg > developers > built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC) > configuration: --disable-static --enable-shared --enable-gpl > --enable-version3 > --disable-pthreads --enable-runtime-cpudetect --enable-avisynth > --enable-bzlib > --enable-frei0r --enable-libass --enable-libopencore-amrnb > --enable-libopencore- > amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame > --enable-libnut - > -enable-libopenjpeg --enable-libopus --enable-librtmp > --enable-libschroedinger - > -enable-libspeex --enable-libtheora --enable-libutvideo > --enable-libvo-aacenc -- > enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 > --enab > le-libxavs --enable-libxvid --enable-zlib > libavutil 52. 9.100 / 52. 9.100 > libavcodec 54. 77.100 / 54. 77.100 > libavformat 54. 37.100 / 54. 37.100 > libavdevice 54. 3.100 / 54. 3.100 > libavfilter 3. 23.102 / 3. 23.102 > libswscale 2. 1.102 / 2. 1.102 > libswresample 0. 17.101 / 0. 17.101 > libpostproc 52. 2.100 / 52. 2.100 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4': > Metadata: > major_brand : isom > minor_version : 512 > compatible_brands: isomiso2mp41 > encoder : Lavf54.37.100 > Duration: 00:01:04.62, start: 0.000000, bitrate: 129 kb/s > Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, > s16, 128 > kb/s > Metadata: > handler_name : SoundHandler > > ---------------------------------------------------------------------------------------------------- > > Hence the reason I was supplying: > > c->sample_fmt = AV_SAMPLE_FMT_S16; (in add_audio_stream() function). > > If I'm not wasting too much of your time, can you please guide how I can > co relate the two formats, pragmatically? > > Thanks for your time! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Jun 24 08:04:08 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Jun 2013 06:04:08 +0000 (UTC) Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem References: Message-ID: Taha Ansari writes: > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 This looks outdated. The aac decoder of current git head outputs FLTP iirc. Carl Eugen From mtaha.ansari at gmail.com Mon Jun 24 08:26:30 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 11:26:30 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: Hi Carl, You are right, last working build I downloaded from Zeranoe FFmpeg builds was from a long time ago. If you suggest I can always get the latest working build from there, but! the point is: even for this old version of FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file just fine, so there is obviously something wrong with my code... Still, if you suggest I get latest build from there, well, I can do it as well! Kindly, could you guide further based on above facts? On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos wrote: > Taha Ansari writes: > > > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 > > This looks outdated. > The aac decoder of current git head outputs FLTP iirc. > > 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 michael.ivanov at idomoo.com Mon Jun 24 09:36:56 2013 From: michael.ivanov at idomoo.com (Michael Ivanov) Date: Mon, 24 Jun 2013 10:36:56 +0300 Subject: [Libav-user] Muxing audio and video into mp4 Message-ID: Hi All. I have an audio input stream.The video input however comes from rgb images which I compose in runtime.I fail to mux these two .All my errors are around pts/dts.In some examples I can see the pts is calculated vs input av_read_frame but in my case there is no read_frame for image data.How do I synchronize such a thing? The source code can be seen here : http://ffmpeg.gusari.org/viewtopic.php?f=16&t=959&sid=2e7838f5ce7a51e241541f5eadbe3497&p=2224#p2224 -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From bersac_1 at hotmail.fr Mon Jun 24 10:11:05 2013 From: bersac_1 at hotmail.fr (... ...) Date: Mon, 24 Jun 2013 08:11:05 +0000 Subject: [Libav-user] What define the quality of a decoded video In-Reply-To: References: , Message-ID: Hi, Thanks for all your responses, it makes things clearer. So if I understand, I can't encode video without losing quality (the same with decoding, but I don't actually have problems with decoding). But I can't skip decoding for processing reasons. So how to define the encoding tweaks which will minimize the lost of quality ? Is there a function like AVOutputFormat* defineBestDecodeSettings(AVPacket *pkt, enum AVQuality flags); ? Sincerely,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 > Date: Sun, 23 Jun 2013 23:49:17 +0300 > From: alexcohn at netvision.net.il > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] What define the quality of a decoded video > > On Fri, Jun 21, 2013 at 5:45 PM, Guillaume Bersac wrote: > > HI, > > > > I have a basic .avi video. I decode it, reencode it using the same type of > > encoder without modifying the decoded data and finally I save it on one file > > of my computer. The saved video has a good framerate but it had lost a lot > > of quality in the process (it's now with a lot of pixel). I kwon that the > > image has been decoded without losing quality. The lost of quality appeared > > during the decoding and saving process. > > What define the quality of a decoded video ? > > > > Thanks, > > Guillaume Bersac > > 237bis rue de Pessac > > 33000 Bordeaux > > 06.65.30.89.43 > > The quality was lost because of re-encoding. Video encoders involve > irreversible transformations, e.g. quantization. Applying this kind of > transformation several times may easily result in bad visual. > > Luckily, you don't need to go through this process if your goal is to > store some video file in a different format. ffmpeg accepts "-vcodec > copy" parameter, which will bypass decoding and re-encoding, and keep > the quality of the original. Same can be easily achieved > programmatically using libavformat and libavcodec, if you are writing > your program (implied by your posting to the libav-user list, and not > to ffmpeg-user list). > > Note however that not all container formats are compatible with all > codecs, so in some use cases "-vcodec copy" is invalid. > > Sincerely, > Alex > _______________________________________________ > 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 Mon Jun 24 10:16:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Jun 2013 08:16:00 +0000 (UTC) Subject: [Libav-user] What define the quality of a decoded video References: , Message-ID: ... ... writes: > So how to define the encoding tweaks which will > minimize the lost of quality ? Use -qscale 2 Please do not top-post here, Carl Eugen From mtaha.ansari at gmail.com Mon Jun 24 12:07:47 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 15:07:47 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: Hi Carl, On your suggestion, I downloaded latest available build from Zeranoe site: ffmpeg-20130623-git-c329713-win32. I had some trouble getting my code to run with latest build, but finally was able to do so. I had to make following additions: inside open_audio_input(): // Set up SWR context once you've got codec information swr = swr_alloc(); av_opt_set_int(swr, "in_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "out_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "in_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_int(swr, "out_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_S16P, 0); av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); swr_init(swr); inside decode_packet(): swr_convert( swr, audio_dst_data, decoded_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data, decoded_frame->nb_samples ); inside add_audio_stream(): c->sample_fmt = AV_SAMPLE_FMT_S16; c->bit_rate = audio_bit_rate; c->sample_rate = audio_sample_rate; c->channels = audio_channels; Then, all things started working, but the output was identical to previous behavior (plays faster, and ends on same time: on about 65th second). I tried changing output format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP (inside above relevant functions), but it fails inside avcodec_open2(), giving me -22 return value. Any ideas how to fix this? Thanks for your time... On Mon, Jun 24, 2013 at 11:26 AM, Taha Ansari wrote: > Hi Carl, > > You are right, last working build I downloaded from Zeranoe FFmpeg builds > was from a long time ago. If you suggest I can always get the latest > working build from there, but! the point is: even for this old version of > FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file > just fine, so there is obviously something wrong with my code... > > Still, if you suggest I get latest build from there, well, I can do it as > well! > > Kindly, could you guide further based on above facts? > > > On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos wrote: > >> Taha Ansari writes: >> >> > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 >> >> This looks outdated. >> The aac decoder of current git head outputs FLTP iirc. >> >> 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 onemda at gmail.com Mon Jun 24 12:18:25 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 24 Jun 2013 10:18:25 +0000 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On 6/24/13, Taha Ansari wrote: > Hi Carl, > > On your suggestion, I downloaded latest available build from Zeranoe site: > ffmpeg-20130623-git-c329713-win32. I had some trouble getting my code to > run with latest build, but finally was able to do so. > > I had to make following additions: > > inside open_audio_input(): > > // Set up SWR context once you've got codec information > swr = swr_alloc(); > av_opt_set_int(swr, "in_channel_layout", > codec_ctx_audio->channel_layout, 0); > av_opt_set_int(swr, "out_channel_layout", > codec_ctx_audio->channel_layout, 0); > av_opt_set_int(swr, "in_sample_rate", > codec_ctx_audio->sample_rate, 0); > av_opt_set_int(swr, "out_sample_rate", > codec_ctx_audio->sample_rate, 0); > av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_S16P, > 0); > av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, > 0); > swr_init(swr); > > inside decode_packet(): > > swr_convert( swr, audio_dst_data, > decoded_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data, > decoded_frame->nb_samples ); > > inside add_audio_stream(): > > c->sample_fmt = AV_SAMPLE_FMT_S16; > c->bit_rate = audio_bit_rate; > c->sample_rate = audio_sample_rate; > c->channels = audio_channels; > > Then, all things started working, but the output was identical to previous > behavior (plays faster, and ends on same time: on about 65th second). > > I tried changing output format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP > (inside above relevant functions), but it fails inside avcodec_open2(), > giving me -22 return value. You can't change input sample format like that, input sample format is what decoder outputs, nothing else. Same apply to sample format that encoder accepts. So you first need to make sure that you do not change sample format of decoder and that sample format for encoder is actually supported. Cleary examples are not documented properly and needs improving ASAP. > > Any ideas how to fix this? > > Thanks for your time... > > > On Mon, Jun 24, 2013 at 11:26 AM, Taha Ansari > wrote: > >> Hi Carl, >> >> You are right, last working build I downloaded from Zeranoe FFmpeg builds >> was from a long time ago. If you suggest I can always get the latest >> working build from there, but! the point is: even for this old version of >> FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file >> just fine, so there is obviously something wrong with my code... >> >> Still, if you suggest I get latest build from there, well, I can do it as >> well! >> >> Kindly, could you guide further based on above facts? >> >> >> On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos >> wrote: >> >>> Taha Ansari writes: >>> >>> > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 >>> >>> This looks outdated. >>> The aac decoder of current git head outputs FLTP iirc. >>> >>> Carl Eugen >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> >> > From mtaha.ansari at gmail.com Mon Jun 24 12:34:24 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 15:34:24 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: You can't change input sample format like that, input sample format is > what decoder outputs, nothing else. > > Same apply to sample format that encoder accepts. > > So you first need to make sure that you do not change sample format > of decoder and that sample format for encoder is actually supported. > > That makes sense, so I modified swr initialization function like this: swr = swr_alloc(); av_opt_set_int(swr, "in_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "out_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "in_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_int(swr, "out_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_sample_fmt(swr, "in_sample_fmt", codec_ctx_audio->sample_fmt, 0); av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); swr_init(swr); So I'm letting decoder decide whatever format it is comfortable with. Buf for encoder, I know AV_SAMPLE_FMT_S16 has given me compatible results so far (otherwise crashing). So I keep it like this and run my program: same results, unfortunately (btw codec_ctx_audio->sample_fmt shows AV_SAMPLE_FMT_S16P inside debugger anyway). The success I'm talking of, from AV_SAMPLE_FMT_S16 have been from some other test, i.e. if i try to encode an mp4 file as mp4 file (makes no sense but this exercise makes me visualize my guess for 'AV_SAMPLE_FMT_S16' is working, i.e. mp4 to mp4 conversion from my code runs just fine). Obviously, I need to improve encoding functions, somehow. But I can't put my finger on it. Cleary examples are not documented properly and needs improving ASAP. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.Roeber at hella.com Mon Jun 24 12:24:51 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Mon, 24 Jun 2013 03:24:51 -0700 (PDT) Subject: [Libav-user] How to retrieve number of frames Message-ID: <1372069491928-4657992.post@n4.nabble.com> Is there any way to retirve the number of frames of a stream if (AVStream *)stream->nb_frames == 0? -- View this message in context: http://libav-users.943685.n4.nabble.com/How-to-retrieve-number-of-frames-tp4657992.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Mon Jun 24 12:42:52 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 24 Jun 2013 10:42:52 +0000 Subject: [Libav-user] How to retrieve number of frames In-Reply-To: <1372069491928-4657992.post@n4.nabble.com> References: <1372069491928-4657992.post@n4.nabble.com> Message-ID: On 6/24/13, Steffen wrote: > Is there any way to retirve the number of frames of a stream if > (AVStream *)stream->nb_frames == 0? Yes, by demuxing/decoding every single one. From onemda at gmail.com Mon Jun 24 12:46:01 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 24 Jun 2013 10:46:01 +0000 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On 6/24/13, Taha Ansari wrote: > You can't change input sample format like that, input sample format is > >> what decoder outputs, nothing else. >> >> Same apply to sample format that encoder accepts. >> >> So you first need to make sure that you do not change sample format >> of decoder and that sample format for encoder is actually supported. >> >> > That makes sense, so I modified swr initialization function like this: > > swr = swr_alloc(); > av_opt_set_int(swr, "in_channel_layout", > codec_ctx_audio->channel_layout, 0); > av_opt_set_int(swr, "out_channel_layout", > codec_ctx_audio->channel_layout, 0); > av_opt_set_int(swr, "in_sample_rate", > codec_ctx_audio->sample_rate, 0); > av_opt_set_int(swr, "out_sample_rate", > codec_ctx_audio->sample_rate, 0); > av_opt_set_sample_fmt(swr, "in_sample_fmt", > codec_ctx_audio->sample_fmt, 0); > av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, > 0); > swr_init(swr); > > So I'm letting decoder decide whatever format it is comfortable with. > > Buf for encoder, I know AV_SAMPLE_FMT_S16 has given me compatible results > so far (otherwise crashing). So I keep it like this and run my program: > same results, unfortunately (btw codec_ctx_audio->sample_fmt shows > AV_SAMPLE_FMT_S16P inside debugger anyway). "Compatible" results from rest of thread means its wrong one, as it gives wrong output. Planar sample format have data in different format stored in memory thus if you do not use it correctly crash happens.... > > The success I'm talking of, from AV_SAMPLE_FMT_S16 have been from some > other test, i.e. if i try to encode an mp4 file as mp4 file (makes no sense > but this exercise makes me visualize my guess for 'AV_SAMPLE_FMT_S16' is > working, i.e. mp4 to mp4 conversion from my code runs just fine). > > Obviously, I need to improve encoding functions, somehow. But I can't put > my finger on it. > > Cleary examples are not documented properly and needs improving ASAP. >> > From abelalon at gmail.com Mon Jun 24 13:02:51 2013 From: abelalon at gmail.com (Abel Alonso) Date: Mon, 24 Jun 2013 13:02:51 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: Message-ID: Yes it's sufficient to requesst the decoder, but I'm getting a crash when trying to decode the video and the crash never occurs at the same code location. El 23/06/2013 20:10, "Carl Eugen Hoyos" escribi?: > Abel Alonso writes: > > > But once I get FFmpeg compiled. Have I to change > > my current code to ask FFmpeg for use > > libstagefright decoder? > > I have never tried it, but isn't it sufficient to > request the decoder "libstagefright_h264" instead > of the decoder "h264" ? > > 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 alexcohn at netvision.net.il Mon Jun 24 13:35:51 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 24 Jun 2013 14:35:51 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: Message-ID: On Mon, Jun 24, 2013 at 2:02 PM, Abel Alonso wrote: > Yes it's sufficient to requesst the decoder, but I'm getting a crash when > trying to decode the video and the crash never occurs at the same code > location. > El 23/06/2013 20:10, "Carl Eugen Hoyos" escribi?: > >> Abel Alonso writes: >> >> > But once I get FFmpeg compiled. Have I to change >> > my current code to ask FFmpeg for use >> > libstagefright decoder? >> >> I have never tried it, but isn't it sufficient to >> request the decoder "libstagefright_h264" instead >> of the decoder "h264" ? >> >> Carl Eugen >> > Does the crash happen in ffmpeg executable or in your program that uses ffmpeg libraries? Even if crashes are not the same, it's worth to post a stack trace for example. BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Mon Jun 24 13:40:36 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 24 Jun 2013 14:40:36 +0300 Subject: [Libav-user] What define the quality of a decoded video In-Reply-To: References: Message-ID: On Mon, Jun 24, 2013 at 11:11 AM, ... ... wrote: > > Hi, > > Thanks for all your responses, it makes things clearer. So if I understand, I can't encode video without losing quality (the same with decoding, but I don't actually have problems with decoding). But I can't skip decoding for processing reasons. So how to define the encoding tweaks which will minimize the lost of quality ? Is there a function like AVOutputFormat* defineBestDecodeSettings(AVPacket *pkt, enum AVQuality flags); ? > > Sincerely, > Guillaume Bersac > 237bis rue de Pessac > 33000 Bordeaux > 06.65.30.89.43 Which codec are you using? > I decode it, reencode it using the same type of encoder without modifying the decoded data and finally I save it on one file of my computer. If you need to process decoded frames, but don't modify them for storage, you can still copy the original packets to the file on your computer. Sincerely, Alex From Steffen.Roeber at hella.com Mon Jun 24 13:27:44 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Mon, 24 Jun 2013 04:27:44 -0700 (PDT) Subject: [Libav-user] How to retrieve number of frames In-Reply-To: References: <1372069491928-4657992.post@n4.nabble.com> Message-ID: <1372073264047-4657997.post@n4.nabble.com> Yes, but this might take a log of time. Is there maybe any way to jump to the last one? -- View this message in context: http://libav-users.943685.n4.nabble.com/How-to-retrieve-number-of-frames-tp4657992p4657997.html Sent from the libav-users mailing list archive at Nabble.com. From bersac_1 at hotmail.fr Mon Jun 24 14:02:16 2013 From: bersac_1 at hotmail.fr (... ...) Date: Mon, 24 Jun 2013 12:02:16 +0000 Subject: [Libav-user] What define the quality of a decoded video In-Reply-To: References: , , , Message-ID: Hi, Thanks but the problem is I do need to modify the pictures (printing time and other stuff). Cordialy,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 > Date: Mon, 24 Jun 2013 14:40:36 +0300 > From: alexcohn at netvision.net.il > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] What define the quality of a decoded video > > On Mon, Jun 24, 2013 at 11:11 AM, ... ... wrote: > > > > Hi, > > > > Thanks for all your responses, it makes things clearer. So if I understand, I can't encode video without losing quality (the same with decoding, but I don't actually have problems with decoding). But I can't skip decoding for processing reasons. So how to define the encoding tweaks which will minimize the lost of quality ? Is there a function like AVOutputFormat* defineBestDecodeSettings(AVPacket *pkt, enum AVQuality flags); ? > > > > Sincerely, > > Guillaume Bersac > > 237bis rue de Pessac > > 33000 Bordeaux > > 06.65.30.89.43 > > Which codec are you using? > > > I decode it, reencode it using the same type of encoder without modifying the decoded data and finally I save it on one file of my computer. > > If you need to process decoded frames, but don't modify them for > storage, you can still copy the original packets to the file on your > computer. > > Sincerely, > Alex > _______________________________________________ > 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 mtaha.ansari at gmail.com Mon Jun 24 14:21:31 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 17:21:31 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: "Compatible" results from rest of thread means its wrong one, as it gives > wrong output. > > Planar sample format have data in different format stored in memory thus if > you do not use it correctly crash happens.... > Do you have any link to any example that uses planar data correctly? I have been trying since your email to get it to work, but no success so far. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Mon Jun 24 14:29:20 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 17:29:20 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: >>Do you have any link to any example that uses planar data correctly? I have been trying >>since your email to get it to work, but no success so far. > Since encoding from mp4 to mp4 seems to be working fine with my modified code, I am thinking it is the decoding part where I need to be careful dealing with planar formats... is my understanding correct? -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Mon Jun 24 14:39:22 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 24 Jun 2013 12:39:22 +0000 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On 6/24/13, Taha Ansari wrote: >>>Do you have any link to any example that uses planar data correctly? I > have been trying >>since your email to get it to work, but no success so > far. > >> > Since encoding from mp4 to mp4 seems to be working fine with my modified mp4 to mp4 is not encoding but remuxing which can also do transcoding..... > code, I am thinking it is the decoding part where I need to be careful > dealing with planar formats... is my understanding correct? > From hs at tagtraum.com Mon Jun 24 14:48:54 2013 From: hs at tagtraum.com (Hendrik Schreiber) Date: Mon, 24 Jun 2013 14:48:54 +0200 Subject: [Libav-user] Faulty handling of file: protocol on Windows In-Reply-To: <20130618173742.GA11701@phare.normalesup.org> References: <6C78026E-6475-4128-B592-8A6E5B7C6233@tagtraum.com> <20130618173742.GA11701@phare.normalesup.org> Message-ID: <8D7B09EE-4BDD-45B2-9F76-9E8907FC7762@tagtraum.com> On Jun 18, 2013, at 7:37 PM, Nicolas George wrote: > Le decadi 30 prairial, an CCXXI, Carl Eugen Hoyos a ?crit : >> three sounds like a very unlikely number to me. > > The standard syntax is proto://host/full/path; if host is empty with the > file: protocol, that gives file:///full/path, that is correct. I filed a bug report: https://ffmpeg.org/trac/ffmpeg/ticket/2702 Cheers, -hendrik From mtaha.ansari at gmail.com Mon Jun 24 15:03:41 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Mon, 24 Jun 2013 18:03:41 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: >>mp4 to mp4 is not encoding but remuxing which can also do transcoding..... Understood... only my point is: since this decode -> resample -> encode process is happening from my code, it should be applicable to other formats as well, shouldn't it? > > > code, I am thinking it is the decoding part where I need to be careful > > dealing with planar formats... is my understanding correct? > > > _______________________________________________ > 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 Mon Jun 24 15:08:20 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Jun 2013 13:08:20 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: Message-ID: Abel Alonso writes: > Yes it's sufficient to requesst the decoder, but I'm > getting a crash when trying to decode the video Can you reproduce the crash with ffmpeg (the application)? Please do not top-post here, Carl Eugen From onemda at gmail.com Mon Jun 24 20:52:57 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 24 Jun 2013 18:52:57 +0000 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On 6/24/13, Taha Ansari wrote: >>>mp4 to mp4 is not encoding but remuxing which can also do >>> transcoding..... > > Understood... only my point is: since this decode -> resample -> encode > process is happening from my code, it should be applicable to other formats > as well, shouldn't it? Yes. > >> >> > code, I am thinking it is the decoding part where I need to be careful >> > dealing with planar formats... is my understanding correct? >> > >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > From pablo.platt at gmail.com Mon Jun 24 22:47:34 2013 From: pablo.platt at gmail.com (pablo platt) Date: Mon, 24 Jun 2013 23:47:34 +0300 Subject: [Libav-user] mp3 live stream to stdout In-Reply-To: References: Message-ID: I also tried with red5 with the oflaDemo. I found other with the same issue but couldn't find a solution http://ffmpeg.org/pipermail/ffmpeg-user/2013-May/015034.html http://stackoverflow.com/questions/16113734/red5-receive-a-stream-and-have-it-available-for-just-one-client https://groups.google.com/forum/#!topic/red5interest/U6EGDeDFDqg ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/oflaDemo/test -f flv test.flv ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers built on Jun 14 2013 05:25:56 with gcc 4.6 (Debian 4.6.3-1) configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx libavutil 52. 35.101 / 52. 35.101 libavcodec 55. 16.100 / 55. 16.100 libavformat 55. 8.102 / 55. 8.102 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 77.101 / 3. 77.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-i' ... matched as input file with argument 'rtmp:// 127.0.0.1/oflaDemo/test'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option 'test.flv' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file rtmp://127.0.0.1/oflaDemo/test. Successfully parsed a group of options. Opening an input file: rtmp://127.0.0.1/oflaDemo/test. [rtmp @ 0x29e5440] Handshaking... [rtmp @ 0x29e5440] Type answer 3 [rtmp @ 0x29e5440] Server version 1.2.3.4 [rtmp @ 0x29e5440] Proto = rtmp, path = /oflaDemo/test, app = oflaDemo, fname = test [rtmp @ 0x29e5440] Creating stream... [rtmp @ 0x29e5440] Sending play command for 'test' [rtmp @ 0x29e5440] Server error: rtmp://127.0.0.1/oflaDemo/test: Operation not permitted On Mon, Jun 24, 2013 at 1:34 AM, pablo platt wrote: > Sometimes when I'm stopping the media server I suddenly see many packets > in the terminal. > It seems that ffmpeg is buffering the output and doesn't stream it. > > > > On Mon, Jun 24, 2013 at 1:22 AM, pablo platt wrote: > >> When I'm trying to output to a file it gets stuck at >> [rtmp @ 0xb481460] New incoming chunk size = 4096 >> and when I stop rtmplite I'm getting the rest. >> >> ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 test.mp3 >> >> ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg >> developers >> built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) >> configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 >> --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' >> --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' >> --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared >> --disable-ffserver --disable-doc --enable-bzlib --enable-zlib >> --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl >> --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray >> --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex >> --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 >> --enable-libvpx >> libavutil 52. 35.101 / 52. 35.101 >> libavcodec 55. 16.100 / 55. 16.100 >> libavformat 55. 8.102 / 55. 8.102 >> libavdevice 55. 2.100 / 55. 2.100 >> libavfilter 3. 77.101 / 3. 77.101 >> libswscale 2. 3.100 / 2. 3.100 >> libswresample 0. 17.102 / 0. 17.102 >> libpostproc 52. 3.100 / 52. 3.100 >> Splitting the commandline. >> Reading option '-loglevel' ... matched as option 'loglevel' (set logging >> level) with argument 'debug'. >> Reading option '-i' ... matched as input file with argument 'rtmp:// >> 127.0.0.1/audio/test'. >> Reading option '-f' ... matched as option 'f' (force format) with >> argument 'mp3'. >> Reading option 'test.mp3' ... matched as output file. >> >> Finished splitting the commandline. >> Parsing a group of options: global . >> Applying option loglevel (set logging level) with argument debug. >> Successfully parsed a group of options. >> Parsing a group of options: input file rtmp://127.0.0.1/audio/test. >> Successfully parsed a group of options. >> Opening an input file: rtmp://127.0.0.1/audio/test. >> [rtmp @ 0xb481460] Handshaking... >> [rtmp @ 0xb481460] Type answer 3 >> [rtmp @ 0xb481460] Server version 1.2.3.4 >> [rtmp @ 0xb481460] Proto = rtmp, path = /audio/test, app = audio, fname = >> test >> [rtmp @ 0xb481460] Server bandwidth = 1073741824 >> [rtmp @ 0xb481460] Creating stream... >> [rtmp @ 0xb481460] Sending play command for 'test' >> [rtmp @ 0xb481460] New incoming chunk size = 4096 >> [flv @ 0xb480f40] Format flv probed with size=2048 and score=100 >> [flv @ 0xb480f40] File position before avformat_find_stream_info() is 13 >> [flv @ 0xb480f40] Could not find codec parameters for stream 0 (Video: >> none): unspecified size >> Consider increasing the value for the 'analyzeduration' and 'probesize' >> options >> [flv @ 0xb480f40] Could not find codec parameters for stream 1 (Audio: >> none, 0 channels): unspecified sample format >> Consider increasing the value for the 'analyzeduration' and 'probesize' >> options >> [flv @ 0xb480f40] File position after avformat_find_stream_info() is 13 >> rtmp://127.0.0.1/audio/test: could not find codec parameters >> [AVIOContext @ 0xb481e00] Statistics: 13 bytes read, 0 seeks >> [rtmp @ 0xb481460] Deleting stream... >> >> >> On Mon, Jun 24, 2013 at 12:36 AM, pablo platt wrote: >> >>> Tested with ffmpeg.static.32bit.2013-06-14.tar.gz from http://ffmpeg.gusari.org/static/ under ubuntu 12.04 32bit. >>> >>> I'm using rtmplite with the test client. >>> >>> test:~/rtmplite$ python rtmp.py -d >>> >>> I'm Using the textClient that comes with rtmplite to create a video+audio stream: >>> test:~/rtmplite/testClient/bin-debug$ python -m SimpleHTTPServer >>> >>> I open the testClient example with Firefox in >>> >>> >>> http://localhost:8000/testClient.html >>> >>> Result: >>> >>> ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>> >>> >>> ffmpeg version N-54023-g6fe419b Copyright (c) 2000-2013 the FFmpeg developers >>> built on Jun 14 2013 05:12:40 with gcc 4.6 (Debian 4.6.3-1) >>> configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx >>> >>> >>> >>> libavutil 52. 35.101 / 52. 35.101 >>> libavcodec 55. 16.100 / 55. 16.100 >>> libavformat 55. 8.102 / 55. 8.102 >>> libavdevice 55. 2.100 / 55. 2.100 >>> >>> >>> libavfilter 3. 77.101 / 3. 77.101 >>> libswscale 2. 3.100 / 2. 3.100 >>> >>> libswresample 0. 17.102 / 0. 17.102 >>> libpostproc 52. 3.100 / 52. 3.100 >>> Splitting the commandline. >>> Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. >>> >>> >>> >>> Reading option '-i' ... matched as input file with argument 'rtmp://127.0.0.1/audio/test'. >>> Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'. >>> >>> >>> >>> Reading option 'pipe:1' ... matched as output file. >>> Finished splitting the commandline. >>> Parsing a group of options: global . >>> Applying option loglevel (set logging level) with argument debug. >>> Successfully parsed a group of options. >>> >>> >>> >>> Parsing a group of options: input file rtmp://127.0.0.1/audio/test. >>> Successfully parsed a group of options. >>> Opening an input file: rtmp://127.0.0.1/audio/test. >>> >>> >>> >>> [rtmp @ 0xa8a7460] Handshaking... >>> [rtmp @ 0xa8a7460] Type answer 3 >>> [rtmp @ 0xa8a7460] Server version 1.2.3.4 >>> [rtmp @ 0xa8a7460] Proto = rtmp, path = /audio/test, app = audio, fname = test >>> [rtmp @ 0xa8a7460] Server bandwidth = 1073741824 >>> >>> >>> >>> [rtmp @ 0xa8a7460] Creating stream... >>> [rtmp @ 0xa8a7460] Sending play command for 'test' >>> [rtmp @ 0xa8a7460] New incoming chunk size = 4096 >>> >>> >>> >>> On Sun, Jun 23, 2013 at 8:31 PM, Paul B Mahol wrote: >>> >>>> On 6/23/13, pablo platt wrote: >>>> > I'm using static builds from: >>>> > http://ffmpeg.gusari.org/static/ >>>> > >>>> > I've tried: >>>> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 - >>>> > and >>>> > ./ffmpeg -loglevel debug -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>>> > >>>> > I don't see anything in the shell >>>> >>>> Really? Paste full uncut console output. >>>> >>>> > >>>> > >>>> > On Sun, Jun 23, 2013 at 3:57 AM, pablo platt >>>> wrote: >>>> > >>>> >> Sorry but the mailing list is called libav. >>>> >> How can I install ffmpeg on ubuntu 12.04 and above? >>>> >> >>>> >> >>>> >> On Sun, Jun 23, 2013 at 3:42 AM, Paul B Mahol >>>> wrote: >>>> >> >>>> >>> On 6/23/13, pablo platt wrote: >>>> >>> > Hi, >>>> >>> > >>>> >>> > I'm trying to transcode a live RTMP stream to mp3. >>>> >>> > I can't make avconv write the output to stdout. >>>> >>> > >>>> >>> > I was trying: >>>> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 - >>>> >>> > and >>>> >>> > avconv -i rtmp://127.0.0.1/audio/test -f mp3 pipe:1 >>>> >>> > >>>> >>> > But all I'm getting is a message that the speex header is missing. >>>> >>> > When I'm stopping the RTMP server I see some more message but not >>>> >>> getting >>>> >>> > mp3 packets. >>>> >>> > >>>> >>> > I'm using ubuntu 12.04 64bit with the libav-tools deb package. >>>> >>> > For testing I'm using the python rtmp server >>>> >>> > http://code.google.com/p/rtmplite/ >>>> >>> > >>>> >>> > How can I make the output go to stdout? >>>> >>> >>>> >>> You are asking for help on ffmpeg mailing list for avconv >>>> >>> which is from libav (ffmpeg fork). >>>> >>> >>>> >>> If you want help for avconv don't ask here as this is >>>> >>> mailing list for ffmpeg only (real ffmpeg not fake one). >>>> >>> _______________________________________________ >>>> >>> 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 mtaha.ansari at gmail.com Tue Jun 25 07:41:49 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 25 Jun 2013 10:41:49 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: On Mon, Jun 24, 2013 at 11:52 PM, Paul B Mahol wrote: > On 6/24/13, Taha Ansari wrote: > >>>mp4 to mp4 is not encoding but remuxing which can also do > >>> transcoding..... > > > > Understood... only my point is: since this decode -> resample -> encode > > process is happening from my code, it should be applicable to other > formats > > as well, shouldn't it? > > Yes. > Hi again, I tried searching online again, apparently I'm doing almost identical to this post (input/output format changed but theme is same): http://stackoverflow.com/questions/14989397/how-to-convert-sample-rate-from-av-sample-fmt-fltp-to-av-sample-fmt-s16 It does not work for me (same quick audio playback) People have posted similar question (in theme at least): http://stackoverflow.com/questions/16904841/how-to-encode-resampled-pcm-audio-to-aac-using-ffmpeg-api-when-input-pcm-samples http://stackoverflow.com/questions/16724722/how-to-fill-audio-avframe-ffmpeg-with-the-data-obtained-from-cmsamplebufferref Also they could not find the answer. I'm tired trying to figure it out on my own, is there any kind soul who has done this already? Please share... -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Tue Jun 25 11:16:25 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 25 Jun 2013 11:16:25 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: Message-ID: 2013/6/24 Carl Eugen Hoyos > Abel Alonso writes: > > > Yes it's sufficient to requesst the decoder, but I'm > > getting a crash when trying to decode the video > > Can you reproduce the crash with ffmpeg (the application)? > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > The crash is in my application that uses ffmpeg libraries. In order to execute the ffmpeg application I built, I should root my Android device, right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Tue Jun 25 11:17:56 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 25 Jun 2013 14:17:56 +0500 Subject: [Libav-user] Conversion from mp3 to aac/mp4 container problem In-Reply-To: References: Message-ID: I have another observation: When transcoding from mp4 to mp4 (using my code), I see codec_ctx_audio->frame_size is equal to 1024 (that is decoder codec context), and encoder codec context's frame_size is allocated the same (1024). Whereas, while converting from mp3 to mp4, codec_ctx_audio->frame_size is 1152, and encoder codec context frame_size is 1024. I am thinking these could be related, if I figure out magic going on here, I might be able to proceed better....? -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Jun 25 11:55:51 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 25 Jun 2013 12:55:51 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: Message-ID: On Tue, Jun 25, 2013 at 12:16 PM, Abel Alonso wrote: > > 2013/6/24 Carl Eugen Hoyos >> >> Abel Alonso writes: >> >> > Yes it's sufficient to requesst the decoder, but I'm >> > getting a crash when trying to decode the video >> >> Can you reproduce the crash with ffmpeg (the application)? >> >> Please do not top-post here, Carl Eugen >> > The crash is in my application that uses ffmpeg libraries. In order to > execute the ffmpeg application I built, I should root my Android device, > right? Not really. You can push the executable to /data/local/tmp or some other local directory with r/w access (it must not be on /sdcard/, because Android does not allow execution from there), chmod 777 and run it (the input and output files may be on /sdcard/). BR Alex From niulicheng at gmail.com Tue Jun 25 12:22:59 2013 From: niulicheng at gmail.com (Licheng Niu) Date: Tue, 25 Jun 2013 18:22:59 +0800 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: I am not familiar with libstagefright in ffmpeg and I believe it works well on most devices. But since libstagefright uses Openmax IL api, I guess there would be some incompatible issues. The most frequently happened problem is color format incompatible. However, color format incompatible doesn't affect decoding. Another problem for example: On TI Tegra II cpu, there is a special way to use openmax api. On Mon, Jun 24, 2013 at 2:07 AM, Carl Eugen Hoyos wrote: > Niu Licheng writes: > > > i don't suggest using libstagefright in ffmpeg. i > > guess there would be oncompatible on many devices. > > Could you elaborate? > I don't know much about Android and libstagefright > but I don't remember any reports that it does not > work. > > 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 srkntmondal at gmail.com Tue Jun 25 12:38:03 2013 From: srkntmondal at gmail.com (srikanta mondal) Date: Tue, 25 Jun 2013 16:08:03 +0530 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: I have decode by software in Android 4.0 NDK using ffmpeg. I had got the issue of color format incompatible. but that is a silly matter as the format was BGR to RGB. I just convert it. On Tue, Jun 25, 2013 at 3:52 PM, Licheng Niu wrote: > I am not familiar with libstagefright in ffmpeg and I believe it works > well on most devices. But since libstagefright uses Openmax IL api, I guess > there would be some incompatible issues. > The most frequently happened problem is color format incompatible. > However, color format incompatible doesn't affect decoding. > Another problem for example: On TI Tegra II cpu, there is a special way to > use openmax api. > > > On Mon, Jun 24, 2013 at 2:07 AM, Carl Eugen Hoyos wrote: > >> Niu Licheng writes: >> >> > i don't suggest using libstagefright in ffmpeg. i >> > guess there would be oncompatible on many devices. >> >> Could you elaborate? >> I don't know much about Android and libstagefright >> but I don't remember any reports that it does not >> work. >> >> Carl Eugen >> >> _______________________________________________ >> 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 radu.robotin at gmail.com Tue Jun 25 12:47:08 2013 From: radu.robotin at gmail.com (Radu Robotin) Date: Tue, 25 Jun 2013 13:47:08 +0300 Subject: [Libav-user] help encoding audio ogg/vorbis Message-ID: Hi, I'm developing an application that requires audio streaming using ogg/vorbis format (among other things). My application successfully creates mp2, mp3 ac3 or aac encoded streams, but when I'm trying to use the libvorbis encoder the result is not playable. I suspected it has something to do with the fact that there is no "raw vorbis" stream defines, so I tried using an ogg container and the vorbis documentation specifies. I was looking at muxing.c example that comes with ffmpeg (I'm using the source ffmpeg from git, built on 06.18.2013 on Ubuntu 12.04 32 bit). I can make that example work with pretty much any format except with vorbis. I tried both the libvorbis encoder and the native vorbis encoder that comes with ffmpeg and the results are the same: the resulting file is not playable. Interestingly enough, when using the example muxing.c to produce an ogg file with FLAC audio, it works flawlessly, so the only problem seems to be with vorbis audio encoder. When using ffmpeg in command line with something like: ffmpeg -i input.wav -codec:a libvorbis output.ogg works without any issues, so my guess is there is nothing wrong with the vorbis encoder. I also noticed there are several people having similar issues, I tried contacting them, some have abandoned the idea, some are still waiting for answers. However I didn't find mine. To summarize, here is my question: Have somebody had any success encoding audio using the vorbis encoder with libav (that is programmatically, not command line ffmpeg). What is the difference in using libvorbis as opposed to mp3 or aac encoder? Are there additional setting to be made so that one can use libvorbis encoder and produce a playable ogg file? Can someone point me in the right direction? Thank you, any help would be appreciated! Radu Robotin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Jun 25 12:49:26 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 25 Jun 2013 13:49:26 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: On Tue, Jun 25, 2013 at 1:22 PM, Licheng Niu wrote: > I am not familiar with libstagefright in ffmpeg and I believe it works well > on most devices. But since libstagefright uses Openmax IL api, I guess there > would be some incompatible issues. > The most frequently happened problem is color format incompatible. However, > color format incompatible doesn't affect decoding. > Another problem for example: On TI Tegra II cpu, there is a special way to > use openmax api. The advantage of stagefright is to provide a cros-device interface, and compensate for OpenMax IL incompatibilities. This said, there still may be hw-specific quirks, especially when using older devices. BR, Alex From praks411 at gmail.com Tue Jun 25 13:02:52 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 25 Jun 2013 04:02:52 -0700 (PDT) Subject: [Libav-user] avpicture_free crashing when using with sws_scale() In-Reply-To: <1372157561816-4658017.post@n4.nabble.com> References: <1372157561816-4658017.post@n4.nabble.com> Message-ID: <1372158172065-4658018.post@n4.nabble.com> Also this is happening when I'm converting from Av_PIX_FMT_BGR24 ----->AV_PIX_FMT_YUV420P (Src Format) (Dst Format) Please help. -- View this message in context: http://libav-users.943685.n4.nabble.com/avpicture-free-crashing-when-using-with-sws-scale-tp4658017p4658018.html Sent from the libav-users mailing list archive at Nabble.com. From abelalon at gmail.com Tue Jun 25 13:18:27 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 25 Jun 2013 13:18:27 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/25 Alex Cohn > On Tue, Jun 25, 2013 at 1:22 PM, Licheng Niu wrote: > > I am not familiar with libstagefright in ffmpeg and I believe it works > well > > on most devices. But since libstagefright uses Openmax IL api, I guess > there > > would be some incompatible issues. > > The most frequently happened problem is color format incompatible. > However, > > color format incompatible doesn't affect decoding. > > Another problem for example: On TI Tegra II cpu, there is a special way > to > > use openmax api. > > The advantage of stagefright is to provide a cros-device interface, > and compensate for OpenMax IL incompatibilities. This said, there > still may be hw-specific quirks, especially when using older devices. > > BR, > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > I've just executed the ffmpeg app on Android and it raises a Segmentation Fault. The line I executed was: ./ffmpeg -i /sdcard/Download/video.mov -f image2 -vf fps=fps=1 /sdcard/Download/out%d.png I attach the result of the execution, as you can see, no frame was decoded successfully. I also attach the backtrace given by logcat. The Android version is 4.2.2 (JDQ39) and the device is a LG Nexus 4. As you can see, I had to enable the memalgin-hack to get the app built. I did it because without that flag, the file libavutil/mem.c didn't compile successfully, due to there is no posix_memalign function in Android. I don't know if this could be related with the crash, but it surprised me, because the FFmpeg configure file is able to detect the posix_memalign function and, therefore, it defines HAVE_POSIX_MEMALIGN 1. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- ffmpeg version 1.1.5 Copyright (c) 2000-2013 the FFmpeg developers built on Jun 25 2013 12:50:41 with gcc 4.6 (GCC) 20120106 (prerelease) configuration: --target-os=linux --cross-prefix=arm-linux-androideabi- --enable-cross-compile --disable-optimizations --disable-stripping --enable-debug=3 --arch=arm --enable-asm --disable-symver --enable-runtime-cpudetect --enable-memalign-hack --disable-doc --disable-ffplay --disable-ffprobe --disable-ffserver --sysroot=/tmp/vplayer/sysroot/ --disable-avdevice --disable-decoder=h264 --disable-decoder=h264_vdpau --enable-libstagefright-h264 --enable-decoder=libstagefright_h264 --prefix=../build/stagefright/armeabi-v7a --extra-cflags='-I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/include -I/hom libavutil 52. 13.100 / 52. 13.100 libavcodec 54. 86.100 / 54. 86.100 libavformat 54. 59.106 / 54. 59.106 libavfilter 3. 32.100 / 3. 32.100 libswscale 2. 1.103 / 2. 1.103 libswresample 0. 17.102 / 0. 17.102 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/sdcard/Download/video.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2013-05-21 20:52:29 timecode : 01:00:00:00 Duration: 00:02:41.20, start: 0.000000, bitrate: 2881 kb/s Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 848x476, 2606 kb/s, 23.98 fps, 23.98 tbr, 2997 tbn, 2997 tbc Metadata: creation_time : 2013-05-21 20:52:29 handler_name : Apple Video Media Handler Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s Metadata: creation_time : 2013-05-21 20:52:29 handler_name : Apple Sound Media Handler Stream #0:2(eng): Data: none (tmcd / 0x64636D74) Metadata: creation_time : 2013-05-21 20:52:29 handler_name : Time Code Media Handler timecode : 01:00:00:00 Stream #0:3(eng): Data: none (rtp / 0x20707472) Metadata: creation_time : 2013-05-21 20:52:29 handler_name : hint media handler Stream #0:4(eng): Data: none (rtp / 0x20707472) Metadata: creation_time : 2013-05-21 20:52:29 handler_name : hint media handler [swscaler @ 0x1d498d0] No accelerated colorspace conversion found from yuv420p to rgb24. [swscaler @ 0x1d672b0] No accelerated colorspace conversion found from yuv420p to rgb24. [swscaler @ 0x1cfdf30] No accelerated colorspace conversion found from yuv420p to rgb24. Output #0, image2, to '/sdcard/Download/out%d.png': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt timecode : 01:00:00:00 encoder : Lavf54.59.106 Stream #0:0(eng): Video: png, rgb24, 848x476, q=2-31, 200 kb/s, 90k tbn, 1 tbc Metadata: creation_time : 2013-05-21 20:52:29 handler_name : Apple Video Media Handler Stream mapping: Stream #0:0 -> #0:0 (libstagefright_h264 -> png) Press [q] to stop, [?] for help Segmentation fault -------------- next part -------------- F/libc ( 4338): @@@ ABORTING: LIBC: ARGUMENT IS INVALID HEAP ADDRESS IN dlfree addr=0x01cb47c8 F/libc ( 4338): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 4343 (Binder_2) I/DEBUG ( 158): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 158): Build fingerprint: 'google/occam/mako:4.2.2/JDQ39/573038:user/release-keys' I/DEBUG ( 158): Revision: '11' I/DEBUG ( 158): pid: 4338, tid: 4343, name: Binder_2 >>> ./ffmpeg <<< I/DEBUG ( 158): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad I/DEBUG ( 158): r0 00000055 r1 40f3ba48 r2 00000003 r3 deadbaad I/DEBUG ( 158): r4 4013a228 r5 01cb47c8 r6 40f3ba70 r7 4012d72a I/DEBUG ( 158): r8 01cb47d0 r9 ffffffff sl 4013a228 fp 40f3bbc4 I/DEBUG ( 158): ip 00000000 sp 40f3ba70 lr 40119a19 pc 400fdffc cpsr 00000030 I/DEBUG ( 158): d0 0000000000000016 d1 fe04500890b5ce00 I/DEBUG ( 158): d2 0059eb2101000000 d3 21010000e04f0000 I/DEBUG ( 158): d4 4f00850059eb9f00 d5 ba4f0021010000e0 I/DEBUG ( 158): d6 0000f813402140d6 d7 2140d67a77002101 I/DEBUG ( 158): d8 0000000000000000 d9 0000000000000000 I/DEBUG ( 158): d10 0000000000000000 d11 0000000000000000 I/DEBUG ( 158): d12 0000000000000000 d13 0000000000000000 I/DEBUG ( 158): d14 0000000000000000 d15 0000000000000000 I/DEBUG ( 158): d16 3ff0000000000000 d17 3fe0000000000000 I/DEBUG ( 158): d18 3f974c074a362e68 d19 c047069e2aa2aa5b I/DEBUG ( 158): d20 c050800000000000 d21 bfc34e892d87a4ea I/DEBUG ( 158): d22 3fcc745e0ab0ad85 d23 3fd24aaf828e1369 I/DEBUG ( 158): d24 3fd99b7c3731d10b d25 3fe5568b9401f367 I/DEBUG ( 158): d26 0000000000000000 d27 0000000000000000 I/DEBUG ( 158): d28 0000000000000000 d29 0000000000000000 I/DEBUG ( 158): d30 0000000000000000 d31 0000000000000000 I/DEBUG ( 158): scr 80000010 I/DEBUG ( 158): I/DEBUG ( 158): backtrace: I/DEBUG ( 158): #00 pc 0000effc /system/lib/libc.so I/DEBUG ( 158): #01 pc 00011da3 /system/lib/libc.so (dlfree+1458) I/DEBUG ( 158): #02 pc 0000cf13 /system/lib/libc.so (free+10) I/DEBUG ( 158): #03 pc 00a38408 /data/local/tmp/ffmpeg (av_expr_parse+360) I/DEBUG ( 158): I/DEBUG ( 158): stack: I/DEBUG ( 158): 40f3ba30 00000001 I/DEBUG ( 158): 40f3ba34 4012d72a /system/lib/libc.so I/DEBUG ( 158): 40f3ba38 01cb47d0 [heap] I/DEBUG ( 158): 40f3ba3c 40119a83 /system/lib/libc.so I/DEBUG ( 158): 40f3ba40 01d4fd00 [heap] I/DEBUG ( 158): 40f3ba44 00000007 I/DEBUG ( 158): 40f3ba48 40f3ba44 [stack:4343] I/DEBUG ( 158): 40f3ba4c 00000001 I/DEBUG ( 158): 40f3ba50 4012d326 /system/lib/libc.so I/DEBUG ( 158): 40f3ba54 00000005 I/DEBUG ( 158): 40f3ba58 40f3ba7c [stack:4343] I/DEBUG ( 158): 40f3ba5c 0000004f I/DEBUG ( 158): 40f3ba60 4013a228 I/DEBUG ( 158): 40f3ba64 01cb47c8 [heap] I/DEBUG ( 158): 40f3ba68 df0027ad I/DEBUG ( 158): 40f3ba6c 00000000 I/DEBUG ( 158): #00 40f3ba70 62633130 I/DEBUG ( 158): 40f3ba74 38633734 I/DEBUG ( 158): 40f3ba78 01d4fd00 [heap] I/DEBUG ( 158): 40f3ba7c 20404040 I/DEBUG ( 158): 40f3ba80 524f4241 I/DEBUG ( 158): 40f3ba84 474e4954 I/DEBUG ( 158): 40f3ba88 494c203a I/DEBUG ( 158): 40f3ba8c 203a4342 I/DEBUG ( 158): 40f3ba90 55475241 I/DEBUG ( 158): 40f3ba94 544e454d I/DEBUG ( 158): 40f3ba98 20534920 I/DEBUG ( 158): 40f3ba9c 41564e49 /dev/ashmem/OMXCodec (deleted) I/DEBUG ( 158): 40f3baa0 2044494c I/DEBUG ( 158): 40f3baa4 50414548 I/DEBUG ( 158): 40f3baa8 44444120 I/DEBUG ( 158): 40f3baac 53534552 I/DEBUG ( 158): ........ ........ I/DEBUG ( 158): #01 40f3bb98 01d09228 [heap] I/DEBUG ( 158): 40f3bb9c 01d3bfa0 [heap] I/DEBUG ( 158): 40f3bba0 00000000 I/DEBUG ( 158): 40f3bba4 0040c6d4 /data/local/tmp/ffmpeg (decode_init+236) I/DEBUG ( 158): 40f3bba8 402902a2 /system/lib/libstagefright.so I/DEBUG ( 158): 40f3bbac 400fbf15 /system/lib/libc.so (free+12) I/DEBUG ( 158): #02 40f3bbb0 01cb47d0 [heap] I/DEBUG ( 158): 40f3bbb4 00a4040c /data/local/tmp/ffmpeg (av_expr_parse+364) I/DEBUG ( 158): I/DEBUG ( 158): memory near r1: I/DEBUG ( 158): 40f3ba28 4012d326 40f3ba7c 00000001 4012d72a I/DEBUG ( 158): 40f3ba38 01cb47d0 40119a83 01d4fd00 00000007 I/DEBUG ( 158): 40f3ba48 40f3ba44 00000001 4012d326 00000005 I/DEBUG ( 158): 40f3ba58 40f3ba7c 0000004f 4013a228 01cb47c8 I/DEBUG ( 158): 40f3ba68 df0027ad 00000000 62633130 38633734 I/DEBUG ( 158): 40f3ba78 01d4fd00 20404040 524f4241 474e4954 I/DEBUG ( 158): 40f3ba88 494c203a 203a4342 55475241 544e454d I/DEBUG ( 158): 40f3ba98 20534920 41564e49 2044494c 50414548 I/DEBUG ( 158): 40f3baa8 44444120 53534552 204e4920 72666c64 I/DEBUG ( 158): 40f3bab8 61206565 3d726464 31307830 37346263 I/DEBUG ( 158): 40f3bac8 00003863 01d4fd00 40f3bba8 00000010 I/DEBUG ( 158): 40f3bad8 00000002 00000000 00000014 40f3bb78 I/DEBUG ( 158): 40f3bae8 00000000 403492bb 00000014 40f3bb78 I/DEBUG ( 158): 40f3baf8 00000000 00000000 c0000000 00000008 I/DEBUG ( 158): 40f3bb08 40f3bbd0 00000000 01ce3ab8 401003c3 I/DEBUG ( 158): 40f3bb18 01cb27ec 40240d61 74696d65 01cb27f0 I/DEBUG ( 158): I/DEBUG ( 158): memory near r4: I/DEBUG ( 158): 4013a208 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a218 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a228 ba9a446c 00000000 00000000 00000000 I/DEBUG ( 158): 4013a238 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a248 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a258 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a268 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a278 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a288 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a298 00000000 00000000 3f7265e5 00000000 I/DEBUG ( 158): 4013a2a8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2b8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2c8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2d8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2e8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2f8 00000000 00000000 00000000 00004000 I/DEBUG ( 158): I/DEBUG ( 158): memory near r5: I/DEBUG ( 158): 01cb47a8 a00e58c5 0000fc09 77000101 0e58c56a I/DEBUG ( 158): 01cb47b8 00fc09a0 00010100 56b1ca27 7f02a803 I/DEBUG ( 158): 01cb47c8 00000000 00000091 00000000 00000000 I/DEBUG ( 158): 01cb47d8 00000000 10000000 00000000 00000058 I/DEBUG ( 158): 01cb47e8 00000016 00000000 00000000 00000000 I/DEBUG ( 158): 01cb47f8 00000000 00000000 00000000 00000071 I/DEBUG ( 158): 01cb4808 01cb4428 40139cc4 01000000 03110506 I/DEBUG ( 158): 01cb4818 cd4ef487 a1dc4b0a d4c33a94 001f179b I/DEBUG ( 158): 01cb4828 01000080 0059eb21 e04f0085 21010000 I/DEBUG ( 158): 01cb4838 59eb9f00 4f008500 010000e0 ba4f0021 I/DEBUG ( 158): 01cb4848 402140d6 0000f813 77002101 2140d67a I/DEBUG ( 158): 01cb4858 00f81340 00210100 90b5ce27 fe045008 I/DEBUG ( 158): 01cb4868 00000000 0000003b 00000070 00000032 I/DEBUG ( 158): 01cb4878 00000001 01cb4b20 01cb44a0 01cb48b8 I/DEBUG ( 158): 01cb4888 00000016 00000000 00000abe 00000000 I/DEBUG ( 158): 01cb4898 00000000 80000000 00000000 00000011 I/DEBUG ( 158): I/DEBUG ( 158): memory near r6: I/DEBUG ( 158): 40f3ba50 4012d326 00000005 40f3ba7c 0000004f I/DEBUG ( 158): 40f3ba60 4013a228 01cb47c8 df0027ad 00000000 I/DEBUG ( 158): 40f3ba70 62633130 38633734 01d4fd00 20404040 I/DEBUG ( 158): 40f3ba80 524f4241 474e4954 494c203a 203a4342 I/DEBUG ( 158): 40f3ba90 55475241 544e454d 20534920 41564e49 I/DEBUG ( 158): 40f3baa0 2044494c 50414548 44444120 53534552 I/DEBUG ( 158): 40f3bab0 204e4920 72666c64 61206565 3d726464 I/DEBUG ( 158): 40f3bac0 31307830 37346263 00003863 01d4fd00 I/DEBUG ( 158): 40f3bad0 40f3bba8 00000010 00000002 00000000 I/DEBUG ( 158): 40f3bae0 00000014 40f3bb78 00000000 403492bb I/DEBUG ( 158): 40f3baf0 00000014 40f3bb78 00000000 00000000 I/DEBUG ( 158): 40f3bb00 c0000000 00000008 40f3bbd0 00000000 I/DEBUG ( 158): 40f3bb10 01ce3ab8 401003c3 01cb27ec 40240d61 I/DEBUG ( 158): 40f3bb20 74696d65 01cb27f0 40f3bb98 01cb27e4 I/DEBUG ( 158): 40f3bb30 40f3bbd0 696e3634 00000008 00000001 I/DEBUG ( 158): 40f3bb40 40f3bbd0 01d091f8 40f3bc1c 400fbf01 I/DEBUG ( 158): I/DEBUG ( 158): memory near r7: I/DEBUG ( 158): 4012d708 61200020 3d726464 48007830 20504145 I/DEBUG ( 158): 4012d718 4f4d454d 43205952 5552524f 4f495450 I/DEBUG ( 158): 4012d728 5241004e 454d5547 4920544e 4e492053 I/DEBUG ( 158): 4012d738 494c4156 45482044 41205041 45524444 I/DEBUG ( 158): 4012d748 6d005353 73207861 65747379 7962206d I/DEBUG ( 158): 4012d758 20736574 3125203d 0a756c30 73797300 I/DEBUG ( 158): 4012d768 206d6574 65747962 20202073 203d2020 I/DEBUG ( 158): 4012d778 6c303125 69000a75 7375206e 79622065 I/DEBUG ( 158): 4012d788 20736574 20202020 3125203d 0a756c30 I/DEBUG ( 158): 4012d798 72702f00 252f636f 616d2f64 75007370 I/DEBUG ( 158): 4012d7a8 6f6e6b6e 2e006e77 70006f73 65726874 I/DEBUG ( 158): 4012d7b8 645f6461 67756265 20202000 20202020 I/DEBUG ( 158): 4012d7c8 23202020 64323025 63702020 38302520 I/DEBUG ( 158): 4012d7d8 2020786c 28207325 302b7325 29782578 I/DEBUG ( 158): 4012d7e8 20202000 20202020 23202020 64323025 I/DEBUG ( 158): 4012d7f8 63702020 38302520 2020786c 25007325 I/DEBUG ( 158): I/DEBUG ( 158): memory near r8: I/DEBUG ( 158): 01cb47b0 77000101 0e58c56a 00fc09a0 00010100 I/DEBUG ( 158): 01cb47c0 56b1ca27 7f02a803 00000000 00000091 I/DEBUG ( 158): 01cb47d0 00000000 00000000 00000000 10000000 I/DEBUG ( 158): 01cb47e0 00000000 00000058 00000016 00000000 I/DEBUG ( 158): 01cb47f0 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 01cb4800 00000000 00000071 01cb4428 40139cc4 I/DEBUG ( 158): 01cb4810 01000000 03110506 cd4ef487 a1dc4b0a I/DEBUG ( 158): 01cb4820 d4c33a94 001f179b 01000080 0059eb21 I/DEBUG ( 158): 01cb4830 e04f0085 21010000 59eb9f00 4f008500 I/DEBUG ( 158): 01cb4840 010000e0 ba4f0021 402140d6 0000f813 I/DEBUG ( 158): 01cb4850 77002101 2140d67a 00f81340 00210100 I/DEBUG ( 158): 01cb4860 90b5ce27 fe045008 00000000 0000003b I/DEBUG ( 158): 01cb4870 00000070 00000032 00000001 01cb4b20 I/DEBUG ( 158): 01cb4880 01cb44a0 01cb48b8 00000016 00000000 I/DEBUG ( 158): 01cb4890 00000abe 00000000 00000000 80000000 I/DEBUG ( 158): 01cb48a0 00000000 00000011 01cb3f18 40139c64 I/DEBUG ( 158): I/DEBUG ( 158): memory near sl: I/DEBUG ( 158): 4013a208 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a218 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a228 ba9a446c 00000000 00000000 00000000 I/DEBUG ( 158): 4013a238 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a248 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a258 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a268 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a278 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a288 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a298 00000000 00000000 3f7265e5 00000000 I/DEBUG ( 158): 4013a2a8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2b8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2c8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2d8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2e8 00000000 00000000 00000000 00000000 I/DEBUG ( 158): 4013a2f8 00000000 00000000 00000000 00004000 I/DEBUG ( 158): I/DEBUG ( 158): memory near fp: I/DEBUG ( 158): 40f3bba4 0040c6d4 402902a2 400fbf15 01cb47d0 I/DEBUG ( 158): 40f3bbb4 00a4040c 402902a2 01cb47e0 40f3bbdc I/DEBUG ( 158): 40f3bbc4 00a4043c 01d09238 40f3bbf0 01d09228 I/DEBUG ( 158): 40f3bbd4 40f3bbf0 40f3bc1c 0040c9d0 00000000 I/DEBUG ( 158): 40f3bbe4 00000000 40f3bc40 01d091a8 01cb47e0 I/DEBUG ( 158): 40f3bbf4 01cb48a8 01d091f0 01d091f0 01d091f0 I/DEBUG ( 158): 40f3bc04 01cb4a38 01cb48a8 00000000 40f3bc64 I/DEBUG ( 158): 40f3bc14 01d09328 00000000 40247f65 40f3bc70 I/DEBUG ( 158): 40f3bc24 01cb2f80 40f3bc74 70747220 01cb3edc I/DEBUG ( 158): 40f3bc34 00000000 00000000 00000000 01d08ff0 I/DEBUG ( 158): 40f3bc44 40f3bc74 01cb3ee4 40240f0d 01cb3e8c I/DEBUG ( 158): 40f3bc54 00000000 c0000000 0000000c 01d3bc70 I/DEBUG ( 158): 40f3bc64 400d2eeb 00000000 00000001 62664944 I/DEBUG ( 158): 40f3bc74 00000000 00000000 00000003 01d09328 I/DEBUG ( 158): 40f3bc84 01d09328 01d3bc70 01cb2f40 00000000 I/DEBUG ( 158): 40f3bc94 00000000 01d09328 00000001 01d0937c I/DEBUG ( 158): I/DEBUG ( 158): memory near sp: I/DEBUG ( 158): 40f3ba50 4012d326 00000005 40f3ba7c 0000004f I/DEBUG ( 158): 40f3ba60 4013a228 01cb47c8 df0027ad 00000000 I/DEBUG ( 158): 40f3ba70 62633130 38633734 01d4fd00 20404040 I/DEBUG ( 158): 40f3ba80 524f4241 474e4954 494c203a 203a4342 I/DEBUG ( 158): 40f3ba90 55475241 544e454d 20534920 41564e49 I/DEBUG ( 158): 40f3baa0 2044494c 50414548 44444120 53534552 I/DEBUG ( 158): 40f3bab0 204e4920 72666c64 61206565 3d726464 I/DEBUG ( 158): 40f3bac0 31307830 37346263 00003863 01d4fd00 I/DEBUG ( 158): 40f3bad0 40f3bba8 00000010 00000002 00000000 I/DEBUG ( 158): 40f3bae0 00000014 40f3bb78 00000000 403492bb I/DEBUG ( 158): 40f3baf0 00000014 40f3bb78 00000000 00000000 I/DEBUG ( 158): 40f3bb00 c0000000 00000008 40f3bbd0 00000000 I/DEBUG ( 158): 40f3bb10 01ce3ab8 401003c3 01cb27ec 40240d61 I/DEBUG ( 158): 40f3bb20 74696d65 01cb27f0 40f3bb98 01cb27e4 I/DEBUG ( 158): 40f3bb30 40f3bbd0 696e3634 00000008 00000001 I/DEBUG ( 158): 40f3bb40 40f3bbd0 01d091f8 40f3bc1c 400fbf01 I/DEBUG ( 158): I/DEBUG ( 158): code around pc: I/DEBUG ( 158): 400fdfdc f0164479 a803f84f f44f4669 f0167280 I/DEBUG ( 158): 400fdfec 490df849 aa032007 f01b4479 4b05fd1b I/DEBUG ( 158): 400fdffc 9a43601d 428a6821 f003d001 b045fbb3 I/DEBUG ( 158): 400fe00c bf00bdf0 deadbaad 00038fc4 0002f776 I/DEBUG ( 158): 400fe01c 0002f765 0002f72a 0002f32e 4ff0e92d I/DEBUG ( 158): 400fe02c 2300b089 930049b1 93024605 78e2f500 I/DEBUG ( 158): 400fe03c f8d04baf 4aaf71cc 447a48af 44789106 I/DEBUG ( 158): 400fe04c 90049203 e1439307 68b86879 91019b00 I/DEBUG ( 158): 400fe05c 1c5a9005 68f99200 b000f8d7 0009f001 I/DEBUG ( 158): 400fe06c f0402801 f10b8133 f0130308 d0020407 I/DEBUG ( 158): 400fe07c f004425c 445c0407 f0036863 f1bc0c03 I/DEBUG ( 158): 400fe08c f0400f01 99018123 0a07f023 020aeb04 I/DEBUG ( 158): 400fe09c 0028f1a1 0300eb0b f0c0429a 696a8117 I/DEBUG ( 158): 400fe0ac d1034294 616b2300 e08660ab f8d468e6 I/DEBUG ( 158): 400fe0bc 42a69018 68a3d012 42836928 68d9d308 I/DEBUG ( 158): 400fe0cc d10542a1 42a268b2 60debf04 d02460b3 I/DEBUG ( 158): I/DEBUG ( 158): code around lr: I/DEBUG ( 158): 401199f8 0001d8d2 000276e8 b5704b0a 240c447b I/DEBUG ( 158): 40119a08 fb04460d 22033400 46296860 eafef7ec I/DEBUG ( 158): 40119a18 46061c43 f7e4d104 6800fa63 d0f22804 I/DEBUG ( 158): 40119a28 bd704630 0001d890 b088b570 4615460c I/DEBUG ( 158): 40119a38 b9099001 447c4c12 46204912 f7ed4479 I/DEBUG ( 158): 40119a48 aa01efae 92029404 bf0c2800 26012602 I/DEBUG ( 158): 40119a58 90032001 f7ee4620 9506ed80 46281c43 I/DEBUG ( 158): 40119a68 f7ee9305 220ced7a 1c414372 91074806 I/DEBUG ( 158): 40119a78 4478a902 46305883 b0084798 bf00bd70 I/DEBUG ( 158): 40119a88 0001404f 000161e4 0001d81a b570b40c I/DEBUG ( 158): 40119a98 6d81f5ad f50d4c12 460d6383 447c4606 I/DEBUG ( 158): 40119aa8 f8536824 a8012b04 93006821 1404f8cd I/DEBUG ( 158): 40119ab8 6180f44f fbeef7f6 4630aa01 f7ff4629 I/DEBUG ( 158): 40119ac8 f8ddffb3 68232404 d001429a fe4cf7e7 I/DEBUG ( 158): 40119ad8 f50db002 e8bd6d80 b0024070 bf004770 I/DEBUG ( 158): 40119ae8 0001d48e b08bb500 23012200 f10d9003 I/DEBUG ( 158): I/DEBUG ( 158): memory map around fault addr deadbaad: I/DEBUG ( 158): be964000-be985000 [stack] I/DEBUG ( 158): (no map for address) I/DEBUG ( 158): ffff0000-ffff1000 [vectors] From praks411 at gmail.com Tue Jun 25 12:52:41 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 25 Jun 2013 03:52:41 -0700 (PDT) Subject: [Libav-user] avpicture_free crashing when using with sws_scale() Message-ID: <1372157561816-4658017.post@n4.nabble.com> Hi I'm trying to encode images into video. I'm following muxing.c and scaling.c examples. Though I'm able to encode a video, I'm not able to get rid of memory leaks. I tried many different things related related to allocation of AVPicture but still memory leaks. Specifically my code crashed when I call avpicture_free due to heap error. Here is the snippet of code void WriteFrame(const uchar* buf) //Input buffer contained image data { if(need_conversion) { AVPicture inpic; avpicture_alloc(&inpic,(PixelFormat)input_pix_fmt, width, height); avpicture_fill(&inpic, (uint8_t*)buf, (PixelFormat)input_pix_fmt, width, height); struct SwsContext *img_convert_ctx = NULL; img_convert_ctx = sws_getContext( width, height, PIX_FMT_BGR24, c->width, c->height, c->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); if (sws_scale( img_convert_ctx, inpic.data, inpic.linesize, 0, height, dst_picture.data, dst_picture.linesize) < 0 ) { std::cout<<"Conversion Failed "< <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > As you can see, I had to enable the memalgin-hack to > get the app built. I did it because without that flag, > the file libavutil/mem.c didn't compile successfully Please provide the error report, but please test current git head first, your version looks old. What toolchain are you using? Carl Eugen From abelalon at gmail.com Tue Jun 25 15:26:27 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 25 Jun 2013 15:26:27 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: I've checkout the current git head and libstagefright.cpp doesn't compile. In build_error.txt you can find the error report. I was also getting this error with the previous version that I was using (1.1.5) and I fixed it including the header internal.h, but if I try to apply the same simple patch, I get another error. In after_patch_build_error.txt you can find the error report. To confirm that I'm using the git head I executed git log --pretty=format:%H -1 and I got: cea8a0077fc597a11838f2f7242c01722d577b44 I'm using the arm-linux-androideabi-4.6 toolchain from Android NDK r8e. The Android headers I'm using were downloaded from: git://github.com/CyanogenMod/android_frameworks_base.git git://github.com/CyanogenMod/android_system_core.git git://github.com/CyanogenMod/android_frameworks_native.git git://github.com/CyanogenMod/android_frameworks_av.git git://github.com/CyanogenMod/android_hardware_libhardware.git And the Android libraries were downloaded from: http://get.cm/get/jenkins/32371/cm-10.1.0-mako.zip The configure line I'm using is: ./configure --target-os=linux --cross-prefix=arm-linux-androideabi- --enable-cross-compile --disable-optimizations --disable-stripping --enable-debug=3 --arch=arm --enable-asm --disable-symver --enable-runtime-cpudetect --disable-doc --disable-ffplay --disable-ffprobe --disable-ffserver --sysroot=/tmp/vplayer/sysroot/ --disable-avdevice --disable-decoder=h264 --disable-decoder=h264_vdpau --enable-libstagefright-h264 --enable-decoder=libstagefright_h264 --prefix=../build/stagefright/armeabi-v7a --extra-cflags='-I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/include -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp' --extra-ldflags='-Wl,--fix-cortex-a8 -L../android-libs -L/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a -Wl,-rpath-link,../android-libs' --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti' 2013/6/25 Carl Eugen Hoyos > Abel Alonso writes: > > > As you can see, I had to enable the memalgin-hack to > > get the app built. I did it because without that flag, > > the file libavutil/mem.c didn't compile successfully > > Please provide the error report, but please test > current git head first, your version looks old. > > What toolchain are you using? > > 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: -------------- next part -------------- arm-linux-androideabi-g++ -Wno-multichar -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -I. -I./ --sysroot=/tmp/vplayer/sysroot/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DHAVE_AV_CONFIG_H -I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/include -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 -fPIC -marm -g3 -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -c -o libavcodec/libstagefright.o libavcodec/libstagefright.cpp cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-format-zero-length' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default] In file included from ../android-source/frameworks/native/include/binder/ProcessState.h:22:0, from libavcodec/libstagefright.cpp:25: ../android-source/frameworks/native/include/utils/String8.h:227:59: warning: redundant redeclaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' in same scope [-Wredundant-decls] ../android-source/frameworks/native/include/utils/String16.h:120:13: warning: previous declaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' [-Wredundant-decls] libavcodec/libstagefright.cpp: In function 'void* decode_thread(void*)': libavcodec/libstagefright.cpp:199:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1 CXX libavcodec/libstagefright.o cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-format-zero-length' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default] In file included from ../android-source/frameworks/native/include/binder/ProcessState.h:22:0, from libavcodec/libstagefright.cpp:25: ../android-source/frameworks/native/include/utils/String8.h:227:59: warning: redundant redeclaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' in same scope [-Wredundant-decls] ../android-source/frameworks/native/include/utils/String16.h:120:13: warning: previous declaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' [-Wredundant-decls] libavcodec/libstagefright.cpp: In function 'void* decode_thread(void*)': libavcodec/libstagefright.cpp:188:53: error: 'ff_get_buffer' was not declared in this scope libavcodec/libstagefright.cpp:199:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1stagefright.cpp:188:53: error: 'ff_get_buffer' was not declared in this scope libavcodec/libstagefright.cpp:199:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1 CXX libavcodec/libstagefright.o cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-format-zero-length' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default] In file included from ../android-source/frameworks/native/include/binder/ProcessState.h:22:0, from libavcodec/libstagefright.cpp:25: ../android-source/frameworks/native/include/utils/String8.h:227:59: warning: redundant redeclaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' in same scope [-Wredundant-decls] ../android-source/frameworks/native/include/utils/String16.h:120:13: warning: previous declaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' [-Wredundant-decls] libavcodec/libstagefright.cpp: In function 'void* decode_thread(void*)': libavcodec/libstagefright.cpp:188:53: error: 'ff_get_buffer' was not declared in this scope libavcodec/libstagefright.cpp:199:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:460:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:485:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:518:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:537:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1 -------------- next part -------------- arm-linux-androideabi-g++ -Wno-multichar -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -I. -I./ --sysroot=/tmp/vplayer/sysroot/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DHAVE_AV_CONFIG_H -I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/include -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 -fPIC -marm -g3 -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -c -o libavcodec/libstagefright.o libavcodec/libstagefright.cpp cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-format-zero-length' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default] In file included from ../android-source/frameworks/native/include/binder/ProcessState.h:22:0, from libavcodec/libstagefright.cpp:25: ../android-source/frameworks/native/include/utils/String8.h:227:59: warning: redundant redeclaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' in same scope [-Wredundant-decls] ../android-source/frameworks/native/include/utils/String16.h:120:13: warning: previous declaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' [-Wredundant-decls] libavcodec/libstagefright.cpp: In function 'void* decode_thread(void*)': libavcodec/libstagefright.cpp:189:53: error: too few arguments to function 'int ff_get_buffer(AVCodecContext*, AVFrame*, int)' libavcodec/internal.h:200:5: note: declared here libavcodec/libstagefright.cpp:200:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:461:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:461:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:486:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:486:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:519:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:519:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:538:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:538:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1 CXX libavcodec/libstagefright.o cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-format-zero-length' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default] In file included from ../android-source/frameworks/native/include/binder/ProcessState.h:22:0, from libavcodec/libstagefright.cpp:25: ../android-source/frameworks/native/include/utils/String8.h:227:59: warning: redundant redeclaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' in same scope [-Wredundant-decls] ../android-source/frameworks/native/include/utils/String16.h:120:13: warning: previous declaration of 'android::TextOutput& android::operator<<(android::TextOutput&, const android::String16&)' [-Wredundant-decls] libavcodec/libstagefright.cpp: In function 'void* decode_thread(void*)': libavcodec/libstagefright.cpp:189:53: error: too few arguments to function 'int ff_get_buffer(AVCodecContext*, AVFrame*, int)' libavcodec/internal.h:200:5: note: declared here libavcodec/libstagefright.cpp:200:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] libavcodec/libstagefright.cpp: In function 'int Stagefright_decode_frame(AVCodecContext*, void*, int*, AVPacket*)': libavcodec/libstagefright.cpp:461:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:461:16: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp: In function 'int Stagefright_close(AVCodecContext*)': libavcodec/libstagefright.cpp:486:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:486:28: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:519:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:519:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:538:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] libavcodec/libstagefright.cpp:538:20: warning: 'AVCodecContext::release_buffer' is deprecated (declared at libavcodec/avcodec.h:2043) [-Wdeprecated-declarations] make: *** [libavcodec/libstagefright.o] Error 1 From cehoyos at ag.or.at Tue Jun 25 15:36:05 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 25 Jun 2013 13:36:05 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > I've checkout the current git head and > libstagefright.cpp doesn't compile. Thank you, this looks like an important report! Didn't you write earlier that there is a problem related to posix_memalign? I only saw the following error (and closely related ones): > libavcodec/libstagefright.cpp:189:53: error: > too few arguments to function 'int > ff_get_buffer(AVCodecContext*, AVFrame*, int)' Or do I simply miss the important error? > I was also getting this error with the previous > version that I was using (1.1.5) and I fixed it > including the header internal.h Did you ever report this? (Or was your patch missed?) Please do not top-post here, Carl Eugen From cehoyos at ag.or.at Tue Jun 25 16:03:25 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 25 Jun 2013 14:03:25 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > I've checkout the current git head and libstagefright.cpp > doesn't compile. I created ticket #2709, could you test version 2e7bc9c ? Carl Eugen From abelalon at gmail.com Tue Jun 25 16:07:31 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 25 Jun 2013 16:07:31 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/25 Carl Eugen Hoyos > > Didn't you write earlier that there is a problem > related to posix_memalign? > I only saw the following error (and closely > related ones): > Yes, I wrote earlier about an issue with posix_memalign, but this was with 1.1.5 version after apply the patch of the #include "internal.h". But now, when I apply that patch, I get the ff_get_buffer error. I'm now fixing it, and as soon as I get the posix_memalign error again, I will send the error report to you. > > I was also getting this error with the previous > > version that I was using (1.1.5) and I fixed it > > including the header internal.h > > Did you ever report this? > (Or was your patch missed?) > No, I don't. As I wasn't able to get libstagefright working, I didn't report anything, however, if I achieve to get this working, I will send you all patchs that you may need. > > Please do not top-post here, Carl Eugen Sorry... :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Tue Jun 25 16:22:01 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 25 Jun 2013 16:22:01 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/25 Carl Eugen Hoyos > > I created ticket #2709, could you test version 2e7bc9c ? > > With the version 2e7bc9c I get the posix_memalign error again. The report is attached. If you need that I attach or comment something in the ticket, please let me know. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- arm-linux-androideabi-gcc -I. -I./ --sysroot=/tmp/vplayer/sysroot/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -DHAVE_AV_CONFIG_H -I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/include -I/home/aalonso/Desktop/Work/Android/android-ndk-r8e//sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 -fPIC -marm -g3 -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -MMD -MF libavutil/mem.d -MT libavutil/mem.o -c -o libavutil/mem.o libavutil/mem.c libavutil/mem.c: In function 'av_malloc': libavutil/mem.c:93:5: error: implicit declaration of function 'posix_memalign' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make: *** [libavutil/mem.o] Error 1 CC libavutil/mem.o libavutil/mem.c: In function 'av_malloc': libavutil/mem.c:93:5: error: implicit declaration of function 'posix_memalign' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make: *** [libavutil/mem.o] Error 1 From stefasab at gmail.com Tue Jun 25 23:44:09 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 25 Jun 2013 23:44:09 +0200 Subject: [Libav-user] avpicture_free crashing when using with sws_scale() In-Reply-To: <1372157561816-4658017.post@n4.nabble.com> References: <1372157561816-4658017.post@n4.nabble.com> Message-ID: <20130625214408.GB6917@barisone> On date Tuesday 2013-06-25 03:52:41 -0700, Pradeep Karosiya encoded: > Hi > > I'm trying to encode images into video. I'm following muxing.c and scaling.c > examples. > Though I'm able to encode a video, I'm not able to get rid of memory leaks. > I tried many different things > related related to allocation of AVPicture but still memory leaks. > Specifically my code crashed when I call avpicture_free due to heap error. > Here is the snippet of code > void WriteFrame(const uchar* buf) //Input buffer contained image data > { > if(need_conversion) > { > AVPicture inpic; > avpicture_alloc(&inpic,(PixelFormat)input_pix_fmt, width, height); Here you're allocating an image in inpic, and setting the data and linesize pointers. > avpicture_fill(&inpic, (uint8_t*)buf, (PixelFormat)input_pix_fmt, > width, height); Here you're filling inpic with the buffer in buf (assuming align = 1). Now you destroyed the reference to the previously allocated data -> leak. > struct SwsContext *img_convert_ctx = NULL; > img_convert_ctx = sws_getContext( > width, > height, > PIX_FMT_BGR24, > c->width, > c->height, > c->pix_fmt, > SWS_BICUBIC, > NULL, NULL, NULL); > > if (sws_scale( > img_convert_ctx, > inpic.data, > inpic.linesize, 0, > height, > dst_picture.data, > dst_picture.linesize) < 0 ) > { > std::cout<<"Conversion Failed "< } > > avpicture_free(&inpic); //Crashing here here you're freeing the buf data, which maybe does not belong to the heap? [...] From mtaha.ansari at gmail.com Wed Jun 26 08:01:55 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 26 Jun 2013 11:01:55 +0500 Subject: [Libav-user] Audio conversion from planar to non-planar formats Message-ID: Hi! I am working on audio conversion. Looking at different example online, I have been successfully able to convert FLTP format to S16. To my understanding, FLTP is planar, with values in floating range: -1.0 to +1.0. This converts to S16 just fine. Now, I want to convert audio coming from S16P format to S16 format. Because of initial success with planar to S16 (FLTP to S16), I assume I am interpreting planar data correctly, but, when I convert from S16P to S16, I get lots of artifacts in destination audio (noise is not clear, and is faster than original track). I am requesting could anyone kindly guide me on how to do successful conversion from S16P to S16 formats? I am simply amazed how such an apparently simple task is taking me forever, but still gets me nowhere. Thanks in advance @all! -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Wed Jun 26 08:54:47 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 26 Jun 2013 06:54:47 +0000 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: References: Message-ID: On 6/26/13, Taha Ansari wrote: > Hi! > > I am working on audio conversion. Looking at different example online, I > have been successfully able to convert FLTP format to S16. To my > understanding, FLTP is planar, with values in floating range: -1.0 to +1.0. > This converts to S16 just fine. Now, I want to convert audio coming from > S16P format to S16 format. > > Because of initial success with planar to S16 (FLTP to S16), I assume I am > interpreting planar data correctly, but, when I convert from S16P to S16, I > get lots of artifacts in destination audio (noise is not clear, and is > faster than original track). > > I am requesting could anyone kindly guide me on how to do successful > conversion from S16P to S16 formats? I am simply amazed how such an > apparently simple task is taking me forever, but still gets me nowhere. It should be exactly the same as FLTP to S16. I'm not willing to play guess games. Please provide source code you use for convert audio if you expect someone will help you. > > Thanks in advance @all! > From h.leppkes at gmail.com Wed Jun 26 09:02:51 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 26 Jun 2013 09:02:51 +0200 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: References: Message-ID: On Wed, Jun 26, 2013 at 8:01 AM, Taha Ansari wrote: > Hi! > > I am working on audio conversion. Looking at different example online, I > have been successfully able to convert FLTP format to S16. To my > understanding, FLTP is planar, with values in floating range: -1.0 to +1.0. > This converts to S16 just fine. Now, I want to convert audio coming from > S16P format to S16 format. > > Because of initial success with planar to S16 (FLTP to S16), I assume I am > interpreting planar data correctly, but, when I convert from S16P to S16, I > get lots of artifacts in destination audio (noise is not clear, and is > faster than original track). > > I am requesting could anyone kindly guide me on how to do successful > conversion from S16P to S16 formats? I am simply amazed how such an > apparently simple task is taking me forever, but still gets me nowhere. > > Thanks in advance @all! > Here, have some (pseudo) code: int16_t *dst = av_malloc(frame->channels * frame->nb_samples * 2); int16_t **src = (int16_t **)frame->extended_data; for (int i = 0; i < frame->nb_samples; i++) { for (int ch = 0; ch < frame->channels; ch++) { dst[i * frame->channels + ch] = src[ch][i]; } } From mtaha.ansari at gmail.com Wed Jun 26 10:07:05 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 26 Jun 2013 13:07:05 +0500 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: References: Message-ID: Hi everyone! >>It should be exactly the same as FLTP to S16. I'm not willing to play >>guess games. Please provide source code you use for convert audio if you >>expect someone will help you. @Paul: My code is similar to what I have been nagging since few days on the mailing list, so sorry for not providing it (attached now near end of email)! While experimenting, I have made significant progress: now, my conversions from S16P to S16 are apparently fine (I was making a grave mistake while calling swr_convert() function). So current status is: I am able to convert between these two formats, but! only about 90% of audio is converted, and any media player just jumps ahead after reaching this mark. Kindly review my updated code (note: I am also writing delayed frames in end, but that does not help): ------------------------------------------------- #include "stdafx.h" #include #include #include #include #include #include #include #include #include #include #include extern "C" { #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavdevice/avdevice.h" #include "libswscale/swscale.h" #include "libavutil/dict.h" #include "libavutil/error.h" #include "libavutil/opt.h" #include #include #include #include } AVFormatContext* fmt_ctx= NULL; int audio_stream_index = -1; AVCodecContext * codec_ctx_audio = NULL; AVCodec* codec_audio = NULL; AVFrame* decoded_frame = NULL; uint8_t** audio_dst_data = NULL; int got_frame = 0; int audiobufsize = 0; AVPacket input_packet; int audio_dst_linesize = 0; int audio_dst_bufsize = 0; SwrContext * swr = NULL; AVOutputFormat * output_format = NULL ; AVFormatContext * output_fmt_ctx= NULL; AVStream * audio_st = NULL; AVCodec * audio_codec = NULL; double audio_pts = 0.0; AVFrame * out_frame = avcodec_alloc_frame(); int audio_input_frame_size = 0; uint8_t * audio_data_buf = NULL; uint8_t * audio_out = NULL; int audio_bit_rate; int audio_sample_rate; int audio_channels; int decode_packet(); int open_audio_input(char* src_filename); int decode_frame(); int open_encoder(char* output_filename); AVStream *add_audio_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id); int open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st); void close_audio(AVFormatContext *oc, AVStream *st); void write_audio_frame(uint8_t ** audio_src_data, int audio_src_bufsize); int open_audio_input(char* src_filename) { int i =0; /* open input file, and allocate format context */ if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { fprintf(stderr, "Could not open source file %s\n", src_filename); exit(1); } // Retrieve stream information if(avformat_find_stream_info(fmt_ctx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(fmt_ctx, 0, src_filename, 0); // Find the first video stream for(i=0; inb_streams; i++) { if(fmt_ctx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO) { audio_stream_index=i; break; } } if ( audio_stream_index != -1 ) { // Get a pointer to the codec context for the audio stream codec_ctx_audio=fmt_ctx->streams[audio_stream_index]->codec; // Find the decoder for the video stream codec_audio=avcodec_find_decoder(codec_ctx_audio->codec_id); if(codec_audio==NULL) { fprintf(stderr, "Unsupported audio codec!\n"); return -1; // Codec not found } // Open codec AVDictionary *codecDictOptions = NULL; if(avcodec_open2(codec_ctx_audio, codec_audio, &codecDictOptions)<0) return -1; // Could not open codec // Set up SWR context once you've got codec information swr = swr_alloc(); av_opt_set_int(swr, "in_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "out_channel_layout", codec_ctx_audio->channel_layout, 0); av_opt_set_int(swr, "in_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_int(swr, "out_sample_rate", codec_ctx_audio->sample_rate, 0); av_opt_set_sample_fmt(swr, "in_sample_fmt", codec_ctx_audio->sample_fmt, 0); av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); swr_init(swr); // Allocate audio frame if ( decoded_frame == NULL ) decoded_frame = avcodec_alloc_frame(); int nb_planes = 0; AVStream* audio_stream = fmt_ctx->streams[audio_stream_index]; nb_planes = av_sample_fmt_is_planar(codec_ctx_audio->sample_fmt) ? codec_ctx_audio->channels : 1; int tempSize = sizeof(uint8_t *) * nb_planes; audio_dst_data = (uint8_t**)av_mallocz(tempSize); if (!audio_dst_data) { fprintf(stderr, "Could not allocate audio data buffers\n"); } else { for ( int i = 0 ; i < nb_planes ; i ++ ) { audio_dst_data[i] = NULL; } } } } int decode_frame() { int rv = 0; got_frame = 0; if ( fmt_ctx == NULL ) { return rv; } int ret = 0; audiobufsize = 0; rv = av_read_frame(fmt_ctx, &input_packet); if ( rv < 0 ) { return rv; } rv = decode_packet(); // Free the input_packet that was allocated by av_read_frame //av_free_packet(&input_packet); return rv; } int decode_packet() { int rv = 0; int ret = 0; //audio stream? if(input_packet.stream_index == audio_stream_index) { /* decode audio frame */ rv = avcodec_decode_audio4(codec_ctx_audio, decoded_frame, &got_frame, &input_packet); if (rv < 0) { fprintf(stderr, "Error decoding audio frame\n"); //return ret; } else { if (got_frame) { if ( audio_dst_data[0] == NULL ) { ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, decoded_frame->channels, decoded_frame->nb_samples, (AVSampleFormat)decoded_frame->format, 1); if (ret < 0) { fprintf(stderr, "Could not allocate audio buffer\n"); return AVERROR(ENOMEM); } /* TODO: extend return code of the av_samples_* functions so that this call is not needed */ audio_dst_bufsize = av_samples_get_buffer_size(NULL, audio_st->codec->channels, decoded_frame->nb_samples, (AVSampleFormat)decoded_frame->format, 1); //int16_t* outputBuffer = ...; swr_convert( swr, audio_dst_data, out_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data, decoded_frame->nb_samples ); } /* copy audio data to destination buffer: * this is required since rawaudio expects non aligned data */ //av_samples_copy(audio_dst_data, decoded_frame->data, 0, 0, // decoded_frame->nb_samples, decoded_frame->channels, (AVSampleFormat)decoded_frame->format); } } } return rv; } int open_encoder(char* output_filename ) { int rv = 0; /* allocate the output media context */ AVOutputFormat *opfmt = NULL; avformat_alloc_output_context2(&output_fmt_ctx, opfmt, NULL, output_filename); if (!output_fmt_ctx) { printf("Could not deduce output format from file extension: using MPEG.\n"); avformat_alloc_output_context2(&output_fmt_ctx, NULL, "mpeg", output_filename); } if (!output_fmt_ctx) { rv = -1; } else { output_format = output_fmt_ctx->oformat; } /* Add the audio stream using the default format codecs * and initialize the codecs. */ audio_st = NULL; if ( output_fmt_ctx ) { if (output_format->audio_codec != AV_CODEC_ID_NONE) { audio_st = add_audio_stream(output_fmt_ctx, &audio_codec, output_format->audio_codec); } /* Now that all the parameters are set, we can open the audio and * video codecs and allocate the necessary encode buffers. */ if (audio_st) { rv = open_audio(output_fmt_ctx, audio_codec, audio_st); if ( rv < 0 ) return rv; } av_dump_format(output_fmt_ctx, 0, output_filename, 1); /* open the output file, if needed */ if (!(output_format->flags & AVFMT_NOFILE)) { if (avio_open(&output_fmt_ctx->pb, output_filename, AVIO_FLAG_WRITE) < 0) { fprintf(stderr, "Could not open '%s'\n", output_filename); rv = -1; } else { /* Write the stream header, if any. */ if (avformat_write_header(output_fmt_ctx, NULL) < 0) { fprintf(stderr, "Error occurred when opening output file\n"); rv = -1; } } } } return rv; } AVStream *add_audio_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id) { AVCodecContext *c; AVStream *st; /* find the audio encoder */ *codec = avcodec_find_encoder(codec_id); if (!(*codec)) { fprintf(stderr, "Could not find codec\n"); exit(1); } st = avformat_new_stream(oc, *codec); if (!st) { fprintf(stderr, "Could not allocate stream\n"); exit(1); } st->id = 1; c = st->codec; /* put sample parameters */ c->sample_fmt = AV_SAMPLE_FMT_S16; c->bit_rate = audio_bit_rate; c->sample_rate = audio_sample_rate; c->channels = audio_channels; // some formats want stream headers to be separate if (oc->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; return st; } int open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st) { int ret=0; AVCodecContext *c; st->duration = fmt_ctx->duration; c = st->codec; /* 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_input_frame_size = 10000; else audio_input_frame_size = c->frame_size; int tempSize = audio_input_frame_size * av_get_bytes_per_sample(c->sample_fmt) * c->channels; return ret; } void close_audio(AVFormatContext *oc, AVStream *st) { avcodec_close(st->codec); } void write_audio_frame(uint8_t ** audio_src_data, int audio_src_bufsize) { AVFormatContext *oc = output_fmt_ctx; AVStream *st = audio_st; if ( oc == NULL || st == NULL ) return; AVCodecContext *c; AVPacket pkt = { 0 }; // data and size must be 0; int got_packet; av_init_packet(&pkt); c = st->codec; out_frame->nb_samples = audio_input_frame_size; int buf_size = audio_src_bufsize * av_get_bytes_per_sample(c->sample_fmt) * c->channels; avcodec_fill_audio_frame(out_frame, c->channels, c->sample_fmt, (uint8_t *) *audio_src_data, buf_size, 1); avcodec_encode_audio2(c, &pkt, out_frame, &got_packet); if (!got_packet) { } else { if (pkt.pts != AV_NOPTS_VALUE) pkt.pts = av_rescale_q(pkt.pts, st->codec->time_base, st->time_base); if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, st->codec->time_base, st->time_base); if ( c && c->coded_frame && c->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = st->index; pkt.flags |= AV_PKT_FLAG_KEY; /* Write the compressed frame to the media file. */ if (av_interleaved_write_frame(oc, &pkt) != 0) { fprintf(stderr, "Error while writing audio frame\n"); exit(1); } } av_free_packet(&pkt); } void write_delayed_frames(AVFormatContext *oc, AVStream *st) { AVCodecContext *c = st->codec; int got_output = 0; int ret = 0; AVPacket pkt; pkt.data = NULL; pkt.size = 0; av_init_packet(&pkt); int i = 0; for (got_output = 1; got_output; i++) { ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output); if (ret < 0) { fprintf(stderr, "error encoding frame\n"); exit(1); } static int64_t tempPts = 0; static int64_t tempDts = 0; /* If size is zero, it means the image was buffered. */ if (got_output) { if (pkt.pts != AV_NOPTS_VALUE) pkt.pts = av_rescale_q(pkt.pts, st->codec->time_base, st->time_base); if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, st->codec->time_base, st->time_base); if ( c && c->coded_frame && c->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = st->index; /* Write the compressed frame to the media file. */ ret = av_interleaved_write_frame(oc, &pkt); } else { ret = 0; } av_free_packet(&pkt); } } int main(int argc, char **argv) { /* register all formats and codecs */ av_register_all(); avcodec_register_all(); avformat_network_init(); avdevice_register_all(); int i =0; char src_filename[90] = "mp3.mp3"; char dst_filename[90] = "test.mp4"; open_audio_input(src_filename); audio_bit_rate = codec_ctx_audio->bit_rate; audio_sample_rate = codec_ctx_audio->sample_rate; audio_channels = codec_ctx_audio->channels; open_encoder( dst_filename ); while(1) { int rv = decode_frame(); if ( rv < 0 ) { break; } if (audio_st) { audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den; } else { audio_pts = 0.0; } if ( codec_ctx_audio ) { if ( got_frame) { write_audio_frame( audio_dst_data, audio_dst_bufsize ); } } if ( audio_dst_data[0] ) { av_freep(&audio_dst_data[0]); audio_dst_data[0] = NULL; } av_free_packet(&input_packet); printf("\naudio_pts: %.3f", audio_pts); } write_delayed_frames( output_fmt_ctx, audio_st ); av_write_trailer(output_fmt_ctx); close_audio( output_fmt_ctx, audio_st); swr_free(&swr); avcodec_free_frame(&out_frame); return 0; } ----------------------------------------- On Wed, Jun 26, 2013 at 12:02 PM, Hendrik Leppkes wrote: > On Wed, Jun 26, 2013 at 8:01 AM, Taha Ansari > wrote: > > Hi! > > > > I am working on audio conversion. Looking at different example online, I > > have been successfully able to convert FLTP format to S16. To my > > understanding, FLTP is planar, with values in floating range: -1.0 to > +1.0. > > This converts to S16 just fine. Now, I want to convert audio coming from > > S16P format to S16 format. > > > > Because of initial success with planar to S16 (FLTP to S16), I assume I > am > > interpreting planar data correctly, but, when I convert from S16P to > S16, I > > get lots of artifacts in destination audio (noise is not clear, and is > > faster than original track). > > > > I am requesting could anyone kindly guide me on how to do successful > > conversion from S16P to S16 formats? I am simply amazed how such an > > apparently simple task is taking me forever, but still gets me nowhere. > > > > Thanks in advance @all! > > > > Here, have some (pseudo) code: > > int16_t *dst = av_malloc(frame->channels * frame->nb_samples * 2); > int16_t **src = (int16_t **)frame->extended_data; > for (int i = 0; i < frame->nb_samples; i++) { > for (int ch = 0; ch < frame->channels; ch++) { > dst[i * frame->channels + ch] = src[ch][i]; > } > } > _______________________________________________ > 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 Jun 26 10:08:16 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Jun 2013 08:08:16 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > 2013/6/25 Carl Eugen Hoyos > > I created ticket #2709, could you test version 2e7bc9c ? > > With the version 2e7bc9c I get the posix_memalign error again. What is the output for the following two commands? $ grep -i alloc config.h $ grep -i align config.h Thank you, Carl Eugen From abelalon at gmail.com Wed Jun 26 10:43:09 2013 From: abelalon at gmail.com (Abel Alonso) Date: Wed, 26 Jun 2013 10:43:09 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/26 Carl Eugen Hoyos > $ grep -i alloc config.h > #define HAVE_ALIGNED_MALLOC 0 #define HAVE_MALLOC_H 1 #define HAVE_VIRTUALALLOC 0 $ grep -i align config.h #define HAVE_FAST_UNALIGNED 0 #define HAVE_ALIGNED_MALLOC 0 #define HAVE_ALIGNED_STACK 0 #define HAVE_LOCAL_ALIGNED_16 0 #define HAVE_LOCAL_ALIGNED_8 0 #define HAVE_MEMALIGN 1 #define HAVE_POSIX_MEMALIGN 1 #define CONFIG_FAST_UNALIGNED 0 #define CONFIG_MEMALIGN_HACK 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Wed Jun 26 10:58:52 2013 From: er.anshul.maheshwari at gmail.com (Anshul) Date: Wed, 26 Jun 2013 14:28:52 +0530 Subject: [Libav-user] Memory Leak while using avformat_new_stream Message-ID: <51CAAD4C.4020401@gmail.com> hi friends i found memory leak when i am using avformat_new_stream , below is valgrind log ==12990== 1,599 (1,592 direct, 7 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 21 ==12990== at 0x40294EB: memalign (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==12990== by 0x4A7A71C: av_mallocz (mem.c:223) ==12990== by 0x463153D: avcodec_get_context_defaults3 (options.c:129) ==12990== by 0x4631652: avcodec_alloc_context3 (options.c:157) ==12990== by 0x4975548: avformat_new_stream (utils.c:3258) ==12990== by 0x4AA4F3D: add_stream (muxing.c:32) ==12990== by 0x4AA51E9: init (muxing.c:121) ==12990== by 0x80487EE: main (test_app.c:52) thanks anshul From cehoyos at ag.or.at Wed Jun 26 12:17:50 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Jun 2013 10:17:50 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > #define HAVE_POSIX_MEMALIGN 1 How does the part of config.log look like starting with "check_func posix_memalign"? Thank you and sorry for my comment on trac, I couldn't resist, Carl Eugen From praks411 at gmail.com Wed Jun 26 12:25:55 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Wed, 26 Jun 2013 03:25:55 -0700 (PDT) Subject: [Libav-user] avpicture_free crashing when using with sws_scale() In-Reply-To: <20130625214408.GB6917@barisone> References: <1372157561816-4658017.post@n4.nabble.com> <20130625214408.GB6917@barisone> Message-ID: <1372242355830-4658034.post@n4.nabble.com> Hi Stefano, Thanks for your explanation. However I didn't get about your point on fill pic with data and destroying previously allocating data. I've buffer filled with image data and I want to create AVPicture object from it so that it can be encoded to video. The inpic is used as temporary storage for conversion with input pix_format is different than required pix_format. Thats why I used AVPicture inpic avpicture_alloc(&inpic,(PixelFormat)input_pix_fmt, width, height); avpicture_fill(&inpic, (uint8_t*)buf, (PixelFormat)input_pix_fmt, width, height); First I'm allocating AVPicture then I'm filling it with data from buf. And finally after conversion I'm destroying it. But you said that there will be leak on call of avpicture_fill which is correct as I'm also seeing the leaking in my code. So what is the best way to do this without leak. I've also tried following void WriteFrame(const uint8_t*buf) { const uint8_t *indata[1] = {buf}; int inlinesize[1] = {3*width}; if (sws_scale(img_convert_ctx, indata, inlinesize, 0,height, dst_picture.data, dst_picture.linesize) < 0 ) { std::cout<<"Conversion Failed "< References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/26 Carl Eugen Hoyos > > How does the part of config.log look like > starting with "check_func posix_memalign"? > check_func posix_memalign check_ld cc check_cc BEGIN /tmp/ffconf.OWpbPrDe.c 1 extern int posix_memalign(); 2 int main(void){ posix_memalign(); } END /tmp/ffconf.OWpbPrDe.c arm-linux-androideabi-gcc --sysroot=/tmp/vplayer/sysroot/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -I/tmp/vplayer/sysroot//usr/include/ -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/av/include -I../android-source/hardware/libhardware/include -I../android-source/frameworks/av/include/media/stagefright -I../android-source/frameworks/native/include -I../android-source/frameworks/native/include/media/openmax -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 -fPIC -marm -c -o /tmp/ffconf.0oGOKy9k.o /tmp/ffconf.OWpbPrDe.c arm-linux-androideabi-gcc -Wl,--fix-cortex-a8 -L../android-libs -L/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a -Wl,-rpath-link,../android-libs --sysroot=/tmp/vplayer/sysroot/ -Wl,--as-needed -o /tmp/ffconf.RTbjtA2w /tmp/ffconf.0oGOKy9k.o > > Thank you and sorry for my comment on trac, > I couldn't resist, Carl Eugen > What comment? I didn't read any comment on the #2709 ticket :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Wed Jun 26 13:57:10 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 26 Jun 2013 16:57:10 +0500 Subject: [Libav-user] Reading from mp3 files ends pre-maturely Message-ID: Hi! I have made following sample program: int main(int argc, char **argv) { /* register all formats and codecs */ av_register_all(); avcodec_register_all(); avformat_network_init(); avdevice_register_all(); AVFormatContext* fmt = NULL; avformat_open_input( &fmt, "mp3.mp3", NULL, NULL ); int fcount = 0; while(1) { int rv = av_read_frame(fmt, &input_packet); if ( rv <0 ) { break; } fcount ++; } } It reads from an mp3 file, and counts total frames read. If I supply an mp3 file as input, I read lesser frames (810 total in my case), and if I specify an mp4 audio file (mp4.mp4 - which is same as mp3 file, converted by FFmpeg command line), I read total 912 frames. So in case of mp3, I read about 1-(810/912)*100 = 11.18% less than original duration. My simple question is: why does this happen? It is necessary I understand this part because while converting between different audio formats, converting mp3 to mp4 (aac) actually writes about 11% lesser frames. So if the total duration of input mp3 file is about 21.16 seconds, only 18.83 seconds of output file is generated (which is fine till that mark), but afterwards it ends abruptly. Can anyone raise the curtain from this mystery? Thanks for your time! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Jun 26 15:19:07 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 26 Jun 2013 16:19:07 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: On Wed, Jun 26, 2013 at 1:48 PM, Abel Alonso wrote: > 2013/6/26 Carl Eugen Hoyos >> >> >> How does the part of config.log look like >> starting with "check_func posix_memalign"? > > > check_func posix_memalign > check_ld cc > check_cc > BEGIN /tmp/ffconf.OWpbPrDe.c > 1 extern int posix_memalign(); > 2 int main(void){ posix_memalign(); } > END /tmp/ffconf.OWpbPrDe.c > arm-linux-androideabi-gcc --sysroot=/tmp/vplayer/sysroot/ -D_ISOC99_SOURCE > -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC > -I/tmp/vplayer/sysroot//usr/include/ > -I../android-source/frameworks/base/include > -I../android-source/system/core/include > -I../android-source/frameworks/av/include > -I../android-source/hardware/libhardware/include > -I../android-source/frameworks/av/include/media/stagefright > -I../android-source/frameworks/native/include > -I../android-source/frameworks/native/include/media/openmax > -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include > -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include > -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math > -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing > -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ > -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG > -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 > -fPIC -marm -c -o /tmp/ffconf.0oGOKy9k.o /tmp/ffconf.OWpbPrDe.c > arm-linux-androideabi-gcc -Wl,--fix-cortex-a8 -L../android-libs > -L/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a > -Wl,-rpath-link,../android-libs --sysroot=/tmp/vplayer/sysroot/ > -Wl,--as-needed -o /tmp/ffconf.RTbjtA2w /tmp/ffconf.0oGOKy9k.o What do you have in /tmp/vplayer/sysroot/ ? Where does its contents come from? Alex From abelalon at gmail.com Wed Jun 26 15:34:03 2013 From: abelalon at gmail.com (Abel Alonso) Date: Wed, 26 Jun 2013 15:34:03 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: I have there some Android libraries and headers. That directory is generated by Android NDK r8e after execute the following line: $NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/tmp/vplayer/sysroot/ Where $NDK points to the NDK's installation directory. 2013/6/26 Alex Cohn > On Wed, Jun 26, 2013 at 1:48 PM, Abel Alonso wrote: > > 2013/6/26 Carl Eugen Hoyos > >> > >> > >> How does the part of config.log look like > >> starting with "check_func posix_memalign"? > > > > > > check_func posix_memalign > > check_ld cc > > check_cc > > BEGIN /tmp/ffconf.OWpbPrDe.c > > 1 extern int posix_memalign(); > > 2 int main(void){ posix_memalign(); } > > END /tmp/ffconf.OWpbPrDe.c > > arm-linux-androideabi-gcc --sysroot=/tmp/vplayer/sysroot/ > -D_ISOC99_SOURCE > > -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC > > -I/tmp/vplayer/sysroot//usr/include/ > > -I../android-source/frameworks/base/include > > -I../android-source/system/core/include > > -I../android-source/frameworks/av/include > > -I../android-source/hardware/libhardware/include > > -I../android-source/frameworks/av/include/media/stagefright > > -I../android-source/frameworks/native/include > > -I../android-source/frameworks/native/include/media/openmax > > > -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include > > > -I/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include > > -Wall -mthumb -pipe -fpic -fasm -g -finline-limit=300 -ffast-math > > -fmodulo-sched -fmodulo-sched-allow-regmoves -fstrict-aliasing > > -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ > > -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG > > -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -march=armv5 -std=c99 > > -fPIC -marm -c -o /tmp/ffconf.0oGOKy9k.o /tmp/ffconf.OWpbPrDe.c > > arm-linux-androideabi-gcc -Wl,--fix-cortex-a8 -L../android-libs > > > -L/home/aalonso/Work/Android/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a > > -Wl,-rpath-link,../android-libs --sysroot=/tmp/vplayer/sysroot/ > > -Wl,--as-needed -o /tmp/ffconf.RTbjtA2w /tmp/ffconf.0oGOKy9k.o > > What do you have in /tmp/vplayer/sysroot/ ? Where does its contents come > from? > > Alex > _______________________________________________ > 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 alexcohn at netvision.net.il Wed Jun 26 15:59:12 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 26 Jun 2013 16:59:12 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: On Wed, Jun 26, 2013 at 4:34 PM, Abel Alonso wrote: > I have there some Android libraries and headers. That directory is generated > by Android NDK r8e after execute the following line: > > $NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 > --install-dir=/tmp/vplayer/sysroot/ > > Where $NDK points to the NDK's installation directory. I don't know if --enable-memalign-hack is responsible or not, but you will be safer if you remove all .so files from /tmp/vplayer/sysroot/sysroot/usr/lib and only use the Android libraries downloaded from http://get.cm/get/jenkins/32371/cm-10.1.0-mako.zip. Or even better - get these libraries from your device on which you intend to run your application. BTW, you can safely remove all references to cxx-stl in your ./configure enchantment, because ffmpeg has not C++. BR, Alex From cehoyos at ag.or.at Wed Jun 26 16:02:18 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Jun 2013 14:02:18 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Alex Cohn writes: > BTW, you can safely remove all references to cxx-stl in > your ./configure enchantment, because ffmpeg has not C++. Is this also true if you want to use libstagefright? Carl Eugen From abelalon at gmail.com Wed Jun 26 16:05:17 2013 From: abelalon at gmail.com (Abel Alonso) Date: Wed, 26 Jun 2013 16:05:17 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/6/26 Alex Cohn > > BTW, you can safely remove all references to cxx-stl in > your ./configure enchantment, because ffmpeg has not C++. > > I cannot remove that, because the FFmpeg libstagefright_h264 codec is implemented in C++ and uses a std::map. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Jun 26 16:08:49 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 26 Jun 2013 17:08:49 +0300 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: On Wed, Jun 26, 2013 at 5:05 PM, Abel Alonso wrote: > 2013/6/26 Alex Cohn >> >> >> BTW, you can safely remove all references to cxx-stl in >> your ./configure enchantment, because ffmpeg has not C++. >> > > I cannot remove that, because the FFmpeg libstagefright_h264 codec is > implemented in C++ and uses a std::map. Sorry about that. I'd double check, though: make-standalone-toolchain puts stl headers and libs inside your sysroot. Alex From jona at visualblasters.com Wed Jun 26 07:32:57 2013 From: jona at visualblasters.com (jona) Date: Tue, 25 Jun 2013 22:32:57 -0700 (PDT) Subject: [Libav-user] Merging various audio and video sources into one using avfilter lib? In-Reply-To: References: <1371395312992-4657898.post@n4.nabble.com> Message-ID: <1372224777365-4658027.post@n4.nabble.com> Well once you do mix the various audio sources into one audio stream and the video sources into one stream you would then mux the audio and video sources. My concern is that I spend a lot of time trying to figure out how to do something with libavfilter and then find out that is not possible. -- View this message in context: http://libav-users.943685.n4.nabble.com/Merging-various-audio-and-video-sources-into-one-using-avfilter-lib-tp4657898p4658027.html Sent from the libav-users mailing list archive at Nabble.com. From mtaha.ansari at gmail.com Thu Jun 27 07:08:35 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 27 Jun 2013 10:08:35 +0500 Subject: [Libav-user] Reading from mp3 files ends pre-maturely In-Reply-To: References: Message-ID: Hi everyone! I read somewhere online that MP3 may contain multiple frames inside one packet, and it is up to a decoder to detect this, and read contiguous packet. Maybe this is the reason why my input mp3 file ends after reading approximately 89%? If above statement is true, it would mean there are missing frames inside the output stream, which does not seem to happen (only last 11% data is missing). I am looking at clues, but am still clueless. Can anyone kindly guide? Thanks for your time -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Thu Jun 27 07:51:58 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 27 Jun 2013 10:51:58 +0500 Subject: [Libav-user] Reading from mp3 files ends pre-maturely In-Reply-To: References: Message-ID: Hi everyone, I discovered one more thing: MP3 audio's frame size is 1152, and AAC audio frame size is 1024, which amounts to: 1-(1024/1152)*100 = 11.1.% lesser than MP3. Is it possible these figures somehow correlate? Since I am able to write about 11% less audio to AAC (MP4) format. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Thu Jun 27 08:14:42 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 27 Jun 2013 11:14:42 +0500 Subject: [Libav-user] Reading from mp3 files ends pre-maturely In-Reply-To: References: Message-ID: > MP3 audio's frame size is 1152, and AAC audio frame size is 1024, which > amounts to: > > 1-(1024/1152)*100 = 11.1.% lesser than MP3. > > Is it possible these figures somehow correlate? Since I am able to write > about 11% less audio to AAC (MP4) format. > Sorry, I meant number of samples for mp3 and aac (nb_samples inside AVFrame), are 1152, and 1024, respectively. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefasab at gmail.com Thu Jun 27 12:23:53 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Thu, 27 Jun 2013 12:23:53 +0200 Subject: [Libav-user] avpicture_free crashing when using with sws_scale() In-Reply-To: <1372242355830-4658034.post@n4.nabble.com> References: <1372157561816-4658017.post@n4.nabble.com> <20130625214408.GB6917@barisone> <1372242355830-4658034.post@n4.nabble.com> Message-ID: <20130627102353.GU6917@barisone> In data Wednesday 2013-06-26 03:25:55 -0700, Pradeep Karosiya ha scritto: > Hi Stefano, > > Thanks for your explanation. However I didn't get about your point on > fill pic with data and destroying previously allocating data. > I've buffer filled with image data and I want to create AVPicture object > from it so that it can > be encoded to video. The inpic is used as temporary storage for conversion > with input pix_format is different than required pix_format. Thats why I > used > AVPicture inpic > avpicture_alloc(&inpic,(PixelFormat)input_pix_fmt, width, height); > avpicture_fill(&inpic, (uint8_t*)buf, (PixelFormat)input_pix_fmt, > width, height); > You don't need avpicture_alloc() at all, since you're already providing the buffer in avpicture_fill(). In other words avpicture_fill() will overwrite the reference to the memory allocated by avpicture_alloc(). Note: you can also use the equivalent av_image_alloc() and av_image_fill_arrays() API which is better documented and a bit more flexible. > First I'm allocating AVPicture then I'm filling it with data from buf. And > finally after conversion > I'm destroying it. But you said that there will be leak on call of > avpicture_fill which is correct > as I'm also seeing the leaking in my code. > So what is the best way to do this without leak. > I've also tried following > void WriteFrame(const uint8_t*buf) > { > const uint8_t *indata[1] = {buf}; > int inlinesize[1] = {3*width}; > if (sws_scale(img_convert_ctx, indata, inlinesize, 0,height, > dst_picture.data, dst_picture.linesize) < 0 ) > { > std::cout<<"Conversion Failed "< } > else > { > avpicture_fill(&dst_picture, (uint8_t*)buf, (PixelFormat)input_pix_fmt, > width, height); > } This looks pointless, since you already filled dst_picture with the converted data. [...] From stefasab at gmail.com Thu Jun 27 12:26:41 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Thu, 27 Jun 2013 12:26:41 +0200 Subject: [Libav-user] How to retrieve number of frames In-Reply-To: <1372073264047-4657997.post@n4.nabble.com> References: <1372069491928-4657992.post@n4.nabble.com> <1372073264047-4657997.post@n4.nabble.com> Message-ID: <20130627102641.GV6917@barisone> In data Monday 2013-06-24 04:27:44 -0700, Steffen ha scritto: > Yes, but this might take a log of time. Is there maybe any way to jump to the > last one? No, unless you rely on header info, which may be not be reliable. From mtaha.ansari at gmail.com Thu Jun 27 15:49:29 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 27 Jun 2013 18:49:29 +0500 Subject: [Libav-user] Reading from mp3 files ends pre-maturely In-Reply-To: References: Message-ID: Please disregard this email thread - when I choose mp3.mp3 file as input, and test.mp3 as output (changing S16 output to S16P), it is transcoding fine. On Thu, Jun 27, 2013 at 11:14 AM, Taha Ansari wrote: > > MP3 audio's frame size is 1152, and AAC audio frame size is 1024, which >> amounts to: >> >> 1-(1024/1152)*100 = 11.1.% lesser than MP3. >> >> Is it possible these figures somehow correlate? Since I am able to write >> about 11% less audio to AAC (MP4) format. >> > > Sorry, I meant number of samples for mp3 and aac (nb_samples inside > AVFrame), are 1152, and 1024, respectively. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Thu Jun 27 15:58:15 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 27 Jun 2013 18:58:15 +0500 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: References: Message-ID: I tried an experiment: mp3.mp3 file as input, and test.mp3 file as output (output format from S16 to S16P), it is getting converted (transcoded) just fine, but I can't understand what is exactly happening with conversion from mp3 to mp4. Only one thing I think might be correlated: MP3 with 128 kbps gets me nb_samples equal to 1152, and MP4 (AAC-destination) has nb_samples equal to 1024, so is it possible some frames from mp3 to mp4 are being buffered inappropriately, and never get written to destination mp4 file? Considering the fact 1-(1024/1152)*100 is about 11.11%, about the same amount 'not' written to mp4 near end. Please can someone help me fix this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From arvind_raman at yahoo.com Thu Jun 27 20:52:02 2013 From: arvind_raman at yahoo.com (Arvind Raman) Date: Thu, 27 Jun 2013 11:52:02 -0700 (PDT) Subject: [Libav-user] avcodec_encode_video2() crashes after encoding a few pictures Message-ID: <1372359122.72604.YahooMailNeo@web122304.mail.ne1.yahoo.com> I am developing an application using the FFmpeg libraries and am facing a crash issue that I am finding extremely hard to debug. My printf logs suggest that crash happens within the avcodec_encode_video2() function but I am not sure what is causing the crash.? Just for debugging purpose, I created the following infinite loop on the "encode" thread. The loop iterates several times and crashes somewhere in between the 350th and the 400th iteration. The crash is not deterministic. Please note there are video decode (libavcodec) and demux (libavformat) threads running in parallel that are interrupting the avcodec_encode_video2() function. Could this be a problem. Do you spot anything that might be causing the crash? I am using the x.264 encoder. The only error log that I get on the terminal is "Segmentation fault (core dumped)" so I am finding it hard to proceed. Is there anyway to get x.264 to print where the crash might be happening.? Its quite likely that this might be a silly coding mistake from my end, but just wanted to get a quick check done from you all and receive your suggestions. while(1) { ? ?av_init_packet(&encode_packet); ? ?frame->pts += 3750; ? ?frame->data[0] = frame_buf; ? ?frame->data[1] = frame->data[0] + (frame->linesize[0] * encoder_ctx->height); ? ?frame->data[2] = frame->data[1] + (frame->linesize[1] * (encoder_ctx->height / 2)); ? ?encode_status = avcodec_encode_video2(encoder_ctx, &encode_packet, frame, &got_packet); ? ?av_free_packet(&encode_packet); } I tried running valgrind as well but that didn't throw any illegal memory access and it throws the following error. Could this be causing the crash? What is this error about? I saw similar error messages elsewhere as well, but don't think I found any solution there. vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x38 0x41 0xC0 0x66 0xF 0x7E ==10933== valgrind: Unrecognised instruction at address 0x51393bc. ==10933== ? ?at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) ==10933== ? ?by 0x2000200020001F: ??? ==10933== Your program just tried to execute an instruction that Valgrind ==10933== did not recognise. ?There are two possible reasons for this. ==10933== 1. Your program has a bug and erroneously jumped to a non-code ==10933== ? ?location. ?If you are running Memcheck and you just saw a ==10933== ? ?warning about a bad jump, it's probably your program's fault. ==10933== 2. The instruction is legitimate but Valgrind doesn't handle it, ==10933== ? ?i.e. it's Valgrind's fault. ?If you think this is the case or ==10933== ? ?you are not sure, please let us know and we'll try to fix it. ==10933== Either way, Valgrind will now raise a SIGILL signal which will ==10933== probably kill your program. ==10933==? ==10933== Process terminating with default action of signal 4 (SIGILL) ==10933== ?Illegal opcode at address 0x51393BC ==10933== ? ?at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) ==10933== ? ?by 0x2000200020001F: ??? Any help would be greatly appreciated!!! Best regards Arvind From onemda at gmail.com Thu Jun 27 21:50:50 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 27 Jun 2013 19:50:50 +0000 Subject: [Libav-user] avcodec_encode_video2() crashes after encoding a few pictures In-Reply-To: <1372359122.72604.YahooMailNeo@web122304.mail.ne1.yahoo.com> References: <1372359122.72604.YahooMailNeo@web122304.mail.ne1.yahoo.com> Message-ID: On 6/27/13, Arvind Raman wrote: > I am developing an application using the FFmpeg libraries and am facing a > crash issue that I am finding extremely hard to debug. My printf logs > suggest that crash happens within the avcodec_encode_video2() function but I > am not sure what is causing the crash. > > Just for debugging purpose, I created the following infinite loop on the > "encode" thread. The loop iterates several times and crashes somewhere in > between the 350th and the 400th iteration. The crash is not deterministic. > Please note there are video decode (libavcodec) and demux (libavformat) > threads running in parallel that are interrupting the > avcodec_encode_video2() function. Could this be a problem. > > Do you spot anything that might be causing the crash? I am using the x.264 > encoder. The only error log that I get on the terminal is "Segmentation > fault (core dumped)" so I am finding it hard to proceed. Is there anyway to > get x.264 to print where the crash might be happening. > > Its quite likely that this might be a silly coding mistake from my end, but > just wanted to get a quick check done from you all and receive your > suggestions. > > while(1) > { > av_init_packet(&encode_packet); > frame->pts += 3750; > > frame->data[0] = frame_buf; > frame->data[1] = frame->data[0] + (frame->linesize[0] * > encoder_ctx->height); > frame->data[2] = frame->data[1] + (frame->linesize[1] * > (encoder_ctx->height / 2)); This looks wrong, use memcpy instead. > encode_status = avcodec_encode_video2(encoder_ctx, &encode_packet, > frame, &got_packet); > > av_free_packet(&encode_packet); > } > > I tried running valgrind as well but that didn't throw any illegal memory > access and it throws the following error. Could this be causing the crash? > What is this error about? I saw similar error messages elsewhere as well, > but don't think I found any solution there. > > > vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x38 0x41 0xC0 0x66 0xF > 0x7E > ==10933== valgrind: Unrecognised instruction at address 0x51393bc. > ==10933== at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) > ==10933== by 0x2000200020001F: ??? > ==10933== Your program just tried to execute an instruction that Valgrind > ==10933== did not recognise. There are two possible reasons for this. > ==10933== 1. Your program has a bug and erroneously jumped to a non-code > ==10933== location. If you are running Memcheck and you just saw a > ==10933== warning about a bad jump, it's probably your program's fault. > ==10933== 2. The instruction is legitimate but Valgrind doesn't handle it, > ==10933== i.e. it's Valgrind's fault. If you think this is the case or > ==10933== you are not sure, please let us know and we'll try to fix it. > ==10933== Either way, Valgrind will now raise a SIGILL signal which will > ==10933== probably kill your program. > ==10933== > ==10933== Process terminating with default action of signal 4 (SIGILL) > ==10933== Illegal opcode at address 0x51393BC > ==10933== at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) > ==10933== by 0x2000200020001F: ??? > > Any help would be greatly appreciated!!! > > Best regards > Arvind > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From alexcohn at netvision.net.il Fri Jun 28 18:54:58 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 28 Jun 2013 19:54:58 +0300 Subject: [Libav-user] avcodec_encode_video2() crashes after encoding a few pictures In-Reply-To: References: <1372359122.72604.YahooMailNeo@web122304.mail.ne1.yahoo.com> Message-ID: On Jun 27, 2013 10:51 PM, "Paul B Mahol" wrote: > > On 6/27/13, Arvind Raman wrote: > > I am developing an application using the FFmpeg libraries and am facing a > > crash issue that I am finding extremely hard to debug. My printf logs > > suggest that crash happens within the avcodec_encode_video2() function but I > > am not sure what is causing the crash. > > > > Just for debugging purpose, I created the following infinite loop on the > > "encode" thread. The loop iterates several times and crashes somewhere in > > between the 350th and the 400th iteration. The crash is not deterministic. > > Please note there are video decode (libavcodec) and demux (libavformat) > > threads running in parallel that are interrupting the > > avcodec_encode_video2() function. Could this be a problem. > > > > Do you spot anything that might be causing the crash? I am using the x.264 > > encoder. The only error log that I get on the terminal is "Segmentation > > fault (core dumped)" so I am finding it hard to proceed. Is there anyway to > > get x.264 to print where the crash might be happening. > > > > Its quite likely that this might be a silly coding mistake from my end, but > > just wanted to get a quick check done from you all and receive your > > suggestions. > > > > while(1) > > { > > av_init_packet(&encode_packet); > > frame->pts += 3750; > > > > frame->data[0] = frame_buf; > > frame->data[1] = frame->data[0] + (frame->linesize[0] * > > encoder_ctx->height); > > frame->data[2] = frame->data[1] + (frame->linesize[1] * > > (encoder_ctx->height / 2)); > > This looks wrong, use memcpy instead. > > > encode_status = avcodec_encode_video2(encoder_ctx, &encode_packet, > > frame, &got_packet); > > > > av_free_packet(&encode_packet); > > } > > > > I tried running valgrind as well but that didn't throw any illegal memory > > access and it throws the following error. Could this be causing the crash? > > What is this error about? I saw similar error messages elsewhere as well, > > but don't think I found any solution there. > > > > > > vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x38 0x41 0xC0 0x66 0xF > > 0x7E > > ==10933== valgrind: Unrecognised instruction at address 0x51393bc. > > ==10933== at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) > > ==10933== by 0x2000200020001F: ??? > > ==10933== Your program just tried to execute an instruction that Valgrind > > ==10933== did not recognise. There are two possible reasons for this. > > ==10933== 1. Your program has a bug and erroneously jumped to a non-code > > ==10933== location. If you are running Memcheck and you just saw a > > ==10933== warning about a bad jump, it's probably your program's fault. > > ==10933== 2. The instruction is legitimate but Valgrind doesn't handle it, > > ==10933== i.e. it's Valgrind's fault. If you think this is the case or > > ==10933== you are not sure, please let us know and we'll try to fix it. > > ==10933== Either way, Valgrind will now raise a SIGILL signal which will > > ==10933== probably kill your program. > > ==10933== > > ==10933== Process terminating with default action of signal 4 (SIGILL) > > ==10933== Illegal opcode at address 0x51393BC > > ==10933== at 0x51393BC: ??? (in /usr/local/lib/libx264.so.133) > > ==10933== by 0x2000200020001F: ??? > > > > Any help would be greatly appreciated!!! > > > > Best regards > > Arvind Or even easier, there exists avpicture_fill((AVPicture *) frame, frame_buf, encoder_ctx->pix_fmt, frame->width, frame->height); BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.tushar99 at gmail.com Sat Jun 29 07:32:09 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Sat, 29 Jun 2013 11:02:09 +0530 Subject: [Libav-user] Fwd: Libavcodec issue In-Reply-To: References: Message-ID: Hi... In the example give in ffmpeg doc examples in case of audio encoder is there any provision to get output for each input frame. I have done same change for h264 video encoder example also. I have removed delay part and now i can get output frame for each input frame, so any same hing possible in case of audio encoder...? Regards Tushar -------------- next part -------------- An HTML attachment was scrubbed... URL: