quasarstream / PHP-FFmpeg-video-streaming

📼 Package media content for online streaming(DASH and HLS) using FFmpeg

Home Page:https://www.quasarstream.com/op/php/ffmpeg-streaming?u=php-ff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add Stream To File for hardware conversion

adis0308 opened this issue · comments

Describe the bug
I want to add a hardware conversion to convert hls / mpd to mp4. I want to use the h264_nvenc video codec for an NVIDIA GPU. Here is the php code that I use.
$ff = \Streaming\FFMpeg::create($config, $log); $video = $ff->open('https://bitmovin-a.akamaihd.net/content/MI20192708/master.m3u8'); $format = new \Streaming\Format\x264('h264_nvenc'); $format->setInitialParameters(array('-vsync', 0, '-hwaccel', 'cuda')); $convert = $video->stream2file()->setFormat($format)->save('test.mp4');

I got the following FFMpeg running command.
ffmpeg.exe -y -i "https://bitmovin-a.akamaihd.net/content/MI20192708/master.m3u8" -c:v libx264 -c:a aac -bf 1 -keyint_min 25 -g 250 -sc_threshold 40 -threads 6 test.mp4

Expected behavior
The FFMpeg running command I expected.
ffmpeg.exe -vsync 0 -hwaccel cuda -y -i "https://bitmovin-a.akamaihd.net/content/MI20192708/master.m3u8" -c:v h264_nvenc -c:a aac -bf 1 -keyint_min 25 -g 250 -sc_threshold 40 -threads 6 test.mp4

Desktop/Server (please complete the following information):

  • Windows 10
  • FFmpeg 4.4