Project

General

Profile

Bug #4628

Transcoding aspect ratio - 4.3 Version

Added by Carmelo Milazzo about 7 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
Transcoding
Target version:
-
Start date:
2017-09-25
Due date:
% Done:

100%

Estimated time:
Found in version:
since 4.3 488
Affected Versions:

Description

Only in unstable 4.3 since 488 (for sure) Inputing like stream an SD channel (720x576) the encoding modifies original aspect ratio reducing height and increasing lenght. Any kind of transcoding profile used


Files

07C15093-F163-442B-8489-9C5B103E8F64.png (4.18 MB) 07C15093-F163-442B-8489-9C5B103E8F64.png rpluto ., 2017-09-27 01:24
stream-atv2.mkv (15.2 MB) stream-atv2.mkv rpluto ., 2017-09-27 22:30
5A4F517E-D17D-454C-B3E5-DC197969A495.jpeg (331 KB) 5A4F517E-D17D-454C-B3E5-DC197969A495.jpeg rpluto ., 2017-09-27 22:31
BA8FA5EC-29F6-4179-B0F8-E14A75CF2628.jpeg (357 KB) BA8FA5EC-29F6-4179-B0F8-E14A75CF2628.jpeg rpluto ., 2017-09-27 22:31
Заснемане.PNG (48.5 KB) Заснемане.PNG saen acro, 2017-09-27 22:41
stream-atv2 (correct one).mkv (5.73 MB) stream-atv2 (correct one).mkv rpluto ., 2017-09-27 22:41
stream-atv2-mediainfo.txt (2.5 KB) stream-atv2-mediainfo.txt rpluto ., 2017-09-27 22:46
stream-atv2-mediainfo.txt (2.5 KB) stream-atv2-mediainfo.txt rpluto ., 2017-09-27 23:02
stream-atv2-mediainfo.txt (2.5 KB) stream-atv2-mediainfo.txt rpluto ., 2017-09-27 23:02
4D95F99E-2919-4523-804F-5D6F38F1C927.jpeg (329 KB) 4D95F99E-2919-4523-804F-5D6F38F1C927.jpeg rpluto ., 2017-09-27 23:02
stream-atv2.mp4 (7.39 MB) stream-atv2.mp4 rpluto ., 2017-09-27 23:03
Заснемане2.PNG (20.9 KB) Заснемане2.PNG saen acro, 2017-09-27 23:32
matroska.mkv (1.15 MB) matroska.mkv Nick Noone, 2017-10-11 00:56
mpegts.ts (1.04 MB) mpegts.ts Nick Noone, 2017-10-11 00:56
sd-mpeg2source-transcoded.png (795 KB) sd-mpeg2source-transcoded.png philip hewitt, 2017-11-29 21:37
hd-H264source-transcoded.png (1.32 MB) hd-H264source-transcoded.png philip hewitt, 2017-11-29 21:37
codec params.png (69.4 KB) codec params.png philip hewitt, 2017-11-29 21:40
profile params.png (73.1 KB) profile params.png philip hewitt, 2017-11-29 21:40
hd-H264source-original.png (1.72 MB) hd-H264source-original.png philip hewitt, 2017-11-29 21:47
sd-mpeg2source-original.png (2.27 MB) sd-mpeg2source-original.png philip hewitt, 2017-11-29 21:47

History

#1

Updated by saen acro about 7 years ago

DAR and SAR values of stream is continuous or there is a interlaced image?

#2

Updated by Carmelo Milazzo about 7 years ago

Of course DAR and SAR are continuous and happen not only with a stream but with every stream in that resolution i indicated 720x576 when transcoded with H264 in container mpegts/avlib

#3

Updated by saen acro about 7 years ago

Can you attach short record of PASS and TRANSCODED profiles?

#4

Updated by Carmelo Milazzo about 7 years ago

PASS non give any problem ... not change resolution problem is when is activated H264 transcoding ... tested any kind of preset (fast, ultrafast and so on) and just inputed a lower video rate... not changed nothing else.... this bug not happens in 4.2 with same settings...

#5

Updated by saen acro about 7 years ago

Attach 10sec record.

#6

Updated by Carmelo Milazzo about 7 years ago

later i put record.. anyway some additional info... running on ubuntu 16.04 and ubuntu 17.04 same effect... running matroska container appear correct aspect/ratio with same video and audio profiles...

#7

Updated by rpluto . about 7 years ago

I also have this behavior, in 4.3-500, i also Confirm Carmelo, matroska/avlib for me solve the aspect radio, but now in my player shows like this, please see the image attached

#8

Updated by saen acro about 7 years ago

Attach 10sec record
also settings used in transcoding

#10

Updated by rpluto . about 7 years ago

Correct file
Please ignore the other

#11

Updated by saen acro about 7 years ago

Rafael Silva wrote:

Here is goes

Thx

What exactly is problem with this video?

General
ID                             : 1 (0x1)
Complete name                  : C:\Users\Saen\Desktop\stream-atv2.mkv
Format                         : MPEG-TS
File size                      : 15.2 MiB
Duration                       : 14 s 600 ms
Overall bit rate mode          : Variable
Overall bit rate               : 8 684 kb/s
FileExtension_Invalid          : ts m2t m2s m4t m4s tmf ts tp trp ty

Video
ID                             : 256 (0x100)
Menu ID                        : 1 (0x1)
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L4
Format settings, CABAC         : Yes
Format settings, RefFrames     : 4 frames
Codec ID                       : 27
Duration                       : 14 s 720 ms
Bit rate                       : 7 802 kb/s
Width                          : 1 920 pixels
Height                         : 1 080 pixels
Display aspect ratio           : 16:9
Frame rate                     : 25.000 FPS
Standard                       : Component
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Interlaced
Scan type, store method        : Separated fields
Scan order                     : Top Field First
Bits/(Pixel*Frame)             : 0.151
Stream size                    : 13.7 MiB (90%)
Color range                    : Limited
Color primaries                : BT.709
Transfer characteristics       : BT.709
Matrix coefficients            : BT.709

Audio
ID                             : 257 (0x101)
Menu ID                        : 1 (0x1)
Format                         : AC-3
Format/Info                    : Audio Coding 3
Format settings, Endianness    : Big
Codec ID                       : 129
Duration                       : 15 s 904 ms
Bit rate mode                  : Constant
Bit rate                       : 448 kb/s
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 31.250 FPS (1536 SPF)
Bit depth                      : 16 bits
Compression mode               : Lossy
Delay relative to video        : -1 s 424 ms
Stream size                    : 870 KiB (6%)
Service kind                   : Complete Main

Menu
ID                             : 4096 (0x1000)
Menu ID                        : 1 (0x1)
Duration                       : 14 s 600 ms
List                           : 256 (0x100) (AVC) / 257 (0x101) (AC-3)
Service name                   : Nos/12246H/National Geographic HD
Service provider               : Tvheadend 4.3-472~g8fc3520
Service type                   : digital television

and where is hardware acceleration?
see attachment

#12

Updated by Carmelo Milazzo about 7 years ago

Anyway is much worst if used container not matroska... avlib mp4

#14

Updated by rpluto . about 7 years ago

saen acro wrote:

Rafael Silva wrote:

Here is goes

Thx

What exactly is problem with this video?
[...]

and where is hardware acceleration?
see attachment

Wrong file, please se the another one (correct one).
I can try change to hardware acceleration, but I have the same results

#15

Updated by Carmelo Milazzo about 7 years ago

Accordingly with Rafael... I tried hardware acceleration and not change absolutely nothing

#16

Updated by saen acro about 7 years ago

General
Unique ID                      : 23141128046024423173300529612919350093 (0x1168D1B37DD687E030E0F0BCF77F234D)
Complete name                  : C:\Users\Saen\Desktop\stream-atv2 (correct one).mkv
Format                         : Matroska
Format version                 : Version 4 / Version 2
File size                      : 5.73 MiB
Movie name                     : Nos/12246H/National Geographic HD
Writing application            : Lavf57.71.100
Writing library                : Lavf57.71.100
IsTruncated                    : Yes
SERVICE_NAME                   : Nos/12246H/National Geographic HD / Nos/12246H/National Geographic HD
SERVICE_PROVIDER               : Tvheadend 4.3-472~g8fc3520 / Tvheadend 4.3-472~g8fc3520

Video
ID                             : 1
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L3
Format settings, CABAC         : Yes
Format settings, RefFrames     : 4 frames
Codec ID                       : V_MPEG4/ISO/AVC
Width                          : 1 920 pixels
Original width                 : 682 pixels
Height                         : 1 080 pixels
Original height                : 384 pixels
Display aspect ratio           : 3.160
Original display aspect ratio  : 16:9
Frame rate mode                : Constant / Constant
Frame rate                     : 25.000 FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive / Progressive
Default                        : Yes
Forced                         : No

Audio
ID                             : 2
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format profile                 : LC
Codec ID                       : A_AAC
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 46.875 FPS (1024 SPF)
Compression mode               : Lossy / Lossy
Delay relative to video        : -1 s 600 ms
Default                        : Yes
Forced                         : No

Video is Truncated it is container problem.

#17

Updated by Carmelo Milazzo about 7 years ago

if is a container problem why I observe same problem with container mpeg-ts/av-lib?
With matroska same devices recognize video correctly but never happen with mpeg-ts/av-lib container... always wrong format

#19

Updated by rpluto . about 7 years ago

Send twice the mediainfo, here goes the video

#20

Updated by rpluto . about 7 years ago

For me this is the awkward part

Codec ID : V_MPEG4/ISO/AVC
Width : 1 920 pixels
Original width : 682 pixels
Height : 1 080 pixels
Original height : 384 pixels
Display aspect ratio : 3.160
Original display aspect ratio : 16:9

#21

Updated by rpluto . about 7 years ago

Carmelo Milazzo wrote:

if is a container problem why I observe same problem with container mpeg-ts/av-lib?
With matroska same devices recognize video correctly but never happen with mpeg-ts/av-lib container... always wrong format

For me always get wrong independent of container I choose

#22

Updated by rpluto . about 7 years ago

MP4 mediainfo txt

General
Complete name : stream-atv2.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/iso6/mp41)
File size : 7.39 MiB
Duration : 20s 96ms
Overall bit rate mode : Variable
Overall bit rate : 3 083 Kbps
Movie name : Nos/12246H/National Geographic HD
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Writing application : Lavf57.71.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile :
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 20s 96ms
Bit rate : 5 461 bps
Width : 1 920 pixels
Original width : 682 pixels
Height : 1 080 pixels
Original height : 384 pixels
Display aspect ratio : 16:9
Original display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 22.840 fps
Minimum frame rate : 0.576 fps
Maximum frame rate : 25.014 fps
Original frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.000
Stream size : 13.4 KiB (0%)
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 20s 85ms
Bit rate mode : Variable
Bit rate : 5 187 bps
Nominal bit rate : 62.2 Kbps
Maximum bit rate : 128 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Frame rate : 46.875 fps (1024 spf)
Compression mode : Lossy
Stream size : 12.7 KiB (0%)
Default : Yes
Alternate group : 1
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00

#23

Updated by Carmelo Milazzo about 7 years ago

Dear Rafael if you open a matroska container with VLC it reconstruct correctly the original video format but this not happen even with VLC if you use a MPEG-TS/av-lib container

#24

Updated by rpluto . about 7 years ago

Carmelo Milazzo wrote:

Dear Rafael if you open a matroska container with VLC it reconstruct correctly the original video format but this not happen even with VLC if you use a MPEG-TS/av-lib container

Confirm my player (iPad) also see that way, that’s why i say before that matrosca/avlib is Ok

But this client (atv2, kodi 14.2) won’t see it same way and always get green bars also, and is why I think is related.

#25

Updated by saen acro about 7 years ago

General
ID                             : 1 (0x1)
Complete name                  : C:\Users\Saen\Desktop\Премиера_-Откраднат-живот_-Чуждо-тяло-NOVA2017-09-19.ts
Format                         : MPEG-TS
File size                      : 1.44 GiB
Duration                       : 1 h 9 min
Overall bit rate mode          : Variable
Overall bit rate               : 2 936 kb/s

Video
ID                             : 256 (0x100)
Menu ID                        : 1 (0x1)
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : [email protected]
Format settings, CABAC         : No
Format settings, RefFrames     : 4 frames
Format settings, GOP           : M=3, N=12
Codec ID                       : 27
Duration                       : 1 h 9 min
Width                          : 900 pixels          <<<<<<<<<<< wrong value 576 ???
Height                         : 720 pixels
Display aspect ratio           : 5:4
Frame rate                     : 25.000 FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive

Audio
ID                             : 257 (0x101)
Menu ID                        : 1 (0x1)
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format version                 : Version 4
Format profile                 : LC
Muxing mode                    : ADTS
Codec ID                       : 15
Duration                       : 1 h 9 min
Bit rate mode                  : Variable
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 46.875 FPS (1024 SPF)
Compression mode               : Lossy
Delay relative to video        : -40 ms
Language                       : Bulgarian

Menu
ID                             : 4096 (0x1000)
Menu ID                        : 1 (0x1)
Duration                       : 1 h 9 min
List                           : 256 (0x100) (AVC) / 257 (0x101) (AAC, Bulgarian)
Language                       :  / Bulgarian
Service name                   : Премиера: Откраднат живот: Чуждо тяло
Service provider               : Tvheadend 4.3-485~gf5337ad
Service type                   : digital television

this is sd record input and output is same 5:4
Width value is wrong video profile attached.
Is deinterlace change something
#26

Updated by rpluto . about 7 years ago

No deinterlace doesn’t change nothing for me

#27

Updated by Carmelo Milazzo about 7 years ago

Tried also me.. deinterlace not change.. matroska is ok if seen on intelligent player otherwise taken ffmpeg remain same problem of bad aspect/ratio

#28

Updated by saen acro about 7 years ago

In Kodi is easy to set 16:9 output for every video, its not most elegant choice but... .

#29

Updated by Carmelo Milazzo about 7 years ago

Can also make a second transcoding on same machine with ffmpeg but is a dirty solution making 2 times same work with cpu. Is like to move a box 2 times for not telling first worker where to put :-D

#30

Updated by Nick Noone about 7 years ago

I am experiencing the same issue with MPEG-TS container over in Australia, Matroska container keeps the correct AR.

#31

Updated by Nick Noone about 7 years ago

I should say similar issue, when using MPEGTS the AR is set to 5:4, when using MKV the AR is set to 16:9. The only thing that changed in this capture was the container type, source video is 16:9

MPEG-TS:
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 5:4

MKV:
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9

#32

Updated by philip hewitt almost 7 years ago

Dont know if this helps but I have taken 2 screenshots from within kodi/krypton that shows the aspect ratio issue. Both the HD and SD sources were put through the same transcode settings on tvheadend (4.3-714). Settings can be seen in screenshots "profile params" and "codec params"

Screenshot 1 - BBC one HD - hd-H264source-transcoded.png
this shows full frame being transcoded and aspect ratio (AR) being reported as 1.78

Screenshot 2 - BBC one SD - sd-mpeg2source-transcoded.png
this shows the frame being transcoded and aspect ratio (AR) being reported as 1.22

Both the SD and HD sources are broadcast in 16:9 AR so it seems that TVHeadend is no longer reporting the AR properly in the container to the client?

Would love for this to be fixed as setting kodi to "stretch 16:9" isnt an ideal option as sometimes we have broadcast of old movies in 4:3 format inside a 16:9 frame, so that stretch would completely mess up the AR again.

Please help!?

#33

Updated by philip hewitt almost 7 years ago

to add to the above here are some original "passthrough" samples of the same channels showing the resolutions and aspect ratios

#34

Updated by Jaroslav Kysela almost 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|e59a07579e1a0833519b68d39f817ee7ebe836f7.

#35

Updated by philip hewitt almost 7 years ago

this bug has re-appeared in 4.3-1047~g6230715c8 :(

#36

Updated by Jaroslav Kysela almost 7 years ago

There are no code changes in the transcoding in the latest weeks. If this is a different bug, create another report and upload the affected mpeg-ts stream for an analysis.

Also available in: Atom PDF