akropp
17th April 2013, 23:20
I've been trying to generate a ios streamable file using the x264 library programmatically and not using ffmpeg or the x264 executable (I am on windows). I have an x264 dll compiled with the disable-gpl flag set. In general, video records and streams fine for me, but now I am trying to generate ios playable files.
The settings I am using when initializating the x264_param_t pointer are:
param->i_threads = X264_THREADS_AUTO;
param->b_deterministic = 1;
param->i_csp = X264_CSP_I420;
param->i_width = 640;
param->i_height = 480;
param->i_frame_reference = 1;
param->i_fps_num = 30;
param->i_level_idc = 30;
param->rc.i_rc_method = X264_RC_ABR;
param->rc.i_bitrate = 300;
param->rc.i_lookahead = 0;
param->b_repeat_headers = 1;
param->b_aud = 0;
applyProfile(param, "baseline");
There are no other settings after I apply the baseline profile. I wanted to mention that the "applyProfile" function does return 0. This is just a function pointer to x264_param_apply_profile by doing
applyProfile = (APPLY_PROFILE_PTR)GetProcAddress(dllModule, "x264_param_apply_profile");
When doing dynamic loading of the x264.dll that I built. I have it set up this way so I can drop in new dll's without having to recompile the solution.
My goal is to generate the most basic h.264 ios streamable file.
Using the settings above, the files I generate play just fine in VLC, and QuickTime player. The files are also valid in atombox studio, AtomicParsley and other applications (as far as I can tell). I've made sure the file sizes are small, the bitrate is small, and I've tried most of the suggestions I've heard about h.264 files not playing, but nothing works. I keep getting a play button with a line through it. I also have no idea if there is a way to get any debug information as to why the file wont' play.
I can tell that the sps/pps values between my files and ffmpeg generated files are not the same though, but I don't know how to map this to the internal x264 parameters. Short of those differences, for a while I thought that maybe it was header differences between how ffmpeg writes mp4 file formats vs how my own file saver formats the mp4 headers, but to remove any chances that invalid header atoms were causing problems I ran it through AtomicParsely. The ffmpeg file still works, and my file still does not work. This made me think that it was some sort of encoder setting?
Here are two files that I've generated:
http://thesummerwentwest.com/video/ (http://thesummerwentwest.com/video)
One (customVideo.mp4), is created by me.
The second video (ffmpegVideo.mp4) I created with the baseline profile, -refs 1 and -weightp 0.
I've been banging my head against this for a few days and figured I'd come to the experts to ask. If anyone has any clue or can maybe guide me in the right direction of where to look that would be amazing.
Thanks!
The settings I am using when initializating the x264_param_t pointer are:
param->i_threads = X264_THREADS_AUTO;
param->b_deterministic = 1;
param->i_csp = X264_CSP_I420;
param->i_width = 640;
param->i_height = 480;
param->i_frame_reference = 1;
param->i_fps_num = 30;
param->i_level_idc = 30;
param->rc.i_rc_method = X264_RC_ABR;
param->rc.i_bitrate = 300;
param->rc.i_lookahead = 0;
param->b_repeat_headers = 1;
param->b_aud = 0;
applyProfile(param, "baseline");
There are no other settings after I apply the baseline profile. I wanted to mention that the "applyProfile" function does return 0. This is just a function pointer to x264_param_apply_profile by doing
applyProfile = (APPLY_PROFILE_PTR)GetProcAddress(dllModule, "x264_param_apply_profile");
When doing dynamic loading of the x264.dll that I built. I have it set up this way so I can drop in new dll's without having to recompile the solution.
My goal is to generate the most basic h.264 ios streamable file.
Using the settings above, the files I generate play just fine in VLC, and QuickTime player. The files are also valid in atombox studio, AtomicParsley and other applications (as far as I can tell). I've made sure the file sizes are small, the bitrate is small, and I've tried most of the suggestions I've heard about h.264 files not playing, but nothing works. I keep getting a play button with a line through it. I also have no idea if there is a way to get any debug information as to why the file wont' play.
I can tell that the sps/pps values between my files and ffmpeg generated files are not the same though, but I don't know how to map this to the internal x264 parameters. Short of those differences, for a while I thought that maybe it was header differences between how ffmpeg writes mp4 file formats vs how my own file saver formats the mp4 headers, but to remove any chances that invalid header atoms were causing problems I ran it through AtomicParsely. The ffmpeg file still works, and my file still does not work. This made me think that it was some sort of encoder setting?
Here are two files that I've generated:
http://thesummerwentwest.com/video/ (http://thesummerwentwest.com/video)
One (customVideo.mp4), is created by me.
The second video (ffmpegVideo.mp4) I created with the baseline profile, -refs 1 and -weightp 0.
I've been banging my head against this for a few days and figured I'd come to the experts to ask. If anyone has any clue or can maybe guide me in the right direction of where to look that would be amazing.
Thanks!