Open jpietek opened 4 years ago
OK, I'll answer myself in case someone stumbles upon a similar problem.
To fix the mp4 just assign in the mp4 muxer:
vstr.codecpar.extradata = ts_demux.streams[video_index].codecpar.extradata;
Thanks for this. The bitstream filter docs say that for ffmpeg the h264_mp4toannexb filter is auto-inserted for MPEG-TS (muxer mpegts) and raw H.264 (muxer h264) output formats. More to do!
I'm struggling to get the mp4 muxer output working on Windows10 default video stack, thus Adobe Premiere project bin (on third party players like VLC or Chrome it's playable). The video stream is not recognized at all, no metadata, nothing. Audio is fine.
The muxer is set up similarly as in the mp4 example:
MP4Box -info output, beamcoder muxer:
I've finally figured out that the problem is with missing h264 extradata (AVCC) in stream->codecpar. The source of the video is MPEGTS, which does not provide it (null in js object). I guess the ffmpeg automaticaly adds a proper bitstream filter while transmuxing ts->mp4 (?).
Any idea how to achieve a similar to ffmpeg behaviour with beamcoder? I've tried generating the AVCC bytes on my own, but got it a bit wrong, having some missing frames in the video. Would be easier to get it done with libav itself.