Question / Help Solution: Recorded MP4 files play as all black in QuickTime Player

dougg3

New Member
I did some searching here and couldn't find a solution, but I found my own, so I figured it might be useful to post my solution in here for others.

I'm using the Windows version of OBS (0.637b) to record my screen to an MP4 file. Everything was working great when I played the recorded files in VLC and Windows Media Player, but QuickTime Player on both Windows and Mac was having trouble with the files. It was correctly loading the file and sizing the playback window, but the video was all black.

I did some experimenting with MediaInfo to see if I could find the difference between the OBS files and other working MP4 files. There were a lot of differences but I finally found the difference that mattered: on OBS files, the Transfer Characteristics are sYCC. On the files that are working, the Transfer Characteristics are BT.709. I put the following option into the Custom x264 Encoder Settings:

transfer=bt709

Now QuickTime Player is able to view the MP4 files created by OBS and I can import them into iMovie. Hope this helps someone out there!
 
Any idea if this encoder setting works for Quick Sync? I do all my local recording using QS at 25Mbps so as not to sacrifice any framerate or quality. I've tested x264 at 25Mbps just recording the desktop and it works fine (and can confirm this encoder setting does indeed allow it to play within QuickTime Player) but I know in-game OBS is immediately and constantly complaining about high encoding latency.

Maybe an ffmpeg switch could be used to do this after recording?
 

dping

Active Member
I did some searching here and couldn't find a solution, but I found my own, so I figured it might be useful to post my solution in here for others.

I'm using the Windows version of OBS (0.637b) to record my screen to an MP4 file. Everything was working great when I played the recorded files in VLC and Windows Media Player, but QuickTime Player on both Windows and Mac was having trouble with the files. It was correctly loading the file and sizing the playback window, but the video was all black.

I did some experimenting with MediaInfo to see if I could find the difference between the OBS files and other working MP4 files. There were a lot of differences but I finally found the difference that mattered: on OBS files, the Transfer Characteristics are sYCC. On the files that are working, the Transfer Characteristics are BT.709. I put the following option into the Custom x264 Encoder Settings:

transfer=bt709

Now QuickTime Player is able to view the MP4 files created by OBS and I can import them into iMovie. Hope this helps someone out there!
Just for the heck of it, would you please post your log file?
 

dougg3

New Member
Luckily, I stayed subscribed to this thread just in case :-) Thanks for the reference link Boildown. I don't understand exactly what all it means, but QuickTime Player doesn't seem to support the default setting that OBS uses.

8BitCerberus: Unfortunately I know almost nothing about OBS, so I can't help. I didn't know the option was slowing anything down, but I haven't heavily tested things. It would definitely be nice to be able to post-process the file to change the transfer characteristics and get the same result without any loss in quality.

dping: I turned off my custom x264 encoder option and verified that QuickTime Player shows the resulting video as black. Here's the corresponding log file:

https://gist.github.com/71825ab193ece0bc6544

Here's another one with the custom encoder option turned on. I verified that QuickTime Player is able to play the resulting video with no trouble.

https://gist.github.com/49d250122543aa00412d
 
its more the player cant read mp4 files try downlaoding vls it plays pretty much evrything the reason is it wont have teh codecs you could download codecs but vlc is justeasier xD
 

dougg3

New Member
its more the player cant read mp4 files try downlaoding vls it plays pretty much evrything the reason is it wont have teh codecs you could download codecs but vlc is justeasier xD

It's not playing that's the problem -- I love VLC for playing videos, and I'd be crazy to use QuickTime Player instead of it for playing videos, especially on Windows. The purpose of this change is to be able to successfully import recorded videos into iMovie.

I have found an ffmpeg flag that might work, but it does appear to require a re-encode. -pix_fmt yuv420p is the flag, it's referenced here:

Interesting, but I don't think pixel format and transfer characteristics are the same thing. From my reading, transfer characteristics are basically just specifying the gamma correction. Both the nonworking video and the working video are "Planar 4:2:0 YUV" according to VLC.
 

abortcode

New Member
I have a similar issue but tried the following ffmpeg command line:
NOTE: Not sure why it works but the processing time is done in seconds and my file plays but just fine on VLC now.


MD MP4
MD DONE
FOR %%I in (*.mp4) do (ffmpeg.exe -i %%I -vcodec copy -acodec copy -y MP4\%%~nI.mp4 & MOVE %%I DONE\%%I)
 
Top