I have a problem with ffmpeg and I don't know how to continue. I have 2 computers:
Client :
Run Ubuntu 14.04
FFmpeg installed
Use c++ language
Features: use ffmpeg to encode h264 video data from webcam of client laptop, then real time streaming to server
Server:
Running Windows 7
FFmpeg installed
Use c++ language (MFC)
Features: Get real time data from client and show it on screen.
I've just connected client to server and they can chat text data together, and I don't have any idea to make real time video work.
And my questions are:
[Client] How to get video from webcam on laptop (using ffmpeg code), save it to buffer (raw data), encode it and send to server?
I use ffmpeg to get video from wc but it save to file. I really don't want it. Code is:
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.mkv
[Client] How to get raw data from client, decode it and play it?
I have an idea to play it by using directshow in MFC.
If you must you could implement your own player in c++ using the FFmpeg libraries or the libav libraries. This allows you to support a wide range of codecs and formats.
On Windows you can use the c++ Windows Media Player Control, but it supports only a few formats, and no H.264.
You have the following options on the origin server (your Linux box):
vlc transcode
DivX3 with MP3 in ASF seem to be accepted by WMP:
cvlc input.mp4 --sout="#transcode{vcodec=DIV3,scale=Auto,acodec=mp3,ab=128,channels=2,samplerate=44100}:http{mux=asf,dst=:8080/}" --sout-keep
On the client you can retrieve the stream using http://server_address:8080.
ffmpeg with ffserver
Read the ffserver Documentation and Streaming media with ffserver in order to set it up.
For WMP you'll be using once again ASF:
# ASF compatible
<Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
</Stream>
Source.
You can retrieve the stream using http://ffserver_address:port/stream_name.asf.
Related
I am actually working on a server-client multimedia player. This player can be a server to stream a MP3 file (or wma, wav, ogg, flac ...) over the network to another player (client).
I worked first on a basic network communication (client-server), that send and receive bits. But I have a problem : the audio encoding. I need a tool to encode the audio data to be able to send a little part of it through the network and let the client play it before the next part is coming.
I saw a few tools on internet such as BASS library, Live555 ... I used to work with PortAudio for student's projects but I hate it.
So basically, I need a tool to encode audio data (server side), (I can send it over lan), and decode data to play it (client-side).
Do you guys have some ideas about how to do it ? Which tool could be useful for me in that case?
PS : I am trying to use Qt library for the network interface (it is efficient, and it works on windows, linux, mac) ... Is there any audio streaming tool included in the Qt library ?
You can try FFMPEG. It can convert almost anything to anything (so it claims) and it is a widely used open source library.
We use it in our application mainly for decoding video/audio streams.
I have a Silverlight5 based application which works in both In Browser as well as OOB mode.
I need to play video files which are of mp4 extension and encoding as shown by VLC media player:
Stream 0
Type: Video
Codec: MPEG-4 Video (mp4v)
Resolution: 320*240
Frame Rate: 10
Decoded Format: Planar 4:2:0 YUV.
I have tried using the Media Element provided by Silverlight framework and also tried using the Azure media services to display the video, but did not have any success. It says that the file format is not supported.
Will really appreciate your inputs.
Alpee
Windows does support MPEG4 video decoder. See below links
http://msdn.microsoft.com/en-us/library/windows/desktop/ff819502(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ff819503(v=vs.85).aspx
You can use MediaInfo a free tool to check the codec info in each stream inside a media container.
Without examining files it is hard to tell what's wrong.
I'm trying to use FFMpeg to create a video. So far i've been playing with a multiplexing example:
http://ffmpeg.org/doxygen/trunk/muxing_8c-source.html, and i'm able to create a compressed video from an already existing video.
Because my program is going to run on an embedded platform I would like to use some custom code (generated by a colleague) to compress the video data and place it into the video file.
So I'm looking for a way to create a video file in c/c++ using ffmpeg in which i have full control over the compression part (to basically circumvent ffmpeg from doing the compression for me and inserting my own code).
To clarify i'm planning to use this to save film from an intelligent camera into a compressed h264 mpeg-4 file.
You could pipe the output with -vcodec rawvideo to your custom program, or write it as a codec and have ffmpeg handle it.
By the way, ffmpeg was superceded by avconv. ffmpeg only exists for backwards compatibility now.
Edit: apparently avconv is a newer fork of ffmpeg, and seems to have more support. Either way, the options are almost the same.
I have a application (qt c++) that reads data from USB-device, decodes that data into 24bit RGB pixels which are stored in a uchar array.
Framerate is ~10 FPS. Framesize is 128x4096.
Question is: How to encode these frames into VP8 or h.264 video in real time?
No external processes are allowed, everything needs to run inside my application.
ffmpeg is an option but how to include it to my project and use it? Documentation is rather bad to say the least. Also x264 could be an option but same question as to ffmpeg. And it's also quite expensive, 1$ for unit and minimum of 10000.
Simple guide would be helpful but I doubt there exists one.
Application should run in Windows and Linux.
The problem with the VP8 SDK is that the examples only encode to IVF. That codec appears to have been shut down by Microsoft due to a security flaw (buffer overflow). It's pretty hard to even get the VP8 project setup when you can't even check the results. It at least uses a BSD license scheme and its supposedly unencumbered with patents.
The VP8 SDK has some routines for converting formats, but they are buried in the source tree.
An option not mentioned is the Intel Media SDK, but that locks you to windows.
There is also Theora and Dirac.
X264 has an encoder, but it would be expensive to get a commercial license.
GPLv2 source code is not "free". I don't care what they try to get you to believe.
There is also a project called "Revel - the Really Easy Video Encoding Library". That is a path to getting MPEG-4 part 2 files encoded. H264 is MPEG-4 part 10. H264 is also called AVC. Revel is also GPL'd.
Ffmpeg is a catch all utility that tries to create a wrapper around the various encoders/decoders. If you use the x264 encoder with it, it becomes GPLv2.
The VP8 SDK has documentation and even some sample code
I'm looking for a way to extract the audio part of a FLV file.
I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this.
ffMpeg is the way to go !
It worked for me with SVN Rev 14277.
The command I used is : ffmpeg -i source.flv -nv -f mp3 destination.mp3
GOTCHA :
If you get this error message : Unsupported audio codec (n),
check the FLV Spec in the Audio Tags section.
ffMpeg can decode n=6 (Nellymoser).
But for n=4 (Nellymoser 8-kHz mono) and n=5 (Nellymoser 16-kHz mono) it doesn't work.
To fix this use the default microphone rate when recording your streams, overwise ffMpeg is unable to decode them.
Hope this helps !
This isn't an exact answer, but some relevant notes I've made from investigating FLV files for a business requirement.
Most FLV audio is encoded in the MP3 format, meaning you can extract it directly from the FLV container. If the FLV was created from someone recording from their microphone, the audio is encoded with the Nellymoser Asao codec, which is proprietary (IIRC).
I'd check out libavcodec, which handles FLV/MP3/Nellymoser natively, and should let you get to the audio.
I'm currently using FFmpeg version SVN-r12665 for this, with no problems (the console version, without any wrapper library). There are some caveats to using console applications from non-console .NET environments, but it's all fairly straightforward. Using the libavcodec DLL directly is much more cumbersome.
I was going to recommend this: http://code.google.com/hosting/takenDown?project=nelly2pcm¬ice=7281.
But its been taken down. Glad I got a copy first :-)