FAQ  •  Register  •  Login

Another plea for a basics guide to transcoding

<<

SolihullRog

Streaming enthusiast

Posts: 33

Joined: Mon Feb 03, 2014 11:43 pm

Post Sat Aug 30, 2014 8:39 pm

Another plea for a basics guide to transcoding

This is yet another request for help with transcoding.

I just read a thread here viewtopic.php?f=7&t=10442&p=69632&hilit=syntax#p69632

where it is claimed that there is a very detailed guide at

http://wiki.serviio.org/doku.php?id=file_np

The only trouble is that the link points to a page entitled "Provide details of a video file that doesn't play".

I've got to a point where I can convert my files to run on my setup, but rather than converting every file, it would be easier to have Serviio transcode them. But Serviio (Sony 2013US profile) doesn't transcode them so that they work on my PC/network/TV.

I would expect that, if I can convert files, then I should be able write a transcode routine to convert them instead. Am I naive?

I've looked at the xml of some profiles, and it doesn't look daunting. But I can't find any guide to the structure of a profile - at least, not one that tells me what I want to know.

How do you define the input? What syntax?
What syntax do you use to define things like the Frames per Second, the output Resolution etc?
How do you define the output? What syntax?
Do I have to crawl through available samples and pick out bits as I find them?


I (think I) need a process whichs accepts an AVI file and outputs it as an MPEG4 stream, with the following attributes:

Frames per second in the range 12 to 30. Say 12.
Resolution based on a maximum width of 1024 pixels
Maximum bit rate 1200 kbps

Is there a guide which tells me how to do this, and also gives me a broader understanding if my first attempts fail?
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Sat Aug 30, 2014 9:55 pm

Re: Another plea for a basics guide to transcoding

I pointed you to the guide before, that shows what you can do. http://www.serviio.org/index.php?option ... icle&id=24
Look at the existing profiles and you will see things like you request.
but transcode to AVC takes too much power so you must use Mpeg2 and you an only specify height not width, nor can you change the frames.
eg:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="1200" maxHeight ="640" >
<Matches container="avi" />
</Video>

BUT
why don't you take the easy path and post the ffmpeg output of the avi's that don't play with the 2012 and 2013 profiles.
<<

SolihullRog

Streaming enthusiast

Posts: 33

Joined: Mon Feb 03, 2014 11:43 pm

Post Sun Aug 31, 2014 4:57 am

Re: Another plea for a basics guide to transcoding

Thank you very much for your reply.

jhb50 wrote:I pointed you to the guide before, that shows what you can do. http://www.serviio.org/index.php?option ... icle&id=24

I've read that page, but I'd call it an overview rather than a detailed description. I'm not a teccie and I didn't expect to get into days of learning. You seem to suggest that this page is the most comprehensive that I can expect. Is that correct?

Look at the existing profiles and you will see things like you request.
but transcode to AVC takes too much power so you must use Mpeg2 and you an only specify height not width, nor can you change the frames.
eg:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="1200" maxHeight ="640" >
<Matches container="avi" />
</Video>

Thanks for the above. I hope that I can use it, but the fact that it would have taken hours/days for me to work it out, illustrates the difficulty. And thanks for telling me about the constraints on specifying widths and frame rates. This is the type of information that I'd expect in a detailed description. Apologies if it's there ... All I did was buy a TV that I expected to do what it said on the tin ...

BUT
why don't you take the easy path and post the ffmpeg output of the avi's that don't play with the 2012 and 2013 profiles.

The difficulty with that is that I've got a large amount of footage and I don't know which does/does not play. I don't think that people would be happy if I just sent details of every film that I've got.

Thanks again for your help.


EDIT. I've now posted FFMPEG output of two files. Good idea!
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Sun Aug 31, 2014 8:07 pm

Re: Another plea for a basics guide to transcoding

The guide is totally explicit. It tells you what you can detect and what you can transcode to.
Should be obvious that if AVC and width output are not specified but mpeg2video and width are, then those are your options/constraints.
Also obvious, if one of your videos is different than the rest, and wont play, that you will need its specs before you can set the rules.
That's all you need it work it out by your self.
<<

SolihullRog

Streaming enthusiast

Posts: 33

Joined: Mon Feb 03, 2014 11:43 pm

Post Sun Aug 31, 2014 11:56 pm

Re: Another plea for a basics guide to transcoding

Thank you for your reply, along with your previous ones. I don't know if you are part of the Serviio organisation but you are rapidly persuading me to find a different solution.

I've told you before that I am not a teccie, and just bought a TV that Sony said would play my movies via Serviio. Maybe I make Sony aware of this thread.

jhb50 wrote:The guide is totally explicit. It tells you what you can detect and what you can transcode to.
Perhaps it's explicit to you, but if I told you that I was 6 ft tall, would you know what colour or sex I was?
If you worked in my company, and said that that was a satisfactory spec, I'd fire you.


Should be obvious that if AVC and width output are not specified but mpeg2video and width are, then those are your options/constraints.
It may be obvious to you but I just bought a TV and was advised by Sony to use Serviio. What is AVC? Wnat is mpeg2video? Obviously I'm using the wrong product.

Also obvious, if one of your videos is different than the rest, and wont play, that you will need its specs before you can set the rules. Now that's obvious.

That's all you need it work it out by your self.
I must remember, the next time I buy a car, that I need to know how to replace the gearbox, or I shouldn't buy it.

As a helper you make a good obstacle.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Sep 01, 2014 1:24 pm

Re: Another plea for a basics guide to transcoding

I don't know if you are part of the Serviio organisation...
Other than the developer, Petr (zip), everyone else on the forum is simply a user of the product (myself included). Users give of their time freely to try and assist other users.

jhb50 has pointed you to the guide. There are two main parts you need to look at:

  • The <Matches ...> statement. This defines the container type, video codec, audio codec and some other selected parameters of the source file. For example the statement:

      <Matches container="matroska" vCodec="h264" aCodec="ac3" />
    will match any source files with a Matroska container type (.MKV file) with a video codec of AVC (H264) and an audio codec of Dolby Digital (AC3). When you attempt to play a file that matches these characteristics, Serviio will "match" it and perform the transcoding action that is listed in the <Video..> statement that precedes the matches command
  • The <Video ...> statement/block. This defines the container type, video codec, audio codec and some other selected parameters that the source file will be transcoded to. For example the statement:

      <Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" aBitrate="384">
    will transcode the source file (matched via the Match statement) to a MPEG2-TS container type with a video codec of mpeg-2 and an audio codec of Dolby Digital (AC3) with a audio bitrate of 384 kbps.
You put these two parts together to provide a complete "transcoding block" - for example:
  Code:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="17000" targetACodec="ac3" aBitrate="384">
   <Matches container="maktroska" vCodec="h264" aCodec="ac3"/>
</Video>
will match any maktroska (MKV) source file that contains H264 video and AC3 audio, and transcode it to a MPEG2-TS file with MPEG2 video and AC3 audio. It will limit the video bit rate to 17Mbps during transcoding.

The guide will give you all the supported parameters (supported container types, video codecs, audio codecs etc). What I think you may be missing is "what the hell do all these terms mean". What is a container, what is video codec, audio codec, etc. This is where the guide doesnt help you - but google does- some suggested reading for this is:

  • https://www.youtube.com/watch?v=WpBjGUlBTHU - pretty good, but I don't necessary support his recommendation to use MP4 ... this depends on your renderer, but a good overview of containers, codecs, etc.
  • http://www.fallenempiredigital.com/blog/2013/02/08/a-guide-to-common-video-formats-containers-compression-and-codecs/
  • https://library.rice.edu/services/dmc/guides/video/VideoFormatsGuide.pdf
You can use tools like ffmpeg and MediaInfo (see viewtopic.php?f=5&t=1123 - I prefer MediaInfo for this) which will provide you with the details of your video files (container type, codecs, etc) - as you can see, this information is critical to triggering transcoding through the <Matches..> command.

Even once you get your head around all of this, the last part is... video files ain't perfect. Some video encoders are better than others; some were freeware that was poorly written and caused issues. So you can end up with an AVI file for example that has all the characteristics and looks exactly the same as another AVI, and yet one will play and the other not. This is where the forum can assist - others will have had similar experiences and can help you. For example, looking at some of you other posts I think your AVI files may be able to fixed by remuxing them - there was a commonly encoder that caused some problems with AVI files (if you play the AVI on your TV via USB does it display the same problems ). To remux the file use the command:

    ffmpeg -i filename.avi -c copy -map 0 newfilename.avi
and see if the new file is better.

Hope this long, long post helps your understanding. Once you get your head around it, its not too bad... and the forum users will fill in the gaps. Serviio is imho the best media server around, and has the flexibility to deal with 99% of the video variants out there (99% of all stats are made up :-)). I think this is why Sony recommend it....
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

SolihullRog

Streaming enthusiast

Posts: 33

Joined: Mon Feb 03, 2014 11:43 pm

Post Mon Sep 01, 2014 2:58 pm

Re: Another plea for a basics guide to transcoding

Thank you very much.

EDIT
====

I've just read your post properly, and it's a great improvement on anything else I've seen, including the wiki.

I still don't see a definition of all the supported parameters, but perhaps I need to read again, slower.

To help others in my position...

To identify movies that are unlikely to play I've done this.

Run some sample movies and record which play and which don't.
Scan all (sampled and unsampled) movies in Mediainfo (XML view)
Export them into Excel in XML format but in an analysable structure. There are various videos like this, which show how to do it. http://www.youtube.com/watch?v=r0S2CQd46C4
Now, knowing which sample files run, and which don't, it's fairly easy (maybe) to identify the causes of problems and identify which others might not run ...
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Tue Sep 09, 2014 7:09 am

Re: Another plea for a basics guide to transcoding

As DenyAll said, problems with media are quite often down to the particular media files themselves - especially with AVI. On here everyone always asks for the media info first, because that is the most likely problem and issues can be spotted quickly by an experienced eye. It saves someone testing device profiles or Serviio itself for no reason. Many older digital cameras save AVIs containing MJPEG but with strange audio bitrates that can cause problems for instance.

Back when movie and TV rips were all AVI files it was a bit of a wild west scenario. Encoders were poorly understood by the guys making the files, and so you encounter invalid options, and things like H.264 in AVI which is a horrible non-compliant hack. People frequently complain about these types of file on here, but AVI does not technically support H.264 video end of story. If you downloaded a TV series that's in that format, the advice would be to get it again in MP4 or MKV format.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 11 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.