Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Multiple files in JW Player 6 not working
18 octobre 2013, par DvexUse version 6 JW Player. I'm transforming my videos using FFMPEG to MP4, FLV and WebM.
When the videos are intended to be played, it does not and I have the following error:
Error playing media: MediaError code: 4 __proto__: MediaError MEDIA_ERR_ABORTED: 1 MEDIA_ERR_DECODE: 3 MEDIA_ERR_ENCRYPTED: 5 MEDIA_ERR_NETWORK: 2 MEDIA_ERR_SRC_NOT_SUPPORTED: 4 constructor: function MediaError() { [native code] } __proto__: Object jwplayer.js?muokxc:4 CAPTIONS([object Object]) jwplayer.js?muokxc:4 CAPTIONS([object Object])
In Firefox I have the error: "The file can not be decoded". This scenario only happens on my server. But on localhost, does not happen. The videos can be played normally.
What is it that is happening?
My JS code to initialize the JW Player is:
jwplayer('jwplayerjw-player').setup({ "aspectratio":"16:9", "playlist":[{ "image":"http://mydomain.com/system/files/videos/thumbnails/48/thumbnail-48_0002.png", "sources":[{ "file":"http://mydomain.com/system/files/videos/converted/48/loop_2_flv_1381794678.flv"}, {"file":"http://mydomain.com/system/files/videos/converted/48/loop_2_mp4_1381794691.mp4"}, {"file":"http://mydomain.com/system/files/videos/converted/48/loop_2_webm_1381794705.webm"}]}], "width":"100%", "height":360, "stretching":"fill", "skin":"sites/all/libraries/jwplayer/skin.xml" });
-
ffmpeg avcodec_decode_video2 is crashing the andrid app
18 octobre 2013, par AzhagiriHI i am using ffmpeg library in my android app. Using the library from https://github.com/churnlabs/android-ffmpeg-sample
My application crashes when i am calling the avcodec_decode_video2() function. My code
int decode_packet(int *got_frame, int cached){ int ret = 0; int decoded = packet.size; if (packet.stream_index == videoStream) { /* decode video frame */ ret = avcodec_decode_video2(pCodecCtx, pFrame, got_frame, &packet); if (ret < 0) { LOGE("Error decoding video frame"); return ret; } if (*got_frame) { av_image_copy(video_dst_data, video_dst_linesize, (const uint8_t **)(pFrame->data), pFrame->linesize, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height); /* write to rawvideo file */ LOGE("Frame Count [%d]",video_frame_count++); // fwrite(video_dst_data[0], 1, video_dst_bufsize, videoOut); } return decoded; } }
The app crashes at the line
ret = avcodec_decode_video2(pCodecCtx, pFrame, got_frame, &packet);
Help to get resolve the problem. I'll attach the ndk-stack output also
********** Crash dump: ********** Build fingerprint: 'samsung/ja3gxx/ja3g:4.2.2/JDQ39/I9500XWUBMG5:user/release-keys' pid: 12494, tid: 12512, name: Thread-1088 >>> com.churnlabs.ffmpegsample <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000020 Stack frame #00 pc 00285804 /data/app-lib/com.churnlabs.ffmpegsample-1/libffmpegutils.so (avcodec_decode_video2+60) Stack frame #01 pc 00285854 /data/app-lib/com.churnlabs.ffmpegsample-1/libffmpegutils.so (avcodec_decode_video2+140) Crash dump is completed
From this i can find the function which crashes but i can't find the reason for the crash and how to get out from that
-
is ffmpeg memory-leakful ?
18 octobre 2013, par user718146I have compiled ffmpeg for Android and tried to use it in my app. I did test a bit , but it seemed memory-leakful.
This is my code:
void fftest() { char *url = "/mnt/sdcard/h264.dat"; prot_read_avc_buff_init(); AVFormatContext *fmt_ctx = NULL; int ret = avformat_open_input(&fmt_ctx, url, 0, NULL); if (ret < 0) { LOG(LOG_ERROR, __FUNCTION__, "avformat_open_input for url %s failed (%s)", url, strerror(ret) ); return ; } LOGI("avformat_open_input OK "); if(fmt_ctx) avformat_close_input(&fmt_ctx); }
Each time after calling this code, the allocated native heap memory of this Process increased. So, do you guys have any idea about fixing this leak. Or, is there substitute of ffmpeg.
Thanks for replies!
-
How to compile ffmpeg statically for android
17 octobre 2013, par Gonzalo SoleraI´m new on native code, ndk and all of this. I have been searching for a good tutorial but I don´t understand them so much. How can I compile FFmpeg statically for android? I need to encode h264 too. I don´t know how to use the NDK (I have it downloaded on a windows and on a linux os but I think it´s better to use it on linux). Please, I would need detailed answers... Thanks!!
-
Decoding H.264 stream from dvr
17 octobre 2013, par Andrew SI have a security DVR that uses h264 streams. I have been trying to get this to work with zoneminder. I have successfully logged into the dvr and recieved some form of data streams. The data stream is dumped to a fifo/pipe, and then zoneminder uses ffmpeg to read this in.
Note: i know very very little about h.264 streams. just enough to be stupid.
The video only updates about every 15 seconds in ZM. I can dump the stream to a file with ffmpeg or avconv (avconv -i /tmp/mypipe cam.mp4) but it is still not right. However, the file created by avconv is WAY WAY better than the one created by ffmpeg.
I've included a link to the wireshark dump (I did change the PW and login info, etc...). From the data, It appears that the dvr is adding a header to the h264 data streams. I understand that the h264 stream starts with a (0x00 00 01 67) or (0x00 00 01 61). Here is an example of the header plus start of stream:
0x33, 0x30, 0x64, 0x63, 0x48, 0x32, 0x36, 0x34, 0x3f, 0x55, 0x00, 0x00, 0x08, 0x00, 0x20, 0x00, 0xa2, 0x7a, 0xea, 0xdc, 0xcf, 0x08, 0x00, 0x00, 0x0d, 0x0a, 0x11, 0x07, 0x13, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0xe0, 0x14, 0xdb, 0x05, 0x87, 0xc4, 0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x30, 0xa4, 0x80, 0x00, 0x00, 0x00, 0x01, 0x06, 0xe5, 0x01, 0x51, 0x80, 0x00, 0x00, 0x00, 0x01, 0x65, 0xb8, 0x00, 0x01, 0xa8, 0xac,
I can see that there are a few frame indicators in this message. The DVR's header appears to be 32 bytes long in this case, and in some other messages in the dump, it appears to be 24 bytes long. I am striping the header off before I dump the stream to the pipe. (I have verified the output doesn't include the dvr's headers in any way.
What I would like help with is determining what I should be sending to the pipe. should I start with the first h.264 key? Is there something out of order? I'm very surprised that ffmpeg is only getting 15 second updates, but avconv is much better (lots of dropped frames, and playback is "sped up".
using ffmpeg to read the pipe produces a file that shows it's codec as: H264 - MPEG-4 AVC (part 10) (avc1) with a Decoded format: Planar 4:2:0 YUV using vlc.
Appreciate any help you can provide!
edit: on Ubuntu 13.04 ffmpeg version: 6:0.8.6-1ubuntu2 avconv 0.8.6-6:0.8.6-1ubuntu2