Jump to content

Option to override ffmpeg command


lills

Recommended Posts

Hi,

 

I cannot get Emby (Windows or Synology versions) to transcode mkvs (h265) to mp4 (h264) my Humax set top box connected to my TV. I believe my dlna profile is configured correctly as the Humax box see's the emby server and attempts to start transcoding the mkv to mp4. It tries for about 15 seconds and I can see that transcoded file building in the transcoding-temp folder. But I get the error 'unsupported format'.

 

After looking at the ffmpeg log I could see it was trying to run this command:

 

/var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -f matroska -i file:"/volume1/TV Series/Episode1.mkv" -map 0:0 -map 0:1 -sn -c:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -pix_fmt yuv420p  -maxrate 2797563 -bufsize 5595126 -preset veryfast -profile:v:0 high -level:v:0 4.1 -crf 50 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -metadata:s:a:0 language=eng -disposition:a:0 default -f mp4 -movflags frag_keyframe+empty_moov -y "/var/packages/EmbyServer/target/var/transcoding-temp/0f3c8cf01426f08cce293ae4187ac740.mp4"

 

I then decided to run this command manually and then stream the resulting mp4 file to my box and it would not play (unsupported format). After a lot of trial and error, I modified the command above (replacing -movflags frag_keyframe+empty_moov with -movflags faststart and then the mp4 file would stream to the Humax box no problem.

 

So I was wondering, is it possible to override the built in ffmpeg command so that I can specify -movflags faststart.

 

Log file attached 

 

Many thanks

 

Lills

Link to comment
Share on other sites

Hi, I'm surprised it's even transcoding to mp4. Did you do a custom profile?

Link to comment
Share on other sites

Yes,

 

I created a HTTP Header using User-Agent = POSIX (substring). I also configured the transcoding option Type=Video, Protocol=HTP, Container=MP4, Video Codec=h264, Audio=ac3,aac

 

I know mkv to mp4 is possible because I have managed it with UMS on my laptop to the Humax box which supports the above codecs, but would like to do it in Emby so I can do this direct from the NAS.

Link to comment
Share on other sites

Are you sure this is the right choice though? Testing a completed mp4 file and having it work does not mean that an in-progress mp4 transcoding will be able to play. Are you sure it can't play .ts which is the default transcoding container?

Link to comment
Share on other sites

Hi, I've managed to get the video to transcode and play now on a source mkv file. But only the video will play, no audio (get an error saying audio not supported)

 

Transcode settings:

Type=Video, Protocol=HTTP, Container=mpg, Video Codec=h264, Audio=ac3

 

So it looks like the mpg container is getting things going. However setting audio to ac3 or aac in the dlna profile doesn't seem to work. I can downmix to mp3, but would like the full multichannel audio

 

The source MKV file has an ac-3 dolby digital stream (448 kb/s, 16 bits, 6 channels)

 

This will play when using UMS, so I know ac3 audio is possible on the HUMAX box.

Edited by lills
Link to comment
Share on other sites

I'm still trying to work that out in the massive log it creates. I have noticed something interesting in the emby ffmpeg log. It says this

 

'ac3 in MPEG-1 system streams is not widely supported, consider using the vob or the dvd muxer to force a MPEG-2 program stream.'

 

so it looks like it don't like the mpg container for audio (but works for video). but if i set it to ts it wont even play video or audio.

Link to comment
Share on other sites

The first step in supporting any device with Dlna profiles is finding out what formats it supports. Then from that list it's essentially trial and error to find out the right transcoding format. Why, because even though a device can play a static, completed video file, doesn't mean it can play the same in-progress as it's being written to during the transcoding process.

 

So you'll need to find out what formats should be used before worrying about designing a dlna profile in Emby. I would imagine the easiest way to find that out will be to just figure out what ums is doing when it transcodes.

Link to comment
Share on other sites

Thanks for your help with this.

 

Just by luck I found another thread where someone was having a similar issue to me with a Panasonic Viera TV and noticed you had updated that profile for this issue. I tried that profile and everything now works. 

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