Skip to content

Encoding Failed #61

@rohitpotato

Description

@rohitpotato

I am using Laravel 5.4 on localhost using xampp on Windows 10.

I am trying to convert a file to x264 (nothing is working btw),
Here's my controller:

`
<?php

public function store(Request $request)
{
    $channel = $request->user()->channel()->first();

    $video = $channel->videos()->where('uid', $request->uid)->firstOrFail();

    $request->file('video')->move(storage_path() . '/app/uploads', $video->video_filename);

    FFMpeg::open('uploads'. '\\' . $video->video_filename)->addFilter(function ($filters) {
       
        $filters->resize(new \FFMpeg\Coordinate\Dimension(640, 480));
    })->export()->toDisk('local') ->inFormat(new \FFMpeg\Format\Video\X264)->save('small_steve.mkv');

    //$enc = FFMpeg::open('uploads'. '\\' . $video->video_filename)->export()->todisk('local')->inFormat(new \FFMpeg\Format\Video\X264)->save("{$video->video_filename}");

    //$this->dispatch(new UploadVideo($video));

    return response()->json(null, 200);
}

`

I am getting the following error:

ffmpeg failed to execute command "C:/FFmpeg/bin/ffmpeg.exe" -y -i C:\xampp\htdocs\codetube\storage\app\uploads\15a40296629413.mp4 -threads 12 -vcodec libx264 -acodec libfaac -b:v 1000k -refs 6 -coder 1 -sc_threshold 40 -flags +loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -vf "[in]scale=640:480 [out]" -pass 1 -passlogfile "C:\Users\Rohit\AppData\Local\Temp\ffmpeg-passes5a4042ad8cd3ewsp9v/pass-5a4042ad8d8e9" C:\xampp\htdocs\codetube\storage\app\15a40296629413.mkv

And also,
` (2/2) RuntimeException

 Encoding failed`

Note that the commented code isn't working as well.

My main aim is to encode the videos and export them to s3 on the fly. I have tried a lot please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions