Cannot stream MKV and badly encoded AVI/divx

Need help? Post your questions here.

Moderator: moderators

Cannot stream MKV and badly encoded AVI/divx

Postby dodob19 » Mon Feb 21, 2011 1:39 pm

I can't stream any MKV files. I get a video not found or access denied error in JWPlayer (version 5). I'm running Subsonic version 4.4 on OS X.

AVI (divx) files work perfectly, except for badly encoded ones (more on that later).

This is the output of my ffmpeg -i movie.mkv:

Code: Select all
/Library/Application\ Support/Subsonic/transcode/ffmpeg -i movie.mkv
FFmpeg version SVN-r25203-einsteinx2, Copyright (c) 2000-2010 the FFmpeg developers
  built on Sep 26 2010 02:08:29 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --prefix=/Volumes/Ramdisk/ --as=yasm --extra-version=einsteinx2 --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3
  libavutil     50.28. 0 / 50.28. 0
  libavcore      0. 9. 0 /  0. 9. 0
  libavcodec    52.90. 0 / 52.90. 0
  libavformat   52.78. 5 / 52.78. 5
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.45. 0 /  1.45. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[matroska,webm @ 0x1809600] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 24.00 (24/1)
Input #0, matroska,webm, from 'movie.mkv':
  Duration: 00:44:24.66, start: 0.000000, bitrate: 448 kb/s
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
At least one output file must be specified


In Subsonic's About log, when I play the file, I get the above and also:
Code: Select all

[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [buffer @ 0x1104c90] w:1280 h:720 pixfmt:yuv420p
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [scale @ 0x1104ea0] w:1280 h:720 fmt:yuv420p -> w:640 h:360 fmt:yuv420p flags:0xc0000004
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Output #0, flv, to 'pipe:':
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Metadata:
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) encoder : Lavf52.78.5
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0(eng): Video: flv, yuv420p, 640x360 [PAR 1:1 DAR 16:9], q=2-31, 1000 kb/s, 1k tbn, 24 tbc
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 64 kb/s
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream mapping:
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0 -> #0.0
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1 -> #0.1
[2/21/11 9:34:32 PM CST]   DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Press [q] to stop encoding


... which seems to indicate it might be working.

My Subsonic>Settings>Transcoding settings are default. All video conversions including mkv to flv are:
Code: Select all
ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -


Any suggestions would be appreciated :)
dodob19
 
Posts: 5
Joined: Mon Feb 21, 2011 1:27 pm

About badly encoded AVI files

Postby dodob19 » Mon Feb 21, 2011 2:01 pm

Some of my AVI files fail to play with the same "video not found or access denied" error in JWplayer.

The Subsonic>About log for a failed AVI transcode reads:

Code: Select all
[2/21/11 9:55:55 PM CST]    INFO   PlaylistInputStream   admin listening to "movie.avi"
[2/21/11 9:55:55 PM CST]    DEBUG   TranscodeInputStream   Starting transcoder: [/Library/Application Support/Subsonic/transcode/ffmpeg] [-ss] [0] [-i] [/Users/bob/movies/movie.avi] [-async] [1] [-b] [1000k] [-s] [480x360] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-]
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) FFmpeg version SVN-r25203-einsteinx2, Copyright (c) 2000-2010 the FFmpeg developers
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) built on Sep 26 2010 02:08:29 with gcc 4.2.1 (Apple Inc. build 5664)
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) configuration: --prefix=/Volumes/Ramdisk/ --as=yasm --extra-version=einsteinx2 --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavutil 50.28. 0 / 50.28. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavcore 0. 9. 0 / 0. 9. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavcodec 52.90. 0 / 52.90. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavformat 52.78. 5 / 52.78. 5
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavdevice 52. 2. 2 / 52. 2. 2
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libavfilter 1.45. 0 / 1.45. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libswscale 0.11. 0 / 0.11. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [mpeg4 @ 0x1812600] Invalid and inefficient vfw-avi packed B frames detected
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg)
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (2997/125)
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Input #0, avi, from '/Users/bob/movies/movie.avi':
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Metadata:
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) ISFT : VirtualDubMod 1.5.10.2 (build 2540/release)
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Duration: 00:22:48.03, start: 0.000000, bitrate: 1061 kb/s
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0: Video: mpeg4, yuv420p, 576x432 [PAR 1:1 DAR 4:3], 23.98 tbr, 23.98 tbn, 23.98 tbc
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [buffer @ 0x1101a60] w:576 h:432 pixfmt:yuv420p
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [scale @ 0x1101c90] w:576 h:432 fmt:yuv420p -> w:480 h:360 fmt:yuv420p flags:0xc0000004
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Output #0, flv, to 'pipe:':
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Metadata:
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) encoder : Lavf52.78.5
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0: Video: flv, yuv420p, 480x360 [PAR 1:1 DAR 4:3], q=2-31, 1000 kb/s, 1k tbn, 23.98 tbc
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream mapping:
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.0 -> #0.0
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Stream #0.1 -> #0.1
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) Press [q] to stop encoding
[2/21/11 9:55:55 PM CST]    DEBUG   InputStreamReaderThread   (/Library/Application Support/Subsonic/transcode/ffmpeg) [mpeg4 @ 0x1812600] Invalid and inefficient vfw-avi packed B frames detected


Is there a way to make ffmpeg ignore the "invalid and inefficient vfw-avi packed B frames detected" error/warning?

If not, is there a utility to batch-check a bunch of AVIs for validity, and a tool to fix them?
dodob19
 
Posts: 5
Joined: Mon Feb 21, 2011 1:27 pm

Postby dodob19 » Mon Feb 21, 2011 4:18 pm

Got both of the above working by compiling my own ffmpeg :)

Subsonic for OS X 4.4 (build 2169) – February 6, 2011

Default pack-in ffmpeg ( /Library/Application Support/Subsonic/transcode/ffmpeg )
Code: Select all
FFmpeg version SVN-r25203-einsteinx2, Copyright (c) 2000-2010 the FFmpeg developers
  built on Sep 26 2010 02:08:29 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --prefix=/Volumes/Ramdisk/ --as=yasm --extra-version=einsteinx2 --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3
  libavutil     50.28. 0 / 50.28. 0
  libavcore      0. 9. 0 /  0. 9. 0
  libavcodec    52.90. 0 / 52.90. 0
  libavformat   52.78. 5 / 52.78. 5
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.45. 0 /  1.45. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0


Recompiled ffmpeg
Code: Select all
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Feb 21 2011 23:54:55 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --enable-libmp3lame --enable-shared --disable-mmx --arch=x86_64
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0


I used a lot less switches. Should I be recompiling it with some switches found in the default ffmpeg (enable-gpl, enable-pthreads, enable-postproc, enable-gray, enable-nonfree, etc.)?
dodob19
 
Posts: 5
Joined: Mon Feb 21, 2011 1:27 pm

Postby dodob19 » Mon Feb 21, 2011 4:33 pm

For those interested, here's what I did:

Get lame source and compile it (required to build ffmpeg with --enable-libmp3lame). Grab the latest lame source from http://sourceforge.net/projects/lame/files/lame/
Code: Select all
tar xvzf lame-3.98.4.tar.gz
cd lame-3.98.4/
./configure
sudo make install


Grab the latest ffmpeg and built it:
Code: Select all
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg/
./configure --enable-libmp3lame --enable-shared --disable-mmx --arch=x86_64
make
sudo make install


Replace the old ffmpeg with the new one:
Code: Select all
cd /Library/Application Support/Subsonic/transcode/
mv ffmpeg ffmpeg.old
ln -s /usr/local/bin/ffmpeg .



There is still a problem with file seeking. Clicking anywhere on the time seeking bar and the video will reset from the beginning.
dodob19
 
Posts: 5
Joined: Mon Feb 21, 2011 1:27 pm

Postby muiz » Wed Mar 09, 2011 12:18 pm

Not all of us can compile, so.. no use for us
muiz
 
Posts: 86
Joined: Wed Feb 02, 2011 11:52 am

Postby twoolums » Wed Mar 23, 2011 11:19 am

dodob19 I wanted to say thank you. I followed your steps on my Mac OS X 10.6, Subsonic 4.4 install to get my avi (divx) files to stream. I couldn't even get them to stream without getting that Video not found or access denied error. Works like a charm now!


muiz wrote:Not all of us can compile, so.. no use for us


Why can't you...I couldn't at first. Install Xcode (its in the App store for 5 bucks) from Apple and then you're good to go.
twoolums
 
Posts: 1
Joined: Wed Mar 23, 2011 11:14 am

Postby GJ51 » Wed Mar 23, 2011 3:00 pm

Try:

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -acodec copy -

or

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -ar 44100 -ac 2 -
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Yeah!

Postby mgiffels » Tue Mar 29, 2011 4:15 am

I was getting the same "Video not found" error. Recompiling worked! I am having the seek problem that you were talking about though, dodob19. Any fix on that yet?
mgiffels
 
Posts: 2
Joined: Tue Mar 29, 2011 4:13 am

Postby mgiffels » Tue Mar 29, 2011 1:53 pm

Just wanted to add another quick update that I was still having trouble streaming certain files. Using the second line from GJ51 fixed the problem.

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -ar 44100 -ac 2 -

Thanks for figuring these things out. You've made my work day a little more bearable.
mgiffels
 
Posts: 2
Joined: Tue Mar 29, 2011 4:13 am

Postby countzer0 » Fri Apr 29, 2011 4:14 pm

Thanks dodob19, updating ffmpeg worked for me! Before that, I had only been able to play XviD/avi and a very small percentage of x264/mkv. Also, transcoding to a lower bitrate did not work. All fixed now, thanks.

BTW, you can get Xcode (without having to buy the app) from your Mac OS X install disc, under Optional Installs...
countzer0
 
Posts: 5
Joined: Fri Apr 29, 2011 4:09 pm

Recompiling FFMPEG fixed my issues on OSX as well

Postby jameskeagie » Wed Jun 15, 2011 7:04 pm

Following the steps above to re-compile resolved my issues as well. Like the rest, I still cannot scan/seek to a time.

I had multiple issues with AVI, DIVX, mkv/x264 before, as well as down-sampling to a lower bitrate on AVI's. These are all now resolved.

I will continue to play videos and see if I run into any more issues.

As far as GJ51's transcoding commands, they broke any streaming to flv on my Android devices. I am not sure why - but switching back to the default restored streaming to my Android browser. I will continue testing to see if it is necessary. If so - I'll have to set up a player/user for mobile use only with the default transcoding command.

Thanks for all your awesome help guys on this forum!
jameskeagie
 
Posts: 11
Joined: Fri Nov 19, 2010 3:45 am

Postby GJ51 » Wed Jun 15, 2011 7:13 pm

Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re:

Postby cryptworks » Thu Feb 02, 2012 6:41 pm

GJ51 wrote:Try:

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -acodec copy -

or

ffmpeg -v 0 -ss %o -async 30 -i %s -f flv -b %bk -r 23.976 -s %wx%h -ar 44100 -ac 2 -


Had similar issues, The second option above worked like a champ!! very nice, and quite graceful!
cryptworks
 
Posts: 1
Joined: Wed Nov 24, 2010 10:29 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 24 guests