Page 1 of 1

[SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Sat Sep 08, 2012 5:13 pm
by jhb50
Some SOPCAST streams are HD 1280x720 transmitted as h264/mp3.mpegts
streams.

When processed by ffmpeg in Serviio the transcoding often fails with
2012-09-08 07:51:14,128 WARN [ProcessExecutor] Process cmd has a return code of 1! This is a possible error.


When I run the same command manually, it will often fail with the message
[mpegts @ 0183F3A0] max_analyze_duration 5000000 reached at 5015467
[mpegts @ 0183F3A0] decoding for stream 1 failed
[mpegts @ 0183F3A0] Could not find codec parameters (Video: h264 ([27][0][0][0]
/ 0x001B))

but if I repeat the command it will eventually find the parameters and run successfully, and explains why Serviio sometimes fails.

This failure has 2 impacts on Serviio. First when refreshing a Webresource containing that stream, the refresh will often fail because ffmpeg fails, and the stream will not be listed by Serviio. Secondly if the webresource does refresh correctly, the playback will often fail because ffmpeg fails on the transcode.

I tried adding the -analyzeduration parameter to extend the amount of the file that is searched (I intercept Serviio ffmpeg calls and change the parameters) and it seems to have fixed the webresource refresh which are info only calls, but that parameter has no effect on encoding calls and so transcoding continues to frequently fail.

This problem makes impossible to transcode SOPCAST streams within Serviio. Any suggestions on how to get ffmpeg to extend its search for the h264 parameters?

Re: [Solved]Problem Transcoding SOPCAST streams

PostPosted: Sun Sep 09, 2012 1:37 am
by jhb50
After a lot of testing, I have determined that the -analyzeduration parameter will also work with ffmpeg encoding commands if it is specified before the input parameter hence
ffmpeg.exe" -analyzeduration 10000000 -i http://localhost:8902 -y -threads 4 -copyts -c:v mpeg2video -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -vf scale=854:480 -g 15 -c:a copy -map 0:1 -map 0:0 -sn -f mpegts pipe:

will extend the search for the h264 parameters beyond 5000000 and successfully transcode the stream. This needs to be added to the Serviio ffmpeg command generator.

Re: [Solved]Problem Transcoding SOPCAST streams

PostPosted: Sun Sep 09, 2012 7:37 am
by Illico
Good work !
Could you add a bitbucket ticket ? This parameter is only need with live stream.

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Sun Sep 09, 2012 1:28 pm
by jhb50

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Sun Sep 09, 2012 10:01 pm
by zip
Does the change have any effect on performance? IE should I add it to processing local files as well, or just online content?

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Sun Sep 09, 2012 10:43 pm
by jhb50
zip wrote:Does the change have any effect on performance? IE should I add it to processing local files as well, or just online content?

Not that I can see, and its only an online stream problem

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Wed Sep 12, 2012 12:02 am
by jhb50
jhb50 wrote:
zip wrote:Does the change have any effect on performance? IE should I add it to processing local files as well, or just online content?

Not that I can see, and its only an online stream problem


Looks like ffmpeg will only scan until it finds the files parameters so there will be no performance hit on any files, and its only these problematic live streams that will take a little longer than normal.

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Thu Dec 20, 2012 8:32 pm
by zenix
I am experiancing the same problem, the connection just is lost after couple of minutes.

I have been trying to figure out from this post where to insert those attributes?
Can anyone help a newbie?

Thanks!

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Thu Dec 20, 2012 9:26 pm
by jhb50
This has nothing to do with lost connections.

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Sun Jan 13, 2013 5:23 pm
by ljw69
i could do with a a hand on inserting the above text... any help would be much appreciated

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Tue Jan 15, 2013 11:43 pm
by jhb50
As I said the "Problem Transcoding SOPCAST streams" had nothing to do with "lost connections". As the thread documented the [solved] solution was to add the parameter and this is now added to all ffmpeg commands with Serviio 1.1

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Tue Jan 29, 2013 7:46 pm
by ljw69
So im guessing this problem has not been resolved...

Re: [SOLVED] Problem Transcoding SOPCAST streams

PostPosted: Tue Jan 29, 2013 10:36 pm
by jhb50
Do I really need to say it again? The problem addressed by this thread has been solved! As posted above it had nothing to do with a different "lost connections" problem which this thread is not attempting to solve.