Page 1 of 1

Allow custom A/V encoder

PostPosted: Mon Jan 14, 2013 11:15 am
by csholmq
Currently, only a fixed set of encoders are available for transcoding.

targetVCodec - optional; name of video codec to transcode into or omit this attribute to keep the video stream as it is; possible values: mpeg2video (MPEG2), wmv2 (WMV9)
targetACodec - optional; name of audio codec to transcode into or omit this attribute to keep the audio stream as it is; possible values: aac, ac3, mp2, mp3, lpcm, wmav2


For my FPU-less NAS, I rely heavily on fixed point algorithms or otherwise effective codecs. If, for audio encoding, I want to use ac3_fixed or libshine, there are basically two ways of solving it;

  • Create a ticket and wait for a new version of Serviio that supports the new fixed point codec (-Dserviio.fixedPointEncoders)
    - This takes time and doesn't really make sense for multiple codecs or for codecs that aren't fully fixed point (e.g libfdk_aac).
  • Use a bash wrapper that substitutes the codec for each FFmpeg call.
    - Brings a lot of bash issues where spaces and special characters get scrambled etc.

I propose a solution where targetVCodec/targetACodec accepts any used-given codec. In order to be able to validate used input, I understand this poses issues. My suggestion is to have a config file with listed, pre-defined, codec names. Much like today, just that the pre-defined codecs are user-configurable.

What do you think?

Re: Allow custom A/V encoder

PostPosted: Mon Jan 14, 2013 5:24 pm
by slyguy42o
I am no expert in this arena, but I think this thread might be of use to your inquiry.

viewtopic.php?f=7&t=6458

Re: Allow custom A/V encoder

PostPosted: Mon Jan 14, 2013 5:44 pm
by csholmq
Kind of correct. patters has settled for the wrapper-approach. That's what I'm arguing against.

Re: Allow custom A/V encoder

PostPosted: Tue Jan 15, 2013 5:14 pm
by zip
it would involve a big change in the core. I'll be trying to release in shorter cycles now.

Re: Allow custom A/V encoder

PostPosted: Tue Jan 15, 2013 6:19 pm
by csholmq
zip wrote:it would involve a big change in the core. I'll be trying to release in shorter cycles now.

I see. What would be the best approach of selecting between multiple codecs you reckon? For instance, my example with libfdk-aac doesn't really fall under fixed point encoder. So how would I invoke that?

Re: Allow custom A/V encoder

PostPosted: Thu Jan 17, 2013 2:05 pm
by zip
I guess I'd have to add a new -D property, something like -Daac.encoder

So the ticket that you posted should not use the fixedpointencoders as this library is not fixed point?

Re: Allow custom A/V encoder

PostPosted: Fri Jan 18, 2013 3:29 pm
by csholmq
zip wrote:I guess I'd have to add a new -D property, something like -Daac.encoder

So the ticket that you posted should not use the fixedpointencoders as this library is not fixed point?

I initially had trouble finding anything declaring it's fixed point. But now I have. So it should be fine to use the -Dserviio.fixedPointEncoders flag.