Jump to content

Anyone using the hardware acceleration with emby / ffmpeg?


tdiguy

Recommended Posts

tdiguy

I just bought the mp2 license for my raspberry pi and got it to work at least according to the test output.

Now i am curious though, how do i get emby to take advantage of this?

 

I am curious about this but i have seen where using emby makes transcoding nearly obsolete as long as i use the emby apps. I am curious how well the pi handles transcoding with hardware acceleration vs when it didnt which it nearly fell over itself when i had it turned on.

Link to comment
Share on other sites

tdiguy

OK so i found a tutorial on doing this, i downloaded ffmpeg and compiled it on the pi. I am pretty sure i got it installed as the default ffmpeg player. Now the problem i have is that it seems the options emby uses are not recognized by my newly compiled ffmpeg. At least thats what it looks like to this untrained eye.

 

ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Unrecognized option 'preset'.
Error splitting the argument list: Option not found

Link to comment
Share on other sites

tdiguy

Well thankfully i found out how to uninstall my custom build ffmpeg so now i have 2 builds of ffmepg on my pi one that works with emby and the one i compiled on the pi that emby cant seem to use but has hadware acceleration. 

Link to comment
Share on other sites

Waldonnis

Can you post the ffmpeg command line that's failing?  Looking at the ffmpeg source, there's no preset option for h264_omx, which would explain why it doesn't like that.  The only options I can see begin on line 38555 in libavcodec/omx.c:

  • omx_libname: OpenMAX library name
  • omx_libprefix: OpenMAX library prefix
  • zerocopy: Try to avoid copying input frames if possible
  • profile: Set the encoding profile (baseline, main, high)

If this list is accurate for your build (you can check by typing 'ffmpeg -h encoder=h264_omx' and it should show the same four options), then Luke can modify Emby's OpenMAX hardware encoding defaults accordingly.  My Rpi isn't in bootable shape right now, so I can't do any checking here (it's also a Rpi 1B with a horridly slow SD card, so doing much of anything on it is painful).

Link to comment
Share on other sites

tdiguy

When i select the option to use omx acceleration i get the following:

 

http://192.168.1.50:8096/emby/videos/5503981653edb9e778a1db383fe3ab98/live.m3u8?DeviceId=6931dcd27ec2a4eb67605e0246c3cbc13b2492cf&MediaSourceId=cde1409cb11f4ad0a8bd0fbd0fc1815d_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=336000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=62d4e9f0d87d40b68e02d7057af39dde&api_key=d992a72ef45a488a8a2054cfdc74e8a7&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_cde1409cb11f4ad0a8bd0fbd0fc1815d_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False

{"Protocol":"Http","Id":"cde1409cb11f4ad0a8bd0fbd0fc1815d_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89","Path":"http://127.0.0.1:8096/LiveTv/LiveStreamFiles/69d4c7b107a643e8a7baea101b6d4f04/stream.ts","Type":"Default","Container":"mpegts","IsRemote":false,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"SupportsProbing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_cde1409cb11f4ad0a8bd0fbd0fc1815d_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89","BufferMs":0,"RequiresLooping":false,"MediaStreams":[{"Codec":"mpeg2video","TimeBase":"1/90000","CodecTimeBase":"1001/30000","IsInterlaced":true,"BitRate":2000000,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":480,"Width":720,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"4:3","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":8,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"EngDolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":384000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"ac3","Language":"spa","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital mono","IsInterlaced":false,"ChannelLayout":"mono","BitRate":96000,"Channels":1,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2480000,"RequiredHttpHeaders":{},"AnalyzeDurationMs":2000,"DefaultAudioStreamIndex":1}

/home/pi/FFMpeg/ffmpeg -analyzeduration 2000000 -fflags +igndts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/69d4c7b107a643e8a7baea101b6d4f04/stream.ts"-map_metadata -1 -map_chapters -1 -threads 1 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx -b:v 336000 -maxrate 336000 -bufsize 672000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 2 -ab 384000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/b669e860511d52113c66426878eeb871/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby-server/transcoding-temp/b669e860511d52113c66426878eeb871.m3u8" -y "/var/lib/emby-server/transcoding-temp/b669e860511d52113c66426878eeb871%d.ts"


ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg2video @ 0x3404780] Invalid frame dimensions 0x0.
Last message repeated 12 times
Input #0, mpegts, from 'http://127.0.0.1:8096/LiveTv/LiveStreamFiles/69d4c7b107a643e8a7baea101b6d4f04/stream.ts':
Duration: N/A, start: 42471.746067, bitrate: N/A
Program 1
Stream #0:0[0xfb9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x480 [sAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0xfba](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
Stream #0:2[0xfbb](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, mono, fltp, 96 kb/s (visual impaired)
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_omx))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
[h264_omx @ 0x3530750] Using OMX.broadcom.video_encode
[h264_omx @ 0x3530750] OMX error 80001000
[h264_omx @ 0x3530750] err 80001018 (-2147479528) on line 561
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
[aac @ 0x3483100] Qavg: 55590.988
[aac @ 0x3483100] 2 frames left in the queue on closing
Conversion failed!

*****

When i have it set to none for hardware acceleration i get:

 

http://192.168.1.50:8096/emby/videos/8f3bf17d46bffce238a58888fe560b9e/live.m3u8?DeviceId=6931dcd27ec2a4eb67605e0246c3cbc13b2492cf&MediaSourceId=d6d9271dff7d43fa870f1ece901b3f59_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=2&VideoBitrate=336000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=e472dc46cd8d415eb4758860209d3880&api_key=d992a72ef45a488a8a2054cfdc74e8a7&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_d6d9271dff7d43fa870f1ece901b3f59_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False

{"Protocol":"Http","Id":"d6d9271dff7d43fa870f1ece901b3f59_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89","Path":"http://127.0.0.1:8096/LiveTv/LiveStreamFiles/b660bc31ef0a4c3b80d154e48055aa27/stream.ts","Type":"Default","Container":"mpegts","IsRemote":false,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"SupportsProbing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_d6d9271dff7d43fa870f1ece901b3f59_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89","BufferMs":0,"RequiresLooping":false,"MediaStreams":[{"Codec":"mpeg2video","TimeBase":"1/90000","CodecTimeBase":"1001/30000","IsInterlaced":true,"BitRate":2000000,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":480,"Width":720,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"4:3","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":8,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"EngDolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":384000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"ac3","Language":"spa","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":192000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":3,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2576000,"RequiredHttpHeaders":{},"AnalyzeDurationMs":2000,"DefaultAudioStreamIndex":2}

/home/pi/FFMpeg/ffmpeg -analyzeduration 2000000 -fflags +igndts -f mpegts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/b660bc31ef0a4c3b80d154e48055aa27/stream.ts"-map_metadata -1 -map_chapters -1 -threads 1 -map 0:0 -map 0:2 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 26 -maxrate 336000 -bufsize 672000 -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 "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 2 -ab 384000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/7b320a22ede45225cdab4eb5a3773fee/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby-server/transcoding-temp/7b320a22ede45225cdab4eb5a3773fee.m3u8" -y "/var/lib/emby-server/transcoding-temp/7b320a22ede45225cdab4eb5a3773fee%d.ts"


ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Unrecognized option 'preset'.
Error splitting the argument list: Option not found

 

This is using ffmpeg i compiled, so its of course subject to just flat out being wrong. I bought a license to try taking advantage of hardware acceleration. From what i have seen online its supposed to be a pretty significant improvement. I would imagine that its just what many users of emby would like especially given its a one time very low cost upgrade.

 

Sorry forgot to get the output from the command you asked me to run. I figured i should run it for both versions of ffmpeg i have. 

This is for the one compiled on my pi:

Handy that it shows the compile date makes it easy for newbs like me to tell which one is responding.

 

root@raspberrypi:/home/pi/FFMpeg# ./ffmpeg -h encoder=h264_omx
ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10)
  configuration: --enable-gpl --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi
  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. 91.100 /  6. 91.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Encoder h264_omx [OpenMAX IL H.264 video encoder]:
    General capabilities: delay
    Threading capabilities: none
    Supported pixel formats: yuv420p
h264_omx AVOptions:
  -omx_libname       <string>     ED.V.... OpenMAX library name
  -omx_libprefix     <string>     ED.V.... OpenMAX library prefix
  -zerocopy          <int>        E..V.... Try to avoid copying input frames if possible (from 0 to 1) (default 0)
  -profile           <int>        E..V.... Set the encoding profile (from -99 to 100) (default -99)
     baseline                     E..V....
     main                         E..V....
     high                         E..V....
 
This is for the one i installed as system default that works but does not have acceleration:
 
root@raspberrypi:/home/pi/FFMpeg# ffmpeg -h encoder=h264_omx
ffmpeg version 3.2.4-1~bpo8+1 Copyright © 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-version='1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Encoder h264_omx [OpenMAX IL H.264 video encoder]:
    General capabilities: delay
    Threading capabilities: none
    Supported pixel formats: yuv420p
h264_omx AVOptions:
  -omx_libname       <string>     ED.V.... OpenMAX library name
  -omx_libprefix     <string>     ED.V.... OpenMAX library prefix
  -zerocopy          <int>        E..V.... Try to avoid copying input frames if possible (from 0 to 1) (default 0)
 
Edited by tdiguy
Link to comment
Share on other sites

Waldonnis

Again, my browser eats a reply...here we go again  :wacko:

 

The following line really stands out, especially since it's repeated 12 times and the encoder dies on the first frame:

[mpeg2video @ 0x3404780] Invalid frame dimensions 0x0.

Have you tried any other files or anything that's not mpeg2?  It's not easy to tell where the issue really lies, since both encoder and decoder are complaining.  I'm wondering if it's something with that file or a configuration issue...or even a en/decoder issue.  I've seen some mpeg2ts captures that had bad frames at the start, so this may just be one of those files and it's not too difficult to fix if that's the case.

 

As for the -preset option not being known with your custom ffmpeg, it's likely because it's not configured to use libx264 (--enable-libx264, which is not enabled by default).  If you want more complete software encoder support as well and don't mind doing another recompile, you may want to adapt the system's ffmpeg configuration options and add your own omx options to that.  This will probably require installing more libraries and their -dev packages as well (apt-get build-dep is a wonderful thing for this).  I've never built ffmpeg without explicitly enabling a ton of things including libx264 and libx265, so I'm not sure what happens when those aren't enabled and/or the libraries/headers aren't present at build time (I add non-free encoders to my local ffmpeg build, so I have a rather exhaustive --enable list).  You may not need everything that the system's ffmpeg binary has built-in, but you can always recompile later and pare it back once you've confirmed that the stuff you need is working.

Link to comment
Share on other sites

tdiguy

Again, my browser eats a reply...here we go again  :wacko:

 

The following line really stands out, especially since it's repeated 12 times and the encoder dies on the first frame:

[mpeg2video @ 0x3404780] Invalid frame dimensions 0x0.

Have you tried any other files or anything that's not mpeg2?  It's not easy to tell where the issue really lies, since both encoder and decoder are complaining.  I'm wondering if it's something with that file or a configuration issue...or even a en/decoder issue.  I've seen some mpeg2ts captures that had bad frames at the start, so this may just be one of those files and it's not too difficult to fix if that's the case.

 

As for the -preset option not being known with your custom ffmpeg, it's likely because it's not configured to use libx264 (--enable-libx264, which is not enabled by default).  If you want more complete software encoder support as well and don't mind doing another recompile, you may want to adapt the system's ffmpeg configuration options and add your own omx options to that.  This will probably require installing more libraries and their -dev packages as well (apt-get build-dep is a wonderful thing for this).  I've never built ffmpeg without explicitly enabling a ton of things including libx264 and libx265, so I'm not sure what happens when those aren't enabled and/or the libraries/headers aren't present at build time (I add non-free encoders to my local ffmpeg build, so I have a rather exhaustive --enable list).  You may not need everything that the system's ffmpeg binary has built-in, but you can always recompile later and pare it back once you've confirmed that the stuff you need is working.

As of right now the only thing that i have that is not in mp4 format is live tv off my hd homerun. So these errors happen when i go to watch a tv channel which i imagine its trying to transcode / convert on the fly.

As far as the pi goes i have no problem with downloading more stuff. My pi runs off a 160gb hard drive which for a pi and the OS is absolutely spacious. Only problem i have is that i understand what you are telling me, but i have no clue how to do it. I compiled ffmpeg following the tutorial here: https://github.com/legotheboss/YouTube-files/wiki/(RPi)-Compile-FFmpeg-with-the-OpenMAX-H.264-GPU-acceleration. I would assume i could re-compile it with the libx264 just by adding --libx264 to the line:

sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree

so it would then read:

sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --libx264

Is that right?

 

Course i suppose since i am leaving the system ffmpeg intact i could just try it and it wont mess anything up unless i execute the make install command.

Link to comment
Share on other sites

Waldonnis

As of right now the only thing that i have that is not in mp4 format is live tv off my hd homerun. So these errors happen when i go to watch a tv channel which i imagine its trying to transcode / convert on the fly.

As far as the pi goes i have no problem with downloading more stuff. My pi runs off a 160gb hard drive which for a pi and the OS is absolutely spacious. Only problem i have is that i understand what you are telling me, but i have no clue how to do it. I compiled ffmpeg following the tutorial here: https://github.com/legotheboss/YouTube-files/wiki/(RPi)-Compile-FFmpeg-with-the-OpenMAX-H.264-GPU-acceleration. I would assume i could re-compile it with the libx264 just by adding --libx264 to the line:

sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree

so it would then read:

sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --libx264

Is that right?

 

Course i suppose since i am leaving the system ffmpeg intact i could just try it and it wont mess anything up unless i execute the make install command.

 

You can remove the --enable-gpl, since you're configuring for --enable-nonfree, but yep, that would include libx264 support (h.264 software encoder).  You can also override the install directory if you want with --prefix (it defaults to /usr/local) to install it to your home directory or somewhere else like /opt, if you'd like.  There are other things you may want to enable, depending on your preference or needs (some like having libmp3lame other audio and video codecs supported as well)...running configure with --help should print a pretty exhaustive list so you can see what the options are.

 

Ok i quickly found i that wasnt the end all for this. I have been following: https://owenashurst.com/?p=242

Still mid process.

 

:)   I just looked at that and it's a pretty good guide.  I see they also like libfdk-aac (which I personally like as well for some AAC encoding), but be aware that compiling with that means you can't share your ffmpeg binary with others (license for fdk-aac prohibits redistribution, IIRC).  That's really an optional bit, though, as the newer ffmpeg aac encoder is better than its predecessor was, and good for general use.

 

Compiling ffmpeg is a bear because of all of the dependencies and options available (and even worse on Windows for a host of other reasons).  Once you get it configured and working, though, it's a breeze to rebuild if a dependency changes or you want to include some updates from upstream.  For a while, I used a self-written script for my Linux rebuilds, since I built the dependencies straight from their source repositories rather than relying on distribution packages, but I think my scratch drive died or I'd share it.

Link to comment
Share on other sites

tdiguy

I thank you very much for the help on this. My pi is still compiling. I skipped the aac audio part it seems neat but i am lazy and it doesnt look nescisary to me. Actually i skipped a lot of the parts of the tutorial because i dont think they are needed for what i am trying to do. I will see if i am wrong on that part.

If this works it will likely just stay like this for a long time :)

Link to comment
Share on other sites

Waldonnis

Some AAC support is generally good to keep, since it's a pretty universally supported audio codec, but if you're not transcoding the audio tracks, it's no big deal to leave out.   I don't even know if you need to enable anything special for that any more anyway (at least since the aac revamp; it's been a few years now and I haven't thought about it in ages).  It'll be obvious if it's not in there when you try your first transcode with the new binary, I guess  :P   Emby won't ever use fdk-aac, so that's definitely safe to leave out and saves a bit of compile time.  I use it locally for some manual encoding, which is why I keep it around.

 

libvpx is also probably unneeded, since that's for VP8/VP9, and encoding those codecs is pretty rare around here (don't even think Emby is written to encode VPx, only copy or transcode to h.264/HEVC depending on device support).

 

Once you get the configuration down and if you ever feel frisky, you can always download and modify Raspbian's ffmpeg source package so you can build a .deb that you can use dpkg to install (or just make your own package).  It's a bit of work and you have to ensure that you version it such that it doesn't get overwritten by an update from the distribution repo, but it's nice to have a source package that you can build easily, as well as having a deb handy if you ever want to install it on another Rpi.  I actually make packages for anything that I install on my Linux system that isn't already in the upstream repo or that I modify...but I'm a former Debian package maintainer that used to have to deal with multiple architectures, so it's habit.  It does make uninstalling that stuff easier, that's for sure.

Edited by Waldonnis
Link to comment
Share on other sites

tdiguy

So i ended up running sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libx264

 
and compiled it.
I can use the custom ffmpeg in emby with hardware acceleration set to none. but setting hardware acceleration to omx just gets me a black screen.
 
Log file shows:
http://192.168.1.50:8096/emby/videos/8f3bf17d46bffce238a58888fe560b9e/live.m3u8?DeviceId=6931dcd27ec2a4eb67605e0246c3cbc13b2492cf&MediaSourceId=e4dba331709041e596c16386d6ef845c_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=2&VideoBitrate=336000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=24432f055e2c4114b1f6cc4965f62c2f&api_key=d992a72ef45a488a8a2054cfdc74e8a7&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_e4dba331709041e596c16386d6ef845c_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False

{"Protocol":"Http","Id":"e4dba331709041e596c16386d6ef845c_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89","Path":"http://127.0.0.1:8096/LiveTv/LiveStreamFiles/b660bc31ef0a4c3b80d154e48055aa27/stream.ts","Type":"Default","Container":"mpegts","IsRemote":false,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"SupportsProbing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_e4dba331709041e596c16386d6ef845c_native_fcbcf1347c6429fa31f5b1e78d8011d2_6acc3b51ebc6c01d2024de8a03a51c89","BufferMs":0,"RequiresLooping":false,"MediaStreams":[{"Codec":"mpeg2video","TimeBase":"1/90000","CodecTimeBase":"1001/30000","IsInterlaced":true,"BitRate":2000000,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":480,"Width":720,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"4:3","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":8,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"EngDolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":384000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"ac3","Language":"spa","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":192000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":3,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2576000,"RequiredHttpHeaders":{},"AnalyzeDurationMs":2000,"DefaultAudioStreamIndex":2}

/home/pi/FFMpeg/ffmpeg -analyzeduration 2000000 -fflags +igndts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/b660bc31ef0a4c3b80d154e48055aa27/stream.ts"-map_metadata -1 -map_chapters -1 -threads 1 -map 0:0 -map 0:2 -map -0:s -codec:v:0 h264_omx -b:v 336000 -maxrate 336000 -bufsize 672000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 2 -ab 384000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/e460d7dbd8ef5678ee99905b19e6ca06/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby-server/transcoding-temp/e460d7dbd8ef5678ee99905b19e6ca06.m3u8" -y "/var/lib/emby-server/transcoding-temp/e460d7dbd8ef5678ee99905b19e6ca06%d.ts"


ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libx264
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg2video @ 0x2b22730] Invalid frame dimensions 0x0.
Last message repeated 10 times
Input #0, mpegts, from 'http://127.0.0.1:8096/LiveTv/LiveStreamFiles/b660bc31ef0a4c3b80d154e48055aa27/stream.ts':
Duration: N/A, start: 3850.261133, bitrate: N/A
Program 5
Stream #0:0[0x11b0]: Video: mpeg2video (Main) ([128][0][0][0] / 0x0080), yuv420p(tv, top first), 720x480 [sAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x118a]: Data: scte_35
Stream #0:2[0x118b](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
Stream #0:3[0x118c](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_omx))
Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
[h264_omx @ 0x2b179f0] Using OMX.broadcom.video_encode
[h264_omx @ 0x2b179f0] OMX error 80001000
[h264_omx @ 0x2b179f0] err 80001018 (-2147479528) on line 561
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
[aac @ 0x2b75220] Qavg: 44086.867
[aac @ 0x2b75220] 2 frames left in the queue on closing
Conversion failed!
Edited by tdiguy
Link to comment
Share on other sites

Waldonnis

 

So i ended up running sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libx264

 
and compiled it.
I can use the custom ffmpeg in emby with hardware acceleration set to none. but setting hardware acceleration to omx just gets me a black screen.

 

 

Hmm, that's going to be something beyond my ability to help with, then.  You can try running a manual transcode with the same options that Emby's trying with an increased loglevel to see if there's some issue that ffmpeg just isn't coping well with that wouldn't cause an overt error, but that's about all I can think of trying without having my Rpi working to double-check what else might be needed for OpenMAX support.  Glad that it's working without trying hardware transcoding, though...at least we got that sorted out.  There's nothing obviously odd in the transcode log when it's showing a black screen, I'm assuming?

Link to comment
Share on other sites

tdiguy

I just went back and edited my post to include the log. Only thing that stands out to me is that it seems to be complaining about frame dimensions of 0x0. 

Link to comment
Share on other sites

Waldonnis

Just saw the log you posted and everything I'm seeing about that error value indicates an out of resources issue.  I found a few references indicating that increasing the gpu_mem value in their Rpi's config.txt made a difference for others.  Some reporting setting it to 128MB seems to work for them, while a few others set it higher (192MB or 256MB).  Worth trying and shouldn't take long to change/reboot.

Link to comment
Share on other sites

tdiguy

I just realized i might also be going about this all wrong. I am trying to get hardware accelerated transcoding to work from my hdhomerun via emby to my web browser..

 

I just upped the memory to 256 and i turned on gl full kms. Not really sure what it does but it seemed like it might be related to hardware acceleration. ( lol but i dont know )

This is my latest transcode error log.

 

http://192.168.1.50:8096/emby/videos/5503981653edb9e778a1db383fe3ab98/live.m3u8?DeviceId=6931dcd27ec2a4eb67605e0246c3cbc13b2492cf&MediaSourceId=b19e8b9f361c451b9a3de3406d158136_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=336000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=1e0b5bb9f04e40ddbded46acbbd66f24&api_key=d992a72ef45a488a8a2054cfdc74e8a7&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_b19e8b9f361c451b9a3de3406d158136_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False

{"Protocol":"Http","Id":"b19e8b9f361c451b9a3de3406d158136_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89","Path":"http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8dcebf24dfd3448083668fd126b1dbee/stream.ts","Type":"Default","Container":"mpegts","IsRemote":false,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"SupportsProbing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_b19e8b9f361c451b9a3de3406d158136_native_bbba5a6de96521ff4b73e891b4afe6e8_6acc3b51ebc6c01d2024de8a03a51c89","BufferMs":0,"RequiresLooping":false,"MediaStreams":[{"Codec":"mpeg2video","TimeBase":"1/90000","CodecTimeBase":"1001/30000","IsInterlaced":true,"BitRate":2000000,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":480,"Width":720,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"4:3","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":8,"IsAnamorphic":false},{"Codec":"ac3","Language":"eng","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"EngDolby Digital stereo","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":384000,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"ac3","Language":"spa","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital mono","IsInterlaced":false,"ChannelLayout":"mono","BitRate":96000,"Channels":1,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":2480000,"RequiredHttpHeaders":{},"AnalyzeDurationMs":2000,"DefaultAudioStreamIndex":1}

/home/pi/FFMpeg/ffmpeg -analyzeduration 2000000 -fflags +igndts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8dcebf24dfd3448083668fd126b1dbee/stream.ts"-map_metadata -1 -map_chapters -1 -threads 1 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx -b:v 336000 -maxrate 336000 -bufsize 672000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 2 -ab 384000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/eddb2be8f422ca2235e2fb4414d9b115/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby-server/transcoding-temp/eddb2be8f422ca2235e2fb4414d9b115.m3u8" -y "/var/lib/emby-server/transcoding-temp/eddb2be8f422ca2235e2fb4414d9b115%d.ts"


ffmpeg version git-2017-06-01-3385989 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libx264
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg2video @ 0x2b5b730] Invalid frame dimensions 0x0.
Last message repeated 16 times
Input #0, mpegts, from 'http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8dcebf24dfd3448083668fd126b1dbee/stream.ts':
Duration: N/A, start: 61355.586067, bitrate: N/A
Program 1
Stream #0:0[0xfb9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x480 [sAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0xfba](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
Stream #0:2[0xfbb](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, mono, fltp, 96 kb/s (visual impaired)
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_omx))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
[h264_omx @ 0x2bdae00] Using OMX.broadcom.video_encode
[h264_omx @ 0x2bdae00] OMX error 80001000
[h264_omx @ 0x2bdae00] err 80001018 (-2147479528) on line 561
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
[aac @ 0x2b4ffb0] Qavg: 57311.465
[aac @ 0x2b4ffb0] 2 frames left in the queue on closing
Conversion failed!

 

To me it looks like its trying...but i see it is still complaining about 0x0 dimensions.

Link to comment
Share on other sites

Waldonnis

Also i just noticed it says 6-1, i had just compiled this it should say 6-2 right?

 

No, that's just the date and version stamp from the last upstream commit prior to the build.  When it's built isn't as important as what "version" was built, so version strings like that indicate when the source snapshot was from (the version string on mine is even more arcane).  Adding OpenGL support shouldn't really help with this stuff, but it shouldn't hurt either.  It was worth trying, I guess.

 

Looking over the code again, the error being returned is happening right after buffer allocation is attempted, so it still seems resource related.  Not sure what model Rpi you're using, but you can try going even higher with gpu_mem for grins and see if that helps, assuming your model has that much memory to spare.  Everything I'm seeing points to you having a correctly configured ffmpeg at this point.  The only things I can think of now are: something's wacky with the TS file (not likely if software encoding works), that this file needs more RAM to buffer for the encoder, or the encoder is choking on something it wasn't designed to handle.  I've seen issues with some hardware encoders when using odd resolutions or framerates, but this file looks pretty generic - 480p, 29.97 framerate, yuv420p (although it could be interlaced, but I can't tell and don't know if it would matter).

Link to comment
Share on other sites

tdiguy

I have a rpi3 if i remember this thing only has a gig of ram. I have it set for 256 for the gpu right now. Not sure how much higher i should set it. I wonder how much gpu memory is needed to satisfy this. 

I don't really know if the source is interlaced or not myself except to say that with just software decoding it does work, albeit very slow and somewhat choppy.

Link to comment
Share on other sites

tdiguy

Well i upped the gpu memory to 400mb not sure i want to go much past that.

I think the error has stayed the same.

http://192.168.1.50:8096/emby/videos/4c09260289813348672fd1661b895dd1/hls1/main/0.ts?DeviceId=6931dcd27ec2a4eb67605e0246c3cbc13b2492cf&MediaSourceId=4c09260289813348672fd1661b895dd1&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=336000&AudioBitrate=384000&Level=51&Profile=high&PlaySessionId=8ff208586d3f493c91b066e16190bda3&api_key=d992a72ef45a488a8a2054cfdc74e8a7&CopyTimestamps=false&TranscodingMaxAudioChannels=6&EnableSubtitlesInManifest=false&Tag=ccd5e20c88dd2ffd393b5b89cbb467ab&RequireAvc=true&RequireNonAnamorphic=false&DeInterlace=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False

{"Protocol":"File","Id":"4c09260289813348672fd1661b895dd1","Path":"/media/emby/Recorded-TV/Judge Judy/Judge Judy 2017-06-01 - Time Share Fiasco!; Bad Luck Car Sale.ts","Type":"Default","Container":"ts","Name":"1080P/MPEG2VIDEO/AC3","IsRemote":false,"ETag":"ccd5e20c88dd2ffd393b5b89cbb467ab","RunTimeTicks":18000609280,"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":"mpeg2video","TimeBase":"1/90000","CodecTimeBase":"1001/30000","IsInterlaced":true,"BitRate":11683885,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":4,"IsAnamorphic":false},{"Codec":"ac3","CodecTag":"AC-3","Language":"eng","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Eng Dolby Digital 5.1","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":384000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false},{"Codec":"ac3","CodecTag":"AC-3","Language":"spa","TimeBase":"1/90000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital mono","IsInterlaced":false,"ChannelLayout":"mono","BitRate":96000,"Channels":1,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0,"IsAnamorphic":false}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":12163885,"RequiredHttpHeaders":{}}

/home/pi/FFmpeg/ffmpeg -i file:"/media/emby/Recorded-TV/Judge Judy/Judge Judy 2017-06-01 - Time Share Fiasco!; Bad Luck Car Sale.ts" -map_metadata -1 -map_chapters -1 -threads 1 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_omx -b:v 336000 -maxrate 336000 -bufsize 672000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,640)/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 -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/emby-server/transcoding-temp/3efee7a6b9f1e07b267af575bfc58ec2.m3u8" -y "/var/lib/emby-server/transcoding-temp/3efee7a6b9f1e07b267af575bfc58ec2%d.ts"


ffmpeg version N-86348-g9faf098 Copyright © 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libx264
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. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg2video @ 0x2e3cb20] Invalid frame dimensions 0x0.
Last message repeated 13 times
[mpegts @ 0x2e385c0] PES packet size mismatch
Last message repeated 1 times
Input #0, mpegts, from 'file:/media/emby/Recorded-TV/Judge Judy/Judge Judy 2017-06-01 - Time Share Fiasco!; Bad Luck Car Sale.ts':
Duration: 00:30:00.06, start: 10449.261978, bitrate: 11683 kb/s
Program 10
Stream #0:0[0xe65]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [sAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0xe66](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2[0xe67](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, mono, fltp, 96 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_omx))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
[h264_omx @ 0x2fa3950] Using OMX.broadcom.video_encode
[h264_omx @ 0x2fa3950] OMX error 80001000
[h264_omx @ 0x2fa3950] err 80001018 (-2147479528) on line 561
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
[aac @ 0x2fa51e0] Qavg: 331.021
[aac @ 0x2fa51e0] 2 frames left in the queue on closing
Conversion failed!

Link to comment
Share on other sites

tdiguy

I am not really sure where this is failing at this point. When i read about the rpi and hardware encoding there are plenty of people saying its nice and smooth and very resource light. Not really sure how they get it to work other than they typically are using a player that also directly supports hardware acceleration. 

I have been trying it on pre-recorded shows to try narrowing things down a bit rather than trying to transcode the scream from the hd homerun. but it does not seem to make a difference.

Link to comment
Share on other sites

Waldonnis

I run across a lot of omxplayer and gstreamer use as well, but not much with ffmpeg other than the initial patches/discussion to make it happen.  I'm not sure what else to really try, though.  If software encoding works, then it's something with h264_omx, but I just don't see what that could be offhand...especially after trying the gpu_mem increases.  I'll keep digging around and see what I can find.

Link to comment
Share on other sites

tdiguy

Yes I guess I was just being ambitious :) thinking how cool it would be to have working hardware acceleration with ffmpeg on a pi and how much better it would work as a media server.

 

Sent from my SM-G900P using Tapatalk

Link to comment
Share on other sites

tdiguy

Hmm,maybe i have been chasing the wrong rabbit this whole time.

Looking at https://trac.ffmpeg.org/wiki/HWAccelIntro

It seems the only hardware acceleration for ffmpeg curretly supported is mmal

 

What i really dont know though is how this plays into things because i dont recall seeing an option for mmal under hardware acceleration in emby. I bet there is a way to compile ffmpeg with it though but no idea if emby would know how to use it. Off to find out how to compile ffmpeg with mmal!

Link to comment
Share on other sites

  • 2 weeks later...
tdiguy

I will have to see if this works when i get home but i think i might have found my problem.

I have a boot redirect setup on my pi. I keep making changes to /boot/config.txt but thats not the config file my system actually uses for config information. My system uses /dev/mmcblk0p1/config.txt for nearly all config information and such. I should have remembered this from when i had a heck of a time entering the mp2 decode key.

 

Cant wait to get home and test this. I also changed the hdmi mode because i kept seeing the errors about sizing maybe the hdmi mode will clear that up also.

 

I swear i should change my banner to *** remember to mod the correct config.txt file! /dev/mmcblk0p1 mount this device then edit! ***

 

 

 

Link to comment
Share on other sites

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...