Convert mp4 video to m3u8 format with C# ffmpack - c#

I can convert the file with the extension mp4 in my hand from the code line related to PowerShell to m3u8 format.
ffmpeg -i inputVideo.mp4 -profile:v baseline -level 3.0 -s 960x540 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls outputVideo.m3u8
But I want to automate this process using C#. I did as written in the document on Microsoft's site, but I could not add the relevant parameters. Has anyone done anything like this before? or how can I follow a path.
https://learn.microsoft.com/en-us/powershell/scripting/developer/hosting/adding-and-invoking-commands?view=powershell-7&fbclid=IwAR05LjyIa8Yv5YFVh-HcbWH5YqmaeQKJ8LzaGsCQxjvJBIepdLAx7E39y7Y

Related

How can I convert a regular WAV file to a 4bit WAV file using ffmpeg?

I have tried something along the lines of
C:\ffmpeg\ffmpeg -i "Blip_Select2.wav" -c:a wav -sample_fmt u8 "Blip_Select2_8bit.wav"
but I cannot figure out how to access a 4bit conversion.
I am using the audio for a c# project, 4 bit is sufficient and I prefer wav so I won't have to distribute a possibly restricted usage decoder with my files.
Just a heads up that -b 4 with sox seems to use MS ADPCM codec which encodes the difference between samples using 4 bits. If you want to produce a similar result using ffmpeg you can use:
ffmpeg -i sound.wav -codec:a adpcm_ms -f wav sound_4bit.wav
Ok, so I did manage to find a solution for this. It's a great command line utility similar to ffmpeg, called (Sound eXchange) SoX. It can be found here:
http://sox.sourceforge.net/
The command line that achieves converting to 4 bit wav is this:
sox "sound.wav" -b 4 "sound_4bit.wav"
It works perfectly and I did not notice any quality drop as the sampling rate is still 44100, while the size drops to 1/4.
An important note. This works well only if your audio is clean and not recorded too loud, such as correctly recorded voice speech (this is what I am using it for), but also works for music as long as it's not too loud.

.TS file to .mp3 using FFMPEG in windows phone

Hi I am using ffmpeg for windows phone which was found here. With this I am trying to convert a .ts file to .mp3 file but the command that I am using is not working for this type of conversion, I have also noted that it works for certain other format conversions such as ts to wma, ts to ogg e.t.c . The commands that I have tried are
-i sourcewithfullpath.ts destinationwithfullpath.mp3
-i sourcewithfullpath.ts
-f destinationwithfullpath.mp3
-i sourcewithfullpath.ts
-c:a libmp3lame destinationwithfullpath.mp3
-i sourcewithfullpath.ts
-acodec mp3 destinationwithfullpath.mp3
most of these gave me an AccessViolationException while calling ffmpeg.Run()
Any help is appreciated.
I think Mulvya is right MP3 encoding is not included in this FFMPEG build but I figured out another way which does not satisfy the exact need still a good option
-i sourcewithfullpath.ts
-f destinationwithfullpath.mp2
FFMPEG does support mp2 format, the file was converted to mp2 audio and renamed to mp3, it is playable in the windows phone. Please note that the compression ratio of the mp2 format is not that good compared to mp3 format which means that the output file resulted in a much greater size which was almost double.

Converting large (4gb) avi file to mpeg or mp4 format using C#

I have successfully converted avi files to Mpeg using NREco converter http://www.nrecosite.com/video_converter_net.aspx
But, the length (duration) of the converted video is never greater than 2mins, 35 secs.
I tried using ffmpeg command line utility (https://www.ffmpeg.org/download.html or http://ffmpeg.zeranoe.com/builds/ ffmpeg 64 bit static for windows) but the length was always less than or equal to 2mins, 35 seconds.
How to increase the duration of the ffmpeg converted video?
I tried the -t command but couldn't increase the length (duration) of the converted video. Original video is a 14mins 5 sec avi file.
ffmpeg -i inputAVIfilename outputMPEGfilename
ffmpeg -i inputAVIfilename -t 90000 outputMPEGfilename
The video file has only bitmap images. No sound tracks are required.
Please note that my dll would be used with both windows & web applications.
Converting of videos of from one format to other can be done either using software or hardware. In your case you are using ffmpeg which is software based solution. Generally speaking software based solutions are a lot slower, inefficient and has many operating system restrain, and I am suspecting you have reached that limit.
I suggest that you use cloud based solution such as Azure Media service or Elementals.

Create video from still images

I am developing an application that I can get series of Images from IP camera.
Now I want make video from those image. Can anyone help me in creating a video of any format from still images using C#?
You could just use ffmpeg behind the scenes to do so.
Use ffmpeg, http://ffmpeg.org/
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video.
Also...
FFmpeg is free software licensed under the LGPL or GPL depending on your choice of configuration options. If you use FFmpeg or its constituent libraries, you must adhere to the terms of the license in question. You can find basic compliance information and get licensing help on our license and legal considerations page.
From the documentation:
For creating a video from many images:
ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi

Optimum encoding standard for flowplayer to play mp4

I'm using flow player 3.1.1 for streaming videos to my browser.The videos are uploaded by the users and they may upload different formats. What will be solution to stream the videos as mp4 , what ever be the format they upload. I'm currently using ffmpeg commands.
ffmpeg -i "InputFile.mp4" -sameq -vcodec libx264 -r 35 -acodec libfaac -y "OutputFile.mp4"
But video files of more size(say 100mb) are taking a minute more for laoding in to the flowplayer and buffering. I think the problem with my encoding.
Welcome your valuable Suggestions!!!
The problem come from metadata. ffmpeg put this data at the end of file, for a progressive download you must move this data at the begininng. You can use MP4Box or qt-faststart after ffmpeg process.
MP4Box -inter 1000 file.mp4 or qt-faststart in.mp4 out.mp4

Categories