Video will not play, Resampling input channels error

Need help? Post your questions here.

Moderator: moderators

Video will not play, Resampling input channels error

Postby greatpenguin » Wed Dec 22, 2010 12:48 am

When I hit the play button for a video, it tries to play for .2 seconds, then the icon changes from pause to play again. I am getting the following error in the subsonic logs.

2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\Videos\Clash of the Titans [2010]\CLASH_OF_THE_TITANS_2010.Title1.mp4':
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Duration: 01:46:06.82, start: 0.000000, bitrate: 2864 kb/s
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: h264, yuv420p, 720x304, 29.97 tbr, 29.97 tbn, 59.94 tbc
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: aac, 48000 Hz, 5.1, s16
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Output #0, flv, to 'pipe:':
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: flv, yuv420p, 720x304, q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream mapping:
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0 -> #0.0
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1 -> #0.1
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Press [q] to stop encoding
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Resampling with input channels greater than 2 unsupported.
[2010-12-22 19:40:24,835] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Can not resample 6 channels @ 48000 Hz to 2 channels @ 44100 Hz

Now, it seems pretty straight forward.. ffmpeg doesn't support transcoding from 5.1.. has anyone found a workaround for this issue? I dont feel like going through and redoing all of my video files just to change the audio on them.

For information, other video files play correctly that are in 2-channel format. Its just my mp4 5.1 files that wont play.

Thanks for any feedback or help on this, it hurts being so close after messing with this for hours and not being able to get over the last hump.
greatpenguin
 
Posts: 3
Joined: Wed Dec 22, 2010 12:42 am

Postby greatpenguin » Wed Dec 22, 2010 12:58 am

Update:

I changed my transcoding string from
ffmpeg -re -y -i %s -ar 44100 -ac 2 -sameq -f flv -

to
ffmpeg -re -y -i %s -ar 44100 -s 384x240 -b 192kb -ab 32kb -sameq -f flv -

so that I would remove transcoding into -ac2 to see if that would help.

However, im now getting the following error. The other files .avi files are still working properly, its just these dang mp4 h264 files.

[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\Videos\Accepted\ACCEPTED.Title1.mp4':
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Duration: 01:33:04.37, start: 0.000000, bitrate: 2185 kb/s
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: h264, yuv420p, 720x304, 29.97 tbr, 29.97 tbn, 59.94 tbc
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: aac, 48000 Hz, 5.1, s16
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Output #0, flv, to 'pipe:':
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: flv, yuv420p, 384x240, q=2-31, 192 kb/s, 90k tbn, 29.97 tbc
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: libmp3lame, 44100 Hz, 5.1, s16, 32 kb/s
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream mapping:
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0 -> #0.0
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1 -> #0.1
[2010-12-22 19:54:43,804] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
greatpenguin
 
Posts: 3
Joined: Wed Dec 22, 2010 12:42 am

Postby greatpenguin » Wed Dec 22, 2010 1:07 am

Last Update for those troubleshooters out there that are trying to help.

Per the last error "maybe incorrect parameters such as bit_rate, rate, width or height" I have removed all options for bit_rate, rate, width or height however im still getting the same error. At this point, im hoping that someone out there can lend me a hand on this one....

here is what I was using at that point
ffmpeg -re -y -i %s -sameq -f flv -

[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\Videos\Accepted\ACCEPTED.Title1.mp4':
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Duration: 01:33:04.37, start: 0.000000, bitrate: 2185 kb/s
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: h264, yuv420p, 720x304, 29.97 tbr, 29.97 tbn, 59.94 tbc
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: aac, 48000 Hz, 5.1, s16
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Output #0, flv, to 'pipe:':
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0(und): Video: flv, yuv420p, 720x304, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1(und): Audio: libmp3lame, 48000 Hz, 5.1, s16, 64 kb/s
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream mapping:
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.0 -> #0.0
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream #0.1 -> #0.1
[2010-12-22 20:04:16,263] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
greatpenguin
 
Posts: 3
Joined: Wed Dec 22, 2010 12:42 am

Postby rhodes3581 » Wed Jan 05, 2011 8:16 pm

I would really like some help with this issue also. I have a lot of files that are in 5.1 and wont work with ffmpeg
rhodes3581
 
Posts: 25
Joined: Wed Sep 09, 2009 7:24 pm

Postby stozher » Wed Jan 05, 2011 8:36 pm

Answer: Resampling with input channels greater than 2 unsupported. Can not resample 6 channels @ 48000 Hz to 2 channels @ 44100 Hz.

Remove "-ar 44100"... Second and third post (removed "-ac 2" ???)... FLV 5.1 :lol:

ffmpeg -i %s -f flv <video options> <-ab ... or -aq ...> -ac 2 -
Last edited by stozher on Wed Jan 05, 2011 8:54 pm, edited 1 time in total.
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby rhodes3581 » Wed Jan 05, 2011 8:51 pm

When I said that I have a lot of files in 5.1 I meant that the files' audio encoding is in 5.1 dolby surround sound. None of those files will play because ffmpeg says that it cant resample the files. The error is below:

Resampling with input channels greater than 2 unsupported.
Can not resample 6 channels @ 48000 Hz to 2 channels @ 44100 Hz
rhodes3581
 
Posts: 25
Joined: Wed Sep 09, 2009 7:24 pm

Postby stozher » Wed Jan 05, 2011 9:04 pm

Don't resample audio stream from 48kHz to 44.1kHz... remove option "-ar 44100". See I edited my above post...
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby rhodes3581 » Thu Jan 06, 2011 10:46 pm

I did what you suggested and this is the error that I get now.


FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 4 2010 15:35:31 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/subsonic/Movies/HD/Takers/Takers.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
Duration: 01:47:05.49, start: 0.000000, bitrate: 2916 kb/s
Stream #0.0(und): Video: h264, yuv420p, 1280x528 [PAR 1:1 DAR 80:33], 2464 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16, 447 kb/s
[libmp3lame @ 0x1fc3f8e0]flv does not support that sample rate, choose from (44100, 22050, 11025).
Output #0, flv, to 'pipe:':
Metadata:
encoder : Lavf52.64.2
Stream #0.0(und): Video: flv, yuv420p, 640x352 [PAR 4:3 DAR 80:33], q=2-31, 1000 kb/s, 1k tbn, 23.98 tbc
Stream #0.1(eng): Audio: libmp3lame, 48000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Could not write header for output file #0 (incorrect codec parameters ?)
rhodes3581
 
Posts: 25
Joined: Wed Sep 09, 2009 7:24 pm

Postby stozher » Thu Jan 06, 2011 11:55 pm

Post your transcode command line...
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby rhodes3581 » Fri Jan 07, 2011 8:06 pm

/var/subsonic/transcode/ffmpeg -ss 0 -ar 44100 -i /home/subsonic/Movies/HD/Takers/Takers.mp4 -b 1000k -s 640x352 -ac 2 -v 0 -f flv -
rhodes3581
 
Posts: 25
Joined: Wed Sep 09, 2009 7:24 pm

Postby stozher » Sat Jan 08, 2011 12:19 am

Don't write FFmpeg options in random order!!! Read FFmpeg manual...

ffmpeg <input options> -i <input file> <output options> <output file>

"-ss 0 -ar 44100" - your options for input Takers.mp4 file :roll:

Takers.mp4 is converted from position "-ss 0" second with sound from it as is an "-ar 44100" kHz sample rate (WRONG! - "Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1")

<output options> = <output video options> <ouput audio options>

"-b 1000k -s 640x352 ... -f flv" - video options for output file: "-b 1000k" bitrate for video and frame size format "-s 640x352" in "-f flv" container format (OK!)

"-ac 2" - audio stereo (OK!)

I rewrite your command line:

ffmpeg -v 0 <input options> -i Takers.mp4 -f flv <output options> -

MP4 video (and all video files except RAW formats) is a container: "Stream #0.0(und): Video: h264, yuv420p, 1280x528" + "Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1" (+ other audio or video stream for example).

"[libmp3lame @ 0x1fc3f8e0] flv does NOT support that sample rate, choose from (44100, 22050, 11025)" - without options "-acodec ..." FFmpeg use default for FLV "-acodec libmp3lame" but your input file sample rate is a 48kHz (you don't define output sample rate options and FFmpeg use same sample rate from input stream). If you use "-ar 44100" for output stream - "Can not resample 6 channels @ 48000 Hz to 2 channels @ 44100 Hz".

FLV support without problem AAC for sound and you not needed to convert to MP3. You only needed to downmix from 5.1 to stereo. JW player don't support 48kHz but play sounds in 48kHz (high frequency not clear - player play 48 kHz in slow speed as is a 44.1kHz). If your movie is a long 60 min for example sound in this situation is a (48 / 44.1) x 60 min = 65.3 min and at end of movies audio and video doesn't in sync...

FLV/AAC:

ffmpeg -v 0 <input options> -i Takers.mp4 -f flv <video options> -acodec libfaac <"-ab ..." or "-aq ..." or noting for default 64k> -ac 2 -

or two steps encoding

ffmpeg -v 0 <input options> -i Takers.mp4 -f flv <video options> -acodec libfaac <"-ab ..." or "-aq ..." or noting for default 64k> -ac 2 - | ffmpeg -v 0 -f flv <other input options> -i - -f flv -vcodec copy -acodec libfaac -ar 44100 <"-ab ..." or "-aq ..." or noting for default 64k> -

Two step encoding of audio degrade sound quality!

TEST ONLY VIDEO:

ffmpeg <input options> -i <input file> -f <output fmt> <output video options> -an <output file>

TEST ONLY AUDIO:

ffmpeg <input options> -i <input file> -f <output fmt> -vn <output audio options> <output file>

See also http://forum.subsonic.org/forum/viewtopic.php?p=19425#19425
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby kapz » Mon Jan 10, 2011 7:41 pm

See last post by me...here (it works now)
Paid Subsonic user
----
Love my unRaid (~9.5TB): [url=http://lime-technology.com/forum/index.php?topic=2031.msg40351#msg40351]Pictures Here (Reply #82)[/url]
User avatar
kapz
 
Posts: 124
Joined: Wed Jun 21, 2006 7:23 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 19 guests