Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inputOptions in ffmpeg plugins #3846

Closed
meredith2u opened this issue Mar 8, 2021 · 2 comments · Fixed by #3917
Closed

Support inputOptions in ffmpeg plugins #3846

meredith2u opened this issue Mar 8, 2021 · 2 comments · Fixed by #3917
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Component: Transcoding Type: Feature Request ✨

Comments

@meredith2u
Copy link

meredith2u commented Mar 8, 2021

PeerTube v3.1.0-rc.1

Describe the problem to be solved
I'm trying to transcoding vp9+opus or vp9+flac in one video, but peertube default not use -strict experimental, it's cause error exception on ffmpeg v4.2.x

Describe the solution you would like:
Add -strict experimental when peertube make m3u8 file command.

@rigelk
Copy link
Collaborator

rigelk commented Mar 8, 2021

hi @meredith2u,

Could you show us your custom transcoding profile definition? Could you show us your error? Could you explain why adding -strict experimental would solve your problem?


Per our deps documentation:

only LTS versions of external dependencies are supported. If no LTS version matching the version constraint is available, only release versions are supported.

Ffmpeg's latest release is 4.3.2. Please upgrade first.

@rigelk rigelk changed the title FFmpeg add -strict experimental command in hls coverter FFmpeg error for custom profile vp9+opus/flac Mar 8, 2021
@rigelk rigelk added Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Question labels Mar 8, 2021
@meredith2u
Copy link
Author

meredith2u commented Mar 8, 2021

hi @meredith2u,

Could you show us your custom transcoding profile definition? Could you show us your error? Could you explain why adding -strict experimental would solve your problem?

Per our deps documentation:

only LTS versions of external dependencies are supported. If no LTS version matching the version constraint is available, only release versions are supported.

Ffmpeg's latest release is 4.3.2. Please upgrade first.

In FFmpeg 4.2.x transcoding opus into mp4 format required command -strict experimental
So, I add command in config, then FFmpeg success doing transcoding job, then peertube next step is make m3u8, in that time, FFmpeg showing error message, I think that peertube when make m3u8 command may not include -strict experimental.

In FFmpeg 4.3.x transcoding flac into mp4 format will showing same type of exception.

error[2021/3/8 下午8:30:59] Error in ffmpeg.
{
  "stdout": "",
  "stderr": "ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers\n  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)\n  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\n  libavutil      56. 31.100 / 56. 31.100\n  libavcodec     58. 54.100 / 58. 54.100\n  libavformat    58. 29.100 / 58. 29.100\n  libavdevice    58.  8.100 / 58.  8.100\n  libavfilter     7. 57.100 /  7. 57.100\n  libavresample   4.  0.  0 /  4.  0.  0\n  libswscale      5.  5.100 /  5.  5.100\n  libswresample   3.  5.100 /  3.  5.100\n  libpostproc    55.  5.100 / 55.  5.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/peertube/storage/videos/ded8f107-6ebc-4868-9f60-cf7e01e854fb-1080.mp4':\n  Metadata:\n    major_brand     : isom\n    minor_version   : 512\n    compatible_brands: isomiso2mp41\n    encoder         : Lavf58.29.100\n  Duration: 00:00:20.36, start: 0.000000, bitrate: 3529 kb/s\n    Stream #0:0(und): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, progressive), 1920x1080, 3387 kb/s, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 15360 tbn, 15360 tbc (default)\n    Metadata:\n      handler_name    : VideoHandler\n    Stream #0:1(und): Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, fltp, 133 kb/s (default)\n    Metadata:\n      handler_name    : SoundHandler\n[hls @ 0x555cefa916c0] Opening '/var/www/peertube/storage/tmp/hls/ded8f107-6ebc-4868-9f60-cf7e01e854fb-1080-fragmented.mp4' for writing\n[mp4 @ 0x555cefacb740] track 1: codec frame size is not set\n[mp4 @ 0x555cefacb740] opus in MP4 support is experimental, add '-strict -2' if you want to use it.\nCould not write header for output file #0 (incorrect codec parameters ?): Experimental feature\nStream mapping:\n  Stream #0:0 -> #0:0 (copy)\n  Stream #0:1 -> #0:1 (copy)\n    Last message repeated 1 times\n"
}
error[2021/3/8 下午8:30:59] Cannot execute job 133 in queue video-transcoding.
{
  "payload": {
    "type": "new-resolution-to-hls",
    "videoUUID": "ded8f107-6ebc-4868-9f60-cf7e01e854fb",
    "resolution": 1080,
    "isPortraitMode": false,
    "copyCodecs": true,
    "isMaxQuality": true
  },
  "err": {
    "stack": "Error: ffmpeg exited with code 1: \n    at ChildProcess.<anonymous> (/var/www/peertube/versions/peertube-v3.1.0-rc.1/node_modules/fluent-ffmpeg/lib/processor.js:182:22)\n    at ChildProcess.emit (node:events:378:20)\n    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)",
    "message": "ffmpeg exited with code 1: "
  }
}
error[2021/3/8 下午9:46:56] Error in ffmpeg.
{
  "stdout": "",
  "stderr": "ffmpeg version 4.3.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers\n  built with gcc 8 (Debian 8.3.0-6)\n  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg\n  libavutil      56. 51.100 / 56. 51.100\n  libavcodec     58. 91.100 / 58. 91.100\n  libavformat    58. 45.100 / 58. 45.100\n  libavdevice    58. 10.100 / 58. 10.100\n  libavfilter     7. 85.100 /  7. 85.100\n  libswscale      5.  7.100 /  5.  7.100\n  libswresample   3.  7.100 /  3.  7.100\n  libpostproc    55.  7.100 / 55.  7.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/peertube/storage/videos/c79bba7c-aaf2-4d81-a518-fcd59dab9920-1080.mp4':\n  Metadata:\n    major_brand     : isom\n    minor_version   : 512\n    compatible_brands: isomiso2mp41\n    encoder         : Lavf58.45.100\n  Duration: 00:00:20.36, start: 0.000000, bitrate: 4615 kb/s\n    Stream #0:0(und): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, progressive), 1920x1080, 3387 kb/s, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 15360 tbn, 15360 tbc (default)\n    Metadata:\n      handler_name    : VideoHandler\n    Stream #0:1(und): Audio: flac (fLaC / 0x43614C66), 44100 Hz, stereo, s32 (24 bit), 1224 kb/s (default)\n    Metadata:\n      handler_name    : SoundHandler\n[hls @ 0x6ec3180] Opening '/var/www/peertube/storage/tmp/hls/c79bba7c-aaf2-4d81-a518-fcd59dab9920-1080-fragmented.mp4' for writing\n[mp4 @ 0x6ed2dc0] track 1: codec frame size is not set\n[mp4 @ 0x6ed2dc0] flac in MP4 support is experimental, add '-strict -2' if you want to use it.\nCould not write header for output file #0 (incorrect codec parameters ?): Experimental feature\nStream mapping:\n  Stream #0:0 -> #0:0 (copy)\n  Stream #0:1 -> #0:1 (copy)\n    Last message repeated 1 times\n"
}
error[2021/3/8 下午9:46:56] Cannot execute job 156 in queue video-transcoding.
{
  "payload": {
    "type": "new-resolution-to-hls",
    "videoUUID": "c79bba7c-aaf2-4d81-a518-fcd59dab9920",
    "resolution": 1080,
    "isPortraitMode": false,
    "copyCodecs": true,
    "isMaxQuality": true
  },
  "err": {
    "stack": "Error: ffmpeg exited with code 1: \n    at ChildProcess.<anonymous> (/var/www/peertube/versions/peertube-v3.1.0-rc.1/node_modules/fluent-ffmpeg/lib/processor.js:182:22)\n    at ChildProcess.emit (node:events:378:20)\n    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)",
    "message": "ffmpeg exited with code 1: "
  }
}

Here is my config
FFmpeg 4.2.x
Transcoding profiles

{
  "vod": [
    {
      "encoderName": "libopus",
      "profileName": "vp9",
      "outputOptions": ["-b:a 160k", "-strict -2"]
    },
    {
      "encoderName": "libvpx-vp9",
      "profileName": "vp9",
      "outputOptions": ["-crf 42", "-b:v 4500k", "-tile-columns 2", "-tile-rows 2", "-cpu-used 3", "-row-mt 1", "-g 999"]
    }
  ],

  "live": []
}

FFmpeg 4.3.x
Transcoding profiles

{
  "vod": [
    {
      "encoderName": "flac",
      "profileName": "vp9",
      "outputOptions": ["-compression_level 12", "-strict -2"]
    },
    {
      "encoderName": "libvpx-vp9",
      "profileName": "vp9",
      "outputOptions": ["-crf 42", "-b:v 4500k", "-tile-columns 2", "-tile-rows 2", "-cpu-used 3", "-row-mt 1", "-g 999"]
    }
  ],

  "live": []
}

@Chocobozzz Chocobozzz changed the title FFmpeg error for custom profile vp9+opus/flac Support inputOptions in ffmpeg plugins Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Component: Transcoding Type: Feature Request ✨
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants