3.0.0-a6 H264TSAC3 can't seek

Developers forum for Univeral Media Server-related development (only for programmers)
Locked
elpetak
Posts: 11
Joined: Thu Mar 28, 2013 3:57 pm

3.0.0-a6 H264TSAC3 can't seek

Post by elpetak »

I changed the PS3 rendered to H264TSAC3 and everything was beautiful, except seeking (and some file that don't play well, but that's another topic).

UPDATE: This happens with Mencoder. If I use FFMPEG seeking works.

With MPEGPSAC3 it works:

Code: Select all

DEBUG 2013-10-02 20:48:08.147 [New I/O worker #5] Requesting time seek: 81.0 seconds
DEBUG 2013-10-02 20:48:08.150 [External Process Stopper] Stopping process: mencoder.exe-3
DEBUG 2013-10-02 20:48:08.160 [New I/O worker #5] Creating pipe \\.\pipe\mencoder1380757688160
DEBUG 2013-10-02 20:48:08.272 [mencoder.exe-4] Starting C:\UMS\win32\mencoder.exe -ss 81.0 "C:\somemovie.mkv" -msglevel statusline=2 -oac lavc -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=640:threads=4:keyint=25:vqmax=5:vqmin=2:vrc_maxrate=11000:vrc_buf_size=4166 -ass -ass-color ffffff00 -ass-border-color 00000000 -ass-font-scale 1.4 -font C:\Windows\Fonts\Arial.ttf -ass-force-style FontName=C:\Windows\Fonts\Arial.ttf,Outline=1,Shadow=1,MarginV=10 -noflip-hebrew -fontconfig -subcp cp1252 -nosub -sub "C:\somemovie.srt" -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1380757688160
DEBUG 2013-10-02 20:48:08.276 [Thread-28] Waiting for pipe connection \\.\pipe\mencoder1380757688160
DEBUG 2013-10-02 20:48:08.496 [mencoder.exe-4] Reading pipe: \\.\pipe\mencoder1380757688160
DEBUG 2013-10-02 20:48:08.496 [mencoder.exe-4] Attaching thread: mencoder.exe-4
DEBUG 2013-10-02 20:48:08.522 [Thread-32] MEncoder SB52 (C) 2000-2013 MPlayer Team
DEBUG 2013-10-02 20:48:08.523 [Thread-32] Custom build by SubJunk, http://www.spirton.com
DEBUG 2013-10-02 20:48:08.523 [Thread-32] 
DEBUG 2013-10-02 20:48:08.530 [Thread-32] success: format: 0  data: 0x0 - 0x3edf7bbc
DEBUG 2013-10-02 20:48:08.530 [Thread-32] libavformat version 54.61.101 (internal)
DEBUG 2013-10-02 20:48:08.532 [Thread-32] libavformat file format detected.
DEBUG 2013-10-02 20:48:08.538 [Thread-32] [lavf] stream 0: video (h264), -vid 0
DEBUG 2013-10-02 20:48:08.538 [Thread-32] [lavf] stream 1: audio (ac3), -aid 0
DEBUG 2013-10-02 20:48:08.538 [Thread-32] VIDEO:  [H264]  1280x720  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
DEBUG 2013-10-02 20:48:08.538 [Thread-32] [V] filefmt:44  fourcc:0x34363248  size:1280x720  fps:23.976  ftime:=0.0417
DEBUG 2013-10-02 20:48:08.538 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:48:08.538 [Thread-32] Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
DEBUG 2013-10-02 20:48:08.539 [Thread-32] libavcodec version 54.89.100 (internal)
DEBUG 2013-10-02 20:48:08.540 [Thread-32] AUDIO: 48000 Hz, 6 ch, floatle, 448.0 kbit/4.86% (ratio: 56000->1152000)
DEBUG 2013-10-02 20:48:08.540 [Thread-28] Result of \\.\pipe\mencoder1380757688160 : true
DEBUG 2013-10-02 20:48:08.540 [Thread-32] Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
DEBUG 2013-10-02 20:48:08.540 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:48:08.540 [Thread-32] PACKET SIZE: 2048 bytes, deltascr: 884
DEBUG 2013-10-02 20:48:08.541 [Thread-32] Opening video filter: [ass auto=1]
DEBUG 2013-10-02 20:48:08.541 [Thread-32] [ass] auto-open
DEBUG 2013-10-02 20:48:08.587 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:48:08.587 [Thread-32] Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
DEBUG 2013-10-02 20:48:08.591 [Thread-32] Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
DEBUG 2013-10-02 20:48:08.591 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:48:08.591 [Thread-31] [ac3 @ 01a39fa0]Channel layout not specified
DEBUG 2013-10-02 20:48:08.591 [Thread-31] [ac3 @ 01a39fa0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
DEBUG 2013-10-02 20:48:08.592 [Thread-31] Limiting audio preload to 0.4s.
DEBUG 2013-10-02 20:48:08.592 [Thread-31] Increasing audio density to 4.
DEBUG 2013-10-02 20:48:08.636 [Thread-32] Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
DEBUG 2013-10-02 20:48:08.638 [Thread-32] videocodec: libavcodec (1280x720 fourcc=3267706d [mpg2])
DEBUG 2013-10-02 20:48:08.646 [Thread-31] [ass] PlayResX undefined, setting to 384
DEBUG 2013-10-02 20:48:08.667 [Thread-32] Writing header...
DEBUG 2013-10-02 20:48:08.667 [Thread-32] INITV: 0.200, 0.158, fps: 23.976
DEBUG 2013-10-02 20:48:08.667 [Thread-32] 
but with H264TSAC3 is just hangs:

Code: Select all

DEBUG 2013-10-02 20:57:48.160 [New I/O worker #4] Requesting time seek: 70.0 seconds
DEBUG 2013-10-02 20:57:48.178 [New I/O worker #4] Creating pipe \\.\pipe\mencoder1380758268178
DEBUG 2013-10-02 20:57:48.360 [External Process Stopper] Stopping process: mencoder.exe-3
DEBUG 2013-10-02 20:57:48.382 [Thread-28] Waiting for pipe connection \\.\pipe\mencoder1380758268178
DEBUG 2013-10-02 20:57:48.383 [mencoder.exe-4] Starting C:\UMS\win32\mencoder.exe -ss 70.0 "C:\somemovie.mkv" -msglevel statusline=2 -oac lavc -of lavf -lavfopts format=mpegts -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=libx264:acodec=ac3:abitrate=640:threads=4:o=preset=superfast,crf=19,g=250,i_qfactor=0.71,qcomp=0.6,level=4.1,weightp=0,8x8dct=0,aq-strength=0:vrc_maxrate=11000:vrc_buf_size=4166 -ass -ass-color ffffff00 -ass-border-color 00000000 -ass-font-scale 1.4 -font C:\Windows\Fonts\Arial.ttf -ass-force-style FontName=C:\Windows\Fonts\Arial.ttf,Outline=1,Shadow=1,MarginV=10 -noflip-hebrew -fontconfig -subcp cp1252 -nosub -sub "C:\somemovie.srt" -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1380758268178
DEBUG 2013-10-02 20:57:48.624 [mencoder.exe-4] Reading pipe: \\.\pipe\mencoder1380758268178
DEBUG 2013-10-02 20:57:48.624 [mencoder.exe-4] Attaching thread: mencoder.exe-4
DEBUG 2013-10-02 20:57:48.653 [Thread-32] MEncoder SB52 (C) 2000-2013 MPlayer Team
DEBUG 2013-10-02 20:57:48.654 [Thread-32] Custom build by SubJunk, http://www.spirton.com
DEBUG 2013-10-02 20:57:48.654 [Thread-32] 
DEBUG 2013-10-02 20:57:48.658 [Thread-32] success: format: 0  data: 0x0 - 0x3edf7bbc
DEBUG 2013-10-02 20:57:48.659 [Thread-32] libavformat version 54.61.101 (internal)
DEBUG 2013-10-02 20:57:48.661 [Thread-32] libavformat file format detected.
DEBUG 2013-10-02 20:57:48.668 [Thread-32] [lavf] stream 0: video (h264), -vid 0
DEBUG 2013-10-02 20:57:48.668 [Thread-32] [lavf] stream 1: audio (ac3), -aid 0
DEBUG 2013-10-02 20:57:48.669 [Thread-32] VIDEO:  [H264]  1280x720  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
DEBUG 2013-10-02 20:57:48.669 [Thread-32] [V] filefmt:44  fourcc:0x34363248  size:1280x720  fps:23.976  ftime:=0.0417
DEBUG 2013-10-02 20:57:48.669 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:57:48.669 [Thread-32] Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
DEBUG 2013-10-02 20:57:48.669 [Thread-32] libavcodec version 54.89.100 (internal)
DEBUG 2013-10-02 20:57:48.669 [Thread-32] AUDIO: 48000 Hz, 6 ch, floatle, 448.0 kbit/4.86% (ratio: 56000->1152000)
DEBUG 2013-10-02 20:57:48.669 [Thread-32] Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
DEBUG 2013-10-02 20:57:48.669 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:57:48.669 [Thread-28] Result of \\.\pipe\mencoder1380758268178 : true
DEBUG 2013-10-02 20:57:48.670 [Thread-31] ** MUXER_LAVF *****************************************************************
DEBUG 2013-10-02 20:57:48.670 [Thread-31] REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
DEBUG 2013-10-02 20:57:48.670 [Thread-31] INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
DEBUG 2013-10-02 20:57:48.670 [Thread-31] will play these INCORRECT files as if nothing were wrong!
DEBUG 2013-10-02 20:57:48.670 [Thread-31] *******************************************************************************
DEBUG 2013-10-02 20:57:48.670 [Thread-32] OK, exit.
DEBUG 2013-10-02 20:57:48.670 [Thread-32] Opening video filter: [ass auto=1]
DEBUG 2013-10-02 20:57:48.671 [Thread-32] [ass] auto-open
DEBUG 2013-10-02 20:57:48.718 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:57:48.718 [Thread-32] Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
DEBUG 2013-10-02 20:57:48.721 [Thread-32] Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
DEBUG 2013-10-02 20:57:48.721 [Thread-32] ==========================================================================
DEBUG 2013-10-02 20:57:48.722 [Thread-31] [ac3 @ 01d29fa0]Channel layout not specified
DEBUG 2013-10-02 20:57:48.722 [Thread-31] [ac3 @ 01d29fa0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
DEBUG 2013-10-02 20:57:48.770 [Thread-32] Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
DEBUG 2013-10-02 20:57:48.772 [Thread-32] videocodec: libavcodec (1280x720 fourcc=34363268 [h264])
DEBUG 2013-10-02 20:57:48.772 [Thread-32] [libx264 @ 01d29fa0]using SAR=1/1
DEBUG 2013-10-02 20:57:48.780 [Thread-32] [libx264 @ 01d29fa0]using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
DEBUG 2013-10-02 20:57:48.786 [Thread-32] [libx264 @ 01d29fa0]profile Constrained Baseline, level 4.1
DEBUG 2013-10-02 20:57:48.787 [Thread-31] [ass] PlayResX undefined, setting to 384
DEBUG 2013-10-02 20:57:48.992 [Thread-32] VIDEO CODEC ID: 28
DEBUG 2013-10-02 20:57:48.993 [Thread-32] AUDIO CODEC ID: 15003, TAG: 0
DEBUG 2013-10-02 20:57:48.993 [Thread-32] Writing header...
User avatar
SubJunk
Lead Developer
Posts: 3705
Joined: Sun May 27, 2012 4:12 pm

Re: 3.0.0-a6 H264TSAC3 can't seek

Post by SubJunk »

Thanks for reporting this, elpetak. I've confirmed it and it's a similar problem that we had with FFmpeg a while ago. I'll have to look into what the fix is for MEncoder and compile a new version with the fix.
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: 3.0.0-a6 H264TSAC3 can't seek

Post by ExSport »

Universal Media Server 3.0.0-b1 (Build: ecbc33fe6 (2013-10-12))
I can reproduce it. If I changed PS3.conf to "H264TSAC3" seeking stopped to work with both engines MEncoder and FFmpeg.
Tested MEncoder from command line and found that when x264 codec is used and -ss parameter is anything different than 0, like 60, MEncoder generates incompatible file.
Exactly to say: when -ss 0 I am able to play file in mpc-hc from incomplete file (same like renderer displays incomple file sent from pipe)
When I used -ss 30/60 or anything else, generated file is without video, only audio is played!
Also weird thing is that when I stopped processing, sometimes generated file was with video, sometimes without it. It seems like MEncoder with -ss 0 stores "something" to file at the beginning of file so it is compatible and with video, but with -ss 60 it saves it at the end of file or never so sometimes file is with video, sometimes without it.
So this behavior is that actual data in pipe are ok with -ss 0 but not with -ss xy. This bug refuse to use seeking or replaying file on PS3 because UMS tries to play file from last position = ss is not 0 so file is not played. But when I forced playing file from beginning, it started to work!
Will try to make same tests with FFMPEG...
@SunJunk: Is it known bug, same one you described in previous post? Thx!
Last edited by ExSport on Sun Oct 27, 2013 8:56 am, edited 1 time in total.
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: 3.0.0-a6 H264TSAC3 can't seek

Post by ExSport »

Another observation is that generated h264 file in mpeg container with MEncoder engine is not well played in PS3 when copied directly to them(test outside UMS). I also changed g/keyint param to 25 from 250 with no real change.
Problem is that file is almost non-seekable on PS3. Also goto doesn't work well.
Is it possible to tweak params so renderers will like generated files better? 8-)
EDIT:
Forgot to say UMS uses too high vrc_maxrate (10x higher than allowed):
-lavcopts autoaspect=1:vcodec=libx264:acodec=ac3:abitrate=640:threads=4:o=preset=superfast,crf=19,g=250,i_qfactor=0.71,qcomp=0.6,level=4.1,weightp=0,8x8dct=0,aq-strength=0:vrc_maxrate=499000:vrc_buf_size=7000
It generates:
[libx264 @ 01b39fa0]VBV bitrate (499000) > level limit (50000)
EDIT2:
Tested also FFMPEG and with -ss 30 and final file is no audio+frozen video=>incompatible file. With -ss 0 or 10 or 20 file has audio but I suppose with other file value will be different but generally to say, problem is anything else than -ss 0. :(
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: 3.0.0-a6 H264TSAC3 can't seek

Post by ExSport »

@SubJunk: Any change in code/MEncoder/FFmpeg binary corresponding to the reported problem so I can retest it? 8-)
Locked