Convert2MKV - New Options; New Hardware Logic! - WIP [UPDATED 27/01/19]

@ntrevena said:
Bump for update

bump back. I thought I was waiting for you to give an update to the script… you nominated me? Can I claim I “didn’t get the memo” ? =))

@ChuckPa said:
bump back. I thought I was waiting for you to give an update to the script… you nominated me? Can I claim I “didn’t get the memo” ? =))

Haha! No no, I just updated the script with a minor change to correct an error. I bumped the thread to let people know I had resolved an issue. :slight_smile:

I’ll be working on the ffmpeg version in the coming week. I’m actually thinking that I might try and combine the two into a single script, using variables. It will take more time though.

I’ll keep working on it :slight_smile:

I really find this script idea pretty funny, when there are so many people running @cayars script for converting away from MKV to MP4… :slight_smile: And that there has been so much work being done on this script.

So many of Plex’s clients can now play MKV’s I suppose it’s time to take the idea full circle. For a while, there were very few that could, and they had even more constraints on them than the MP4’s have had.

That said, I haven’t got any input to the project, other than thanks for providing alternatives.

@MikeG6.5 said:
I really find this script idea pretty funny, when there are so many people running @cayars script for converting away from MKV to MP4… :slight_smile: And that there has been so much work being done on this script.

Oh nice! Can you post a link to it? It might give me a few ideas. One thing I want to add in the future, is the ability to choose your output (one of which will be MP4), so it might give me a few ideas :slight_smile:

So many of Plex’s clients can now play MKV’s I suppose it’s time to take the idea full circle. For a while, there were very few that could, and they had even more constraints on them than the MP4’s have had.

I hear ya. I was the same. I used to convert to MP4 when I had to do any transcoding as well. But these days, I love how MKV can essentially house the entire DVD/BluRay and it’s contents (multiple audio and video tracks, multiple subtitles, chapter marks etc), they’re even working on a way to store interactive menus :smiley:

I know that MP4 can handle most of these things, but it’s development has stagnated, and has a very static set of supported codecs. All of my devices support MKV, so I ran with it :slight_smile:

That said, I haven’t got any input to the project, other than thanks for providing alternatives.

No problem. I hope you might find it useful some day!

Cheers :slight_smile:

Update: Moved to GitLab

PM’d info to you about script. Link is in sig, BTW.

  • Added support for h264
  • Added support for h263
  • Added support for h265

Fix: h265 changed to copy, not convert

  • Support for x265 input and output
  • Support for mp4 container format output
  • Support for encoder presets
  • Support for audio sample rates

Current Updates

New Functionality

  • Ability to detect input FPS and output at same FPS (default action)
  • Ability for user to define FPS for all encoded videos
  • Ability to define crf and crf_max (Constant Rate Factor)
  • Added “-movflags +faststart” to output move more data to the beginning of the file (decrease stream loading delay)
  • Added “-tune film” to output to help preserve the video quality

New Requirements

  • exiftool - Ubuntu install command: apt-get install libimage-exiftool-perl

Fixes:

  • Removed forced FPS predefined in code
  • Cleaned up code for *nix compatability

I am getting these two errors, any idea?
/config/convert2mkv.sh: 28: /config/convert2mkv.sh: shopt: not found /config/convert2mkv.sh: 52: /config/convert2mkv.sh: Syntax error: "(" unexpected (expecting "fi")

@bjønness said:
I am getting these two errors, any idea?
/config/convert2mkv.sh: 28: /config/convert2mkv.sh: shopt: not found /config/convert2mkv.sh: 52: /config/convert2mkv.sh: Syntax error: "(" unexpected (expecting "fi")

Cool. Thanks. I’ll fix this error up tomorrow. 11pm here at the moment.

I’ll post here with the update as soon as it’s done :slight_smile:

Cheers for the post mate. Feedback is good!

@ntrevena said:

@bjønness said:
I am getting these two errors, any idea?
/config/convert2mkv.sh: 28: /config/convert2mkv.sh: shopt: not found /config/convert2mkv.sh: 52: /config/convert2mkv.sh: Syntax error: "(" unexpected (expecting "fi")

Cool. Thanks. I’ll fix this error up tomorrow. 11pm here at the moment.

I’ll post here with the update as soon as it’s done :slight_smile:

Cheers for the post mate. Feedback is good!

Thanks!
1:38PM here :wink:

Hey buddy, I’ve been going over your errors and my code. Can I ask for a little more information please?

@bjønness said:
`/config/convert2mkv.sh: 28: /config/convert2mkv.sh: shopt: not found

What operating system and version are you using? This error looks like a dash error, but the script is written for a bash environment.

@bjønness said:
/config/convert2mkv.sh: 52: /config/convert2mkv.sh: Syntax error: “(” unexpected (expecting “fi”)`

I have a feeling this might be related to the previous issue above, but can you post the output of the following commands for me?

avconv -version

uname -a

echo $SHELL

Thanks!

Found massive error. Script is unable to parse spaces in file names. Working on it.

@ntrevena said:
Hey buddy, I’ve been going over your errors and my code. Can I ask for a little more information please?

@bjønness said:
`/config/convert2mkv.sh: 28: /config/convert2mkv.sh: shopt: not found

What operating system and version are you using? This error looks like a dash error, but the script is written for a bash environment.

@bjønness said:
/config/convert2mkv.sh: 52: /config/convert2mkv.sh: Syntax error: “(” unexpected (expecting “fi”)`

I have a feeling this might be related to the previous issue above, but can you post the output of the following commands for me?

avconv -version

uname -a

echo $SHELL

Thanks!

Output below. I am running this script on ubuntu, in a docker that I am trying to make.
Link to docker if you want to take a look.
https://hub.docker.com/r/bjonness406/convert2mkv/~/dockerfile/

root@17e8f6980b89:/config# avconv -version ffmpeg version 2.8.8-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 root@17e8f6980b89:/config# uname -a Linux 17e8f6980b89 4.4.23-unRAID #1 SMP PREEMPT Sat Oct 1 13:41:00 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux root@17e8f6980b89:/config# echo $SHELL /bin/bash

@ntrevena said:
Found massive error. Script is unable to parse spaces in file names. Working on it.

Good that you found it :wink: But I don’t think that is my issue, since I don’t use space in the filename (yet :stuck_out_tongue: ).

@bjønness said:
Output below. I am running this script on ubuntu, in a docker that I am trying to make.
Link to docker if you want to take a look.
https://hub.docker.com/r/bjonness406/convert2mkv/~/dockerfile/
GitHub - bjonness406/Convert2MKV: A docker to convert your videos to mkv or mp4

Way cool :slight_smile:

`root@17e8f6980b89:/config# avconv -version
Good that you found it :wink: But I don’t think that is my issue, since I don’t use space in the filename (yet :stuck_out_tongue: ).

Ok. Still working on it. It’s taking longer than I thought. Handling naming in bash is a nightmare.You use “” Globs for variables in one place, and it screws it up in another. LOL

Just be sure, I am working on it. Will post as soon as I can.

PS. Thanks for the info, that’s helpful. Out of curiosity, you’re running the script on unRAID?

@ntrevena said:
Just be sure, I am working on it. Will post as soon as I can.

PS. Thanks for the info, that’s helpful. Out of curiosity, you’re running the script on unRAID?

Great!
Yep, running the script in a docker on Unraid. How did you know? B-)

@bjønness said:
Yep, running the script in a docker on Unraid. How did you know? B-)

Haha! I was sneaky :slight_smile:

uname -a Linux 17e8f6980b89 4.4.23-unRAID #1 SMP

I think I might have found more info about the shopt not found error. Apparently it’s to do with docker not running root with bash, not the script. You can find more info here about it: docker.bash file uses unknown command: have · Issue #1639 · moby/moby · GitHub

The other problem Syntax error: "(" unexpected (expecting "fi") could be related to that. Solve one, solve the other.

I’m still working on it this end though. Might pay to have a look :slight_smile:

Current Updates

Fixes:

  • Removed crf_max - not required
  • Removed dependance on exiftool - unreliable
  • Removed x265params - not required
  • Removed unneeded avconv options

New Functionality

  • Added ability to choose own filetypes to parse
  • Added added echo of current file name in case you want to log the output
  • Added sed for parsing FPS instead of exiftool

Changed output to include errors for troubleshooting.

exiftool is no longer required to run this script!