[mythtv] Webfrontend streaming

Dag Nygren dag at newtech.fi
Fri Sep 15 17:33:18 UTC 2017


Hi again!

Using Webfrontend through an Apache proxy and have real problems
streaming the recorded programs to the browser.
Have tried both with Firefox and Chrome (on Linux) but no go.

What happens it that mythtranscode gives up without telling me why.
First it jut crashed, but after patching libavformat a bit to not try
to free NULL pointers and access a ts that didn't exist it will not
crash any more, but still avInit will fail.

The patch is:
*** libavformat/mpegtsenc.c.old 2017-09-15 19:18:23.347786229 +0300
--- libavformat/mpegtsenc.c     2017-09-15 19:24:21.821247636 +0300
***************
*** 1774,1786 ****
          }
      }
  
      for (i = 0; i < ts->nb_services; i++) {
          service = ts->services[i];
!         av_freep(&service->provider_name);
!         av_freep(&service->name);
!         av_freep(&service);
      }
      av_freep(&ts->services);
  }
  
  static int mpegts_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
--- 1774,1792 ----
          }
      }
  
+     if (ts) {
      for (i = 0; i < ts->nb_services; i++) {
          service = ts->services[i];
!       if (service) {
!               if (&service->provider_name)
!                       av_freep(&service->provider_name);
!               if (&service->name)
!                       av_freep(&service->name);
!                       av_freep(&service);
!       }
      }
      av_freep(&ts->services);
+     }
  }
  
  static int mpegts_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)

The end of the log for mythtranscode looks like this:2017-09-15 20:10:59.558534 I [9574/9574] CoreContext mythcorecontext.cpp:269 (Init) - Assumed character encoding: sv_FI.UTF-8
2017-09-15 20:10:59.559140 N [9574/9574] CoreContext mythcontext.cpp:594 (LoadDatabaseSettings) - Empty LocalHostName.
2017-09-15 20:10:59.559147 I [9574/9574] CoreContext mythcontext.cpp:602 (LoadDatabaseSettings) - Using localhost value of mythserv.newtech.fi
2017-09-15 20:10:59.559192 I [9574/9574] CoreContext mythcontext.cpp:844 (TestDBconnection) - Start up testing connections. DB mythserv.newtech.fi, BE , attempt 0, status dbAwake
2017-09-15 20:10:59.559205 D [9574/9574] CoreContext portchecker.cpp:84 (checkPort) - PortChecker::checkPort(): host mythserv.newtech.fi port 3306 timeLimit 1000 linkLocalOnly 0
2017-09-15 20:10:59.657948 I [9574/9576] LogForward loggingserver.cpp:146 (FileLogger) - Added logging to /var/log/mythtv/mythtranscode.20170915171059.9574.log
2017-09-15 20:11:00.060359 D [9574/9574] CoreContext portchecker.cpp:200 (checkPort) - PortChecker::checkPort(): socket state 1
2017-09-15 20:11:00.561405 D [9574/9574] CoreContext portchecker.cpp:200 (checkPort) - PortChecker::checkPort(): socket state 3
2017-09-15 20:11:00.569349 D [9574/9574] CoreContext portchecker.cpp:84 (checkPort) - PortChecker::checkPort(): host mythserv.newtech.fi port 3306 timeLimit 30000 linkLocalOnly 1
2017-09-15 20:11:00.575936 D [9574/9574] CoreContext portchecker.cpp:84 (checkPort) - PortChecker::checkPort(): host mythserv.newtech.fi port 3306 timeLimit 30000 linkLocalOnly 1
2017-09-15 20:11:00.611238 D [9574/9574] CoreContext mythcontext.cpp:522 (FindDatabase) - FindDatabase() - Success!
2017-09-15 20:11:00.611484 D [9574/9574] CoreContext portchecker.cpp:84 (checkPort) - PortChecker::checkPort(): host mythserv.newtech.fi port 3306 timeLimit 30000 linkLocalOnly 1
2017-09-15 20:11:00.613806 N [9574/9574] CoreContext mythcorecontext.cpp:1752 (InitLocale) - Setting QT default locale to sv_FI
2017-09-15 20:11:00.613819 I [9574/9574] CoreContext mythcorecontext.cpp:1785 (SaveLocaleDefaults) - Current locale sv_FI
2017-09-15 20:11:00.613928 E [9574/9574] CoreContext mythlocale.cpp:110 (LoadDefaultsFromXML) - No locale defaults file for sv_FI, skipping
2017-09-15 20:11:00.615888 I [9574/9574] CoreContext mythtranslation.cpp:73 (load) - Loading sv translation for module mythfrontend
2017-09-15 20:11:00.621835 I [9574/9574] CoreContext mythcorecontext.cpp:442 (ConnectCommandSocket) - MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 10.0.0.211:6543 (try 1 of 1)
2017-09-15 20:11:00.624417 I [9574/9574] CoreContext mythcorecontext.cpp:1649 (CheckProtoVersion) - MythCoreContext::CheckProtoVersion(): Using protocol version 91 BuzzOff
2017-09-15 20:11:00.632928 D [9574/9574] CoreContext standardsettings.cpp:194 (haveChanged) - Setting Förlustfri omkodning changed to 0
2017-09-15 20:11:00.632944 D [9574/9574] CoreContext standardsettings.cpp:194 (haveChanged) - Setting Ändra storlek på video under omkodning changed to 0
2017-09-15 20:11:00.632960 N [9574/9574] CoreContext main.cpp:555 (main) - Transcoding HTTP Live Stream ID 20
2017-09-15 20:11:00.946774 I [9574/9574] CoreContext avformatdecoder.cpp:2077 (ScanStreams) - AFD: codec AC3 has 0 channels
2017-09-15 20:11:00.947037 I [9574/9574] CoreContext avformatdecoder.cpp:2579 (OpenAVCodec) - AFD: Opened codec 0xf74be0, id(AC3) type(Audio)
2017-09-15 20:11:00.947116 I [9574/9574] CoreContext avformatdecoder.cpp:2579 (OpenAVCodec) - AFD: Opened codec 0xf75c60, id(DVB_SUBTITLE) type(Subtitle)
2017-09-15 20:11:00.947135 I [9574/9574] CoreContext avformatdecoder.cpp:2579 (OpenAVCodec) - AFD: Opened codec 0xf76ce0, id(DVB_SUBTITLE) type(Subtitle)
2017-09-15 20:11:00.950716 I [9574/9574] CoreContext avformatdecoder.cpp:2579 (OpenAVCodec) - AFD: Opened codec 0xf738c0, id(H264) type(Video)
2017-09-15 20:11:00.950725 W [9574/9574] CoreContext ringbuffer.cpp:462 (CalcReadAheadThresh) - Enabling buffering optimisations for low bitrate stream.
2017-09-15 20:11:00.950775 W [9574/9574] CoreContext ringbuffer.cpp:462 (CalcReadAheadThresh) - Enabling buffering optimisations for low bitrate stream.
2017-09-15 20:11:00.950879 N [9574/9574] CoreContext audioplayer.cpp:167 (ReinitAudio) - AudioPlayer: Enabling Audio
2017-09-15 20:11:00.979047 N [9574/9574] CoreContext audioplayer.cpp:167 (ReinitAudio) - AudioPlayer: Enabling Audio
2017-09-15 20:11:00.979067 N [9574/9574] CoreContext transcode.cpp:491 (TranscodeFile) - HLS: Using segment size of 4 seconds
2017-09-15 20:11:00.986940 N [9574/9574] CoreContext transcode.cpp:569 (TranscodeFile) - x264 HLS using: 2 threads, 'veryfast' profile and 'film' tune
2017-09-15 20:11:00.996036 E [9574/9574] CoreContext transcode.cpp:580 (TranscodeFile) - avfw->Init() failed
2017-09-15 20:11:01.000440 E [9574/9574] CoreContext main.cpp:733 (main) - Transcoding  failed
2017-09-15 20:11:01.000495 I [9574/9574] CoreContext mythcontext.cpp:1581 (~MythContext) - Waiting for threads to exit.


Could it be a problem with the locale?
Any way to get useful info out of mythtranscode?

The error messages from mythtranscode have been quite vague. During my
first run I was missing the --enable-libx264 in the compilation flags
and the log contained almost the same "informative" message: "avfw->Init() failed"
Would have saved me some work if he had told me that
he cannot open libx264. Finally found this when
running mythfrontend from the command line and adding
--loglevel debug

But this last error doesn't tell me anything - Not even with loglevel debug.

Best
Dag



More information about the mythtv-dev mailing list