Jump to content


Photo

24p video being terribly and unnecessarily transcoded

24p transcode android firetv

  • Please log in to reply
9 replies to this topic

#1 wintrmute OFFLINE  

wintrmute

    Newbie

  • Members
  • 5 posts
  • Local time: 02:16 AM

Posted 07 December 2016 - 08:57 PM

I was doing an (unrelated) test of 24p content on my television, via a number of apps, plus via a laptop and on the TV's own media player.

In the process I discovered that Emby was showing an extremely-degraded image compared to everything else!

 

It appeared to be transcoding the source video, and really screwing it up in the process.

 

Have a look at this photo of the screen:

http://s378.photobuc...slmofj.jpg.html

 

From there, click the link back to the album that its part of, and look at the other photos. (Ignore the ones testing motion interpolation)

 

See how in the Emby photo, my "/u/wint_rmute" signature is all blurred? And how the rectangles have gained dark borders? And that the pattern of rectangles is uneven?

What's going on with this?

 

The source video is 1080p 24Hz x264 and everything else can play it directly.



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137760 posts
  • Local time: 10:16 AM

Posted 07 December 2016 - 10:00 PM

Hi there @winrtmute, we're sorry to hear about this. In order for us to best help you resolve this, please provide the information requested in how to report a media playback issue. thanks !



#3 wintrmute OFFLINE  

wintrmute

    Newbie

  • Members
  • 5 posts
  • Local time: 02:16 AM

Posted 07 December 2016 - 11:08 PM

Hi Luke, here are the relevant server logs.

It confirms a couple of things.

1) "No direct play profiles found"

2) transcoding was used.

 

You can get a copy of the file I was playing here: https://www.dropbox....judder_test.mp4

2016-12-07 18:48:52.0580 Info HttpServer: HTTP POST http://10.23.1.1:8096/emby/Items/a52bc32e50f87f55f9b692c2e1db8a72/PlaybackInfo?format=json. UserAgent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; AFTS Build/LVY48F)
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.0657 Info App: Profile: Android-VLC, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.0669 Info HttpServer: HTTP Response 200 to 10.23.1.11. Time: 9ms. http://10.23.1.1:8096/emby/Items/a52bc32e50f87f55f9b692c2e1db8a72/PlaybackInfo?format=json
2016-12-07 18:48:52.1499 Info HttpServer: HTTP POST http://10.23.1.1:8096/emby/Items/a52bc32e50f87f55f9b692c2e1db8a72/PlaybackInfo?format=json. UserAgent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; AFTS Build/LVY48F)
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, Path: /filestore/media/Other Videos/24fps_judder_test.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
2016-12-07 18:48:52.1592 Info App: Profile: Android-Exo, No direct play profiles found for Path: /filestore/media/Other Videos/24fps_judder_test.mp4
2016-12-07 18:48:52.1608 Info HttpServer: HTTP Response 200 to 10.23.1.11. Time: 11ms. http://10.23.1.1:8096/emby/Items/a52bc32e50f87f55f9b692c2e1db8a72/PlaybackInfo?format=json
2016-12-07 18:48:52.2101 Info HttpServer: HTTP GET http://10.23.1.1:8096/emby/videos/a52bc32e50f87f55f9b692c2e1db8a72/stream.mkv?DeviceId=c5fc47582dc49907&MediaSourceId=a52bc32e50f87f55f9b692c2e1db8a72&VideoCodec=h264&AudioCodec=ac3,aac,mp3&VideoBitrate=70137670&AudioBitrate=192000&MaxAudioChannels=6&MaxFramerate=60&Level=51&Profile=high&PlaySessionId=6e3c9dd72f5b409a99a8ac0d53d7afe4&CopyTimestamps=true&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=671cfa071a92407153340c6258803622&EnableSplittingOnNonKeyFrames=false&RequireAvc=false. UserAgent: EMVideoView 2.5.6 (25600) / Android 5.1.1 / AFTS
2016-12-07 18:48:52.2189 Info HttpServer: HTTP POST http://10.23.1.1:8096/emby/Sessions/Playing. UserAgent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; AFTS Build/LVY48F)
2016-12-07 18:48:52.2213 Info App: /usr/bin/ffmpeg -fflags +genpts -i file:"/filestore/media/Other Videos/24fps_judder_test.mp4" -map 0:0 -map -0:a -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,426)/2)*2:trunc(ow/dar/2)*2" -copyts -avoid_negative_ts disabled -start_at_zero -pix_fmt yuv420p -preset superfast -crf 23 -tune zerolatency -b:v 46410 -maxrate 46410 -bufsize 92820 -vsync -1 -profile:v high -level 4.1 -map_metadata -1 -threads 0  -y "/home/emby/transcoding-temp/e1e93d16c47f502b700fb9171ae98362.mkv"
2016-12-07 18:48:52.2566 Info HttpServer: HTTP Response 204 to 10.23.1.11. Time: 38ms. http://10.23.1.1:8096/emby/Sessions/Playing
2016-12-07 18:48:53.3549 Info HttpServer: HTTP GET http://10.23.1.1:8096/emby/videos/a52bc32e50f87f55f9b692c2e1db8a72/stream.mkv?DeviceId=c5fc47582dc49907&MediaSourceId=a52bc32e50f87f55f9b692c2e1db8a72&VideoCodec=h264&AudioCodec=ac3,aac,mp3&VideoBitrate=70137670&AudioBitrate=192000&MaxAudioChannels=6&MaxFramerate=60&Level=51&Profile=high&PlaySessionId=6e3c9dd72f5b409a99a8ac0d53d7afe4&CopyTimestamps=true&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=671cfa071a92407153340c6258803622&EnableSplittingOnNonKeyFrames=false&RequireAvc=false. UserAgent: EMVideoView 2.5.6 (25600) / Android 5.1.1 / AFTS


#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137760 posts
  • Local time: 10:16 AM

Posted 07 December 2016 - 11:15 PM

Can you please attach the ffmpeg log as well? Thanks.

#5 wintrmute OFFLINE  

wintrmute

    Newbie

  • Members
  • 5 posts
  • Local time: 02:16 AM

Posted 07 December 2016 - 11:48 PM

Apologies. ffmpeg log attached.

 

Note that I think the flaw is that transcoding was being done at all, rather than the nature of the transcoding.

That said -- the transcoded quality was terrible.

 

I note from the logs that ffmpeg is using crf=23 and preset=superfast.

 

My original video was encoded with crf=18 and profile=medium. It's just flickering grey squares (to test whether 3:2 pulldown is applied), so maybe ffmpeg is just particularly poor at encoding it well on the superfast preset level? I've adjusted emby server to use 'fast' instead, and crf=18, and will see how that looks.

 

 

But.. I don't think it should have been transcoded at all. It's an Amazon Fire TV 2.. it supports x264 pretty well.

 

Thanks for looking at my report!

Attached Files


Edited by wintrmute, 08 December 2016 - 12:09 AM.


#6 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 46949 posts
  • Local time: 10:16 AM

Posted 08 December 2016 - 12:04 AM

If it is the non-beta version of the app, this is probably why it transcoded:

"RefFrames":10


#7 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137760 posts
  • Local time: 10:16 AM

Posted 08 December 2016 - 12:05 AM

The transcoding quality was terrible due to the very low content bitrate. We don't increase bitrate when we re-encode, so having to re-encode a 47kb bitrate source will generally not turn out too well.

 

I'm looking into why it's transcoding in the first place though.



#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137760 posts
  • Local time: 10:16 AM

Posted 08 December 2016 - 12:05 AM

Ah yes, good catch. The high number of ref frames. We have removed this limitation in the beta version.



#9 wintrmute OFFLINE  

wintrmute

    Newbie

  • Members
  • 5 posts
  • Local time: 02:16 AM

Posted 08 December 2016 - 12:28 AM

You're a genius for figuring that out!

I'm surprised the ref frames are so high as well; turns out that x264 doubles the number of them when you select the animation tune, taking it from 5 to 10 on the 'slow' preset.

I thought the -profile high should have constrained it to 4 though, but.. I guess not.

I'll update my encoding script.

# Original ffmpeg line to encode judder video:
ffmpeg -framerate 24000/1001 -i frame%04d.png \ 
   -crf 18 -c:v libx264 -r 24000/1001 -pix_fmt yuv420p -tune animation -profile:v high \
   -preset slow out.mp4

Edited by wintrmute, 08 December 2016 - 12:29 AM.


#10 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137760 posts
  • Local time: 10:16 AM

Posted 08 December 2016 - 01:49 AM

@wintrmute thanks for confirming !







Also tagged with one or more of these keywords: 24p, transcode, android, firetv

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users