Record F4V in Flash Media Server - ffmpeg

I have problem with record live event in F4v through Flash Media Server
I publish my live event on FMS though FFMPEG
FFMPEG Code:
ffmpeg -f dshow -i video="A4TECH USB2.0 PC Camera" -vcodec libx264 -b:v 32k -acodec libmp3lame -b:a 64k -ar 44100 -f flv rtmp://12.11.1.3/livepkgr/liveevent?adbe-live-event=liveevent
FMS Code to record F4V file:
var vodFile = Stream.get("mp4:" + StreamName.name + ".f4v");
vodFile.record();
vodFile.play(streamName,-1,-1);
So when I use -vcodec libx264 in ffmpeg FMS cam't to create F4V file, But when I erase -vcodec libx264 from FFMPEG FMS create F4V file currently.
Please advise me to solve this problem.

Related

Ffmpeg Add image overlay on rmtp stream

I have a m3u8 input and I convert it to a rmtp stream using this command:
ffmpeg -re -i "https://<url>.m3u8" -af asetpts=N/SR/TB -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -f flv -flvflags no_duration_filesize -s 1920x1080 "rtmp://<url>"
But I would like to add my logo on the top right part of the stream, I didn't manage to do it, do someone know how to do it?
Thanks

How to optimize RTMP AAC transcoding with (or without) FFMPEG?

I do use NginxRTMP to generate HLS.
Problem is that HLS has not sound (since it needs AAC)
I try to trancode my RTMP sound to AAC sound with FFMPEG
exec_push ffmpeg -i rtmp://localhost/src/$name -vcodec libx264 -threads 0 -vprofile baseline -preset ultrafast -s 800x600 -acodec libfaac -ar 44100 -f flv rtmp://localhost/hls/$name
Problem: it takes 25% of CPU per stream.
Any idea on how to optimize that ?

ffmpeg: Proper way to encode ac3 to aac?

I have actually encoded an audio file from ac3 to aac using ffmpeg native aac encoder but the issue is that the file is not playing correctly , more specifically i have played that file in different media player but most of them start from 19 seconds and in vlc it is not even starting till I seek to more than 19 seconds duration.
command i have used is :-
ffmpeg -i source.mkv -map 0:a:0 -c:a aac audio.mp4.
That is the proper way.
Don't know if this will make a difference, try -b:a 400k and -strict experimental.
If you want audio only, convert to m4a or aac.
ffmpeg -i input.mkv -y -c:a aac -b:a 400k -map 0:a:0? -strict experimental output.mp4
Other encoders, may require compiling ffmpeg with use flags:
http://trac.ffmpeg.org/wiki/Encode/AAC
libfdk_aac
libfaac

Audio is lost in some portions of a HLS stream

I have setup a HLS live stream on AWS. Significant part of the video plays as expected but in some portions audio is lost while the video continues to play. Please share you thoughts/insights if you have faced such an issue.
I transcode video to h264, baseline3.1 and audio to aac stereo 2 channels before segmenting to 10s files. Following commands are being used:
Transcoding:
ffmpeg -y -i ${file_path} -b:v ${vBitrate} -minrate ${vBitrate} -maxrate ${vBitrate} -c:v libx264 -b:a ${aBitrate} -c:a libfaac -ac 2 -r 25 -s ${resolution} -profile:v baseline -level 3.1 ${output_dir}/${file_name}.ts
Ex: vBitrate: 1m, aBirate: 128k, resolution: 960x540
Splittting:
ffmpeg -i ${file_path} -c:v copy -c:a copy -flags -global_header -map 0 -f segment -segment_time ${segment} -segment_list ${output_dir}/playlist.m3u8 -segment_format mpegts tmp0/${file_name}_%02d.ts
Ex: segment: 10
Setup: segments are being served from Nginx and playlist is managed by a Python/Flask app.

using ffmpeg for live streaming MPEG-TS with windows media services

I'm trying to live stream MPEG-TS source to Windows Media service.
I found how to live stream using RTMP with this code:
ffmpeg -y -f mpegts -i udp://#:1234 -re -vcodec libx264 -maxrate 700k
-r 25 -s 640x360 -deinterlace -acodec libvo_aacenc -ab 64k -ac 1 -ar 44100 -f flv "rtmp://rtmp1.youtube.com/videolive?sparams=<STREAM PARAMETERS HERE>"
How can I convert it to support WM9/VC1 format?
Does ffmpeg support pulling of the stream or only pushing to Windows Media services?
Windows Media Service can receive data only from Windows Media Encoder.
It can't work with RTMP which its flash technology.
if your input stream is a file or a capture device than you can use "Windows Live Media Encoder".

Resources