Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardware transcode failed, raspberry pi 4 #1747

Closed
0x9394 opened this issue Sep 13, 2019 · 19 comments
Closed

hardware transcode failed, raspberry pi 4 #1747

0x9394 opened this issue Sep 13, 2019 · 19 comments
Labels
bug Something isn't working

Comments

@0x9394
Copy link

0x9394 commented Sep 13, 2019

hw: Raspberry Pi 4, 2GB
OS: dietpi (based on raspbian)
transcoding is set to OpenMAX OMX, enabled for H264.
issue: transcode not work. error logs as bellow:

Expected behavior
Hardware acceleration should work.

Logs
jellyfin logs:

Sep 13 01:32:28 pi4 jellyfin[1703]: [01:32:28] [INF] Profile: Unknown Profile, Path: /mnt/data/movie.mp4, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
Sep 13 01:32:29 pi4 jellyfin[1703]: [01:32:29] [WRN] HTTP Response 200 to 172.17.0.116. Time (slow): 0:00:00.553725. http://172.17.0.9:8096/emby/videos/f198cb2a-b830-ad2e-ac0d-d13c2b0f2afa/master.m3u8?DeviceId=TW96aWxsYS81LjAgKFgxMTsgVWJ1bnR1OyBMaW51eCB4ODZfNjQ7IHJ2OjY5LjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNjkuMHwxNTY4MzMzNTc4MDg1&MediaSourceId=f198cb2ab830ad2eac0dd13c2b0f2afa&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=627010&AudioBitrate=372991&PlaySessionId=40d6d466cb7540e58f2440f52c4336f5&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=563eb3ddc62899daaaf9a2e95c345d06&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit
Sep 13 01:32:30 pi4 jellyfin[1703]: [01:32:30] [INF] /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/data/movie.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 627010 -maxrate 627010 -bufsize 1254020 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 copy -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/8d2db2661ffe41e1df0e8708cbd808d1.m3u8" -y "/var/lib/jellyfin/transcoding-temp/8d2db2661ffe41e1df0e8708cbd808d1%d.ts"
Sep 13 01:32:30 pi4 jellyfin[1703]: * failed to open vchiq instance
Sep 13 01:32:30 pi4 jellyfin[1703]: [01:32:30] [INF] FFMpeg exited with code 255
Sep 13 01:32:30 pi4 jellyfin[1703]: [01:32:30] [INF] returning /var/lib/jellyfin/transcoding-temp/8d2db2661ffe41e1df0e8708cbd808d10.ts

ffmpeg transcode logs:

http://172.17.0.9:8096/emby/videos/f198cb2a-b830-ad2e-ac0d-d13c2b0f2afa/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFgxMTsgVWJ1bnR1OyBMaW51eCB4ODZfNjQ7IHJ2OjY5LjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNjkuMHwxNTY4MzMzNTc4MDg1&MediaSourceId=f198cb2ab830ad2eac0dd13c2b0f2afa&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=627010&AudioBitrate=372991&PlaySessionId=40d6d466cb7540e58f2440f52c4336f5&api_key=3e8ccb736c594e7a8e75697954f266fa&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=563eb3ddc62899daaaf9a2e95c345d06&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit

{"Protocol":"File","Id":"f198cb2ab830ad2eac0dd13c2b0f2afa","Path":"/mnt/data/movie.mp4","Type":"Default","Container":"mov,mp4,m4a,3gp,3g2,mj2","Size":3234022400,"Name":"Avengers.Endgame.2019.1080p.BluRay.x264-[YTS.LT]","IsRemote":false,"ETag":"563eb3ddc62899daaaf9a2e95c345d06","RunTimeTicks":108714131456,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":true,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","CodecTag":"avc1","Language":"und","TimeBase":"1/24000","CodecTimeBase":"1001/48000","VideoRange":"SDR","DisplayTitle":"1080P H264","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":2000048,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":800,"Width":1920,"AverageFrameRate":23.9760246,"RealFrameRate":23.9760246,"Profile":"High","Type":"Video","AspectRatio":"2.40:1","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":41},{"Codec":"aac","CodecTag":"mp4a","Language":"und","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"Und AAC 5.1 Default","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":372991,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"Formats":[],"Bitrate":2379835,"RequiredHttpHeaders":{}}

/usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/data/movie.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 627010 -maxrate 627010 -bufsize 1254020 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 copy -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/8d2db2661ffe41e1df0e8708cbd808d1.m3u8" -y "/var/lib/jellyfin/transcoding-temp/8d2db2661ffe41e1df0e8708cbd808d1%d.ts"


ffmpeg version 4.0.4 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-2)
  configuration: --toolchain=hardened --prefix=/usr --target-os=linux --enable-cross-compile --extra-cflags=--static --enable-gpl --enable-static --disable-doc --disable-ffplay --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-libfontconfig --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-omx --enable-omx-rpi --enable-version3 --enable-vaapi --enable-vdpau --enable-cross-compile --cross-prefix=/usr/bin/arm-linux-gnueabihf- --arch=armhf
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/mnt/data/movie.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.19.100
  Duration: 03:01:11.41, start: 0.000000, bitrate: 2379 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 2000 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 372 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_omx))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help </pre>

System (please complete the following information):

  • OS: dietpi, (raspbian/buster based)
  • Browser: firefox
  • Jellyfin Version: 10.3.7, apt installed from repo.
    jellyfin 10.3.7-1 armhf Jellyfin is a home media server.
    jellyfin-ffmpeg 4.0.4-3-buster armhf Tools for transcoding, streaming and playing of multimedia files
root@pi4:~# uname -a
Linux pi4 4.19.66-v7l+ #1253 SMP Thu Aug 15 12:02:08 BST 2019 armv7l GNU/Linux
root@pi4:~# cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
  • Reverse proxy: no, test in same LAN

thank you.

@0x9394 0x9394 added the bug Something isn't working label Sep 13, 2019
@0x9394 0x9394 changed the title failed to open vchiq instance , raspberry pi 4 hw transcode, failed to open vchiq instance , raspberry pi 4 Sep 13, 2019
@fosslinux
Copy link

Can you please try adding your user jellyfin is running as to the video group? eg sudo usermod -aG video jellyfin?

I think that should fix your problem.

@0x9394
Copy link
Author

0x9394 commented Sep 14, 2019

thanks, but transcode still not work.

root@pi4:~# cat /etc/group | grep jellyfin
video:x:44:jellyfin
jellyfin:x:111:

image

play with firefox, set bitrate limit to 1M to force transcode

Sep 14 01:17:24 pi4 jellyfin[12713]: [01:17:24] [INF] FFMpeg exited with code 1
Sep 14 01:17:24 pi4 jellyfin[12713]: [01:17:24] [INF] returning /var/lib/jellyfin/transcoding-temp/ae7d1f865cfff444acb2a6f47392dc490.ts
Sep 14 01:17:48 pi4 jellyfin[12713]: [01:17:48] [WRN] HTTP Response 500 to 172.17.0.116. Time (slow): 0:00:24.2273998. http://172.17.0.9:8096/emby/videos/518e89a1-826c-c6b9-3b7b-6a8bd3813332/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNzYuMC4zODA5LjEzNyBTYWZhcmkvNTM3LjM2IFZpdmFsZGkvMi43LjE2MjguMzN8MTU2ODM4OTk2MDAwNA11&MediaSourceId=518e89a1826cc6b93b7b6a8bd3813332&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&VideoBitrate=856119&AudioBitrate=143882&PlaySessionId=44d149ef751b4cceb5e6c996756a22f2&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=3658a423e72555941019b2fece837256&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit
Sep 14 01:17:48 pi4 jellyfin[12713]: [01:17:48] [INF] /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/data/2.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 856119 -maxrate 856119 -bufsize 1712238 -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 143882  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/ae7d1f865cfff444acb2a6f47392dc49.m3u8" -y "/var/lib/jellyfin/transcoding-temp/ae7d1f865cfff444acb2a6f47392dc49%d.ts"
Sep 14 01:17:48 pi4 jellyfin[12713]: [01:17:48] [INF] FFMpeg exited with code 1
Sep 14 01:17:48 pi4 jellyfin[12713]: [01:17:48] [INF] returning /var/lib/jellyfin/transcoding-temp/ae7d1f865cfff444acb2a6f47392dc490.ts

@0x9394 0x9394 changed the title hw transcode, failed to open vchiq instance , raspberry pi 4 hw transcode failed, raspberry pi 4 Sep 14, 2019
@SharerMax
Copy link

you can try this repo . The 10.3.7 is not working on raspbian(buster based). How do you run 10.3.7 on raspbian(buster based)?

@fosslinux
Copy link

I'm personally using the docker image (but I'm on a raspberry pi 3). It works mostly fine.

@0x9394
Copy link
Author

0x9394 commented Sep 15, 2019

@SharerMax buster is supported, pls check installing jellyfin

NOTE: Supported releases are: stretch and buster.

@anthonylavado
Copy link
Member

...buster is supported, pls check installing jellyfin

@kt1024 This is true, but if I recall, there's changes to the way the video hardware is handled for an RPi4, so we haven't caught up with those yet in jellyfin-ffmpeg. This might be okay in our next release, which would use a newer ffmpeg, but we'd have to check. I don't know if @joshuaboniface has any suggestions on this.

@SharerMax
Copy link

@kt1024 Weired. When I use 10.3.7, this #1670 will be trigger. it has fixed by #1693 . now I use nightly version.
nightly version is working.

@0x9394
Copy link
Author

0x9394 commented Sep 15, 2019

@SharerMax you can manually install libssl1.0.2 and get 10.3.7 working.

@JustAMan
Copy link
Contributor

@kt1024 please try installing Jellyfin 10.4.0 plus jellyfin-ffmpeg 4.2.1
Also, your issue in the logs above does seem like permission issue, can you show us id jellyfin?

@0x9394
Copy link
Author

0x9394 commented Oct 11, 2019

@JustAMan
upgrade through apt, transcode still failed.

root@pi4:~# dpkg --list | grep jellyfin
ii  jellyfin                         10.4.0-1                            armhf        Jellyfin is a home media server.
ii  jellyfin-ffmpeg                  4.2.1-1-buster                      armhf        Tools for transcoding, streaming and playing of multimedia files

root@pi4:~# id jellyfin
uid=107(jellyfin) gid=111(jellyfin) groups=111(jellyfin),44(video)


Oct 11 10:11:11 pi4 jellyfin[488]: [10:11:11] [ERR] FFMpeg exited with code 1
Oct 11 10:11:11 pi4 jellyfin[488]: [10:11:11] [INF] returning /var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e731750.ts
Oct 11 10:11:13 pi4 jellyfin[488]: [10:11:13] [ERR] Failed to bind to port 1900: Address already in use. DLNA will be unavailable
Oct 11 10:11:20 pi4 jellyfin[488]: [10:11:20] [WRN] HTTP Response 500 to 172.17.0.7. Time (slow): 0:00:10.0206913. http://172.17.0.9:8096/videos/66fbfb1e-1992-8ad7-1a27-e8f552b9e1ee/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKGlQaG9uZTsgQ1BVIGlQaG9uZSBPUyAxM18xXzIgbGlrZSBNYWMgT1MgWCkgQXBwbGVXZWJLaXQvNjA1LjEuMTUgKEtIVE1MLCBsaWtlIEdlY2tvKSBWZXJzaW9uLzEzLjAuMSBNb2JpbGUvMTVFMTQ4IFNhZmFyaS82MDQuMXwxNTcwNzU5NTQ4MTAz&MediaSourceId=66fbfb1e19928ad71a27e8f552b9e1ee&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&VideoBitrate=776001&AudioBitrate=224000&PlaySessionId=6cd868bb80f54a4998d1f80a630dd85d&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=2b21c1a2e9d900b22d33d94893a2cd37&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit
Oct 11 10:11:20 pi4 jellyfin[488]: [10:11:20] [INF] /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/test.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 776001 -maxrate 776001 -bufsize 1552002 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 224000 -af "volume=2" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175.m3u8" -y "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175%d.ts"
Oct 11 10:11:21 pi4 jellyfin[488]: [10:11:21] [ERR] FFMpeg exited with code 1
Oct 11 10:11:21 pi4 jellyfin[488]: [10:11:21] [INF] returning /var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e731750.ts
Oct 11 10:11:30 pi4 jellyfin[488]: [10:11:30] [WRN] HTTP Response 500 to 172.17.0.7. Time (slow): 0:00:09.9974056. http://172.17.0.9:8096/videos/66fbfb1e-1992-8ad7-1a27-e8f552b9e1ee/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKGlQaG9uZTsgQ1BVIGlQaG9uZSBPUyAxM18xXzIgbGlrZSBNYWMgT1MgWCkgQXBwbGVXZWJLaXQvNjA1LjEuMTUgKEtIVE1MLCBsaWtlIEdlY2tvKSBWZXJzaW9uLzEzLjAuMSBNb2JpbGUvMTVFMTQ4IFNhZmFyaS82MDQuMXwxNTcwNzU5NTQ4MTAz&MediaSourceId=66fbfb1e19928ad71a27e8f552b9e1ee&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&VideoBitrate=776001&AudioBitrate=224000&PlaySessionId=6cd868bb80f54a4998d1f80a630dd85d&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=2b21c1a2e9d900b22d33d94893a2cd37&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit
Oct 11 10:11:30 pi4 jellyfin[488]: [10:11:30] [INF] /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/test.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 776001 -maxrate 776001 -bufsize 1552002 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 224000 -af "volume=2" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175.m3u8" -y "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175%d.ts"
Oct 11 10:11:31 pi4 jellyfin[488]: [10:11:31] [ERR] FFMpeg exited with code 1
Oct 11 10:11:31 pi4 jellyfin[488]: [10:11:31] [INF] returning /var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e731750.ts

@JustAMan
Copy link
Contributor

Can you show what happens if you run

sudo -u jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/test.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 776001 -maxrate 776001 -bufsize 1552002 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 224000 -af "volume=2" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175.m3u8" -y "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175%d.ts"

?

@0x9394
Copy link
Author

0x9394 commented Oct 12, 2019

@JustAMan here it's

root@pi4:~# sudo -u jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -i file:"/mnt/test.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx  -b:v 776001 -maxrate 776001 -bufsize 1552002 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 224000 -af "volume=2" -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175.m3u8" -y "/var/lib/jellyfin/transcoding-temp/transcodes/01a8b008d437891a02917c2df9e73175%d.ts"
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-2)
  configuration: --toolchain=hardened --prefix=/usr --target-os=linux --enable-cross-compile --extra-cflags=--static --enable-gpl --enable-static --disable-doc --disable-ffplay --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-libfontconfig --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-omx --enable-omx-rpi --enable-version3 --enable-vaapi --enable-vdpau --enable-cross-compile --cross-prefix=/usr/bin/arm-linux-gnueabihf- --arch=armhf
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'file:/mnt/test.mkv':
  Metadata:
    title           : test
    encoder         : libebml v1.3.6 + libmatroska v1.4.9
    creation_time   : 2018-08-07T04:44:43.000000Z
  Duration: 01:59:29.25, start: 0.000000, bitrate: 4893 kb/s
    Chapter #0:0: start 0.000000, end 150.692000
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 150.692000, end 352.435000
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 352.435000, end 490.656000
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 490.656000, end 689.563000
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 689.563000, end 891.097000
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 891.097000, end 979.977000
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 979.977000, end 1223.512000
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 1223.512000, end 1319.524000
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 1319.524000, end 1593.464000
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 1593.464000, end 1899.770000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 1899.770000, end 2115.944000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 2115.944000, end 2339.375000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 2339.375000, end 2508.919000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 2508.919000, end 2775.226000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 2775.226000, end 3029.021000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 3029.021000, end 3235.060000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 3235.060000, end 3386.419000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 3386.419000, end 3504.703000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 3504.703000, end 3625.031000
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 3625.031000, end 3838.285000
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 3838.285000, end 4076.481000
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 4076.481000, end 4177.456000
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 4177.456000, end 4406.810000
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 4406.810000, end 4668.112000
    Metadata:
      title           : Chapter 24
    Chapter #0:24: start 4668.112000, end 4855.007000
    Metadata:
      title           : Chapter 25
    Chapter #0:25: start 4855.007000, end 5044.905000
    Metadata:
      title           : Chapter 26
    Chapter #0:26: start 5044.905000, end 5180.332000
    Metadata:
      title           : Chapter 27
    Chapter #0:27: start 5180.332000, end 5367.894000
    Metadata:
      title           : Chapter 28
    Chapter #0:28: start 5367.894000, end 5500.276000
    Metadata:
      title           : Chapter 29
    Chapter #0:29: start 5500.276000, end 5605.339000
    Metadata:
      title           : Chapter 30
    Chapter #0:30: start 5605.339000, end 5728.295000
    Metadata:
      title           : Chapter 31
    Chapter #0:31: start 5728.295000, end 5933.541000
    Metadata:
      title           : Chapter 32
    Chapter #0:32: start 5933.541000, end 6135.159000
    Metadata:
      title           : Chapter 33
    Chapter #0:33: start 6135.159000, end 6318.008000
    Metadata:
      title           : Chapter 34
    Chapter #0:34: start 6318.008000, end 6539.562000
    Metadata:
      title           : Chapter 35
    Chapter #0:35: start 6539.562000, end 7169.247000
    Metadata:
      title           : Chapter 36
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x804 [SAR 1:1 DAR 160:67], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default)
    Metadata:
      title           : test
      BPS-eng         : 4508173
      DURATION-eng    : 01:59:29.204000000
      NUMBER_OF_FRAMES-eng: 171889
      NUMBER_OF_BYTES-eng: 4040001992
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-07 04:44:43
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : Deadpool.2.2018.1080p.WEB-DL.DD5.1.H264-FGT
      BPS-eng         : 384000
      DURATION-eng    : 01:59:17.248000000
      NUMBER_OF_FRAMES-eng: 223664
      NUMBER_OF_BYTES-eng: 343547904
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-07 04:44:43
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 120x176, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : small_cover.jpg
      mimetype        : image/jpeg
    Stream #0:3: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 213x120, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : small_cover_land.jpg
      mimetype        : image/jpeg
    Stream #0:4: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x882, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : cover.jpg
      mimetype        : image/jpeg
    Stream #0:5: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1067x600, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : cover_land.jpg
      mimetype        : image/jpeg
Only '-vf scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2' read, ignoring remaining -vf options: Use ',' to separate filters
Only '-af volume=2' read, ignoring remaining -af options: Use ',' to separate filters
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_omx))
  Stream #0:1 -> #0:1 (ac3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[h264_omx @ 0x1d56d70] Using OMX.broadcom.video_encode
[h264_omx @ 0x1d56d70] OMX_GetHandle(OMX.broadcom.video_encode) failed: 80001005
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libmp3lame @ 0x1d73b10] 3 frames left in the queue on closing
Conversion failed!

@JustAMan
Copy link
Contributor

Can you post:

  • contents of /boot/config.txt
  • id jellyfin
  • ls -l /dev/vchiq

@0x9394
Copy link
Author

0x9394 commented Oct 14, 2019

@JustAMan

root@pi4:~# cat /boot/config.txt 
# IMPORTANT:
# - Modifications to /boot/config.txt will not be preserved on reboot.
# - Please ensure you edit from the DietPi-RAMdisk location: /DietPi/config.txt

#-------Display---------
# If you get no picture, set the following to "1" to apply most compatible HDMI settings.
#hdmi_safe=1

# Uncomment to adjust the HDMI signal strength if you have interferences, blanking, or no display.
# - Values from "0" to "11" are allowed, use values above "7" only if required, e.g. with very long HDMI cable. 
# - Default on first RPi1 is "2" and on RPi2 and above: "5"
#config_hdmi_boost=5

# Uncomment if HDMI display is not detected and composite is being outputted.
#hdmi_force_hotplug=1

# Set the following two settings to "1" to disable video output and framebuffer completely.
# NB: This will lead to some error messages on boot, which can be safely ignored.
#hdmi_ignore_hotplug=1
#hdmi_ignore_composite=1

# Uncomment to force a console size. By default it will be display's size minus overscan.
#framebuffer_width=1280
#framebuffer_height=720

# SDTV_MODES
#sdtv_mode=0

# Uncomment to force a specific HDMI mode (this will force VGA).
#hdmi_group=1
#hdmi_mode=1

# Uncomment to force an HDMI mode rather than DVI. This can make audio work in DMT (computer monitor) modes.
#hdmi_drive=2

# Set "hdmi_blanking=1" to allow the display going into standby after 10 minutes without input.
# With default value "0", the display shows a blank screen instead, but will not go into standby.
# NB: With "1" some applications (e.g. Kodi, OMXPlayer) cannot prevent display standby due to missing DPMS signal.
#hdmi_blanking=1

# Set to "1" if your display has a black border of unused pixels visible.
disable_overscan=1

# Uncomment the following to adjust overscan. Use positive numbers if console goes off screen, and negative if there is too much border.
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# Rotation
display_hdmi_rotate=0
lcd_rotate=0

#-------RPi camera module-------
start_x=0
disable_camera_led=0

#-------GPU memory splits-------
gpu_mem_256=16
gpu_mem_512=16
gpu_mem_1024=16

#-------Max USB current---------
max_usb_current=1

#-------Disable Pi splash screen on boot-----------
disable_splash=1

#-------SoundCard-------
dtparam=audio=off

#-------I²C-------------
dtparam=i2c_arm=off
dtparam=i2c1=off
i2c_arm_baudrate=100000

#-------SPI-------------
dtparam=spi=off

#-------Serial/UART-----
# NB: Enabled for 1st run only, if you want to keep this setting, please set CONFIG_SERIAL_CONSOLE_ENABLE=1 in /DietPi/dietpi.txt.
#core_freq=500
enable_uart=0

#-------Overclock-------
temp_limit=65
# Initial turbo currently leads to CPU not being throttled down by CPU governor: https://github.com/MichaIng/DietPi/issues/1836
#initial_turbo=20
force_turbo=0

#over_voltage=0
#arm_freq=1500
#core_freq=500
#sdram_freq=3200

#arm_freq_min=700
#core_freq_min=250
#sdram_freq_min=400

# Note To Self, NEVER enable L2 cache, breaks most X based applications that were not compiled with L2 cache enabled.
root@pi4:~# id jellyfin
uid=107(jellyfin) gid=111(jellyfin) groups=111(jellyfin),44(video)
root@pi4:~# ls -l /dev/vchiq
crw-rw---- 1 root video 244, 0 Oct 13 23:17 /dev/vchiq
root@pi4:~# 

@0x9394 0x9394 changed the title hw transcode failed, raspberry pi 4 hardware transcode failed, raspberry pi 4 Oct 14, 2019
@JustAMan
Copy link
Contributor

#-------GPU memory splits-------
gpu_mem_256=16
gpu_mem_512=16
gpu_mem_1024=16

I think this might be problematic a bit - I don't think 16 MB of memory is enough, see this for inspiration: Sunoo/homebridge-camera-ffmpeg#38 (comment)

@0x9394
Copy link
Author

0x9394 commented Oct 15, 2019

yes, it's. changed mem to 256, now transcode works. thanks all.
and just learned rpi 4 do not have hardware decode for mpeg2, what a shame.

@ricebus
Copy link

ricebus commented Apr 9, 2020

I recommend you update this page:
https://jellyfin.org/docs/general/administration/hardware-acceleration.html#raspberry-pi-3-and-4
with the video group requirement. could save me like 4 hours :P

@fosslinux
Copy link

Is right there...

sudo usermod -aG video jellyfin

@ricebus
Copy link

ricebus commented Apr 9, 2020

You're right. guess I missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants