Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Restream RTSP stream and Record to files

    12 mai 2017, par Aly2000

    Currently I digest a series of RTSP streams from IP cameras and transcode them to multiple output formats (MPEG DASH, HLS, RTSP) on AWS cloud using Wowza Streaming Engine. However, for the majority of these streams, the only required output is RTSP. I have to record these streams, while also re-streaming them through AWS due to limited bandwidth on the source network. I am trying to replace Wowza for the streams that only require RTSP to reduce costs. However, i cannot seem to find a suitable open source tool that will allow me to re-stream the RTSP stream (as RTSP) and in parallel record to chunked mp4 files (i.e every 10 minutes). I have tried ffmpeg & ffserver, but it seems like i cannot do both (re-stream and record) the RTSP streams.

  • How to Unlimited Limit commands FFMPEG

    12 mai 2017, par Kevin Gozmer

    I want to ask if I have a conversion using ffmpeg on a dedicated server, 6 commands run at most. How to change this limit to more? Since 6 orders are very few. This is Debian 8. FFMPEG version 3.0.2.

    My comand ffmpeg convert is:

    echo shell_exec("ffmpeg -i " . $vstup . " -codec copy " . $vystup . " &");
    
  • FFMPEG set -ss and -to with string

    12 mai 2017, par NewUser

    I know I can set the start with -ss and end with -to but can someone please help me to format the following so that I can enter the -ss and -to with a string?

    I want -ss to come from

    String start = editStart.getText().toString();
    

    and -to to come from

    String end = editEnd.getText().toString();
    

    Here is my ffmpeg string I want to edit, I have entered -ss and -to to show where I want the above strings to be.

    String s = "-i" + " " + mVideoUri.toString().replace("file:///", "") + " -i " + newBackgroundBitmap.getPath() +  " -filter_complex [1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v] -ss -to -map [v] -c:v libx264 -preset ultrafast " + directoryToStore + "/" + FileName + mp4;
    
    String[] arguments = s.split(" ");
    
    ExecuteFFMPEG(arguments);
    

    EDIT

    Here is the full ffmpeg

    //Button onclick
    public void onButtonClicked(View view) {
        switch (view.getId()) {
    
        //WHEN THE EXPORT BUTTON IS CLICKED
        case Export:
            String s = "-i" + " " + mVideoUri.toString() + " -i " + newBackgroundBitmap.getPath() + " -filter_complex [1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v] -map [v] -c:v libx264 -preset ultrafast " + directoryToStore + "/" + lastSaved + mp;
            String[] arguments = s.split(" ");
            ExecuteFFMPEG(arguments);
    
        }
    }
    
    //Added onLoad FFMPEG
    public void LoadFFMPEG() {
    
        FFmpeg ffmpeg = FFmpeg.getInstance(getBaseContext());
        try {
            ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
    
                @Override
                public void onStart() {
                    super.onStart();
    
                }
    
                @Override
                public void onFailure() {
                    super.onFailure();
                }
    
                @Override
                public void onSuccess() {
                    super.onSuccess();
    
                }
    
                @Override
                public void onFinish() {
                    super.onFinish();
                }
            });
        } catch (FFmpegNotSupportedException e1) {
            e1.printStackTrace();
            Log.d("[FFMPEGMain Exception]-", e1.toString());
        }
    }
    
    //Added Exceute FFMPEG
    public void ExecuteFFMPEG(String[] command) {
    
    
        FFmpeg ffmpeg = FFmpeg.getInstance(getBaseContext());
        try {
    
            ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
    
                @Override
                public void onStart() {
                    super.onStart();
                    Log.d("[Start]", "start");
    
                }
    
                @Override
                public void onProgress(String message) {
                    Log.d("[Progress]", message);
                }
    
                @Override
                public void onFailure(String message) {
                    Log.d("[fail]", message);
                }
    
                @Override
                public void onSuccess(String message) {
                    Log.d("[Success]", message);
    
    
                }
    
    
                @Override
                public void onFinish() {
                    super.onFinish();
                    Log.d("[Finish]", "file output done");
    
                }
    
            });
        } catch (FFmpegCommandAlreadyRunningException e) {
            // Handle if FFmpeg is already running
            Log.d("[FFMPEG Exception]-", e.toString());
    
        }
    
    
    }
    

    The above works perfectly as I was hoping. Now I want to set the start and end of the video (depending on the position the user selected). I get the start and end of the video back as a string, like this:

    String valueRight = formatter.format(getValueRight);
    String valueLeft = formatter.format(getValueLeft);
    
    //this strings will return 00:00:00.000 DEPENDING on the position from the user
    //just like when you would normally call -ss 00:00:50.849 -to 00:02:05.100
    

    As I mentioned above that I know it should be set as -ss and -to but I am looking for a wat to format my string to enter -ss and -to with a string, somthing like this:

    -ss valueLeft -to valueRight
    

  • How to transcode a video to custom resolution using Xamarin.MP4Transcoder.Transcoder

    12 mai 2017, par Prashant

    I need to transcode a video to 640*480 resolution using Xamarin.MP4Transcoder.Transcoder. Currently there are 2 available resolutions 720pFormat and 960x540Format. There is a method called Transcoder For (IMediaFormatStrategy strategy) available in Transcoder class.

    I can create MediaFormat object with MIME Type, Width and Height by below mentioned code snippet:

    MediaFormat obj = MediaFormat.CreateVideoFormat("video/mp4", 480, 640);


    but the problem is how can assign it to IMediaFormatStrategy or is there any other way to achieve this.

    Piece of code for Transcoding a video:
    
    Xamarin.MP4Transcoder.Transcoder.For960x540Format().ConvertAsync(inputFile, outputFile, f =>
				{
				  onProgress?.Invoke((int)(f * (double)100), 100);

				  
				} );
    
    inputFile: Video file which needs to be transcoded.
    outputFile: Resultant file generated after transcoding.

    For more info you can refer https://github.com/neurospeech/xamarin-android-ffmpeg

    Any help is appreciated. Thanks in advance!!

  • FFMPEG cannot find openCV while integrating modified HEVC

    12 mai 2017, par haider ali

    We modified HEVC (open-source downloaded from bitbucket) encoder and have included some openCV libraries. It works perfect on visual studio.

    Problem: FFMPEG is unable to find openCV libraries.

    Please suggest us a solution?

    Are there any other software in which we can integrate our customized HEVC library?