DS214play, Apple TV and DTS: my solution

Discussion room for Video Station package
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
bobic
I'm New!
I'm New!
Posts: 4
Joined: Thu May 15, 2014 1:03 pm

Re: DS214play, Apple TV and DTS: my solution

Postby bobic » Sat Jul 19, 2014 9:51 am

Guys, any chance to have this script working on DS414? There are some issues with the ffmpeg and ffprobe packages, from what I understand.
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Sat Jul 19, 2014 10:32 am

bobic wrote:Guys, any chance to have this script working on DS414? There are some issues with the ffmpeg and ffprobe packages, from what I understand.


If you could find an ffmpeg/ffprobe built for your cpu, the script should work. if you find it, let us know here... :wink:
zaiclopz
I'm New!
I'm New!
Posts: 3
Joined: Wed Jul 23, 2014 9:50 am

Re: DS214play, Apple TV and DTS: my solution

Postby zaiclopz » Wed Jul 23, 2014 9:51 am

Hello, could any of you write a step-by-stem instalation of the script?
jrlepage
I'm New!
I'm New!
Posts: 1
Joined: Thu Jul 31, 2014 1:40 pm

Re: DS214play, Apple TV and DTS: my solution

Postby jrlepage » Thu Jul 31, 2014 1:56 pm

Hello, I just ordered a DS214Play and after some research, realized that the on-the-fly transcoding may not accomplish what I want:

I wanted to be able to browse for videos to download using the DS Download app on iOS, then immediately serve those videos up to my Apple TV3 from the NAS without any converting, and without going to my computer or even having it turned on. I don't especially care whether the video is 720p or 1080p.

The more I read, it seems like this goal may be difficult to accomplish. I don't mind using AirPlay as part of the process, and using the iOS device as a remote to select what video to stream. I've considered DS Video, Plex, or even iOS apps that transcode on the fly and output via AirPlay like VLC or AirPlayer.

My question is: Can I modify your script in a way to better suit my needs, and does anyone know what combination of DSM software and iOS apps I would need to do this? Ideally, I'd like it to work no matter what format video I download, including subtitle support if possible, and I'd like it to detect the newly downloaded file as soon as it finishes download. The part of my workflow I'm trying to eliminate is the part after downloading a movie when I have to sit down at the computer and fiddle with Handbrake or another conversion application, etc.

Thank you for any suggestions that might help me achieve my goal!
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Mon Aug 04, 2014 4:18 pm

Hi jrlepage

Yeah that was pretty much my wish too, but the limited codec support on Apple devices and no DTS support on Synology makes it almost impossible. :?

But I'm pretty happy with what I have now since I recently updated my script (I still need to update my first post with the new version of the script):

-it converts any MKV to MP4 (+converting DTS). This means, playable and downloadable on Apple devices.
-it runs nightly using the Synology task manager
-before running the script, I run Subliminal to download subtitles. This needs to be done with the MKV file still present (no subtitles are found once the MKV is converted to MP4).

I was also checking if I could run all this whenever a download would finish instead of nightly, but that doesn't seem so simple, so I didn't investigate further.

Feel free to change my script anyway you want.
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Wed Aug 06, 2014 10:29 pm

I'm pretty excited, I was able to play an MKV with DTS sound without preprocessing :D

How:
Install a patched FFMPEG from https://www.dropbox.com/s/g02eelw6vwfjf ... 0-0005.spk
(all courtesy to the guy who compiled FFMPEG with HW transcoding support!)

this plays DTS as stereo to the apple tv.

So I changed the transcoding profile: in /volume1/@appstore/VideoStation/etc/TransProfile

Change the following line as root

Code: Select all

        mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb -acodec libmp3lame -ab 256k -ac 2 -f ssegment

into

Code: Select all

        mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb -c:a ac3 -b:a 640k -f ssegment



This seems to do the trick. This needs more testing, it already seems to break playback on the iPad (which doesnt accept AC3).
CORRECTION 19/2/2015: playback on iPhone/iPad seems to be working when choosing any streaming quality besides "auto" in the app. I guess another transcode profile is used in that case.
Last edited by jeppo77 on Wed Jul 22, 2015 3:13 pm, edited 3 times in total.
bxz
I'm New!
I'm New!
Posts: 3
Joined: Tue Aug 05, 2014 6:28 pm

Re: DS214play, Apple TV and DTS: my solution

Postby bxz » Sat Aug 09, 2014 4:06 am

How do you install the patched ffmpeg spk on the nas?


jeppo77 wrote:I'm pretty excited, I was able to play an MKV with DTS sound without preprocessing :D

How:
Install a patched FFMPEG from https://www.dropbox.com/s/g02eelw6vwfjf ... 0-0005.spk
(all courtesy to the guy who compiled FFMPEG with HW transcoding support!)

this plays DTS as stereo to the apple tv.

So I changed the transcoding profile: in /volume1/@appstore/VideoStation/etc/TransProfile

Change the following line as root

Code: Select all

        mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb -acodec libmp3lame -ab 256k -ac 2 -f ssegment

into

Code: Select all

        mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb -c:a ac3 -b:a 640k -f ssegment



This seems to do the trick. This needs more testing, it already seems to break playback on the iPad (which doesnt accept AC3).
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Sat Aug 09, 2014 9:51 am

bxz wrote:How do you install the patched ffmpeg spk on the nas?


Point 2.3 in
https://www.synology.com/en-uk/support/tutorials/500
Logicus
I'm New!
I'm New!
Posts: 1
Joined: Mon May 07, 2012 4:22 pm

Re: DS214play, Apple TV and DTS: my solution

Postby Logicus » Sun Aug 10, 2014 3:46 am

Cool script, thanks for this! Only downfall seems to be it does not check all audio streams in file. If first stream is DTS it will create AAC stream as new first stream and insert DTS as second stream, but if more audio streams are present you will loose them. I haven't tested with multiple video streams/multiple sub streams (or other MKV streams). Would be nice is all source streams would be remained and only aac audio stream was added.

I will try to meet this goal, try to beat me :)
oRBIT
Ace
Ace
Posts: 776
Joined: Tue Oct 18, 2011 2:17 pm
Location: Gothenburg, Sweden

Re: DS214play, Apple TV and DTS: my solution

Postby oRBIT » Mon Aug 11, 2014 8:49 pm

A DSM app with GUI for this purpose would be awesome, instead of dealing with scripts (which is not for mortals like myself :)).
Anyone up for the task? :)
DS718+ (10GB RAM, 2x3TB WD RED WD30EFRX-68EUZN0)

My Synology blog: http://synofan.blogspot.se
KumanduS
Trainee
Trainee
Posts: 11
Joined: Sat Aug 16, 2014 1:29 pm

Re: DS214play, Apple TV and DTS: my solution

Postby KumanduS » Sat Aug 16, 2014 1:54 pm

Hi,
I'm trying to change scripts jeppo77, Bjorn, s4nder according to my needs. I intend to convert mkv format to mp4 format and the video files must be compatible with iPhone and chromecast.
I have some questions / problems that I can not find solution, since it does not know anything about codecs and formats:


1 -
When i run my script with this settings:
#FFMPEG Setings
## Set default mapping settings:
mopts="-map 0"
## Set default subtitle settings:
sopts="-c:s copy"
## Set default video settings:
vopts="-c:v copy"
## Set default audio settings:
aopts="-c:a:1 aac -b:a 640k "
## Set extra settings:
eopts=" -strict -2"

....

$FFMPEG -nostdin -y -i "$f"-1 $mopts $sopts $vopts $aopts $eopts "${f%.mkv}${VIDEOOUTTYPE}"

i get the following messages:

Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default)
Stream #0:2(hun): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:3(eng): Subtitle: subrip (default)
Stream #0:4(fre): Subtitle: subrip
Stream #0:5(ger): Subtitle: subrip
Stream #0:6(hun): Subtitle: subrip
Stream #0:7(rum): Subtitle: subrip
Stream #0:8(spa): Subtitle: subrip
[libvo_aacenc @ 0x9cc1e20] Unable to set encoding parameters

and
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (dts (dca) -> aac (libvo_aacenc))
Stream #0:2 -> #0:2 (ac3 (native) -> aac (aac))
Stream #0:3 -> #0:3 (copy)
Stream #0:4 -> #0:4 (copy)
Stream #0:5 -> #0:5 (copy)
Stream #0:6 -> #0:6 (copy)
Stream #0:7 -> #0:7 (copy)
Stream #0:8 -> #0:8 (copy)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

how do i fix this?

2- Will the patched FFMPEG:
mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb -c:a ac3 -b:a 640k -f ssegment
Work function with chromecast?

3- Is there a way to download subtitles by script calling for exemple Subliminal
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Mon Aug 18, 2014 2:39 pm

Hi Kumandu

1) I guess a bitrate of 640k might be too high for AAC. try for example 128k

2) I don't have experience with chomecast, can't help you.

3) actually in my private version of my script I'm calling subliminal to get subtitles for every movie I convert (see subliminal CLI). So yes, it's possible. See the latest version of the script which I uploaded. There you can uncomment 2 lines to enable subliminal
Last edited by jeppo77 on Tue Aug 19, 2014 12:31 pm, edited 1 time in total.
jeppo77
Beginner
Beginner
Posts: 28
Joined: Mon Feb 17, 2014 11:37 am

Re: DS214play, Apple TV and DTS: my solution

Postby jeppo77 » Mon Aug 18, 2014 2:56 pm

I recently made some improvements to the whole "conversion" process:

-My conversion starts as soon as download station finishes a download. Hints on how to do that are here:
https://github.com/clinton-hall/nzbToMe ... ad-Station

-Once a conversion is done, I'm notified with email. Hints on how to do that are here:
http://www.beatificabytes.be/wordpress/ ... -synology/

8)
KumanduS
Trainee
Trainee
Posts: 11
Joined: Sat Aug 16, 2014 1:29 pm

Re: DS214play, Apple TV and DTS: my solution

Postby KumanduS » Tue Aug 19, 2014 2:38 pm

Woww jeppo77 thanks for your help.
I just bought my first synology a month ago and I was trying to develop a script that processes directories and files that could be called alone or by events sent by the download statiton. The script would separate the directories and files into categories (movies, books, audio) and in the case of video files would convert them in order to be read by chromecast and still get the subtitles for each file. Apparently this can all be done through nzbToMedia (since they use ffmpeg). Thank you for point me in the rigth way.
I can find:
SickBeard
CouchPotato
HeadPhones
Mylar
in https://synocommunity.com/packages do you now where can i get the packages for the Gamez and nzbToMedia?
outatime
I'm New!
I'm New!
Posts: 2
Joined: Fri Sep 09, 2011 9:00 pm

Re: DS214play, Apple TV and DTS: my solution

Postby outatime » Wed Aug 20, 2014 2:08 am

hi guys,

what about that ??

http://www.chiphell.com/thread-1096072-1-1.html

probably you must translate the site ^^ but im using in my DS415play with DSM DSM 5.0-4493 Update 3 and works fine ...

Return to “Video Station”

Who is online

Users browsing this forum: No registered users and 1 guest