ffmpeg - Is mp4 stream able with ffserver?
使用ffmpeg将video codec为h264的mp4文件demux成video/audio ES，这里主要是video需要特别处理一下，因为mp4 container中video缺少一些头信息，格式有些不同，其
Days I trying to stream mp4 file with ffserver.
I read many questions like these:
Begin stream simple mp4 with ffserver
HTML5 - How to stream large .mp4 files?
Finally I cant understand is mp4 stream able or not?
Is it a way to do this with ffserver?
Is there any sample?I read helps but they most about live stream but I just want to stream a simple mp4 file.
this question edited Mar 20 at 10:18 Community ? 1 1 asked Feb 17 '15 at 18:09 Ara Deonas 28 1 1 6
Streaming an mp4-file is very much possible with
ffserver. However it might require some reading of the documentation:
The crucial part is the writing of the configuration file for ffserver (
ffserver.conf). As far as I know, ffmpeg provides a list of sample-configurations:
Although they might be a bit outdated but if you try to run them,
ffserver will tell you if something isn't as it should be :)
(Since I only have a rep of 1, I can't post more than 2 links I removed the samples and displayed a rather simple one below)
To stream an mp4-file you may have to consider that
ffserver might have problems to stream in the mp4-format. Still you can stream a mp4-file but in a different Format.
A very simple way would be like this:
<Stream streamTest.asf> #ASF as the streaming Format File "/tmp/video1.mp4" #or wherever you store your Videos </Stream>
The server converts the file on it's own, but if you really want to stream in mp4 you may have to take a closer look at "fragmented mp4".
关于从ffmpeg中分离mp4 muxer 找到mp4 muxer源文件 因为为了统一管理muxer的方便，每个的muxer都封装进一个数据结构AVOutputFormat。 即用AVOutputFormat这个结
To watch the stream use a player that can handle asf (I used VLC) and watch from URL:
It should say that I am also still learning the ways of ffserver, so there might be some mistakes :)
This is a short summary of the chapters from the ffserver-documentation to get started.
5.2 Global options
The options in this chapter specify your server settings. For example how many simultaneous requests should be handled. On what port do you want to stream etc... For people who are completely new to
ffserver, most of the default-values should be sufficient.
5.3 Feed section
The feed section is one of the core parts of
ffserver. Since a feed can serve multiple streams it might be useful to build that first.
Note: Feed is only necessary if you want to
a) live stream
b) stream files that are not stored on your server
c) mess around with the file before streaming
5.4 Stream section
Here you can actually build your own stream. There are a lot of variables that can be changed and I recommend to start slowly with adding/customizing options. From this point on the documentation does a decent job. So now you know, what you need (again, I feel like the possibilities are countless but I'm still a beginner^^) and where to find the basics.
The structure of your
ffserver.conf might (but doesn't have to) look like this:
#Options from 5.2 HTTPPort 8090 #... #Feed (Options from 5.3) <Feed feed1.ffm> #... </Feed> # #Stream (Options from 5.4) <Stream stream1.asf> Feed feed1.ffm Format asf NoAudio #... </Stream>
Since this is my first post, I hope it is not too chaotic :)
this answer edited Nov 2 '15 at 15:35 answered Nov 2 '15 at 13:02 Robert K. 76 5 Can you summarise the relevant parts of the linked pages? – MTCoster Nov 2 '15 at 13:18
- 1[置顶] [总结]FFMPEG视音频编解码零基础学习方法
- 2FFmpeg 基本知识