FAQ  •  Register  •  Login

Transcoding for iPhone

<<

Lowlander

DLNA master

Posts: 152

Joined: Wed Jun 16, 2010 12:01 pm

Location: Germany

Post Sun Jan 23, 2011 6:48 pm

Transcoding for iPhone

Hi there,

I try to create a working transcoding setup for the iPhone right now. Here's a short version of what we discussed in the Feature Request forum: The iPhone can on play AVC/AAC from an MP4 container natively, but there is an app called AirPlayer which brings some more codecs, and I thought I might give it a try and start with a profile that transcodes everything to a single target format.

I'm quite new to creating profiles, and there is a major flaw in this one:

[code]<Profile id="12" name="iPhone" extendsProfileId="1">
<Detection>
<User-Agent>Lavf52.54.0</User-Agent>
</Detection>
<MediaFormatProfiles>
<MediaFormatProfile mime-type="video/mpeg">MPEG_PS_PAL</MediaFormatProfile>
</MediaFormatProfiles>
<Transcoding>
<Video targetContainer="mpeg" targetACodec="aac" targetVCodec="mpeg2video" maxVBitrate="2048">
<Matches container="matroska" />
<Matches container="mp4" />
<Matches container="avi" />
<Matches container="mpegts" />
</Video>
</Transcoding>
</Profile>[/code]

According to the logs, the user-agent part actually works, the correct profile section is pulled, but the video never starts to play on the iPhone. I can see from the logs that a transcoding process ist started for each and every file in the directory I tried to play a file from, and every file is delivered to my device, and eventually skipped.

[code]2011-01-23 19:44:37,640 DEBUG [WebServer] Incoming connection from /10.240.11.244:51394
2011-01-23 19:44:37,640 DEBUG [ResourceTransportRequestHandler] GET /resource/46643/MEDIA_ITEM/MPEG_TS_SD_EU_ISO HTTP/1.1, headers = [User-Agent: Lavf52.54.0, Accept: */*, Range: bytes=0-, Host: 10.240.11.11:8895, Authorization: Basic, Connection: close, ]
2011-01-23 19:44:37,640 DEBUG [ResourceTransportRequestHandler] Resource request accepted. Using client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:37,640 DEBUG [ResourceTransportRequestHandler] Request for resource 46643 and type 'MEDIA_ITEM' received
2011-01-23 19:44:37,640 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 46643)
2011-01-23 19:44:37,640 DEBUG [VideoDAOImpl] Reading a Video (id = 46643)
2011-01-23 19:44:37,640 DEBUG [VideoDeliveryEngine] Delivering item '46643' for client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:37,640 DEBUG [VideoDeliveryEngine] Delivering file 'MSCM S02E01 - Mr. Teddybär (Mr Teddy Bear) 101208 ANFANG FEHLT(ts).ts' using transcoding
2011-01-23 19:44:37,640 DEBUG [VideoDeliveryEngine] Stopping previous transcoding job of file 'D:\TEMP\Serviio\transcoding-temp-46598-MPEG2PS.stf'
2011-01-23 19:44:37,640 DEBUG [VideoDeliveryEngine] Deleted temp file 'D:\TEMP\Serviio\transcoding-temp-46598-MPEG2PS.stf': true
2011-01-23 19:44:37,640 DEBUG [VideoDeliveryEngine] No suitable transcoding job exists yet, start one for client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:37,640 DEBUG [MediaItemDAOImpl] Getting file of media item 46643
2011-01-23 19:44:37,656 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode file: F:\daten\mm2\videos\Serien\MSCM S02E01 - Mr. Teddybär (Mr Teddy Bear) 101208 ANFANG FEHLT(ts).ts
2011-01-23 19:44:37,656 DEBUG [ProcessExecutor] Starting C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -threads 1 -i F:\daten\mm2\videos\Serien\MSCM S02E01 - Mr. Teddybär (Mr Teddy Bear) 101208 ANFANG FEHLT(ts).ts -y -vcodec copy -copyts -acodec aac -ab 192k -sn -f vob D:\TEMP\Serviio\transcoding-temp-46643-MPEG2PS.stf
2011-01-23 19:44:38,156 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file MSCM S02E01 - Mr. Teddybär (Mr Teddy Bear) 101208 ANFANG FEHLT(ts).ts: MPEG_PS_PAL
2011-01-23 19:44:38,156 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file MSCM S02E01 - Mr. Teddybär (Mr Teddy Bear) 101208 ANFANG FEHLT(ts).ts: MPEG_PS_NTSC
2011-01-23 19:44:38,156 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: No media description available for required version: MPEG_TS_SD_EU_ISO
2011-01-23 19:44:38,359 DEBUG [WebServer] Incoming connection from /10.240.11.244:51395
2011-01-23 19:44:38,359 DEBUG [ResourceTransportRequestHandler] GET /resource/46644/MEDIA_ITEM/MPEG_TS_SD_EU_ISO HTTP/1.1, headers = [User-Agent: Lavf52.54.0, Accept: */*, Range: bytes=0-, Host: 10.240.11.11:8895, Authorization: Basic, Connection: close, ]
2011-01-23 19:44:38,359 DEBUG [ResourceTransportRequestHandler] Resource request accepted. Using client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:38,359 DEBUG [ResourceTransportRequestHandler] Request for resource 46644 and type 'MEDIA_ITEM' received
2011-01-23 19:44:38,359 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 46644)
2011-01-23 19:44:38,359 DEBUG [VideoDAOImpl] Reading a Video (id = 46644)
2011-01-23 19:44:38,359 DEBUG [VideoDeliveryEngine] Delivering item '46644' for client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:38,359 DEBUG [VideoDeliveryEngine] Delivering file 'MSCM S02E02 - Treibstoff 23 (Propellant 23) 101209(ts).ts' using transcoding
2011-01-23 19:44:38,359 DEBUG [VideoDeliveryEngine] Stopping previous transcoding job of file 'D:\TEMP\Serviio\transcoding-temp-46643-MPEG2PS.stf'
2011-01-23 19:44:38,359 DEBUG [ProcessExecutor] Stopping external process: Thread[Thread-32,5,main]
2011-01-23 19:44:38,359 DEBUG [TranscodingJobListener] Transcoding finished; successful: false
2011-01-23 19:44:38,359 DEBUG [VideoDeliveryEngine] Deleted temp file 'D:\TEMP\Serviio\transcoding-temp-46643-MPEG2PS.stf': true
2011-01-23 19:44:38,359 DEBUG [VideoDeliveryEngine] No suitable transcoding job exists yet, start one for client 'IPAddress=/10.240.11.244, Profile=iPhone'
2011-01-23 19:44:38,359 DEBUG [MediaItemDAOImpl] Getting file of media item 46644
2011-01-23 19:44:38,375 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode file: F:\daten\mm2\videos\Serien\MSCM S02E02 - Treibstoff 23 (Propellant 23) 101209(ts).ts
2011-01-23 19:44:38,375 DEBUG [ProcessExecutor] Starting C:\Program Files (x86)\Serviio\bin\\..\lib/ffmpeg.exe -threads 1 -i F:\daten\mm2\videos\Serien\MSCM S02E02 - Treibstoff 23 (Propellant 23) 101209(ts).ts -y -vcodec copy -copyts -acodec aac -ab 192k -sn -f vob D:\TEMP\Serviio\transcoding-temp-46644-MPEG2PS.stf
2011-01-23 19:44:38,875 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file MSCM S02E02 - Treibstoff 23 (Propellant 23) 101209(ts).ts: MPEG_PS_PAL
2011-01-23 19:44:38,875 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file MSCM S02E02 - Treibstoff 23 (Propellant 23) 101209(ts).ts: MPEG_PS_NTSC
2011-01-23 19:44:38,875 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: No media description available for required version: MPEG_TS_SD_EU_ISO
2011-01-23 19:44:39,078 DEBUG [WebServer] Incoming connection from /10.240.11.244:51396 [/code]

And so on. Is there any hint of what's going wrong here? It DOES play MPEG2PS files (*.mpg), though, if a bit jerky. Yes, I can see the "No media description available for required version: MPEG_TS_SD_EU_ISO" in the logs, but haven't got a clue what to do about it.

Sorry, I'm stuck,
Low
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Jan 23, 2011 6:52 pm

Re: Transcoding for iPhone

try removing:

  Code:
<MediaFormatProfiles>
<MediaFormatProfile mime-type="video/mpeg">MPEG_PS_PAL</MediaFormatProfile>
</MediaFormatProfiles>
<<

Lowlander

DLNA master

Posts: 152

Joined: Wed Jun 16, 2010 12:01 pm

Location: Germany

Post Mon Jan 24, 2011 12:58 pm

Re: Transcoding for iPhone

zip,

without this line it won't play anything at all. I installed 0.5 (congrats, awesome improvements!!!) and gave the generic profile a try. Now the iPhone plays most of my files. But it's far from smooth and there are massive sync issues, too.

There is a support page http://olimsoft.wordpress.com/2010/07/20/airplayer-dlnaupnp-client-for-iphoneipodipad/#comments, which is rather a lengthy blog than a structured source of information. But we learn that AirPlayer uses Apple's native QT playback für mp4, m4v and mov up to 720p. For all other formats there is a restriction to 800x600 tops, which means we should be fine with DVD stuff, but still most videos are jerky and out of sync.

Hmmm, as we can't resize, there's not much we can do about this, can we?

Are there any plans to implement AVC/AAC/MP4 compliant transcoding? I think that there are quite a few mobile devices out there which have problems with anything else.

CU,
Low
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jan 24, 2011 1:26 pm

Re: Transcoding for iPhone

mp4/mov is not a transcoding-friendly container, so cannot use that.
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Wed Feb 02, 2011 6:04 pm

Re: Transcoding for iPhone

Having also been at pains to research this problem with the mp4 container design, it really looks like being a situation that won't change. See here for some further reading. I guess Apple are unlikely to care and allow mpeg-ts because they have a vested interest in selling you the same movie again, rather than letting you stream a copy of one you have already bought. Without mp4 airplayer most likely loses access to the hardware decoder and then you'd be cooking the CPU and the battery to play even a low quality video.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 19 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.