Page 1 of 1

Transcoding FLV/h264 on LG55LW5600

PostPosted: Sun May 01, 2016 7:36 pm
by lsemple
Hi, I have this TV (LG55LW5600).

I cannot play .FLV files on the TV, and I have tried modifying my profiles.xml file, but nothing seems to work ?


The files are .FLV (downloaded from Youtube). Pretty standard file types.

HERE IS THE STRANGE PART.
- I can manually convert the .flv files using this command
"avconv -i infile.flv outfile.mp4"

And then I can play the .mp4 file perfectly fine on the TV, however I have 1000's of them, and serviio -SHOULD- work to transcode them.

Why can I manually convert each file in seconds with that basic command line, but Serviio doesn't have a clue what to do with them ????????. <<-- to me this is very frustrating



HERE IS THE ORIGINAL .FLV FILE PROPERTIES
Demuxer - lavfpref

Video Resolution 300 x 240
Aspect ratio 1.25
Format H264
Bitrate 128 kbps
Frames per second 25.000
Selected codec ffh264

Initial Audio Stream Format MP4A
Bitrate 53 kbps
Rate 22050 Hz
Channels 2
Selected codec ffaac



HERE IS MY PROFILE.XML file for section 8 - LG TV

<Profile id="8" name="LG TV / player" extendsProfileId="1">
<Detection>
<HttpHeaders>
<friendlyName.dlna.org>LG.*</friendlyName.dlna.org>
</HttpHeaders>
</Detection>
<!-- ResourceTransportProtocolHandler>org.serviio.upnp.protocol.http.transport.LGProtocolHandler</ResourceTransportProtocolHandler -->
<MediaFormatProfiles>
<MediaFormatProfile mime-type="video/mp4" name="">AVI</MediaFormatProfile>
</MediaFormatProfiles>
<!--
Transcoding doesn't seem to work and some files can be played natively:
viewtopic.php?f=12&t=3914#p26273
<Transcoding>
<Video targetContainer="mpegts" targetACodec="ac3">
<Matches container="matroska" aCodec="dca" />
</Video>
<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" >
<Matches container="flv" vCodec="h264" />
<Matches container="rm" />
<Matches container="wtv" />
</Video>
</Transcoding>-->
<GenericTranscoding>
<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" />
</GenericTranscoding>
</Profile>


Please help me to understand why such a simple thing as this fails miserably ?

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Sun May 01, 2016 11:56 pm
by DenyAll
You have the entire transcoding block commented out (which is the default for this profile). You need to remove the "-->" at the end of the "</Trancoding>-->" line and add "-->" to the line that ends with "f=12&t=3914#p26273".

I recommend using a context aware editor such as Notepad++ to edit these files. Makes life a lot easier.

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Mon May 02, 2016 2:13 am
by lsemple
HI thanks for the reply, ok so I see that commented out section

the config file was default commented out, so now I have uncommented it, saved it, restarted the server, and for some reason it still does not work.

FLV files still do not play on the TV.






<Profile id="8" name="LG TV / player" extendsProfileId="1">
<Detection>
<HttpHeaders>
<friendlyName.dlna.org>LG.*</friendlyName.dlna.org>
</HttpHeaders>
</Detection>
<!-- ResourceTransportProtocolHandler>org.serviio.upnp.protocol.http.transport.LGProtocolHandler</ResourceTransportProtocolHandler -->
<MediaFormatProfiles>
<MediaFormatProfile mime-type="video/mp4" name="">AVI</MediaFormatProfile>
</MediaFormatProfiles>
<Transcoding>
<Video targetContainer="mpegts" targetACodec="ac3">
<Matches container="matroska" aCodec="dca" />
</Video>
<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" >
<Matches container="flv" />
<Matches container="rm" />
<Matches container="wtv" />
</Video>
</Transcoding>
<GenericTranscoding>
<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" />
</GenericTranscoding>
</Profile>

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Mon May 02, 2016 6:43 am
by lsemple
Ok well, I don't see anything wrong with the config file, so I am assuming that it was commented out by default because it does not work. ?


Anyhow, I made a simple script to batch convert All of my .flv files into .mp4

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Mon May 02, 2016 12:36 pm
by atc98092
lsemple wrote:Ok well, I don't see anything wrong with the config file, so I am assuming that it was commented out by default because it does not work. ?


Anyhow, I made a simple script to batch convert All of my .flv files into .mp4


Sometimes that's the simplest resolution. Better than beating your head against the wall trying to figure it out. :lol: I'm considering doing the same for the hundreds of files I have with MPEG2 video, since a Roku won't play them without transcoding. The main issue is ensuring the files with captions keep them and the ones without captions don't cause an error that stops the script.

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Wed May 04, 2016 5:48 am
by lsemple
To convert a FLV files or any other files to MP4's in a specific folder (for Linux users) ((THIS WORKS RECURSIVELY BTW))

Add this to your ~/.bashrc

mp4ize() {
if [ $# -ne 2 ]; then
echo -e 'Usage: mp4ize path extension\nExample: mp4ize my/Videos/ flv' >&2
else
find "$1" -type f -iname '*.'"$2" | sort | while IFS='' read -r line; do ffmpeg -n -i "$line" -c:v libx264 -c:a libfdk_aac "$(echo "$line" | rev | cut -d '.' -f 2- | rev)".mp4 </dev/null; done
fi
}


Type this is the Linux shell terminal to convert all flv files in /my/videos/folder (your videos) to mp4.

mp4ize /my/videos/folder flv

(replace /my/video/folder with any folder)


Or, you can also convert avi files or other files to mp4's

mp4ize /my/videos/folder avi



Note: you must have ffmpeg installed for this to work :), back up your stuff first,

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Wed May 04, 2016 11:53 am
by zip
yeah, the LG TVs have problems with transcoded content (at least the older models, not sure about the current ones). That's why it was commented out by default.

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Wed May 04, 2016 8:14 pm
by lsemple
I have a newer LG TV (32LB5800) (32" 1080p tv) that I use as my computer screen. FLV and AVI files work with servio perfectly fine on it, with the default Profiles.xml, which has section 8 commented out by default (LG TV).

I guess the TV is a newer model that can play FLV videos.

The LG55LW5600 does not work or transcode even if I uncomment section 8 from Profiles.xml. This is my main TV so the only way to get it working on it is by converting my videos to mp4, no big deal.


I did notice something strange however. If I put a .AVI file on a usb stick and try that on the TV it does not play (unsupported). However, AVI files play over servio on this same TV, even with the transcoding section for that TV commented out. ?

how come servio can play these AVI files over the network but not on the USB stick ? (you don't have to answer it is just some food for thought)


(by the way, the flv videos is h.264 video and ac3 audio codec)

Re: Transcoding FLV/h264 on LG55LW5600

PostPosted: Wed May 04, 2016 10:43 pm
by atc98092
USB and DLNA file support does not necessarily match. Often you can play a file one way and not the other.

However, it's usually the other way around, where USB usually plays something and DLNA doesn't. :shock: