Page 1 of 1

Streaming Videos on anything (I think)

PostPosted: Sun Nov 04, 2012 9:40 pm
by dsplzion
I searched long and hard and tried a lot of stuff before I came up with my solution to my transcoding woes and I wanted to impart my experiences to help others in case they were having the same difficulties. My Subsonic doesn't seem to want to transcode anything at all for me and even if it did, transcoding isn't supposed to work at all anyway when your client is a Roku which one of my major clients is. Every time I try to get Subsonic to transcode, it fails and tries to stream the original file and then the log file says that ffmpeg had a permissions problem. I have tried many times to fix this issue but finally decided to forget that since I needed to stream video to the Roku anyway. My solution was to re-encode all files on my Subsonic server to a format that will stream as-is. I settled on .mp4 format because it works on every client out there. You can stream it to web browsers, external players, androids, iphones, Roku... everything that I need.

The next problem I came up against was finding a good conversion software. I used Handbrake for a long time because it was recommended highly by a lot of people but I found that sometimes it would end up skewing the audio on longer files. I tweaked on it for a very long time thinking I could eventually figure out how to fix this but finally realized that Handbrake just didn't seem to know how to properly convert from AC3 to AAC without skewing. So then I started looking for another encoding product.

I tried a few and finally came up with XMedia Recode. It has some problems but it does a fine job when it works properly. Here are the problems I have encountered with it.

1. It doesn't work at all on some of my computers. When I load a file to be converted and go to the Filters/Preview tab, the preview is blank which tells me that the program has some sort of issue with video. On computers that have this issue, if I try to encode anyway, it creates a 0-length file and stops encoding immediately saying 'Done'. I've tried everything I could to fix this, codecs of all kinds, DirectDraw, older versions of the program.... nothing seems to help. This is only on some computers, though. I have 3 here currently and it works fine on 1 of the 3.

2. It crashes when it comes up against something it doesn't know what to do with. I tried to encode a DVD to .mp4 and every time I started the encoding, it would crash immediately. I finally realized I was trying to encode an audio-DVD and that was why it crashed.

3. The Author is german and though he says on his website if you need support, just email me.... he doesn't respond to emails. I've seen this reported on several other websites. Although he does read the emails I think because once I emailed him for a feature request and though he didn't respond to the email, there was soon a new version of the program out that had the feature I had requested so that was really cool... :D

So, even though it has some problems, when it works, it works brilliantly. XMedia Recode has never failed to recode the audio portion of a video properly. The audio and video is always perfectly synced after a recode (assuming it was synced before encoding). XMedia has a TON of options for encoding so I will tell you what has worked for me.

First of all, I found out that if you want to stream video, you can't just send any old .mp4. To stream video, you have to have an .mp4 that is properly encoded for streaming. In Handbrake that means you have to click 'Web Optimized'. XMedia recode didn't used to have the option to create a file made for streaming but soon after I emailed the author about this, the latest version came out (3.1.3.0 as of this writing) with the option on .mp4 to create a file with 'Fast Start'. This means that the 'moov' atom is set at the beginning of the file rather than the end which used to be the standard. Incidently, if you already have an .mp4 file you want to stream and it doesn't start quickly, you can fix this with either a dos program called qt-faststart.exe or there is a nice little windows utility called MP4 FastStart.exe (thank you DataGoRound for this). Works great... I'm certain I was not the only person to email the author of XMedia Recode about this feature but it seemed as though he was responding to me directly when it came out so quickly after my email. :D he he.

So, beginning with the Format tab set to MP4, mp4 file extension, codec H.264 and Audio Codec set to AAC, make sure you click the FastStart option to create a streamable file.
Next, the video section, I set Profile to Main, Level at 4.1, Preset to Medium, FrameRate to Keep Original, Rate Control to Constant Quality and Quality at 24.0. This gives me a nice-looking file that will still stream in most cases without jittering. Everything else on the Video tab I leave default.
On the Audio Tab, I set Modus to Convert, Codec to AAC, Sample Rate to 44100, Channels Stereo, Rate Control to Average bitrate, and bitrate to 128. MPEG version at MPEG-4, Object Type LC.
I leave the Subtitles section alone, and move on to Filters/Preview. In Resolution, I make some decisions. If the file I am converting is larger than 720 by anything then I change the Width down to 720 and leave the aspect ratio at Keep original in most cases. Unless I think the aspect ratio is incorrect in the original file in which case I try to fix it.
If the original file doesn't have any chapters and it is a long file like a movie or something, I will auto-add chapters at every 5 minutes and that is pretty much it. I click add job and then encode. XMedia may not be the fastest encoder out there. I have read people saying it is a bit slow but the final result is always very nice and streams well.

In subsonic, i pretty much don't have to do anything special. I just set the video file types to just .mp4 and it is happy to send those straight through. Even a long movie will begin streaming in less than 10 seconds over the internet.

I hope I have helped some of you struggling people. If you think there are improvements to be made to my directions here, I welcome your input. I will try to resond to questions as well. I would also like to thank Sindre for Subsonic. It's a wonderful product.

-dsplzion

Re: Streaming Videos on anything (I think)

PostPosted: Tue Dec 11, 2012 5:31 am
by 03WhiteConv
Great info, I was looking for this!

Re: Streaming Videos on anything (I think)

PostPosted: Wed Dec 12, 2012 5:12 am
by dsplzion
Glad I could help!

Re: Streaming Videos on anything (I think)

PostPosted: Wed Dec 12, 2012 8:00 am
by GJ51
I've done this for some time and have written about it quite often.

I use Slysoft's HD-DVD anywhere to rip DVD's and Blue rays to Mp4.

For other videos I use the AVS software suite that has many utilities for reformatting video and audio.

Finally, for MP4's with the atom at the end I use QTIndexSwapper2.

Transcoding takes a lot of CPU power and the more the better, so if your desktop has more CPU than your server, it helps to do everything on your most powerful CPU and then transfer the mp4 to the server.

And, yes, anything that can load Subsonic should be able to play any videos set up this way.

Re: Streaming Videos on anything (I think)

PostPosted: Wed Dec 12, 2012 6:55 pm
by alphawave7
I post my concert vids on Youtube, starting from AVCHD (lite) which presents its own issues, but have settled on the following tools:

Handbrake: 'Quick and Dirty' to normal profile HD files which look great, especially after a quick deinterlace and denoise depending on original. (I'm curious by how it's 'skewing' the AC3 to AAC conversion..do you mean sound loses sync with vid?).

Avidemux: 'More fiddly' because it has more options than Handbrake..has additional filters by different devs that allow finer tweaking (especially the deinterlace/noise areas), as well as decent audio format conversions. If I had to 'give up' Handbrake, this would be my preferred tool.

virtualdub: 'Kitchen sink'..while it outs to AVI (convert in above) this software offers a whole host of tools and filters to really fix troublesome vids. 'Neat' denoise plugin available, along with dozens of others, but what I use it for is to replace the audio tracks in my vids. Often, I'll be so close to stage, my cam will get the usual bass and drum clips from the mains or the monitors, and the audio on that vid is worthless. As a backup and main track, I also record on a Tascam digital recorder, and treat the audio in Audacity for clip reduction, gain, etc. and export that file as AAC. I use virtualdub to reintroduce the new file, and sync it to the main video, and export as uncompressed AVI, then process the final mp4 compression through Avidemux or Handbrake depending on needs. 8)

Re: Streaming Videos on anything (I think)

PostPosted: Mon Dec 31, 2012 7:30 pm
by ados.adrian
so there's no way to properly convert videos on-the-go? i have to convert them all before asking subsonic to stream them?

Re: Streaming Videos on anything (I think)

PostPosted: Mon Dec 31, 2012 10:50 pm
by dsplzion
so there's no way to properly convert videos on-the-go? i have to convert them all before asking subsonic to stream them?


I didn't say that. All i've said is that I've had zero luck with transcoding which is the term for what you are asking about. I've been successful by encoding them and then streaming them. I will say that transcoding will take a lot of CPU power on your server in order to function. My server has a pretty good processor but after watching all those file re-encode, i'm pretty happy that I did it.

Whenever I try to transcode, the log file says that there was a permissions problem with trying to do it so I gave up on it.

Hope that helps.

-dsp

Re: Streaming Videos on anything (I think)

PostPosted: Wed May 28, 2014 9:50 pm
by maximoraban
Hello this format I can disable transcoding?
need my xeon server support 50 listeners watching HD video, is it possible?
video converter according to its instructions, seems to work pretty well although larger, and do not let me advance
Sorry I do not speak English

Re: Streaming Videos on anything (I think)

PostPosted: Thu May 29, 2014 11:33 pm
by GJ51
Video transcoding will max out your CPU quickly. If you want to feed 50 users HD video, you need to use FLV or MP4 format for the video and turn off transcoding. FLV and MP4 are native formats for JW Player and should play the video without transcoding.

Once you've got that working and your CPU isn't overloaded by multiple streams, you'll run into your next barrier; your upload speed. Your upload bandwidth will determine how many streams can be tapped before it starts to choke.

Re: Streaming Videos on anything (I think)

PostPosted: Fri May 30, 2014 6:02 pm
by maximoraban
Thanks for your answer
make converting mp4 and flv videos, I see that the size increases by approximately 30%, It is normal?
turn off the transcoder and work well,just do not allow me to advance the videos from the bar and when I use the button that displays the minutes flying start
is there any solution to forward the videos??????
i have 100mb bandwich

Re: Streaming Videos on anything (I think)

PostPosted: Fri May 30, 2014 6:22 pm
by GJ51
100mb - 102400kb so if you are sending the video out at 5000kbps then you can send a max of about 20 streams under ideal conditions, not taking into consideration switch activity on your local network. Of course you can limit the kbps of the streams, but at some point you defeat the purpose of using HD video. If memory serves me correctly, most HD video is actually around 15,000kbps, but 5,000 should work nicely for a Subsonic feed.

Theoretically, it looks like if you actually had 20 users @5000 then you would saturate a gigabit lan.

As for the indexing of the video feeds, there is a utility available out in the wild that will reformat mp4 so that the index atom is at the beginning of the file rather than at the end. That way you can seek within the file before it is fully loaded. I've not seen anything similar for FLV.

https://www.google.com/#q=Move+mp4+index+to+front

You also need to remember that there are tons of options and programs available for converting/reformatting video. So when you look at the variability of the source video multiplied by the number of programs/options for doing the conversion, there isn't any way to predict all the possible outcomes. A lot of it si just trial and error until you find the right answer for your particular scenario.

I've had good luck with

AVS software http://www.avs4you.com/?utm_medium=Navigator&utm_source=Navigator&utm_content=Main&utm_campaign=

for a reasonably priced package.

I've also used some Arcsoft products with succsess.

HTH

Re: Streaming Videos on anything (I think)

PostPosted: Sat May 31, 2014 3:30 pm
by maximoraban
I fail to advance the mp4 files with yamb, avidemux QTIndexSwapper...etc
any ideas?
someone you work?

Gracias,thks

Re: Streaming Videos on anything (I think)

PostPosted: Sat May 31, 2014 3:37 pm
by GJ51
Does it work in the web UI? If so, then it may be an issue with yamb.

Re: Streaming Videos on anything (I think)

PostPosted: Sat May 31, 2014 10:04 pm
by maximoraban
ON THE WEB INTERFACE SUBSONIC FORWARD WHEN I WANT THE VIDEO FROM START OF NEW BEGINNING