[mythtv-users] mythtranscode FIFO on master - corrupted mp4 output

Mark Perkins perkins1724 at hotmail.com
Tue Oct 20 23:56:39 UTC 2015


Is
 anyone using mythtranscode in FIFO mode on master? I am building a new 
backend on CentOS 7 and while the core systems seem to work well I am 
having trouble with my transcode script which worked on 0.27 / ubuntu 
14.04.

For testing I am essentially using the script from https://www.mythtv.org/wiki/Example_Script_using_mythtranscode_in_fifodir_mode.

Essentially
 the output video is massively corrupted and is a series of horizontal 
lines across the whole screen. Audio appears to have worked fine. 10sec 
example with corrupted output loaded here: https://www.dropbox.com/s/8b1gpuwtza4ndmh/test.mp4


As far as I can see there are no errors generated anywhere in the logging.

Output from mythtranscode for the run that generated the corrupted test file:

[mythtv at mythbackend
 myth_log]$ /usr/local/bin/mythtranscode --chanid 1002 --starttime 
20150703105700 --honorcutlist  --fifodir 
/tmp/mythar20151021-15985-1v1x66g --cleancut
2015-10-21 09:51:44.938837 C  mythtranscode version: master [v0.28-pre-3100-g5cdde2a] www.mythtv.org
2015-10-21 09:51:44.938854 C  Qt version: compile: 5.4.2, runtime: 5.4.2
2015-10-21 09:51:44.938861 N  Enabled verbose msgs:  general
2015-10-21 09:51:44.938868 N  Setting Log Level to LOG_INFO
2015-10-21 09:51:44.949773 I  Setup Interrupt handler
2015-10-21 09:51:44.949781 I  Setup Terminated handler
2015-10-21 09:51:44.949786 I  Setup Segmentation fault handler
2015-10-21 09:51:44.949788 I  Setup Aborted handler
2015-10-21 09:51:44.949792 I  Setup Bus error handler
2015-10-21 09:51:44.949794 I  Setup Floating point exception handler
2015-10-21 09:51:44.949798 I  Setup Illegal instruction handler
2015-10-21 09:51:44.949801 I  Setup Real-time signal 0 handler
2015-10-21 09:51:44.949913 N  Using runtime prefix = /usr/local
2015-10-21 09:51:44.949917 N  Using configuration directory = /home/mythtv/.mythtv
2015-10-21 09:51:44.949967 I  Assumed character encoding: en_AU.utf8
2015-10-21
 09:51:44.949969 W  This application expects to be running a locale that
 specifies a UTF-8 codeset, and many features may behave improperly with
 your current language settings. Please set the LC_ALL or LC_CTYPE, and 
LANG variable(s) in the environment in which this program is executed to
 include a UTF-8 codeset (such as 'en_US.UTF-8').
2015-10-21 09:51:44.950230 N  Empty LocalHostName.
2015-10-21 09:51:44.950236 I  Using localhost value of mythbackend.theperkinsfamily.id.au
2015-10-21 09:51:44.950788 I  Added logging to the console
2015-10-21 09:51:44.960111 N  Setting QT default locale to en_AU
2015-10-21 09:51:44.960123 I  Current locale en_AU
2015-10-21 09:51:44.960154 E  No locale defaults file for en_AU, skipping
2015-10-21 09:51:44.960423 I  Loading en_gb translation for module mythfrontend
2015-10-21 09:51:47.691441 N  Transcoding from /media/servertwo/Myth_Recordings/1002_20150703105700.mpg to FIFO
2015-10-21 09:51:50.648205 I  AFD: codec MP2 has 2 channels
2015-10-21 09:51:50.648278 I  AFD: Opened codec 0xf1b2c0, id(MP2) type(Audio)
2015-10-21 09:51:50.649506 I  AFD: Opened codec 0xf194a0, id(MPEG2VIDEO) type(Video)
2015-10-21 09:51:50.649608 N  AudioPlayer: Enabling Audio
2015-10-21 09:51:50.672581 I  Honoring the cutlist while transcoding
2015-10-21 09:51:50.672938 I  Cutlist        : 241-101928
2015-10-21 09:51:50.672941 I  Original Length: 101928 frames
2015-10-21 09:51:50.672942 I  New Length     : 241 frames
2015-10-21 09:51:50.684242 I  FifoVideoWidth 720
2015-10-21 09:51:50.684249 I  FifoVideoHeight 576
2015-10-21 09:51:50.684260 I  FifoVideoAspectRatio 1.77778
2015-10-21 09:51:50.684262 I  FifoVideoFrameRate 25
2015-10-21 09:51:50.684264 I  FifoAudioFormat raw
2015-10-21 09:51:50.684265 I  FifoAudioChannels 2
2015-10-21 09:51:50.684267 I  FifoAudioSampleRate 48000
2015-10-21 09:51:50.684558 I  Created video fifo: /tmp/mythar20151021-15985-1v1x66g/vidout
2015-10-21 09:51:50.684704 I  Created audio fifo: /tmp/mythar20151021-15985-1v1x66g/audout
2015-10-21 09:51:50.684757 I  Video 720x576 at 25fps Audio rate: 48000
2015-10-21 09:51:50.684759 I  Created fifos. Waiting for connection.
2015-10-21 09:51:50.684766 I  Dumping Video and Audio data to fifos
2015-10-21
 09:51:50.795169 I  MythCoreContext::ConnectCommandSocket(): Connecting 
to backend server: 192.168.1.28:6543 (try 1 of 1)
2015-10-21 09:51:50.816840 I  MythCoreContext::CheckProtoVersion(): Using protocol version 87
2015-10-21 09:51:50.866404 I  Audio is 40ms behind video at # 1: auddelta=92710910, viddelta=92710870
2015-10-21 09:51:50.866409 I  Dropping video frame
2015-10-21 09:51:56.308931 I  Player(0): Fast-Forwarding from 241 to 101928
2015-10-21 09:51:56.391819 N  Transcoding /media/servertwo/Myth_Recordings/1002_20150703105700.mpg done
2015-10-21 09:51:58.709535 N  Transcode: delete old file: waiting while program is in use.
2015-10-21 09:51:58.710036 N  Transcode: program is no longer in use.
2015-10-21
 09:51:59.030113 E  mythtranscode: Error Renaming 
'/media/servertwo/Myth_Recordings/1002_20150703105700.mpg.tmp' to 
'/media/servertwo/Myth_Recordings/1002_20150703105700.mpg'
            eno: No such file or directory (2)
2015-10-21
 09:51:59.034670 N  Requesting delete for file 
'myth://Default@mythbackend.theperkinsfamily.id.au/1002_20150703105700.mpg.old'.
2015-10-21 09:51:59.049112 N  Deleting file '/media/servertwo/Myth_Recordings/1002_20150703105700.mpg.old'.
2015-10-21
 09:51:59.608446 N  Requesting delete for file 
'myth://Default@mythbackend.theperkinsfamily.id.au/1002_20150703105700.mpg.png'.
2015-10-21 09:51:59.626542 N  Deleting file '/media/servertwo/Myth_Recordings/1002_20150703105700.mpg.png'.
2015-10-21 09:51:59.633624 I  Waiting for threads to exit.


Output from ffmpeg for the same run:

[mythtv at mythbackend
 mark]$ /usr/bin/ffmpeg -f s16le -ac 2 -ar 48000 -thread_queue_size 8192
 -i /tmp/mythar20151021-15985-1v1x66g/audout -f rawvideo -top 1 -pix_fmt
 yuv420p -s 720x576 -r 25 -thread_queue_size 8192 -i 
/tmp/mythar20151021-15985-1v1x66g/vidout -threads 2  -vcodec libx264 
-preset medium -profile high  -crf 20.0  -aspect 16:9 -acodec ac3 -ab 
160k -ar 48000 -f mp4 "/media/servertwo/test.mp4"
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
 
 configuration: --prefix=/usr --bindir=/usr/bin 
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg 
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls
 --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 
--disable-indev=jack --enable-libfreetype --enable-libgsm 
--enable-libmp3lame --enable-openal --enable-libopenjpeg 
--enable-libopus --enable-libpulse --enable-libschroedinger 
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
 --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 
--enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample 
--enable-postproc --enable-pthreads --disable-static --enable-shared 
--enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 
--enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, s16le, from '/tmp/mythar20151021-15985-1v1x66g/audout':
  Duration: N/A, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Input #1, rawvideo, from '/tmp/mythar20151021-15985-1v1x66g/vidout':
  Duration: N/A, start: 0.000000, bitrate: 124416 kb/s
    Stream #1:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576, 124416 kb/s, 25 tbr, 25 tbn, 25 tbc
Please use -profile:a or -profile:v, -profile is ambiguous
File '/media/servertwo/test.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 0x1ee3fe0] using SAR=64/45
[libx264 @ 0x1ee3fe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX LZCNT
[libx264 @ 0x1ee3fe0] profile High, level 3.0
[libx264
 @ 0x1ee3fe0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - 
Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: 
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2 
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf 
mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 
aq=1:1.00
Output #0, mp4, to '/media/servertwo/test.mp4':
  Metadata:
    encoder         : Lavf56.25.101
   
 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 
720x576 [SAR 64:45 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.26.100 libx264
    Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, fltp, 160 kb/s
    Metadata:
      encoder         : Lavc56.26.100 ac3
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> ac3 (native))
Press [q] to stop, [?] for help
frame=  241 fps= 19 q=-1.0 Lsize=    5025kB time=00:00:09.59 bitrate=4290.0kbits/s    
video:4830kB audio:188kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.137639%
[libx264 @ 0x1ee3fe0] frame I:5     Avg QP:21.93  size:110944
[libx264 @ 0x1ee3fe0] frame P:132   Avg QP:25.22  size: 28302
[libx264 @ 0x1ee3fe0] frame B:104   Avg QP:28.79  size:  6297
[libx264 @ 0x1ee3fe0] consecutive B-frames: 33.2% 24.9%  8.7% 33.2%
[libx264 @ 0x1ee3fe0] mb I  I16..4:  5.1%  0.8% 94.1%
[libx264 @ 0x1ee3fe0] mb P  I16..4:  0.8%  0.1%  4.1%  P16..4: 39.3% 20.8% 19.0%  0.0%  0.0%    skip:15.9%
[libx264
 @ 0x1ee3fe0] mb B  I16..4:  0.0%  0.0%  0.1%  B16..8: 15.0%  3.0%  
2.3%  direct:10.6%  skip:68.9%  L0:21.6% L1:57.8% BI:20.7%
[libx264 @ 0x1ee3fe0] 8x8 transform intra:1.5% inter:30.9%
[libx264 @ 0x1ee3fe0] coded y,uvDC,uvAC intra: 78.8% 80.7% 76.8% inter: 28.3% 28.0% 18.9%
[libx264 @ 0x1ee3fe0] i16 v,h,dc,p:  0% 100%  0%  0%
[libx264 @ 0x1ee3fe0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  1% 81% 12%  0%  0%  0%  1%  0%  4%
[libx264 @ 0x1ee3fe0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  2% 83%  5%  1%  1%  0%  4%  0%  4%
[libx264 @ 0x1ee3fe0] i8c dc,h,v,p: 18% 80%  1%  1%
[libx264 @ 0x1ee3fe0] Weighted P-Frames: Y:22.7% UV:9.1%
[libx264 @ 0x1ee3fe0] ref P L0: 74.8% 11.9% 10.4%  2.5%  0.4%
[libx264 @ 0x1ee3fe0] ref B L0: 95.9%  3.7%  0.4%
[libx264 @ 0x1ee3fe0] ref B L1: 98.6%  1.4%
[libx264 @ 0x1ee3fe0] kb/s:4104.07


Both
 above outputs appear to be essentially mirroring exactly the output I 
see on my 0.27/ubuntu system which produces a perfect output file.

Bypassing
 mythtranscode and the FIFO pipes and just using the original .mpg file 
as the input to ffmpeg also works fine:

If
 it is relevant this is a recording that was made on my 0.27/ubuntu 
system but have restored the original database into the new system so I 
have some data to work with. Recording plays fine on both old and new 
system.

Any suggestions on where to look or what to try next? I've pretty much exhausted everything I can think of.
 		 	   		  
                                                                                                                                                                                                                                                                                                                                                                                                              


        
    
    

    










  

    
    
  

  
                                                                                                                        

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20151021/533d47b9/attachment.html>


More information about the mythtv-users mailing list