kolyvan / kxmovie Goto Github PK
View Code? Open in Web Editor NEWmovie player for iOS using ffmpeg
movie player for iOS using ffmpeg
Hello, Kolyvan
How are you?
I played Mpeg-4 h.264 video using kxmovie video player.
When i tried it on iPhone, it works great.
But, when i tried it on iPad, lip sync was terribly out.
They didn't really match.
Do you have any ideas for it?
I need your help.
Best Regards.
Hi,
Found a strange issue with mmsh streams (for example mmsh://m.camstreams.com/csmaddrurs).
If buffer turns empty in tick() method then decoding speed drops by about 100 times until buffer filled to _minBufferedDuration.
By the way the _bufferedDuration is never compared to _minBufferedDuration if audio or video arrays contains at least one frame.
Looks like threading conflict between [KxMovieViewController tick] and [decoder decodeFrame] or queuing priority issue there.
The simplest workaround is to lower NETWORK_MIN_BUFFERED_DURATION to 0.02
but it's only a "dirty hack".
Hi,
This stream don't play well (video speed + audio desync):
mmsh://stream2.canal.qc.ca/enOndes_haut_debit
It work with another lib based on FFmpeg 1.0 but i'm not sure problem come from FFmpeg version and i use your lib now (for some reasons)
Tested without deinterlace filter and buffer (as is WMV stream) with 5, 10sec, no change.
Any idea ? Thanks.
This video for example has problems (both network streaming and locally saved) - the meta info seems to be accurate - the same as in ffplay where it plays OK: http://cds1.yospace.com/access/d/u/0/1/web/type=video,fmt=any,minq=0,maxq=100000000,mins=1x1,maxs=640x608,minr=5,maxr=100,/50602731?f=100312513718\
Hello
I put "-all_load" in "Other linker flags" option in Build settings.
Unfortunately, i am getting the following link error.
Could you please tell me any ideas for it?
Undefined symbols for architecture i386:
"_av_abuffersink_params_alloc", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_av_buffersink_get_buffer_ref", referenced from:
_lavfi_read_packet in libavdevice.a(lavfi.o)
"_av_buffersink_params_alloc", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_get_by_name", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_alloc", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_config", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_create_filter", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_dump", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_free", referenced from:
_lavfi_read_close in libavdevice.a(lavfi.o)
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_graph_parse", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_inout_free", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_link", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_register_all", referenced from:
_lavfi_read_header in libavdevice.a(lavfi.o)
"_avfilter_unref_buffer", referenced from:
_lavfi_read_packet in libavdevice.a(lavfi.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I need your help.
Best Regards.
I am trying to view the output of an Axis P5512-E Network Camera. It provides an RTSP H.264 output stream with yuvj420p format. This stream is viewable in VLC, QuickTime, and other multimedia viewers.
Unfortunately, it doesn't look like kxmovie supports the yuvj420p format. When I try to connect to that stream, the app simply displays the spinning wheel until the app eventually exits.
The KxMovieDecoder class contains this code:
- (BOOL) setupVideoFrameFormat: (KxVideoFrameFormat) format
{
if (format == KxVideoFrameFormatYUV &&
_videoCodecCtx &&
_videoCodecCtx->pix_fmt == AV_PIX_FMT_YUV420P) {
_videoFrameFormat = KxVideoFrameFormatYUV;
return YES;
}
_videoFrameFormat = KxVideoFrameFormatRGB;
return _videoFrameFormat == format;
}
This does not properly handle the case where format
is KxVideoFormatYUV
and _videoCodecCtr->pix_fmt
is AV_PIX_FMT_YUVJ420P
. It sets _videoFrameFormat
to KxVideoFrameFormatRGB
, and then -[KxMovieGLView initWithFrame:decoder:]
creates a KxMovieGLRenderer_RGB
.
I have hacked the code to force it to create a KxMovieGLRenderer_YUV
, but I still see only a spinning wheel when I run the app, so I assume some changes to the renderer are needed to support yuvj420p.
When I run this program both on sim or my iPad2, the console tell me:
[h264 @ 0x9a88a00] Missing reference picture
[h264 @ 0x9a88a00] decode_slice_header error
[h264 @ 0x9a88a00] concealing 330 DC, 330 AC, 330 MV errors in P frame
[h264 @ 0x9a46a00] Width/height/bit depth/chroma idc changing with threads is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
How can I solve this problem?
hi when i run the rake, its says that the --disable armvfp command dosent exist
can you help me out :)
From terminal:
Unknown option "--disable-armvfp".
See ./configure --help for available options.
rake aborted!
******** Build failed ********
How can I close a failed stream? When we try to open a invalid stream, the decoder stuck, and is not allowed for us open other stream. When we try to open we I got this error:
"bind failed: Address already in use" and decoder returns with error: "Unable to open file"
There's no timeout. It waits until make a connection, and from there we can close the stream.
I have one live stream, the player can not stop. If application resign active, the player is pause, so the player can not go on playing when application active again
When play mpegts, there is error log:
2013-01-18 13:21:31.534 YunMaoIos[35841:c07] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2013-01-18 13:21:31.543 YunMaoIos[35841:c07] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2013-01-18 13:21:31.561 YunMaoIos[35841:c07] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2013-01-18 13:21:31.570 YunMaoIos[35841:c07] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
Great work.
I managed to have it working fine with flv, mov, mp4 and with f4v that not in your list. But feel lag for video with H264, tested with both remote and local H264, on iPhone 4 with iOS 6. Any clue? Thanks!
Hi,wen i try to build,i got five errors:
Use of undeclared identifier AV_PIX_FMT_NONE
Use of undeclared identifier AV_CODEC_PROP_BITMAP_SUB
Use of undeclared identifier AV_PIX_FMT_YUV420P
No number name sub_charenc_mode in AVCodecContext
will some one have the same error ?
Hi kolyvan , I modify the rakefile for ios5.1 and run rake
** BUILD FAILED **
The following build commands failed:
CompileC tmp/build/kxmovie.build/Debug-iphoneos/kxmovie.build/Objects-normal/armv7/KxAudioManager.o kxmovie/KxAudioManager.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC tmp/build/kxmovie.build/Debug-iphoneos/kxmovie.build/Objects-normal/armv7/KxMovieDecoder.o kxmovie/KxMovieDecoder.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
rake aborted!
******** Build failed ********
/Users/me/iOS/kxmovie/Rakefile:8:in `system_or_exit'
/Users/me/iOS/kxmovie/Rakefile:192:in `block in <top (required)>'
Tasks: TOP => build_movie_debug
(See full trace by running task with --trace)
Hi Konstantin,
I have been trying to get a file encoded in 1440x1080 playing on iPad2 / iPad3 / iPhone4 using your KxMoviePlayer, but no matter if it was local or streamed, the playback was stuttering.
I could not really figure out anything to make it work properly. It looks like it's almost maxing out the CPU use (I checked using Instruments profiling tools). Maybe there is a way to optimise this (either the decoder itself, or ffmpeg code, or else changing some compile time switches) to make it work, but I must admit I don't really know in which direction to investigate.
I was wondering if maybe you had an idea of what could be done in order to be able to play such files. I uploaded a sample file for you to have a look when you have a minute: http://www.sendspace.com/file/y1ioim
Best Regards,
Hi Konstantin Boukreev,
Again, thank you very much for your great project!!!
I'm experiencing a considerable delay for the audio to start on a local .wmv movie. On the computer it plays nicely, but on my iPhone 4S, with iOS 6.0, after a delay to start the audio keeps lagging.
The same results happen when I scrub back or forward.
Could you please check this out? Here is the link for the video, so you can download it and try for yourself:
Thank you!
when I play a live video, the video is correct,but the audio is not correct and the log is:
[aac @ 0x99a2600] Reserved SBR extensions is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x99a2600] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x99a2600] Reserved SBR extensions is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
if we change the music track on streamming server, it cause client player stop playing the music with a lot of these messages:
RTP: dropping old packet received too late
First of all, thenk you for great tool.
I am wondering does pseudostreaming seeking by bytes supported in ffmpeg? In which way to investigate?
Thanks
This is not really an "issue"; it's more of a Request for Comments for doing some re-architecting of the kxmovie library.
For an app I'm developing, I need to display video like KxMovieViewController does now, but I need some different functionality:
The quick-and-dirty way to do this would be to just copy KxMovieViewController and rip out the parts I don't need. However, I wonder whether anyone has given thought to a generic way to customize the viewer.
I'm thinking about creating some sort of "base video controller" that provides the basic functionality (setting up the GL view, decoding frames, pause, play, etc.), and then KxMovieViewController would be a subclass that had the controls, but other people could create other subclasses that have different controls but share the basic implementation.
Does this make sense? Does anyone have different ideas?
Could anyone try this stream: http://dl.dropbox.com/u/36390277/blackbox.avi
lag & stutter : (
I tried play it in local.
FFmpeg has compiled with config.sh (http://dl.dropbox.com/u/36390277/config.sh)
Development environment
XCode 4.6
SDK iOS 6.1
Thank you.
I can't play rtmp audio url "rtmp://129.186.60.79/live/Studio_One/StudioOne" or rtmp video "rtmp://ciena.fv.miisolutions.net/ciena/flash/LynneMilton_256l.flv". It make audio noise. Can anyone give me some advise!
Hi,
I've successfully built FFmpeg but I'm unable to build with XCode.
The error is:
~/path/to/kxmovie/kxmovie/KxMovieDecoder.m:1393:25: warning: 'avpicture_deinterlace' is deprecated [-Wdeprecated-declarations]
avpicture_deinterlace((AVPicture*)_videoFrame,
^
ffmpeg/libavcodec/avcodec.h:4626:5: note: 'avpicture_deinterlace' declared here
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
The docs of avpicture_deinterlace
say indeed that is deprecated and to use yadif (in libavfilter) instead.
Is this related to my FFmpeg version? Anyone know how to fix it? Also, I'm using Xcode 4.6.1
is it possible to save the buffer after it has been fully downloaded to a file?
Very Thanks
P.S. Thanks for your last response.
Small note I thought was worth adding. In addition to the already included install instructions, libiconv.dylib needs to be added as a dependency.
2013-03-19 16:32:43.884 Example[44174:c07] <KxMovieViewController: 0xb459ae0> dealloc
[aac @ 0xab31600] Insufficient thread locking around avcodec_open/close()
[h264 @ 0xab18200] Insufficient thread locking around avcodec_open/close()
2013-03-19 16:32:47.413 Example[44174:c07] loadView
Assertion ff_avcodec_locked failed at libavcodec/utils.c:2750
Solution? I've used this commit 2948123
Seems I'm solved problem by adding in KxMovieDecoder.m
int lock_call_back(void ** mutex, enum AVLockOp op) {
switch(op) {
case AV_LOCK_CREATE:
*mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
pthread_mutex_init((pthread_mutex_t *)(*mutex), NULL);
break;
case AV_LOCK_OBTAIN:
pthread_mutex_lock((pthread_mutex_t *)(*mutex));
break;
case AV_LOCK_RELEASE:
pthread_mutex_unlock((pthread_mutex_t *)(*mutex));
break;
case AV_LOCK_DESTROY:
pthread_mutex_destroy((pthread_mutex_t *)(*mutex));
free(*mutex);
break;
}
return 0;
}
in + (id)initialize()
av_lockmgr_register(&lock_call_back);
in - (void)dealloc()
av_lockmgr_register(NULL);
It's okay solution?
BUT I have problem with EXC_BAD_ACCESS (_videoFrame->interlaced_frame in - (BOOL) setupVideoFrameFormat: (KxVideoFrameFormat) format)
AND The code above (int lock_call_back(void ** mutex, enum AVLockOp op)) not working with latest commit 36c3f08
2013-03-19 18:55:24.658 Example[50975:c07] /Users/bezigon/Library/Application Support/iPhone Simulator/6.1/Applications/CD84470A-4EBE-48F4-A0A6-1F7623694AEC/Documents/50 Common Misconceptions - mental_floss on YouTube (Ep.1).mp4
2013-03-19 18:55:24.658 Example[50975:c07] <KxMovieViewController: 0xa510540> dealloc
2013-03-19 18:55:24.663 Example[50975:c07] <KxMovieDecoder: 0xa510040> dealloc
[NULL @ 0xd34d600] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34de00] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34d600] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34de00] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34d600] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34de00] Insufficient thread locking around avcodec_open/close()
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '50 Common Misconceptions - mental_floss on YouTube (Ep.1).mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2013-03-09 20:30:31
Duration: 00:06:10.13, start: 0.000000, bitrate: 602 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), 640x360, 503 kb/s, 24 fps, 24 tbr, 48 tbn, 48 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, 95 kb/s
Metadata:
creation_time : 2013-03-09 20:30:32
handler_name : IsoMedia File Produced by Google, 5-11-2011
[NULL @ 0xd34d600] Insufficient thread locking around avcodec_open/close()
[NULL @ 0xd34de00] Insufficient thread locking around avcodec_open/close()
2013-03-19 18:55:24.665 Example[50975:c31b] Unable to open codec, 50 Common Misconceptions - mental_floss on YouTube (Ep.1).mp4
Assertion ff_avcodec_locked failed at libavcodec/utils.c:2750
Hi ,
i have setup all the libraries and when i am building the app for device i got 30 compilation errors in KxMovieGLView and in KXMovieDecoder and i am posting some syntax errors here .. i am not sure which compiler should i use to compile the source code .. currently using default LLVM compiler 3.0 iOS SDK 5.0
Here are some errors
KxAudioFrame *frame = _audioFrames[0];
Error : subscript require size of interface "NSMutableArray" which is not constant in non-fragile ABI
_messageLabel.textAlignment = NSTextAlignmentCenter;
Error : Use of undeclared NSTextAlighnmentCenter;
and there are 30 errors .
Can you please help me solving the above issue or if i am using wrong source code please let me know .
Thanks
Hello kolyvan.
I am developing RTSP streaming player application using ffmpeg.
Your project is very similar with my idea.
But, when i build the application, i get the link error.
Ld /Users/wyp/Library/Developer/Xcode/DerivedData/kxmovie-dkcmadoxemowdgfmfnoqftidnwwm/Build/Products/Debug-iphonesimulator/KxMovieExample.app/KxMovieExample normal i386
cd /Users/wyp/Downloads/kxmovie-master
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Volumes/MAC_DATA/develop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Volumes/MAC_DATA/develop/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Volumes/MAC_DATA/develop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Volumes/MAC_DATA/develop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/wyp/Library/Developer/Xcode/DerivedData/kxmovie-dkcmadoxemowdgfmfnoqftidnwwm/Build/Products/Debug-iphonesimulator -L/Users/wyp/Downloads/kxmovie-master/libs -L/Users/wyp/Downloads/kxmovie-master -F/Users/wyp/Library/Developer/Xcode/DerivedData/kxmovie-dkcmadoxemowdgfmfnoqftidnwwm/Build/Products/Debug-iphonesimulator -F/Volumes/MAC_DATA/develop/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/wyp/Library/Developer/Xcode/DerivedData/kxmovie-dkcmadoxemowdgfmfnoqftidnwwm/Build/Intermediates/kxmovie.build/Debug-iphonesimulator/KxMovieExample.build/Objects-normal/i386/KxMovieExample.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -framework Foundation -framework UIKit -framework CoreGraphics -lz -lavcodec -lavdevice -lavformat -lavutil -lswresample -lswscale -framework MediaPlayer -framework CoreAudio -framework AudioToolbox -framework Accelerate -framework QuartzCore -framework OpenGLES -lkxmovie -o /Users/wyp/Library/Developer/Xcode/DerivedData/kxmovie-dkcmadoxemowdgfmfnoqftidnwwm/Build/Products/Debug-iphonesimulator/KxMovieExample.app/KxMovieExample
Undefined symbols for architecture i386:
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I hope you to help me.
Could you please tell me the issue?
Regards.
I got this problem when build the KxmovieExample for iPhone4( ios6.1.2) and iPad2 (iOS 5.1.1), while the simulator worked well.
I follow the reame.md instruction to build it.
(1)get the source code by
git clone git://github.com/kolyvan/kxmovie.git
(2)and then
cd kxmovie
git submodule update --init
rake
the rake command succeed, but when I open the xCode project, build for the iOS device, the problem occurs.
I try to play this 720p video http://edge.v.iask.com/97811058.hlvKID=sina,viask&Expires=1361894400&ssig=xA3elVHv0a
it will be crash
log:
KxMovieExample[1013:907] Received memory warning.
Can not play:mp3.wmv.m4a……..
LOG:
2013-01-24 15:14:43.235 KxMovieExample[7586:707] StayOpened: I make icecream sandwiches for everbody
2013-01-24 15:17:24.974 KxMovieExample[7586:707] AudioRoute: Speaker
2013-01-24 15:17:24.996 KxMovieExample[7586:707] AudioRoute: Speaker
2013-01-24 15:17:24.997 KxMovieExample[7586:707] We've got 1 output channels
2013-01-24 15:17:24.998 KxMovieExample[7586:707] Current sampling rate: 44100.000000
2013-01-24 15:17:25.000 KxMovieExample[7586:707] Current output volume: 1.000000
2013-01-24 15:17:25.001 KxMovieExample[7586:707] Current output bytes per sample: 4
2013-01-24 15:17:25.003 KxMovieExample[7586:707] Current output num channels: 2
[mp3 @ 0x1ebf3600] max_analyze_duration 5000000 reached at 5015510
[mp3 @ 0x1ebf3600] Could not find codec parameters for stream 0 (Audio: mp3, 44100 Hz, 2 channels, 128 kb/s): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mp3 @ 0x1ebf3600] Could not find codec parameters for stream 1 (Video: mjpeg): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
2013-01-24 15:17:25.132 KxMovieExample[7586:1e03] Unable to find stream information, 1.mp3
2013-01-24 15:17:25.133 KxMovieExample[7586:1e03] movie loaded
2013-01-24 15:17:25.134 KxMovieExample[7586:707] setMovieDecoder
Following code is my implementation.
(UIImage *)thumbnailsOfVideo:(NSString *)filePath
{
KxMovieDecoder *decoder = [[KxMovieDecoder alloc] init];
[decoder setupVideoFrameFormat:KxVideoFrameFormatRGB];
NSError *error = nil;
if ([decoder openFile:filePath error:&error]) {
if (decoder.validVideo) {
NSArray *videoFrames = [decoder decodeFrames:0]; // At begin of the video
if (videoFrames.count > 0) {
KxVideoFrameRGB *frame = [videoFrames objectAtIndex:0];
UIImage *image = [frame asImage];
onGotImage(image);
}
}
[decoder closeFile];
decoder = nil;
}
}
I have some problem now.
Any help is greatly appreciated@
Hi,
at first - grat job! kxmovie is amazing :)
I have a backend server that i connect via NSInputStream and NSOutputStream. When i send some controll msg via output stream, server start sending to me data (mp4 stream) via inpuput stream.
I have no idea how to connect ffmpeg with those data (NSInputStream), can You help?
Hi Kolyvan, this is a wonderful project. I'm no expert with ffmpeg so I'm not exactly sure what should be done to fix an audio/video sync issue I have when I try to play streamed content. It only happens when streamed, otherwise playing the FLV file locally presents no issues.
To reproduce the error, you can add
tcp://<your device's local IP>:<some port>/?listen
to the list of URLs in your KxMovieExample project.
Then, when you open that URL, you can do in your mac/linux machine via command line:
curl http://eric.cast.ro/stream2.flv | nc <your device's local IP> <some port>
The example FLV in my website illustrates very quickly the problem through a wrong lip sync. Requires curl and netcat installed, which can be obtained via MacPorts.
Or, if your device is jailbroken, you can execute the exact same command (but change nc to netcat) via SSH after installing those same command utilities via Cydia
Any help is greatly appreciated!
I try to play a IP camera video, my device and IP camera are both connected to the same router, then I closed the authentication of IP camera, and try to play the camera's video by address like "192.168.1.156", the video is played normally. However, when I try to make the IP camera accessible outside the router(mapping the ip 192.168.1.156 to the WAN by configure the router), and try to play the camera video by the corresponding WAN address and mapping port through KxMovieExample, such error occurs:
and neither the simulator nor the device play anything.
Then I try to play the IP camera video by WAN address via VLC, it worked.
what should I do to solve the problem?
There is an error when I'm linking kxmovie with
ffmpeg1.1.3(from http://ffmpeg.org/releases/ffmpeg-1.1.3.tar.gz)
xcode4.6, iOS6.1 SDK
Anyone has the same problem?
anyway, kxmovie is a great project for study video player programming, thanks.
Ld /Users/gdier/Library/Developer/Xcode/DerivedData/kxmovie-bwjlvssbuxmvekeokeoevpsoyjwj/Build/Products/Debug-iphoneos/KxMovieExample.app/KxMovieExample normal armv7
cd /Users/gdier/code/kxmovie
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/gdier/Library/Developer/Xcode/DerivedData/kxmovie-bwjlvssbuxmvekeokeoevpsoyjwj/Build/Products/Debug-iphoneos -L/Users/gdier/code/kxmovie/libs -F/Users/gdier/Library/Developer/Xcode/DerivedData/kxmovie-bwjlvssbuxmvekeokeoevpsoyjwj/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/gdier/Library/Developer/Xcode/DerivedData/kxmovie-bwjlvssbuxmvekeokeoevpsoyjwj/Build/Intermediates/kxmovie.build/Debug-iphoneos/KxMovieExample.build/Objects-normal/armv7/KxMovieExample.LinkFileList -dead_strip -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=5.1 -framework OpenGLES -framework QuartzCore -framework Accelerate -framework AudioToolbox -framework CoreAudio -framework MediaPlayer -framework CoreGraphics -framework Foundation -framework UIKit -lz -lavcodec -lavformat -lavutil -lswresample -lswscale -o /Users/gdier/Library/Developer/Xcode/DerivedData/kxmovie-bwjlvssbuxmvekeokeoevpsoyjwj/Build/Products/Debug-iphoneos/KxMovieExample.app/KxMovieExample
ld: in /Users/gdier/code/kxmovie/libs/libavcodec.a(fft_fixed_neon.o), in section __TEXT,__text reloc 4: R_ABS reloc but no absolute symbol at target address for architecture armv7
I have this warning in KxMovieDecoder and it's causing a problem in loading film process can you help please
the problem is : when video start streaming sometimes it loads the audio before the video so I used to rotate the device in order to see the video again
When I modify some UI for kxmovie player, I need to run rake build_movie
and copy the output folder, that is a little troublesome.
Can I modify the kxmovie code in my project and it will be built by xcode automatically ?
Hi Kostantin
Thank you very much for this amazing project.
Every file that I play in project works fine. But I have a problem when I move the uislider left or right. In this cases I see in the console these messages:
[ac3 @ 0x1fa9d000] frame sync error
decode audio error, skip packet
or in other case this messages:
desync audio (lags) skip 1415.2881 1413.0240
desync audio (lags) skip 1415.2881 1413.0560
How I can solve this problem?, if it is possible. ;)
Pd. I forgot that I use for testing iPad 3 and iPhone 5
Thank you,
Hi,
I am using Xcode Version 4.6 (4H127), iOS SDK 6.1 deploying target 6.0 and I was able to build kxmovie and its example after some trouble. I have included kxmovie library from output folder and ffmpeg libs from libs one and needed frameworks aswel to my own project but the build fails with the following errors (same errors on iPhone and simulator either):
I am adding the same code (test purpose at this moment) as in the example
I am relatively a newbie programming in iOS and I have been not able to solve this problem yet. I have tried to replace ffmpeg libs with others built directly from ffmpeg source code but it didn't work neither.
Thank you in advance
Because of small experience of using GLView, how to do this?
Hi kolyvan,
I noticed that at least ios 5.1 required for kxmovie. so can i make it work on ios 5.0 devices?
what is the limitation if supporting ios 5.0 devices?
Thanks in advance.
Example on how to simulate the issue:
Run KxMovieExample, start playback of a stream, lock the device by pressing the top button, unlock the device. Now the movie won't play anymore (except for what was already in buffer), and if the screen is dismissed, there will be a crash.
Last NSLog messages:
2013-04-21 22:00:30.774 KxMovieExample[5028:907] pause movie
2013-04-21 22:00:30.775 KxMovieExample[5028:907] applicationWillResignActive
2013-04-21 22:00:30.776 KxMovieExample[5028:907] applicationDidEnterBackground
2013-04-21 22:00:42.731 KxMovieExample[5028:907] viewWillDisappear KxMovieViewController: 0x2103edb0
2013-04-21 22:00:43.151 KxMovieExample[5028:907] KxMovieViewController: 0x2103edb0- dealloc
2013-04-21 22:00:43.161 KxMovieExample[5028:907] KxMovieDecoder: 0x2103efd0 dealloc
In this test, a SIGPIPE is raised inside KxMovieDecoder dealloc > closeFile > avformat_close_input(&_formatCtx)
Ideas?
This is fantastic! But how can i keep audio playing when app goes in background?
Thanks
I'm using your example to stream audio and it worked. Is there a way to display audio spectrum instead static image? Thanks in advance.
Hi, I got these error when build kxmovie:
Executing cd ffmpeg; ./configure --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-doc --disable-bzlib --target-os=darwin --enable-cross-compile --enable-gpl --enable-version3 --arch=arm --cpu=cortex-a8 --enable-pic --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' --extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' --enable-neon --enable-optimizations --disable-debug --disable-armv5te --disable-armv6 --disable-armv6t2 --enable-small --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
mac os x lion 10.7.5
xcode 4.6.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.