{"action":"opened","issue":{"url":"https://api.github.com/repos/MediaBrowser/Emby/issues/2285","repository_url":"https://api.github.com/repos/MediaBrowser/Emby","labels_url":"https://api.github.com/repos/MediaBrowser/Emby/issues/2285/labels{/name}","comments_url":"https://api.github.com/repos/MediaBrowser/Emby/issues/2285/comments","events_url":"https://api.github.com/repos/MediaBrowser/Emby/issues/2285/events","html_url":"https://github.com/MediaBrowser/Emby/issues/2285","id":188940380,"number":2285,"title":"[BUG] VAAPI Transcoding (Does not work with certain codecs)","user":{"login":"karbowiak","id":337661,"avatar_url":"https://avatars.githubusercontent.com/u/337661?v=3","gravatar_id":"","url":"https://api.github.com/users/karbowiak","html_url":"https://github.com/karbowiak","followers_url":"https://api.github.com/users/karbowiak/followers","following_url":"https://api.github.com/users/karbowiak/following{/other_user}","gists_url":"https://api.github.com/users/karbowiak/gists{/gist_id}","starred_url":"https://api.github.com/users/karbowiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karbowiak/subscriptions","organizations_url":"https://api.github.com/users/karbowiak/orgs","repos_url":"https://api.github.com/users/karbowiak/repos","events_url":"https://api.github.com/users/karbowiak/events{/privacy}","received_events_url":"https://api.github.com/users/karbowiak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-12T23:10:31Z","updated_at":"2016-11-12T23:10:31Z","closed_at":null,"body":"Hi there!\r\n\r\nSo i managed to get the VAAPI transcoding working with the Intel GPU on my machine under Ubuntu, works phenomenally well infact, except for when it doesn't.\r\n\r\nWhenever it runs across an .avi file encoded with mpeg4/xvid, the following happens.\r\n\r\n```http://127.0.0.1:8096/videos/dd392781d0a4714d45513a28e16a5efe/hls1/main/0.ts?DeviceId=e422d841d2c5de844ea3b8b6d6afb44f98c4ed12&MediaSourceId=dd392781d0a4714d45513a28e16a5efe&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=667693703&AudioBitrate=132384&Level=51&Profile=high&PlaySessionId=57211dc7fc41405fb482498178075059&api_key=71b4c0e30f50460797772869c410055b&CopyTimestamps=false&TranscodingMaxAudioChannels=2&EnableSubtitlesInManifest=false&Tag=7ad7edbe3b005268ea4821ce0d9bd5cb&EnableSplittingOnNonKeyFrames=false\r\n\r\n{\"Protocol\":\"File\",\"Id\":\"dd392781d0a4714d45513a28e16a5efe\",\"Path\":\"/mnt/storage/TV/Foreign/Top Gear/Season 12/Top Gear - S12E01 - Lorries (SDTV).avi\",\"Type\":\"Default\",\"Container\":\"avi\",\"Name\":\"SD/MPEG4/MP3\",\"ETag\":\"7ad7edbe3b005268ea4821ce0d9bd5cb\",\"RunTimeTicks\":36581600000,\"ReadAtNativeFramerate\":false,\"SupportsTranscoding\":true,\"SupportsDirectStream\":true,\"SupportsDirectPlay\":true,\"IsInfiniteStream\":false,\"RequiresOpening\":false,\"RequiresClosing\":false,\"SupportsProbing\":true,\"VideoType\":\"VideoFile\",\"MediaStreams\":[{\"Codec\":\"mpeg4\",\"CodecTag\":\"XVID\",\"TimeBase\":\"1/25\",\"CodecTimeBase\":\"1/25\",\"IsInterlaced\":false,\"BitRate\":1456553,\"RefFrames\":1,\"IsDefault\":false,\"IsForced\":false,\"Height\":352,\"Width\":640,\"AverageFrameRate\":25,\"RealFrameRate\":25,\"Profile\":\"Advanced Simple Profile\",\"Type\":\"Video\",\"AspectRatio\":\"20:11\",\"Index\":0,\"IsExternal\":false,\"IsTextSubtitleStream\":false,\"SupportsExternalStream\":false,\"PixelFormat\":\"yuv420p\",\"Level\":5,\"IsAnamorphic\":false},{\"Codec\":\"mp3\",\"TimeBase\":\"3/125\",\"CodecTimeBase\":\"1/48000\",\"DisplayTitle\":\"MP3 stereo\",\"IsInterlaced\":false,\"ChannelLayout\":\"stereo\",\"BitRate\":132384,\"Channels\":2,\"SampleRate\":48000,\"IsDefault\":false,\"IsForced\":false,\"Type\":\"Audio\",\"Index\":1,\"IsExternal\":false,\"IsTextSubtitleStream\":false,\"SupportsExternalStream\":false,\"Level\":0}],\"PlayableStreamFileNames\":[],\"Formats\":[],\"Bitrate\":1601817,\"RequiredHttpHeaders\":{}}\r\n\r\n/usr/local/bin/ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:\"/mnt/storage/TV/Foreign/Top Gear/Season 12/Top Gear - S12E01 - Lorries (SDTV).avi\" -map_metadata -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi  -b:v 1456553 -maxrate 1456553 -bufsize 2913106 -vsync -1 -level 41 -force_key_frames \"expr:gte(t,n_forced*3)\" -vf \"format=nv12|vaapi,hwupload\" -flags -global_header -copyts -codec:a:0 aac -strict experimental -ac 2 -ab 132384 -af \"adelay=1,aresample=async=1\" -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -hls_time 3 -start_number 0 -hls_list_size 0 -y \"/mnt/cache/emby/transcoding-temp/774c157024506ec2168b19c1ec83c810.m3u8\"\r\n\r\n\r\nffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers\r\n  built with gcc 6.2.0 (Ubuntu 6.2.0-5ubuntu12) 20161005\r\n  configuration: --enable-nonfree --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-vaapi --enable-vdpau --cpu=native --enable-libxvid --enable-openssl --enable-ladspa --enable-libbluray --enable-libpulse --enable-librtmp --enable-libsnappy --enable-opengl --enable-x11grab --enable-frei0r --enable-chromaprint\r\n  libavutil      55. 34.100 / 55. 34.100\r\n  libavcodec     57. 64.100 / 57. 64.100\r\n  libavformat    57. 56.100 / 57. 56.100\r\n  libavdevice    57.  1.100 / 57.  1.100\r\n  libavfilter     6. 65.100 /  6. 65.100\r\n  libswscale      4.  2.100 /  4.  2.100\r\n  libswresample   2.  3.100 /  2.  3.100\r\n  libpostproc    54.  1.100 / 54.  1.100\r\nlibva info: VA-API version 0.39.2\r\nlibva info: va_getDriverName() returns 0\r\nlibva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so\r\nlibva info: Found init function __vaDriverInit_0_39\r\nlibva info: va_openDriver() returns 0\r\nInput #0, avi, from 'file:/mnt/storage/TV/Foreign/Top Gear/Season 12/Top Gear - S12E01 - Lorries (SDTV).avi':\r\n  Metadata:\r\n    encoder         : Nandub v1.0rc2\r\n  Duration: 01:00:58.16, start: 0.000000, bitrate: 1601 kb/s\r\n    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x352 [SAR 1:1 DAR 20:11], 1456 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc\r\n    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 132 kb/s\r\nOutput #0, hls, to '/mnt/cache/emby/transcoding-temp/774c157024506ec2168b19c1ec83c810.m3u8':\r\n  Metadata:\r\n    encoder         : Lavf57.56.100\r\n    Stream #0:0: Video: h264 (h264_vaapi) (High), vaapi_vld, 640x352 [SAR 1:1 DAR 20:11], q=2-31, 1456 kb/s, 25 fps, 90k tbn, 25 tbc\r\n    Metadata:\r\n      encoder         : Lavc57.64.100 h264_vaapi\r\n    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 132 kb/s\r\n    Metadata:\r\n      encoder         : Lavc57.64.100 aac\r\nStream mapping:\r\n  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (h264_vaapi))\r\n  Stream #0:1 -> #0:1 (mp3 (native) -> aac (native))\r\nPress [q] to stop, [?] for help\r\n[vaapi @ 0x7f4020000960] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f4020000960] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f4020000960] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x56464091b040] decoding to AV_PIX_FMT_NONE is not supported.\r\n[mpeg4 @ 0x564640935ae0] Context scratch buffers could not be allocated due to unknown size.\r\n[vaapi @ 0x7f4018000960] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f4018000960] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f4018000960] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x564640935ae0] decoding to AV_PIX_FMT_NONE is not supported.\r\n[mpeg4 @ 0x564640936280] Context scratch buffers could not be allocated due to unknown size.\r\n[mpeg4 @ 0x56464093d000] Context scratch buffers could not be allocated due to unknown size.\r\n[vaapi @ 0x7f401c000960] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f401c000960] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f401c000960] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x56464093d000] decoding to AV_PIX_FMT_NONE is not supported.\r\n[mpeg4 @ 0x564640940340] Context scratch buffers could not be allocated due to unknown size.\r\nError while decoding stream #0:0: Operation not permitted\r\n[vaapi @ 0x7f4010000960] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f4010000960] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f4010000960] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x564640940340] decoding to AV_PIX_FMT_NONE is not supported.\r\n[mpeg4 @ 0x56464091b040] Context scratch buffers could not be allocated due to unknown size.\r\nError while decoding stream #0:0: Operation not permitted\r\n[mpeg4 @ 0x564640935ae0] Context scratch buffers could not be allocated due to unknown size.\r\n[vaapi @ 0x7f4018000bc0] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f4018000bc0] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f4018000bc0] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x564640935ae0] decoding to AV_PIX_FMT_NONE is not supported.\r\n[mpeg4 @ 0x564640936280] Context scratch buffers could not be allocated due to unknown size.\r\n[vaapi @ 0x7f4014000960] No VAAPI support for codec mpeg4 profile 15.\r\n[vaapi @ 0x7f4014000960] If you want attempt decoding anyway with a possibly-incompatible profile, add the option -hwaccel_lax_profile_check.\r\n[vaapi @ 0x7f4014000960] No supported configuration for this codec.vaapi hwaccel requested for input stream #0:0, but cannot be initialized.\r\n[mpeg4 @ 0x564640936280] decoding to AV_PIX_FMT_NONE is not supported.\r\nError while decoding stream #0:0: Operation not permitted\r\n[mpeg4 @ 0x56464093d000] Context scratch buffers could not be allocated due to unknown size.\r\nError while decoding stream #0:0: Operation not permitted\r\n```\r\n\r\nAny chance of a fallback to using the cpu for such instances? :)"}}
{"actor":{"display_login":"karbowiak"}}