Hello there guys, I'm actually having the same problem as kanti, so I thought I'd join in and see if I can help you fix our issue. I've read this thread and tried a great many things. Here's what's happened so far.
With default settings: Most videos play properly; this one and other 29fps videos play at a lower framerate, but the audio plays normally. Subtitles are usually slow at first, and stop working entirely shortly after.
With this code:- Code: Select all
framerate == null :: -fps 30000/1001 -ofps 30000/1001
No changes from default settings. I also tried removing the "-fps" part, leaving only the "-ofps" portion, but with no changes either.
With the no if-statement code:- Code: Select all
:: -fps 30000/1001 -ofps 30000/1001
This actually fixed the video. It works perfectly. But then all of my other videos were having the opposite problem: the video was playing too fast and the audio was behind. Since I have far fewer videos that don't work than do, I decided to revert the change. Again, I tried removing the "-fps" part as suggested, but with no change.
To help, I have uploaded samples of the videos as requested. "Hunter X Hunter" is one of the lower fps videos that works fine under default settings but not with your code, while "Maoyuu Maou Yuusha" is slow under default settings but works with your code.
http://www.mediafire.com/?i9b1s05hz61lyi6Thank you in advance for your help.
EDIT: Since the first code doesn't fix the framerate but the second code does, perhaps we could solve the problem by fixing the code? The framerate fixes from the first code are clearly not being applied, so the if-statement is always returning false. Perhaps the FPS isn't actually null? Noticing something else (forgive me if I'm repeating what was said earlier in the thread)...
Here's a portion of my debug log with the video.
- Code: Select all
INFO 2013-01-26 17:57:30.921 [New I/O server worker #1-10] Starting transcode/remux of [HorribleSubs] Maoyuu Maou
Yuusha - 01 [720p].mkv
DEBUG 2013-01-26 17:57:30.979 [New I/O server worker #1-10] Creating pipe \\.\pipe\mencoder1359241050979
DEBUG 2013-01-26 17:57:31.084 [Thread-29] Waiting for pipe connection \\.\pipe\mencoder1359241050979
DEBUG 2013-01-26 17:57:31.134 [mencoder.exe-5] Starting "C:\Program Files (x86)\PS3 Media Server
\win32\mencoder.exe" -ss 0 "C:\Users\Alex\Desktop\Torrents\[HorribleSubs] Maoyuu Maou Yuusha - 01 [720p].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=8 -lavcopts
autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=448:threads=8:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_
buf_size=7000 -ass -fontconfig -sid 0 -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate
48000 -o \\.\pipe\mencoder1359241050979
DEBUG 2013-01-26 17:57:31.136 [mencoder.exe-5] Reading pipe: \\.\pipe\mencoder1359241050979
DEBUG 2013-01-26 17:57:31.136 [mencoder.exe-5] Attaching thread: mencoder.exe-5
DEBUG 2013-01-26 17:57:31.159 [Thread-33] MEncoder SB41 (C) 2000-2012 MPlayer Team
DEBUG 2013-01-26 17:57:31.159 [Thread-33] Custom build by SubJunk, http://www.spirton.com
DEBUG 2013-01-26 17:57:31.159 [Thread-33]
DEBUG 2013-01-26 17:57:31.162 [Thread-33] success: format: 0 data: 0x0 - 0x142783b6
DEBUG 2013-01-26 17:57:31.162 [Thread-33] libavformat version 54.29.105 (internal)
DEBUG 2013-01-26 17:57:31.163 [Thread-33] libavformat file format detected.
DEBUG 2013-01-26 17:57:31.174 [Thread-33] [lavf] stream 0: video (h264), -vid 0
DEBUG 2013-01-26 17:57:31.174 [Thread-33] [lavf] stream 1: audio (aac), -aid 0
DEBUG 2013-01-26 17:57:31.174 [Thread-33] [lavf] stream 2: subtitle (ass), -sid 0
DEBUG 2013-01-26 17:57:31.174 [Thread-33] VIDEO: [H264] 1280x720 0bpp 30.303 fps 0.0 kbps ( 0.0 kbyte/s)
DEBUG 2013-01-26 17:57:31.175 [Thread-33] [V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:30.303
ftime:=0.0330
DEBUG 2013-01-26 17:57:31.175 [Thread-33]
==========================================================================
DEBUG 2013-01-26 17:57:31.175 [Thread-33] Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
DEBUG 2013-01-26 17:57:31.175 [Thread-33] libavcodec version 54.64.100 (internal)
DEBUG 2013-01-26 17:57:31.177 [Thread-33] AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
DEBUG 2013-01-26 17:57:31.177 [Thread-33] Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4
Audio))
DEBUG 2013-01-26 17:57:31.177 [Thread-33]
==========================================================================
DEBUG 2013-01-26 17:57:31.177 [Thread-29] Result of \\.\pipe\mencoder1359241050979 : true
DEBUG 2013-01-26 17:57:31.177 [Thread-33] PACKET SIZE: 2048 bytes, deltascr: 884
DEBUG 2013-01-26 17:57:31.177 [Thread-33] Opening video filter: [ass auto=1]
DEBUG 2013-01-26 17:57:31.178 [Thread-33] [ass] auto-open
DEBUG 2013-01-26 17:57:31.189 [Thread-33]
==========================================================================
DEBUG 2013-01-26 17:57:31.190 [Thread-33] Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
DEBUG 2013-01-26 17:57:31.192 [Thread-33] Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
DEBUG 2013-01-26 17:57:31.192 [Thread-33]
==========================================================================
DEBUG 2013-01-26 17:57:31.196 [Thread-32] [ac3 @ 0113f220]channel_layout not specified
DEBUG 2013-01-26 17:57:31.197 [Thread-32] [ac3 @ 0113f220]No channel layout specified. The encoder will guess the
layout, but it might be incorrect.
DEBUG 2013-01-26 17:57:31.197 [Thread-32] Limiting audio preload to 0.4s.
DEBUG 2013-01-26 17:57:31.197 [Thread-32] Increasing audio density to 4.
DEBUG 2013-01-26 17:57:31.200 [Thread-32] Unsupported PixelFormat 61
DEBUG 2013-01-26 17:57:31.200 [Thread-32] Unsupported PixelFormat 53
DEBUG 2013-01-26 17:57:31.200 [Thread-32] Unsupported PixelFormat 81
DEBUG 2013-01-26 17:57:31.212 [Thread-33] Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
DEBUG 2013-01-26 17:57:31.212 [Thread-33] videocodec: libavcodec (1280x720 fourcc=3267706d [mpg2])
DEBUG 2013-01-26 17:57:31.212 [Thread-33] [VE_LAVC] Using constant qscale = 1.000000 (VBR).
DEBUG 2013-01-26 17:57:31.224 [Thread-33] Writing header...
DEBUG 2013-01-26 17:57:31.224 [Thread-33] INITV: 0.200, 0.158, fps: 23.976
DEBUG 2013-01-26 17:57:31.224 [Thread-33]
INFO 2013-01-26 17:57:31.235 [StartPlaying Event] renderer: 192.168.0.199, file: C:\Users\Alex\Desktop\Torrents\[HorribleSubs] Maoyuu Maou Yuusha - 01 [720p].mkv
Specifically, I'm looking at these three sets of lines:
- Code: Select all
DEBUG 2013-01-26 17:57:31.134 [mencoder.exe-5] Starting "C:\Program Files (x86)\PS3 Media Server\win32\mencoder.exe" -ss 0 "C:\Users\Alex\Desktop\Torrents\[HorribleSubs] Maoyuu Maou Yuusha - 01 [720p].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=8 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=448:threads=8:keyint=5:vqscale=1:vqmin=2:vrc_maxrate=54000:vrc_buf_size=7000 -ass -fontconfig -sid 0 -ofps 24000/1001 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1359241050979
DEBUG 2013-01-26 17:57:31.174 [Thread-33] VIDEO: [H264] 1280x720 0bpp 30.303 fps 0.0 kbps ( 0.0 kbyte/s)
DEBUG 2013-01-26 17:57:31.175 [Thread-33] [V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:30.303 ftime:=0.0330
DEBUG 2013-01-26 17:57:31.224 [Thread-33] Writing header...
DEBUG 2013-01-26 17:57:31.224 [Thread-33] INITV: 0.200, 0.158, fps: 23.976
For some reason, the middle set of lines (17:57:31.17) say the correct FPS, 30.303. But the other two sets say 23.976 (the first says -ofps 24000/1001, which is 23.976). Maybe this is the important part? What are the middle two lines coming from, and how can I get mencoder to read them?