[API] transcode to mp4 issue?

Need help? Post your questions here.

Moderator: moderators

[API] transcode to mp4 issue?

Postby nayab9 » Fri Jun 15, 2012 5:08 pm

EDIT: Issue tracked down to the debug lines below
Last edited by nayab9 on Sat Jun 16, 2012 3:52 am, edited 2 times in total.
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] stream.view &format=mp4

Postby nayab9 » Sat Jun 16, 2012 3:49 am

After digging further, heres what I found.

to do mp4, you need to add this: -strict experimental

unfortunately, there is something else weird happening. When i request the mp4 file, here is the debug output from subsonic:

Code: Select all
[2012-06-15 22:52:12,787] INFO PlaylistInputStream - ethan listening to "Movies\The.Sunset.Limited.2011.720p.Bluray.X264.Hive-CM8.mkv"
[2012-06-15 22:52:12,790] DEBUG TranscodeInputStream - Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [0] [-i] [\\WALTERNATE-PC\Movies\The.Sunset.Limited.2011.720p.Bluray.X264.Hive-CM8.mkv] [-async] [1] [-b] [1000k] [-s] [320x240] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [mp4] [-vcodec] [libx264] [-strict] [experimental] [-preset] [superfast] [-threads] [0] [-]
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) ffmpeg version N-31653-gfaa3381, Copyright (c) 2000-2011 the FFmpeg developers
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   built on Jul 28 2011 01:57:12 with gcc 4.6.1
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libavutil    51. 11. 0 / 51. 11. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libavcodec   53.  9. 0 / 53.  9. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libavformat  53.  6. 0 / 53.  6. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libavdevice  53.  2. 0 / 53.  2. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libavfilter   2. 27. 3 /  2. 27. 3
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libswscale    2.  0. 0 /  2.  0. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   libpostproc  51.  2. 0 / 51.  2. 0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [matroska,webm @ 01B1D1A0] Estimating duration from bitrate, this may be inaccurate
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Input #0, matroska,webm, from '\\WALTERNATE-PC\Movies\The.Sunset.Limited.2011.720p.Bluray.X264.Hive-CM8.mkv':
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   Duration: 01:30:52.86, start: 0.000000, bitrate: 384 kb/s
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)     Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x704 [PAR 407:400 DAR 37:20], PAR 237:233 DAR 4740:2563, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)     Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s (default) (forced)
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [buffer @ 02064EC0] w:1280 h:704 pixfmt:yuv420p tb:1/1000000 sar:237/233 sws_param:
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [scale @ 02364960] w:1280 h:704 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [libx264 @ 01B1FB40] using SAR=237/233
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [libx264 @ 01B1FB40] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [libx264 @ 01B1FB40] profile High, level 2.0
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [libx264 @ 01B1FB40] 264 - core 116 r2037 f8ebd4a - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [mp4 @ 01FA3A40] muxer does not support non seekable output
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Output #0, mp4, to 'pipe:':
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   Metadata:
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)     encoder         : Lavf53.6.0
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)     Stream #0.0(eng): Video: libx264, yuv420p, 320x240 [PAR 237:233 DAR 316:233], q=2-31, 1000 kb/s, 90k tbn, 23.98 tbc
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)     Stream #0.1(eng): Audio: aac, 44100 Hz, 2 channels, s16, 64 kb/s (default) (forced)
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Stream mapping:
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   Stream #0.0 -> #0.0
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg)   Stream #0.1 -> #0.1
[2012-06-15 22:52:12,843] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) Could not write header for output file #0 (incorrect codec parameters ?)


I took the line being run, copy/pasted it and formatted so I could manually run it in the command prompt, placed an output file at the end of it, and it seems to work just fine... output is below copy/pasted directly from the command prompt:

Code: Select all
C:\subsonic\transcode>ffmpeg -ss 0 -i \\WALTERNATE-PC\Movies\The.Sunset.Limited.
2011.720p.Bluray.X264.Hive-CM8.mkv -async 1 -b 1000k -s 320x240 -ar 44100 -ac 2
-v 0 -f mp4 -vcodec libx264 -strict experimental -preset superfast -threads 0 st
reamorwhat
ffmpeg version N-31653-gfaa3381, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 28 2011 01:57:12 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-
runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  9. 0 / 53.  9. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 27. 3 /  2. 27. 3
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[matroska,webm @ 019FD160] Estimating duration from bitrate, this may be inaccur
ate
Input #0, matroska,webm, from '\\WALTERNATE-PC\Movies\The.Sunset.Limited.2011.72
0p.Bluray.X264.Hive-CM8.mkv':
  Duration: 01:30:52.86, start: 0.000000, bitrate: 384 kb/s
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x704 [PAR 407:400 DAR 37:
20], PAR 237:233 DAR 4740:2563, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s (default) (forced
)
[buffer @ 019FFF20] w:1280 h:704 pixfmt:yuv420p tb:1/1000000 sar:237/233 sws_par
am:
[scale @ 0384AFC0] w:1280 h:704 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4

[libx264 @ 03568B20] using SAR=237/233
[libx264 @ 03568B20] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
4.2
[libx264 @ 03568B20] profile High, level 2.0
[libx264 @ 03568B20] 264 - core 116 r2037 f8ebd4a - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deb
lock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_
range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma
_qp_offset=0 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_comp
at=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weigh
tb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 r
c=abr mbtree=0 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_
ratio=1.40 pb_ratio=1.30 aq=1:1.00
Output #0, mp4, to 'streamorwhat':
  Metadata:
    encoder         : Lavf53.6.0
    Stream #0.0(eng): Video: libx264, yuv420p, 320x240 [PAR 237:233 DAR 316:233]
, q=2-31, 1000 kb/s, 24k tbn, 23.98 tbc
    Stream #0.1(eng): Audio: aac, 44100 Hz, 2 channels, s16, 64 kb/s (default) (
forced)
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
Input stream #0.1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s
16 ch:2


Any ideas why I can run the command through command prompt but not through subsonic?

Cheers,
Ben
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] transcode to mp4 issue?

Postby GJ51 » Sun Jun 17, 2012 12:54 am

I don't know what the problem is, but you can just turn off transcoding and view an MP4 directly in JW Player. MP4 and FLV are the native formats for JW.
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: [API] transcode to mp4 issue?

Postby nayab9 » Sun Jun 17, 2012 9:15 am

GJ51 wrote:I don't know what the problem is, but you can just turn off transcoding and view an MP4 directly in JW Player. MP4 and FLV are the native formats for JW.


Yes this is true, but the transcode in this case, is to be used on non-mp4/flv formats, such that they can be transcoded on the fly and viewed in JWPlayer...

I'm still not sure if this is actually some sort of subsonic bug, or if the command prompt output is just not the same when execute via subsonic as it is manually through the command line. I'm just not sure why the same exact command directed to an output file would be any different.
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] transcode to mp4 issue?

Postby GJ51 » Sun Jun 17, 2012 12:39 pm

What platform are you on? I have all my video files transcoding fine on Wimdows, but I use a release of ffmpeg that I have found works very well with Video for me. I renamed it "Videoffmpeg" and use that on the video transcode line. If you're on Windows I can send you the download link.

On the standard install I did experience problems with avi videos.
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: [API] transcode to mp4 issue?

Postby nayab9 » Tue Jun 26, 2012 11:51 pm

GJ51 wrote:What platform are you on? I have all my video files transcoding fine on Wimdows, but I use a release of ffmpeg that I have found works very well with Video for me. I renamed it "Videoffmpeg" and use that on the video transcode line. If you're on Windows I can send you the download link.

On the standard install I did experience problems with avi videos.


Do you have your videos transcoding from X -> mp4?
If so, I would definitely love to switch over to the version you are running (I am running on Windows 7), although what confuses me here is that it isn't my ffmpeg version failing, since I can manually use the same command directly into ffmpeg to transcode; rather, it is only when I send the same command through subsonic that the error occurs.

What does your mp4 transcode line look like? for comparison, here is mine...

Name: mp4/h264 video
Convert from: avi mpg mpeg flv m4v mkv mov wmv ogv divx m2ts
Convert to: mp4
Step 1: ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mp4 -vcodec libx264 -strict experimental -preset superfast -threads 0 -

Through subsonic, this fails as shown above.. yet directly through ffmpeg via command line, it works fine.
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] transcode to mp4 issue?

Postby GJ51 » Wed Jun 27, 2012 12:15 am

No all my videos are transcoding to flv except for mp4's which are just sent directly to JW.

I may have played with trying to use ffmpeg to output to mp4 once or twice, but no success.
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: [API] transcode to mp4 issue?

Postby nayab9 » Fri Jun 29, 2012 3:31 pm

GJ51 wrote:No all my videos are transcoding to flv except for mp4's which are just sent directly to JW.

I may have played with trying to use ffmpeg to output to mp4 once or twice, but no success.


It would be amazing to get X -> MP4 working, this would allow HTML5 video playback in most browsers. It works very well if the file is already an mp4 x264/aac, unfortunately the switch to mp4 x264/aac is a recent development, so many files are in containers that will need on-the-fly transcode to support html5.

I'll dig this weekend to see if I can figure something out.

Cheers,
Ben
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] transcode to mp4 issue?

Postby sailhobie » Sat Jun 30, 2012 12:03 am

I am also very interested in using MP4 as my output format of choice, especially for android devices.

I am using an ubuntu 12.04 to serve subsonic and have muddled through updating compiling a version of ffmpeg with H264, and just updated the JWplayer to 5.9 (I think it was). Those two changes made a world of difference in quality. But now I just updated my tablet to ICS and now the quality of flv sucks...bit of a ramble.

anyway, I'm interested in helping however I can and wondering what transcode settings you are trying for mp4. Not sure if I will be much help but I will try. Judging from your output, was your transcode stream something like

ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mp4 -vcodec libx264 -strict experimental -preset superfast -threads 0
sailhobie
 
Posts: 3
Joined: Wed Mar 21, 2012 11:48 pm

Re: [API] transcode to mp4 issue?

Postby nayab9 » Sat Jun 30, 2012 12:52 am

yes that is the same line, my exact line is in subsonic transcode settings:

ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mp4 -vcodec libx264 -strict experimental -preset superfast -threads 0 -

I am running on Windows XP and Windows 7, out of the box ss server along with its ffmpeg and jwplayer (my interest is to get everything working out of box, so that the user doesnt have to tweak any server settings at all)

When I request that line through my ss server, it errors (as shown above); manually through command line it works.

Do you have any luck when you run that transcode through your server? Since you are on linux + using updated ffmpeg, you may have more luck than I
nayab9
 
Posts: 14
Joined: Wed Jan 18, 2012 6:51 pm

Re: [API] transcode to mp4 issue?

Postby thothaman » Sun Sep 09, 2012 7:20 am

Hi, I was curious if anyone had any luck with this???

Looking into it a bit it doesn't seem like it's at all viable at the moment to transcode X->MP4 for use in HTML5

The error in the previously attached debug log that is preventing output is
Code: Select all
[2012-06-15 22:52:12,842] DEBUG InputStreamReaderThread - (c:\subsonic\transcode\ffmpeg) [mp4 @ 01FA3A40] muxer does not support non seekable output


Other command line examples like, http://allampersandall.blogspot.dk/2011 ... video.html, work because a file name is given and that creates the "seekable output". Attempting to dump mp4 to stdout at the command line gets the same error message.

I tried to do the same with, the latest ffmpeg build. Aswell as a copy of Handbrake but there doesn't appear to be a pipe output for the video stream.


Lastly, reviewing http://www.longtailvideo.com/html5/hls suggests there's no cross platform way to stream content to mobile devices from subsonic.

I'm hoping i'm wrong this
thothaman
 
Posts: 2
Joined: Sun Sep 09, 2012 7:11 am

Re: [API] transcode to mp4 issue?

Postby tguless » Fri Feb 15, 2013 2:06 pm

The problem I personally am having with this limitation is that when I choose to download the movie in DSub, the resulting download generates a non seekable movie. Meaning in MX Player on Android, I can't seek forward.

Picking MP4 code will error out with the mentioned error of:
"muxer does not support non seekable output mp4"

Picking AVI format will generate a file, but the resulting file is non seekable. Same story with mpegts format.

I will investigate further if there is even a way around this and post back.
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Re: [API] transcode to mp4 issue?

Postby stevejensen22 » Fri May 10, 2013 5:21 pm

Any word on finding a seekable video type for android devices? More specifically DSub?
stevejensen22
 
Posts: 1
Joined: Fri May 10, 2013 5:17 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 13 guests