Jump to content

Xvid playback quality question


Recommended Posts

dcortest
Posted

Hi, 

 

I have some videos in xvid 720p, when I try to play them emby shows that the are at 480p loosing a lot of resolution.

How I can force emby to recognize them at 720p?

Files are .avi with the .mkv native no problem.

 

regards

dcortest
Posted

This is the ffmeg info

 

http://2.139.145.119:8096/emby/videos/f88b3170846524bfb03bcc322db952cb/hls1/main/278.ts?DeviceId=b054ea52a3f9812e423b818fe14f946e9eb90891&MediaSourceId=f88b3170846524bfb03bcc322db952cb&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=467908683&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=bb44db648637483f8087a63af7b1ac0c&api_key=051afa40ddbe44d1907c794e9985bb35&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=54ac534dcd23b70cad626925a961b91d&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=False

 

{"Protocol":"File","Id":"f88b3170846524bfb03bcc322db952cb","Path":"\\\\10.0.1.41\\torrent\\peliculas\\xXx Reactivado.avi","Type":"Default","Container":"avi","Name":"480P/MPEG4/AC3","IsRemote":false,"ETag":"54ac534dcd23b70cad626925a961b91d","RunTimeTicks":64062808064,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"SupportsProbing":true,"RequiresLooping":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"mpeg4","CodecTag":"NULL","TimeBase":"125/2997","CodecTimeBase":"1001/24000","IsInterlaced":false,"BitRate":2102680,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":304,"Width":720,"AverageFrameRate":23.976,"RealFrameRate":23.976,"Profile":"High","Type":"Video","AspectRatio":"2.35:1","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":5,"IsAnamorphic":false},{"Codec":"ac3","TimeBase":"1/56000","CodecTimeBase":"1/48000","DisplayTitle":"Dolby Digital 5.1","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":448000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2560047,"RequiredHttpHeaders":{}}

 

C:\Users\david.cortes\AppData\Roaming\Emby-Server\ffmpeg\20170308\ffmpeg.exe -ss 00:13:54.000 -f avi -codec:0 mpeg4 -codec:1 ac3 -i file:"\\10.0.1.41\torrent\peliculas\xXx Reactivado.avi" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 2102680 -bufsize 4205360 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,1280)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 aac -strict experimental -ac 6 -ab 384000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -segment_time_delta -834 -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 278 -segment_list "C:\Users\david.cortes\AppData\Roaming\Emby-Server\transcoding-temp\27e732819806403554a35ba3eee4368f.m3u8" -y "C:\Users\david.cortes\AppData\Roaming\Emby-Server\transcoding-temp\27e732819806403554a35ba3eee4368f%d.ts"

 

 

ffmpeg version N-86129-g1e8daf3 Copyright © 2000-2017 the FFmpeg developers

built with gcc 6.3.0 (GCC)

configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib

libavutil 55. 63.100 / 55. 63.100

libavcodec 57. 96.101 / 57. 96.101

libavformat 57. 72.101 / 57. 72.101

libavdevice 57. 7.100 / 57. 7.100

libavfilter 6. 90.100 / 6. 90.100

libswscale 4. 7.101 / 4. 7.101

libswresample 2. 8.100 / 2. 8.100

libpostproc 54. 6.100 / 54. 6.100

Input #0, avi, from 'file:\\10.0.1.41\torrent\peliculas\xXx Reactivado.avi':

Metadata:

encoder : VirtualDubMod 1.5.10.2 (build 2540/release)

title : xXx Reactivado [bluRay Rip][www.newpct1.com]

Duration: 01:46:46.28, start: 0.000000, bitrate: 2560 kb/s

Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [sAR 1:1 DAR 45:19], 2102 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc

Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))

Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))

Press [q] to stop, [?] for help

[ac3 @ 0000000002830920] frame sync error

Error while decoding stream #0:1: Invalid data found when processing input

[libx264 @ 0000000000333c00] using SAR=1/1

[libx264 @ 0000000000333c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64

[libx264 @ 0000000000333c00] profile Main, level 4.1

[libx264 @ 0000000000333c00] 264 - core 148 r2762 90a61ec - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=4 chroma_me=0 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2102 vbv_bufsize=4205 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00

Output #0, segment, to 'C:\Users\david.cortes\AppData\Roaming\Emby-Server\transcoding-temp\27e732819806403554a35ba3eee4368f%d.ts':

Metadata:

encoder : Lavf57.72.101

Stream #0:0: Video: h264 (libx264), yuv420p, 720x304 [sAR 1:1 DAR 45:19], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc

Metadata:

encoder : Lavc57.96.101 libx264

Side data:

cpb: bitrate max/min/avg: 2102000/0/0 buffer size: 4205000 vbv_delay: -1

Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 384 kb/s

Metadata:

encoder : Lavc57.96.101 aac

frame= 19 fps=0.0 q=0.0 size=N/A time=00:13:55.36 bitrate=N/A speed=1.67e+003x

frame= 63 fps= 63 q=28.0 size=N/A time=00:13:57.20 bitrate=N/A speed= 835x

frame= 115 fps= 76 q=33.0 size=N/A time=00:13:59.39 bitrate=N/A speed= 556x

frame= 174 fps= 86 q=34.0 size=N/A time=00:14:01.87 bitrate=N/A speed= 417x

frame= 249 fps= 99 q=28.0 size=N/A time=00:14:04.94 bitrate=N/A speed= 336x

frame= 329 fps=109 q=26.0 size=N/A time=00:14:08.33 bitrate=N/A speed= 281x

frame= 412 fps=117 q=28.0 size=N/A time=00:14:11.74 bitrate=N/A speed= 242x

frame= 490 fps=122 q=28.0 size=N/A time=00:14:15.01 bitrate=N/A speed= 213x

frame= 571 fps=126 q=28.0 size=N/A time=00:14:18.38 bitrate=N/A speed= 190x

frame= 654 fps=130 q=28.0 size=N/A time=00:14:21.84 bitrate=N/A speed= 172x

frame= 738 fps=134 q=28.0 size=N/A time=00:14:25.38 bitrate=N/A speed= 157x

frame= 819 fps=136 q=28.0 size=N/A time=00:14:28.70 bitrate=N/A speed= 144x

frame= 900 fps=138 q=28.0 size=N/A time=00:14:32.10 bitrate=N/A speed= 134x

frame= 981 fps=140 q=28.0 size=N/A time=00:14:35.47 bitrate=N/A speed= 125x

frame= 1061 fps=141 q=28.0 size=N/A time=00:14:38.80 bitrate=N/A speed= 117x

frame= 1136 fps=141 q=28.0 size=N/A time=00:14:41.93 bitrate=N/A speed= 110x

frame= 1217 fps=143 q=28.0 size=N/A time=00:14:45.32 bitrate=N/A speed= 104x

frame= 1305 fps=144 q=28.0 size=N/A time=00:14:48.97 bitrate=N/A speed=98.3x

frame= 1390 fps=146 q=28.0 size=N/A time=00:14:52.56 bitrate=N/A speed=93.5x

frame= 1473 fps=147 q=28.0 size=N/A time=00:14:56.03 bitrate=N/A speed=89.2x

frame= 1551 fps=147 q=28.0 size=N/A time=00:14:59.23 bitrate=N/A speed=85.3x

frame= 1630 fps=148 q=28.0 size=N/A time=00:15:02.54 bitrate=N/A speed=81.7x

frame= 1707 fps=148 q=28.0 size=N/A time=00:15:05.80 bitrate=N/A speed=78.4x

frame= 1792 fps=149 q=28.0 size=N/A time=00:15:09.28 bitrate=N/A speed=75.5x

frame= 1872 fps=149 q=28.0 size=N/A time=00:15:12.67 bitrate=N/A speed=72.7x

frame= 1944 fps=149 q=28.0 size=N/A time=00:15:15.62 bitrate=N/A speed=70.1x

frame= 2023 fps=149 q=28.0 size=N/A time=00:15:18.99 bitrate=N/A speed=67.8x

frame= 2102 fps=150 q=25.0 size=N/A time=00:15:22.25 bitrate=N/A speed=65.6x

frame= 2186 fps=150 q=28.0 size=N/A time=00:15:25.73 bitrate=N/A speed=63.6x

frame= 2259 fps=150 q=28.0 size=N/A time=00:15:28.78 bitrate=N/A speed=61.7x

frame= 2338 fps=150 q=28.0 size=N/A time=00:15:32.06 bitrate=N/A speed=59.9x

frame= 2419 fps=151 q=28.0 size=N/A time=00:15:35.44 bitrate=N/A speed=58.2x

frame= 2494 fps=151 q=28.0 size=N/A time=00:15:38.57 bitrate=N/A speed=56.7x

frame= 2569 fps=151 q=28.0 size=N/A time=00:15:41.73 bitrate=N/A speed=55.2x

frame= 2633 fps=150 q=-1.0 Lsize=N/A time=00:15:44.44 bitrate=N/A speed=53.9x

video:18611kB audio:5183kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

[libx264 @ 0000000000333c00] frame I:368 Avg QP:27.39 size: 15389

[libx264 @ 0000000000333c00] frame P:934 Avg QP:25.25 size: 9119

[libx264 @ 0000000000333c00] frame B:1331 Avg QP:28.05 size: 3664

[libx264 @ 0000000000333c00] consecutive B-frames: 27.1% 13.3% 9.5% 50.1%

[libx264 @ 0000000000333c00] mb I I16..4: 30.0% 0.0% 70.0%

[libx264 @ 0000000000333c00] mb P I16..4: 25.8% 0.0% 0.0% P16..4: 59.9% 0.0% 0.0% 0.0% 0.0% skip:14.3%

[libx264 @ 0000000000333c00] mb B I16..4: 4.0% 0.0% 0.0% B16..8: 36.7% 0.0% 0.0% direct:11.3% skip:48.1% L0:34.9% L1:36.0% BI:29.1%

[libx264 @ 0000000000333c00] coded y,uvDC,uvAC intra: 67.9% 65.9% 31.1% inter: 27.5% 21.3% 2.0%

[libx264 @ 0000000000333c00] i16 v,h,dc,p: 21% 40% 21% 18%

[libx264 @ 0000000000333c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 33% 14% 7% 6% 4% 8% 4% 9%

[libx264 @ 0000000000333c00] i8c dc,h,v,p: 39% 32% 18% 11%

[libx264 @ 0000000000333c00] Weighted P-Frames: Y:3.4% UV:1.8%

[libx264 @ 0000000000333c00] kb/s:1388.27

[aac @ 0000000000335c20] Qavg: 514.065

Posted (edited)

Thats isnt a 720p file though. That is (16:9) dvd resolution, 720 x 404ish.. if anything the server is being generous applying the (4:3) 480p name. Your video is 720x304 which will include 50px of black bars top and bottom to fill the 304->404.

 

720p-1280x720ish 1080p-1920x1080ish

Edited by speechles
Waldonnis
Posted

Thats isnt a 720p file though. That is dvd resolution, 720 x 404ish.. if anything the server is being generous applying the 480p name. Your video is 720x304 which will include 50px of black bars top and bottom to fill the 304->404.

 

720p-1280x720ish 1080p-1920x1080ish

 

I agree with speechles.  This is even below 480p, albeit not by much and the difference is probably just from cropping the letterbox filler and a few pixels off of the width that may have just been padding (close enough to call it 480p, IMO, if the crop was to remove the AR difference filler).  From the looks of the log, you're not losing any resolution at all (no scaling being done), so it's likely just a labeling error - the source file should've never been labeled as 720p by anything as it's not even close to 720p.

 

To verify, here's the input and output lines (respectively):

Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 2102 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
...
Stream #0:0: Video: h264 (libx264), yuv420p, 720x304 [SAR 1:1 DAR 45:19], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc

As you can see, the resolution on both is equal.  The quality may be visibly different, but that would be the result of the parameters given to libx264/ffmpeg.

dcortest
Posted

not at all... I understand that the file screen resolution isn't the necessary to marked as 720p

I tried to recode from avi to mkv h264, same characteristics and marked as 480p, but the image quality is so different, the recoded version is better than the original.

If I play the original video from kodi or VLC i have the same quality like the mkv recoded.... that's my question, why emby reduce the quality if the file has better quality than it shows?

Guest asrequested
Posted (edited)

720p refers to height not width. So 480p is the height of your video plus padding. Your video is 720 wide and 304 high. Maybe in the other players it's being upscaled somehow?

Edited by Doofus
Posted (edited)

Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [sAR 1:1 DAR 45:19], 2102 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc

dar = 45:19 = 45/19 = 2.368421052631579, iw = 720, ih = 304, ow = 720

 -vf "scale=trunc(min(max(iw\,ih*dar)\,1280)/2)*2:trunc(ow/dar/2)*2"
 -vf "scale=trunc(min(max(720,304*2.368421052631579),1280)/2)*2:trunc(720/2.368421052631579/2)*2"

 -vf "scale=trunc(min(max(720,720),1280)/2)*2:trunc(720/2.368421052631579/2)*2"
 -vf "scale=trunc(min(720,1280)/2)*2:trunc(720/2.368421052631579/2)*2"
 -vf "scale=trunc(720/2)*2:trunc(720/2.368421052631579/2)*2"
 -vf "scale=trunc(360)*2:trunc(720/2.368421052631579/2)*2"
 -vf "scale=720:trunc(720/2.368421052631579/2)*2"
 -vf "scale=720:trunc(152)*2"
 -vf "scale=720:304"

Stream #0:0: Video: h264 (libx264), yuv420p, 720x304 [sAR 1:1 DAR 45:19], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc

 

As doofus mentioned, maybe the other players are upscale this to 1280x720 rather than keeping original dimensions. Emby is trying to keep original dimensions. It might be the bitrate too, emby is using the same mpeg4 bitrate your stream is as a maximum bitrate for the libx264 it is encoding. Maybe this is causing it? libx264 is usually better quality at lower bitrates than mpeg4, but this depends on the source. Not all mpeg4 source are the same.

Edited by speechles
Posted

This happens sometimes when transcoding xvid. Some adjustments have been made to improve this for the next release of Emby Server. Thanks !

eraser8
Posted

This happens sometimes when transcoding xvid. Some adjustments have been made to improve this for the next release of Emby Server. Thanks !

 

Hi Luke! Does these improvement include audio sync for .avi? I have often problem with audio out of sync when transcoding .avi files (XVID). The delay between video and audio increase in the time I listen the movie.

 

For example, the last one yesterday night. In the ffmpeg log, this is the original streams detected:

 

            Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [sAR 1:1 DAR 45:19], 1435 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc

            Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 384 kb/s

 

Which they are converted to:

            

            Output #0, segment, to '/var/db/emby-server/transcoding-temp/d3a6a8fbcb5e85d0eed1edb95016a7c2%d.ts':

Metadata:

encoder : Lavf56.40.101

Stream #0:0: Video: h264 (libx264), yuv420p, 720x304 [sAR 1:1 DAR 45:19], q=-1--1, max. 1435 kb/s, 23.98 fps, 90k tbn, 23.98 tbc

Metadata:

encoder : Lavc56.60.100 libx264

Stream #0:1: Audio: aac, 48000 Hz, 5.1, fltp, 384 kb/s

Metadata:

encoder : Lavc56.60.100 aac

Stream mapping:

Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))

Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))

 

 

By the way, I was listen it in Chrome browser, and the server was 3.2.17.0 on FreeNAS server. Also, here is the Infos that I can see at the bottom of the movie info page (take look to the difference of the framerate 23.97599 vs 23.98):

 

       

Media Info
VideoCodecMPEG4

Codec tagXVID

ProfileAdvanced Simple Profile

Level5

Resolution720x304

Aspect ratio2.35:1

AnamorphicNo

InterlacedNo

Framerate23.97599

Bitrate1435 kbps

Pixel formatyuv420p

Ref frames1

AudioCodecAC3

Layout5.1

Channels6 ch

Bitrate384 kbps

Sample rate48000 Hz

DefaultNo

TitleDolby Digital 5.1

Containeravi

 

 

Thank you guys!

Posted

We are increasing the transcoding bitrate a little bit to improve quality.

eraser8
Posted

Ok thank you we'll see if this improve the audio syncing

 

Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...