DSS won't stream 3GP's encoded with FFMPEG - ffmpeg

I have setup Darwin Streaming Server which streams the included sample 3GP files pretty well. However when I try to encode my own 3GPs using FFMPEG and stream them, it doesn't work. (I test the streaming using VLC Player).
Here is the command I use for encoding:
ffmpeg -i test.flv -acodec aac -ar 22050 -ab 128kb -vcodec mpeg4 -b 256k -mbd 2 -flags +4mv+aic -trellis 1 -cmp 1 -y test.3gp
Do I need a special way to encode the 3gp's for streaming?

DSS has no idea about file content. So, you have to "hint" (or give an idea to the server how to stream your file) media file. You can use M4Box for hinting - http://gpac.sourceforge.net/doc_mp4box.php

On the following link you can find how to configure a DSS server
http://www.howtoforge.com/apples-darwin-streaming-server-on-centos-5.2
The second page describe how to convert files with FFMPEG and MP4 creator to hint the vodeo to be streamed. The link can be find at the bottom of the page before the comments.

Related

Streaming a stream from website to Twitch with FFMPEG

Is it possible to stream a website with a livestream (i.e. ip-camera) via FFMPEG to Twitch? If yes, does anybody know how to achieve this?
Yes. FFmpeg has a built-in RTMP client (which is the protocol you'll use to send your video data to Twitch), FLV (the wrapper for your audio and video data), H.264 (the video codec), and AAC (the audio codec).
First, find your RTMP ingest URL: https://stream.twitch.tv/ingests/
Now, just run FFmpeg as you normally would to ingest your input, but set some additional parameters for the output:
ffmpeg [your input parameters] -vcodec libx264 -b:v 5M -acodec aac -b:a 256k -f flv [your RTMP URL]

ffmpeg Will stream be copied if same codec is requested?

I loop over some files and convert them with ffmpeg. I provide -vcodec h264. When the input video already is encoded with that codec: will the video stream be copied? How to make sure it's not reencoded in that case? Is it what -sameq was used previously?
You need to use -c:v copy if you want the raw H.264 stream to be passed on without re-encoding:
ffmpeg -i myh264file.mp4 -c:v copy -c:a copy myh264output.mp4
-c:a copy will also copy the audio
-c copy will copy both audio and video as in:
ffmpeg -i myh264file.mp4 -c copy myh264output.mp4
Detecting H.264 streams is not straight forward. You will need to code this.
For the -sameq settings please refer to this statement.
I would recommend upgrading to a recent version of ffmpeg if it is not already done as -vcodec is not used anymore, now it is -c:v.
The documentation on ffmpeg could help you.

How add scale in my ffmpeg command

i want convert video from any format to mp4. so i am using command:
ffmpeg -i ttt.mp4 -vcodec copy -acodec copy test.mp4
this is working perftectly but now i also add scale in this -s 320:240.
There also many other command for convert LIKE :
ffmpeg -i inputfile.avi -s 320x240 outputfile.avi
but after convert by this command video not play in html5 player
BUT this is not working so tell me in my command how i add scale;
So please provide me solution for this .
Thanks in advance.
You have several problems:
In your command, you have -vcodec copy you cannot scale video without reencoding.
In the command you randomly found on the Internet, they are using AVI, which is not HTML5-compatible.
What you should do is:
ffmpeg -i INPUT -s 320x240 -acodec copy OUT.mp4
Adding to Timothy_G:
Video copy will ignore the video filter chain of ffmpeg, so no scaling is available (man ffmpeg is a great source of information that you will not find on Google). Notice that once you start decoding-filtering-encoding (i.e., no copy) the process will be much slower (x100 time slower or even more). The libx264 is recommended if you want compatibility with all browsers.
$ ffmpeg -i INPUT -s 320x240 -threads 4 -c:a copy -c:v libx264 OUT.mp4
vp9 will provide nearly 50% extra bandwidth saving, but only for supported browsers (Firefox/Chrome), and the encoding will much slower compared to libx264 (that itself is much slower that v:c copy):
$ ffmpeg -i INPUT -s 320x240 -c:a copy -c:v vp9 OUT.webm
Notice that there is a set of formats (containers) accepted by browsers (most admit mp4, some also webm, ...) and for each format there is a set of audio/video codecs accepted. For example you can use mp3 or aac with an mp4 file (container), but not with webm files.
http://en.wikipedia.org/wiki/HTML5_video#Supported_video_formats

Pseudo-streaming mp4 files does not work with flash player

I've got a problem with streaming audio on my website. I thought I could put the MP3 file inside an MP4 container with h264 codec, so I can use pseudo-streaming ability of mp4 codec.
The code I'm using to convert my files is:
ffmpeg -i 1.mp3 -y -b:a 32K -vn 1.mp4
Pseudo-streaming (seeking in not-loaded parts of media) now works in HTML5 player but not in any Flash media players such as JWPlayer or FlowPlayer.
I've tested my files on both Apache server with h264 module enabled and Nginx with mod_mp4 enabled, but without any lucks.
I tried MP4Box, QTIndexSwapper and even creating a real video file by mixing of an image loop and my audio file.
ffmpeg -y -i joojoo.png -i 2.mp3 -vcodec mjpeg havij.mp4
MP4Box -add havij.mp4 -isma havij_new.mp4
What am I doing wrong? What can I do to make it work?
You have to hint the file. Check out mp4box -hint

FMS FLV to mp3/aac/wav

How can I decode a FLV's audio if it's recorded from a live stream using Flash Media Server and uses NellyMoser codec?
I'm writing a script that process several FLVs, using FFmpeg, so I need a command line solution.
Any ideas?
This should work for you, since NellyMoser is supported by FFmpeg.
1. Using mp3
ffmpeg -i yourinput.flv -vn -acodec libmp3lame output.flv
2. Using AAC (switch aac with libfaac depending on which you have loaded)
ffmpeg -i yourinput.flv -vn -acodec libfaac output.mp4
I'm assuming of course you dont care about video.

Resources