FFMPEG 4 Transcoding MKV to MP4 Has Weird Issue With DASHJS

0

0

I'm not entirely sure I know what the issue is or where to begin troubleshooting. On my CentOS 7 box I have 4.0.1-static https://johnvansickle.com/ffmpeg/ installed and I'm trying to transcode MKV files to MP4 so I can use Bento4 to fragment and Dash/HLS the files for playback. For some reason when I transcode an MKV file it will not play back via Dash JS, but transcoding MP4 files I have no issue. What's weird is when I convert a working MP4 to MKV it works.

I wasn't confident FFMPEG was the issue, so to single it out, I have another box which has Ubuntu installed with FFMPEG 3.4 and I can transcode MKV with no issues. So I used my same FFMPEG command to transcode the MKV to MP4 and use Bento4 and it worked just fine. So it seems like there is an issue with transcoding MKV to MP4 with version 4... but not sure. I have tried several different MKV's and everyone gives the issue.

Here is my FFMPEG info:

ffmpeg version 4.0.1-static https://johnvansickle.com/ffmpeg/
Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516

configuration: 
--enable-gpl 
--enable-version3
--enable-static 
--disable-debug 
--disable-ffplay 
--disable-indev=sndio 
--disable-outdev=sndio 
--cc=gcc-6 
--enable-fontconfig 
--enable-frei0r 
--enable-gnutls 
--enable-gray 
--enable-libaom 
--enable-libfribidi 
--enable-libass 
--enable-libvmaf 
--enable-libfreetype 
--enable-libmp3lame 
--enable-libopencore-amrnb 
--enable-libopencore-amrwb 
--enable-libopenjpeg 
--enable-librubberband 
--enable-libsoxr 
--enable-libspeex 
--enable-libvorbis 
--enable-libopus 
--enable-libtheora 
--enable-libvidstab 
--enable-libvo-amrwbenc 
--enable-libvpx 
--enable-libwebp 
--enable-libx264 
--enable-libx265 
--enable-libxml2 
--enable-libxvid 
--enable-libzimg

libavutil      56. 14.100 / 56. 14.100
libavcodec     58. 18.100 / 58. 18.100
libavformat    58. 12.100 / 58. 12.100
libavdevice    58.  3.100 / 58.  3.100
libavfilter     7. 16.100 /  7. 16.100
libswscale      5.  1.100 /  5.  1.100
libswresample   3.  1.100 /  3.  1.100
libpostproc    55.  1.100 / 55.  1.100

Hyper fast Audio and Video encoder

usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Some of the things I've tried is went to the FFMPEG Wiki and installed a different version via the installation guide, and got the same result. When I load the output file directly and not through the Dash Player, everything works, but that not the desired result I'm looking for.

If it helps, here is the error I get in the browser:

ERROR DOMException: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.

Any ideas on what could cause this? If I'm not providing the correct info, lease let me know and I'll provide more.

EDIT

I removed FFMPEG 4 and installed the latest in RPM ffmpeg version 2.6.8 and everything works fine. I would like to use the latest and greatest, but I guess I'll have to wait.

FFMPEG COMMAND

ffmpeg 
-i ${DIRECTORY}/temp/master.mkv 
-progress ${DIRECTORY}/logs/transcode.log 
-s 320x240 
-c:v libx264 
-b:v 235k 
-minrate 235k 
-maxrate 235k 
-bufsize 470k 
-g 120 
-keyint_min 120 
-sc_threshold 0 
-profile:v high 
-flags +cgop 
-movflags faststart 
-preset veryfast 
-pix_fmt yuv420p 
${DIRECTORY}/temp/ffmpeg_320_240_235.mp4 &> ${DIRECTORY}/logs/ffmpeg.log

Bento4 Fragment Command

${BENTO4}/mp4fragment 
${DIRECTORY}/temp/ffmpeg_320_240_235.mp4 
${DIRECTORY}/temp/fragment.mp4 &> ${DIRECTORY}/logs/fragment.log

Bento4 Dashing

${BENTO4}/mp4dash 
--verbose 
--debug 
-o ${DIRECTORY} -f 
--mpd-name=episode.mpd 
--profiles=on-demand 
--rename-media 
--media-prefix=media 
--exec-dir=${BENTO4} 
--hls 
--hls-master-playlist-name=episode.m3u8 
${DIRECTORY}/temp/fragment.mp4 &> ${DIRECTORY}/segment.log

Mike

Posted 2018-06-24T03:12:12.300

Reputation: 109

1Downvotes, please explain so I can improve the question. – Mike – 2018-06-24T03:29:48.470

Test with latest git build. If it fails, file a bug report at trac.ffmpeg.org – Gyan – 2018-06-24T05:31:28.080

@Gyan - I'll try it and then submit a bug report if there are any issues. – Mike – 2018-06-24T15:14:00.323

1You're not actually giving a lot of information about what specifically you are doing when you say "transcoding", what specific commands you are using, where you are testing etc. – slhck – 2018-06-25T08:17:04.613

@slhck I'm not why I didn't post the command... I apologize... I'll do it now. As for transcoding, I am still new to video so bear with me, but isn't transcoding just a "conversion" of video containers (Demuxing and Muxing) (MKV to MP4)? I'm sure my command will define what my "transcoding" is. As for testing, other than what I mentioned in my post, is there some suggested tests I can perform? Like I mentioned I'm new to FFMPEG, so I may not know of or think of some proper testing to perform. – Mike – 2018-06-25T14:51:09.533

1No worries, it's just easier to show the full command and the ffmpeg output included, just to rule out some case of "wrong assumptions" or misunderstandings. Transcoding is a rather vague term, unfortunately. Transmuxing would be more precise when all you're doing is changing the container. And by Dash JS you mean the dash.js reference implementation? If you can show the Bento4 commands, that'd also help in order to be able to reproduce your issue. Perhaps they're not needed, and it's an ffmpeg bug in the latest version, but who knows! – slhck – 2018-06-25T14:57:20.073

Transmuxing makes more sense... all these terms, lol. Yeah, my end result will be played via dash.js or HLS if an ios device is detected. My development computer is using FFMPEG version 3.4 and I have no issues with my process, what I did to single out FFMPEG was to convert the MKV on my working machine and use Bento4 to finish the process and it worked. So that is why I thinks it's FFMPEG rather than Bento4, but my troubleshooting skills aren't the best. I'll post the Bento4 commands as well. – Mike – 2018-06-25T15:14:15.450

No answers