Bug Report Local .mp4 files produced by OBS are missing keyframes

Deleted123

New Member
Following the last 5 updates to OBS, which made local .mp4 files produced by OBS to crash VLC, I have been using ffmpeg to convert the files into playable ones using the following command line:
Code:
ffmpeg -i input.mp4 -vcodec copy -acodec copy output.mp4

This has been working fine until 3 days ago, when a new update apparently screwed up the encoding process, which rendered my local recordings useless.
After the update, upon using the aformentioned code, I get the following errors:

Code:
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[h264 @ 0000000000300740] non-existing PPS 0 referenced
[h264 @ 0000000000300740] decode_slice_header error
[h264 @ 0000000000300740] no frame!
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000003181c0] decoding for stream 1 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000003181c0] Could not find codec parameters for
stream 1 (Video: h264 (avc1 / 0x31637661), 1280x720, 4999 kb/s): unspecified pi
xel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2014-10-11-1907-30.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2014-10-11 18:16:48
    encoder         : Open Broadcaster Software v0.637b
  Duration: 02:09:15.87, start: 0.000000, bitrate: 5139 kb/s
    Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
7 kb/s (default)
    Metadata:
      creation_time   : 2014-10-11 18:16:48
      handler_name    : Sound Media Handler
    Stream #0:1(und): Video: h264 (avc1 / 0x31637661), 1280x720, 4999 kb/s, 30 f
ps, 30 tbr, 1k tbn, 2k tbc (default)
    Metadata:
      creation_time   : 2014-10-11 18:16:48
      handler_name    : Video Media Handler
      encoder         : AVC Coding
Output #0, mp4, to 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.4.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), 1280x720, q=2-31, 49
99 kb/s, 30 fps, 16k tbn, 1k tbc (default)
    Metadata:
      creation_time   : 2014-10-11 18:16:48
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 127
kb/s (default)
    Metadata:
      creation_time   : 2014-10-11 18:16:48
      handler_name    : Sound Media Handler
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 2604 fps=0.0 q=-1.0 size=   54338kB time=00:01:26.79 bitrate=5128.5kbits/
...
frame=232676 fps=1700 q=-1.0 Lsize= 4865993kB time=02:09:15.83 bitrate=5139.6kbi
ts/s
video:4733617kB audio:121180kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.230634%

E:\My Recordings\Captured>

I need to mentioned that the output file only contains the audio track, not the video track, which suggests that the .mp4 files produced by OBS after the last update(s) lack keyframes.

This always happens with recordings longer than 2 hours.
 
Last edited:

Lain

Forum Admin
Lain
Forum Moderator
Developer
I was unable to replicate. I would suspect your settings are involved. We didn't particularly change the MP4 code, nor did we stop writing keyframes to MP4 files.

Please include an OBS log file as well.
 

Deleted123

New Member
This is the log file for the last broadcast/recording made with OBS
Code:
19:07:30: =====Stream Start: 2014-10-11, 19:07:30===============================================
19:07:30:   Multithreaded optimizations: On
19:07:30:   Base resolution: 1920x1080
19:07:30:   Output resolution: 1280x720
19:07:30: ------------------------------------------
19:07:30: Loading up D3D10 on AMD Radeon HD 6700 Series (Adapter 1)...
19:07:30: ------------------------------------------
19:07:30: Audio Format: 44100 Hz
19:07:30: ------------------------------------------
19:07:30: Audio Channels: 2 Ch
19:07:30: Playback device {0.0.0.00000000}.{962d4957-ae8d-478f-902f-1af423254e5d}
19:07:30: ------------------------------------------
19:07:30: Using desktop audio input: Speakers (SB X-Fi Xtreme Audio)
19:07:30: Global Audio time adjust: 0
19:07:30: ------------------------------------------
19:07:30: Using auxilary audio input: Microphone (SB X-Fi Xtreme Audio)
19:07:30: Mic time offset: 0
19:07:30: ------------------------------------------
19:07:30: Audio Encoding: AAC
19:07:30:     bitrate: 128
19:07:30: ------------------------------------------
19:07:30:     device: Live! Cam Sync HD VF0770,
19:07:30:     device id \\?\usb#vid_041e&pid_4095&mi_00#6&11db1f77&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global,
19:07:30:     chosen type: MJPG, usingFourCC: false, res: 1280x720 - 1280x720, frameIntervals: 333333-2000000
19:07:30:     use buffering: false - 0, fourCC: 'MJPG'
19:07:30:     audio device: Disable,
19:07:30:     audio device id Disabled,
19:07:30:     audio time offset 0,
19:07:30: 
19:07:30: Using directshow input
19:07:30: Scene buffering time set to 700
19:07:30: ------------------------------------------
19:07:30: Video Encoding: x264
19:07:30:     fps: 30
19:07:30:     width: 1280, height: 720
19:07:30:     preset: faster
19:07:30:     profile: main
19:07:30:     keyint: 60
19:07:30:     CBR: yes
19:07:30:     CFR: yes
19:07:30:     max bitrate: 5000
19:07:30:     buffer size: 5000
19:07:30: ------------------------------------------
19:07:31: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
19:07:32: CLRHost:: Browser 3: Status message: 
19:07:32: CLRHost:: Browser 3: The page at https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716&preview=true displayed insecure content from http://i.imgur.com/Qlc3hpB.png.
19:07:32:  @https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716&preview=true36
19:07:32: CLRHost:: Browser 3: The page at https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716&preview=true displayed insecure content from http://i.imgur.com/YYgzuwn.png.
19:07:32:  @https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716&preview=true0
19:07:32: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
19:07:32: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
19:07:32: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
19:12:16: Using Monitor Capture
20:17:11: Audio timestamp for device 'Microphone (SB X-Fi Xtreme Audio)' was behind target timestamp by 70
20:37:50: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:37:50:   New Scene
20:37:50: Using bitmap image
20:37:50: Using graphics capture
20:37:50: Trying to hook process: csgo.exe
20:37:55: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
20:37:55: CLRHost:: Browser 4: Status message: 
20:37:55: CLRHost:: Browser 4: The page at https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716 displayed insecure content from http://i.imgur.com/Qlc3hpB.png.
20:37:55:  @https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=14671636
20:37:55: CLRHost:: Browser 4: Uncaught ReferenceError: $ is not defined @https://www.nightdev.com/hosted/follower-alert/?channel=viccroyhd&type=custom-centered&sound=146716158
20:37:57: SharedTexCapture hooked
20:38:19: Audio timestamp for device 'Microphone (SB X-Fi Xtreme Audio)' was behind target timestamp by 80
21:16:41: Capture window 0x00190632 invalid or changing, terminating capture
21:16:45: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
21:16:45:   New Scene
21:16:45: Using graphics capture
21:16:45: Using graphics capture
21:16:45: Using graphics capture
21:16:45: Using bitmap image
21:16:45: Using bitmap image
21:16:48: Total frames encoded: 232705, total frames duplicated: 5894 (2.53%)
21:16:48: Number of frames skipped due to encoder lag: 29 (0.01%)
21:16:48: Total frames rendered: 232498, number of late frames: 212 (0.09%) (it's okay for some frames to be late)
21:16:48: 
21:16:48: Profiler time results:
21:16:48: 
21:16:48: ==============================================================
21:16:48: video thread frame - [100%] [avg time: 6.249 ms] [children: 92.2%] [unaccounted: 7.79%]
21:16:48: | scene->Preprocess - [84.1%] [avg time: 5.255 ms]
21:16:48: | GPU download and conversion - [8.11%] [avg time: 0.507 ms] [children: 7.91%] [unaccounted: 0.208%]
21:16:48: | | flush - [7.71%] [avg time: 0.482 ms]
21:16:48: | | CopyResource - [0.144%] [avg time: 0.009 ms]
21:16:48: | | conversion to 4:2:0 - [0.048%] [avg time: 0.003 ms]
21:16:48: Convert444Threads - [100%] [avg time: 0.434 ms] [children: 99.1%] [unaccounted: 0.922%]
21:16:48: | Convert444toNV12 - [99.1%] [avg time: 0.43 ms]
21:16:48: encoder thread frame - [100%] [avg time: 0.971 ms] [children: 5.15%] [unaccounted: 94.9%]
21:16:48: | sending stuff out - [5.15%] [avg time: 0.05 ms]
21:16:48: ==============================================================
21:16:48: 
21:16:48: 
21:16:48: Profiler CPU results:
21:16:48: 
21:16:48: ==============================================================
21:16:48: video thread frame - [cpu time: avg 3.328 ms, total 773968 ms] [avg calls per frame: 1]
21:16:48: | scene->Preprocess - [cpu time: avg 2.949 ms, total 685702 ms] [avg calls per frame: 1]
21:16:48: | GPU download and conversion - [cpu time: avg 0.053 ms, total 12386.5 ms] [avg calls per frame: 1]
21:16:48: | | flush - [cpu time: avg 0.038 ms, total 9063.67 ms] [avg calls per frame: 1]
21:16:48: | | CopyResource - [cpu time: avg 0.006 ms, total 1622.41 ms] [avg calls per frame: 1]
21:16:48: | | conversion to 4:2:0 - [cpu time: avg 0.001 ms, total 421.2 ms] [avg calls per frame: 1]
21:16:48: Convert444Threads - [cpu time: avg 0.376 ms, total 174940 ms] [avg calls per frame: 2]
21:16:48: | Convert444toNV12 - [cpu time: avg 0.374 ms, total 173941 ms] [avg calls per frame: 2]
21:16:48: encoder thread frame - [cpu time: avg 0.232 ms, total 54163.5 ms] [avg calls per frame: 1]
21:16:48: | sending stuff out - [cpu time: avg 0.047 ms, total 11013.7 ms] [avg calls per frame: 1]
21:16:48: ==============================================================
21:16:48: 
21:16:48: =====Stream End: 2014-10-11, 21:16:48=================================================
22:36:50: CLR host plugin instance deleted; removing dynamically loaded localization strings
22:36:50: Server Ping plugin instance deleted; removing dynamically loaded localization strings
22:36:50: Terminating 0xe70
22:36:50: Terminating 0x4e0
22:36:50: Terminating 0xf80
22:36:50: Terminating 0xf64
22:36:50: Terminating 0x151c
22:36:50: Terminating 0x1628


Last game capture log:
2014-10-11, 20:37:50: we're booting up: 
20:37:50: CaptureThread: attached to process csgo.exe
20:37:50: D3D9 Present
20:37:50: GL Present
20:37:50: DirectDraw Present
20:37:50: (half life scientist) everything..  seems to be in order
20:37:57: D3D9EndScene called
20:37:57: D3DPRESENT_PARAMETERS {
20:37:57:     BackBufferWidth: 1920
20:37:57:     BackBufferHeight: 1080
20:37:57:     BackBufferFormat: D3DFMT_A8R8G8B8
20:37:57:     BackBufferCount: 1
20:37:57:     MultiSampleType: D3DMULTISAMPLE_4_SAMPLES
20:37:57:     MultiSampleQuality: 0
20:37:57:     SwapEffect: D3DSWAPEFFECT_DISCARD
20:37:57:     hDeviceWindow: 1639986
20:37:57:     Windowed: true
20:37:57:     EnableAutoDepthStencil: true
20:37:57:     AutoDepthStencilFormat: D3DFMT_D24S8
20:37:57:     Flags: None
20:37:57:     FullScreen_RefreshRateInHz: 0
20:37:57:     PresentationInterval: 2147483648
20:37:57: };
20:37:57: successfully set up d3d9 hooks
20:37:57: D3D9Present called
20:37:57: DoD3D9GPUHook: success
20:37:57: D3DSURFACE_DESC {
20:37:57:     Format: D3DFMT_A8R8G8B8
20:37:57:     Type: D3DRTYPE_SURFACE
20:37:57:     Usage: D3DUSAGE_RENDERTARGET 
20:37:57:     Pool: D3DPOOL_DEFAULT
20:37:57:     MultiSampleType: D3DMULTISAMPLE_4_SAMPLES
20:37:57:     MultiSampleQuality: 0
20:37:57:     Width: 1920
20:37:57:     Height: 1080
20:37:57: };
20:37:57: successfully capturing d3d9 frames via GPU
 

Deleted123

New Member
Since making another post would just be pointless, and since I have already captured your attention, I would like to point out that the file naming function derps out on me.
Using the following code for the file naming, it is completely discarded:
Code:
E:\My Recordings\Captured\$Y$0M$0D-$0d$0m$0s.mp4
Despite the fact that I am using that code there, it doesn't respect the naming policy, and just uses the default one.
 

Deleted123

New Member
The issue has been resolved with a quick reinstall. In the past 2 weeks I have been using binaries of a different version than the one installed, thus the discrepancy in the registry/file versions.
That was probably the issue with my encoding process.

Having said that, there still remains 1 issue: file naming... still does not work the way it is set up.
Using this code:
Code:
E:\My Recordings\Captured\$Y$0M$0D-$0d$0m$0s.mp4
Defaults to this naming policy:
Code:
2014-09-07-2336-03
 

Jack0r

The Helping Squad
Using $T will give you:
2014-10-07-2350-28
In your code you had: 20140907-$0d3603.mp4 because there is no $0d.

I am also having a problem to reproduce your keyframe problem. In the recent time I made several recordings for 3-4 hours, with high and low bitrates, different settings and encoders, and did not encounter a single problem with the files :/
 

karnak

New Member
OBS v0.635b
30/09/2014 I recorded a video long 8h18m 8.02GB without issues
04/10/2014 I recorded a video long 7h58m 7.71GB without issues

OBS v0.637b
11/10/2014 I recorded a video long 0h40m 0,65GB without issues
11/10/2014 I recorded a video long 1h13m 1.18GB without issues
11/10/2014 I recorded a video long 1h57m 1.88GB with issue *
11/10/2014 I recorded a video long 2h46m 2.68GB with issue *
11/10/2014 I recorded a video long 4h07m 3.97GB with issue *

* The issue is that the video track is completely black. The OBS's settings were the same for both v0.365b and v0.637b.
Today I installed the old v0.635b and I have no issues with recording long videos.
 

karnak

New Member
I probably should add that:

I recorded in Monitor Capture mode
Win7 x64
OBS x32
encoder x264
CBR
2200 kb/s
quality 8
preset fast
profile high
audio AAC 128 44.1 kHz stereo
 

d2014

New Member
Same here.

Win7 X64
OBS x32
encoder x264
no CBR
quality 8
Bitrate 3000kb/s
AAC 128 48kHz stereo

720p/25, aero deactivated

preset veryfast
profile high
keyframe interval 2
force audio/video sync

Audio works fine, video is not present. Same ffmpeg error as above.
I did not clean the settings after going from 0.635 to 0.637
 

Deleted123

New Member
The way I'm avoiding this issue, is to record in .FLV format, and then use this piece of code (saved as .BAT):
Code:
:: cmd /k "cd /d %~dp0"
@echo off
@title Converter: ffmpeg -i ?.flv -c copy -copyts ?.mp4
ffmpeg -i %1 -c copy -copyts %1.mp4
To convert the files, I simply drag the files on top of the .BAT file.
Don't forget to install ffmpeg library on your machine.

I can record videos up to 12 hours in length without a problem, and if OBS crashes in the process, the files are still accessible, and it only takes around 1 minute to convert a 1 hour long video.
 

Jack0r

The Helping Squad
In the 0.638b update Palana added a fix that hopefully fixes the MP4 corruption, but in general ViccroyHD does what I would recommend anyone that needs the recorded files no matter if Power goes out or OBS crashes.
FLV files will simply work and can be easily converted.
 
Top