Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How build ffmpeg optimized for iOS, using hardware decoding probably ?
9 décembre 2013, par jAckOdEI make a FFMPEG-based player for ios. It works fine on simulator, but on real-device (iPhone 4) the frame rate is low and make my audio and video out of sync. the player works fine on iPhone 4s, so I guess it's just problem about device's computing power.
So, is there anyway to build FFMPEG optimized for iOS device (armv7, arvm7s arch)? or is there anyway to utilize ios device hardware to decode video stream?
My video stream is encode in H264/AAC.
-
FFMPEG : Mapping Decoded frame buffer to FFMPEG's output frame buffer
9 décembre 2013, par ZaxI have integrated my custom decoder into FFMPEG's multimedia framework. I have the AVCodec structure inside my video decoder as shown below:
AVCodec ff_hello_decoder = { .name = "myDec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HELLO, .init = myDec_decode_init, .close = myDec_decode_close, .decode = myDec_decode_frame, .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_YUV420P}, };
In function
myDec_decode_init()
i perform all initializations, memory allocation etc. In functionmyDec_decode_close()
, all the allocated memory is deallocated. In functionmyDec_decode_frame()
, i read the input stream, and decode a frame as shown below:static int myDec_decode_frame(AVCodecContext *avctx, void *data,int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame=data; unsigned char *YUVptr; //Here i read the input stream and pass it to the decoder. //Decoder gives me a address that points to the YUV data, i collect the address in YUVptr as shown below YUVptr=myDecodeFrame(...); //Inorder to map this pointer to the output frame pointer provided by ffmpeg, i perform the below operation frame->buf=YUVptr; //give indication to ffmpeg framework that the data has been mapped to frame buffer *got_frame_ptr=1; return 0; }
When i execute the ffmpeg command from terminal i get the following message:
./ffmpeg -vcodec myDec -i input.bin output.yuv Codec 0xFF1081 is not in the full list Output file #0 does not contain any stream
My Question is :
1) Why am i getting the first message i.e.
Codec ... is not in the full list
? What has to be done to get this solved2) Why am i getting the message
Output file #0 does not contain any stream
, althought in the definition of AVCodec i have specified that pix_fmts are of typeAV_PIX_FMT_YUV420P
? How can this be resolved?3) Lastly, i still doubt, that i'm actually not mapping the yuv buffer data properly with the ffmpeg's output buffer pointer i.e.
void* data
parameter. Am i doing something wrong here?Any information regarding the same shall be really helpful to me. Please do provide you valuable suggestions. Thanks in advance.
-
FFMPEG : merging multiple audio (MP3) and single image convert them into a video [on hold]
9 décembre 2013, par user3027136I'm tired of searching for this problem. I have found 2 solutions here, but both work only partially. What I want to do is to convert all the MP3 inside a folder (if possible subfolders, too) to avi or anything else accepted by Youtube. I have created 2 .bat that should do this (according to the other threads here). They don't, one of them creates the avi without the image (black) and the other seems to capture the screen. Here they are. If you know about ffmpeg please point me to the right direction. Thank you.
This one uses mp3info.exe - to be honest I have no idea what mp3info does, I just guess it finds the lenght of the song to be mathed later with the length of the video.
@echo off for %%a in (*.mp3) do ( for /f "delims=" %%b in ('mp3info.exe -p %%S "%%a"') do ( ffmpeg -i "%%a" -loop 1 -r 1 -i "cover.jpg" -acodec copy "%%~na.mp4" -t %%b ) )
This seems more simple, runs faster but captures the screenshot and ignores the cover.jpg file.
@echo off for %%A IN (*.mp3) DO ffmpeg -i "%%A" -i "cover.jpg" "%%A.mpg" done
mp2info.exe, cover.jpeg and the .bat scripts are in the same folder with the .mp3 files.
-
Cropping black bars in video with ffmpeg on ubuntu changes video size
9 décembre 2013, par pramodI have a source video size that's 720x576 with black rectangles on the top and bottom.
I want to remove the black rectangles and set the output video size to 640x352.
I tried
-vf cropdetect
and the value it gave was 640:192:0:80.However, putting that same value in
crop=
changes the output video size.How can I fix this?
E.g.:
ffmpeg -i all_the_best_test.mpg -s 640x352 -deinterlace -b 500k -minrate 500k \ -maxrate 500k -aspect 1.82 -force_fps -vcodec libx264 -me_method 10 \ -vf crop=640:192:0:80 -r 25 -acodec libfaac -ac 2 -ar 44100 -ab 96k -subq 6 \ -vpre medium /vod/Movies/final/allthebest-crop-2.mp4
-
Screen Transfer [on hold]
9 décembre 2013, par sanalismI need to develop a program that transfers a users screen and sound to another user over internet. The scenario can be visualized like this:
There is a teacher in front of his computer and writes some code on his computer (ex:visual studio). He has a microphone. There is two students watching teacher's screen and listening his voice from their own computers.
There are a few alternatives to get screen capture of a user and transfer it like ffmpeg, aforge or self coded screen capture program by c# (over udp). Tried all alternatives.
However, the problem is all of them are so slow, or creates bad resolution of video. There should be an alternative way, because some programs reaches a high quality. For example teamviewer, windows remote desktop, logmein can send the screen with a high quality. More over, teamviewer can send sound also.
Where should I begin to overcome this mission? Which platform, language, protocol is useful?