Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Programming in C : Opening, Reading and Transcoding of Live TV with libavcodec. libavformat etc
19 décembre 2011, par mmomentI'm currently developing a live streaming Software for my University Project.
I am supposed to open a Live Video Stream from a USB Stick( I am using the Hauppauge WinTV-HVR 950Q under Linux) and read the Stream. Then I'm supposed to transcode it to h246. and send it to some devices in the Network.
My Problem
I can use the v4l API to access the USB Stick, but transcoding does currently not work as far as I know, therefore I want to use the libav to do so. I know that using the command line tools transcoding of live streams with ffmpeg is not a big deal, but doing so in C seems to be more of a problem.
Here's how I open some static Video File:
static char* path = "./video.mpeg"; AVFormatContext *pFormatCtx;
av_register_all();
if(av_open_input_file(&pFormatCtx, path, NULL, 0, NULL)!=0) { printf("Opening file \"%s\" failed", path); return -1; }else printf("Opening the file \"%s\" succeeded", path);
Here's how I understand to how open a Live Feed
static char* path = "/dev/dvb/adapter0/dvr0"; AVFormatContext *pFormatCtx;
av_register_all(); avdevice_register_all();
if(avformat_open_input(&pFormatCtx, path, NULL, NULL) != 0) { perror("avformat_open_input"); return -1; }else printf("Yay");
Here's how I understand to how open a Live Feed
if(av_find_stream_info(pFormatCtx)<0) { printf("Could not find any Stream Information the file \"%s\"", path); return -1; } // Dump information about file onto standard error dump_format(pFormatCtx, 0, path, 0); AVCodecContext *pCodecCtx;
// Find the first video stream int videoStream=-1; for(i=0; inb_streams; i++) {
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { videoStream=i; break; }
}
if(videoStream==-1) return -1; // Didn't find a video stream
// Get a pointer to the codec context for the video stream pCodecCtx=pFormatCtx->streams[videoStream]->codec;
AVCodec *pCodec;
// Find the decoder for the video stream pCodec=avcodec_find_decoder(pCodecCtx->codec_id); if(pCodec==NULL) { fprintf(stderr, "Unsupported codec!\n"); return -1; // Codec not found } //Open codec if(avcodec_open(pCodecCtx, pCodec)<0) { printf("Could not open the Codec"); return -1; // Could not open codec }
So now how can you help me?
I would really appreciate it if anyone knew how to open a live stream and could give me a good example.
-
web hosting w/ ffmpeg.exe [closed]
18 décembre 2011, par yuriameWe're searching for a web hosting that support ffmpeg.exe.
Can anyone gave us a reliable web hosting that supports ffmpeg.exe?
-
iOS how to convert video mp4 other codecs in libavcodec [closed]
17 décembre 2011, par BaiI am developing the ios app that captures the video in iPad and uploads the video captured(.mp4) to the server.
I must convert the video to other codecs for reducing the size of the video. So I am going to use libavcodec.
But I am beginner in video/audio codecs. I didn't find the method for using libavcodec apis.
How can I convert the .mp4 video to other codecs using libavcodec?
-
x264_coeff_last64_sse2
16 décembre 2011, par mooseThe x264 lib is crashing on Windows as always. Now, I'm trying to fix it, and I don't understand one thing. In the code we can see only the function signature:
int x264_coeff_last64_sse2( dctcoef *dct );
But, there is no implementation in *.h, *.c or *.asm source. How is that possible???
(The function is called and it crashed, so it has to be linked in)
-
Simulate concatenated file using hard link ?
16 décembre 2011, par SugrueI have multiple parts of a single file which I want a 3rd party c++/c# plugin to read as a single file. Basically, when the plugin file reader gets to the end of one file-part, I want it to continue to the next one.
(For anyone interested, the plugin is Aforge.Net FFMpeg, and I am trying to import VOB files)
It looks like quite a task to reprogram the plugin. An alternative solution is to copy the file parts to a concatenated file, but this is slow because I am dealing with many GBs of data.
Is it possible to use a file system hard link to point to multiple files? Or is there some other way to 'fake' a concatenated file? Using command line FFMpeg I can use 'type' to live stream a concatenate file in, but I can't figure out how to achieve this in c# with this plugin.
I am on Windows 7.