I'm having trouble transcoding into h264 with recent (1.0) ffmpeg. Older versions (0.8?) did fine using this command line: ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -vpre normal -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4 the newer versions fail with: Undefined constant or missing '(' in 'wpred' [NULL @ 0x177ca80] Unable to parse option value "wpred+dct8x8+fastpskip+mbtree" [NULL @ 0x177ca80] Error setting option flags2 to value +wpred+dct8x8+fastpskip+mbtree. Based on the little bit of research I did, I should replace -vpre normal with something like -vcodec libx264 -c:v libx264 -preset fast -profile:v baseline which results in this command line: ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -c:v libx264 -preset fast -profile:v baseline -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4 the video transcodes fine, but will not play on the Roku. It plays about 30 seconds, then stops and the Roku starts buffering indefinitely. It also shows lower quality connection, and my apache logs fill up with: (104)Connection reset by peer: core_output_filter: writing data to the network Indicating that the Roku is resetting the connection. Anyone transcoding for the Roku? Any suggestions?
Yan Seiner <yan <at> seiner.com> writes:
ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -c:v libx264 -preset fast -profile:v baseline -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4
Does the "older" version succeed with the following command line? $ ffmpeg -threads 1 -i input.vob -strict -2 -acodec aac -ab 128k -vcodec libx264 -preset fast -vprofile baseline -s 854x480 -crf 22 out.mp4 (Does the "Roku" only support h264 or also mpeg4? Testing without external libraries makes finding regressions much easier.) Generally, for all reports on this mailing list, complete, uncut console output is essential. Carl Eugen
Carl Eugen Hoyos wrote:
Yan Seiner <yan <at> seiner.com> writes:
ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -c:v libx264 -preset fast -profile:v baseline -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4
Does the "older" version succeed with the following command line? $ ffmpeg -threads 1 -i input.vob -strict -2 -acodec aac -ab 128k -vcodec libx264 -preset fast -vprofile baseline -s 854x480 -crf 22 out.mp4
I can't say; I overwrote the older version when I compiled the newer ffmpeg. :-( I also upgraded libx264 so regression is not easy as I don't know what specific version and what compile options I used.
(Does the "Roku" only support h264 or also mpeg4? Testing without external libraries makes finding regressions much easier.)
The Roku is picky about the format. I think it only supports h264. The problem is finding the correct format. Here's the "normal" preset I used with 0.8.x: coder=1 flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=hex subq=6 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 b_strategy=1 qcomp=0.6 qmin=10 qmax=51 qdiff=4 bf=3 refs=2 directpred=3 trellis=0 wpredp=2 flags2=+wpred+dct8x8+fastpskip+mbtree
Generally, for all reports on this mailing list, complete, uncut console output is essential.
Here's my latest failed effort; Roku starts, plays about 30 seconds, and then starts dropping the connection. ffmpeg -i avengers.vob -acodec libfaac -ab 128k -vcodec libx264 -vpre libx264-normal -s 854x480 -crf 22 -weightb 1 -8x8dct 1 -thread 0 -f mp4 avengers.mp4 ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers built on Jan 1 2013 07:45:12 with gcc 4.3.3 (Debian 4.3.3-3) configuration: --enable-libx264 --enable-gpl --enable-libfaac --enable-nonfree libavutil 51. 73.101 / 51. 73.101 libavcodec 54. 59.100 / 54. 59.100 libavformat 54. 29.104 / 54. 29.104 libavdevice 54. 2.101 / 54. 2.101 libavfilter 3. 17.100 / 3. 17.100 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [mpeg @ 0x2a63240] max_analyze_duration 5000000 reached at 5004667 Input #0, mpeg, from 'avengers.vob': Duration: 01:06:19.48, start: 0.211867, bitrate: 14355 kb/s Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 32:27 DAR 16:9], 9800 kb/s, 23.98 fps, 59.94 tbr, 90k tbn, 59.94 tbc Stream #0:1[0x20]: Subtitle: dvd_subtitle Stream #0:2[0x21]: Subtitle: dvd_subtitle Stream #0:3[0x22]: Subtitle: dvd_subtitle Stream #0:4[0x23]: Subtitle: dvd_subtitle Stream #0:5[0x24]: Subtitle: dvd_subtitle Stream #0:6[0x25]: Subtitle: dvd_subtitle Stream #0:7[0x26]: Subtitle: dvd_subtitle Stream #0:8[0x27]: Subtitle: dvd_subtitle Stream #0:9[0x28]: Subtitle: dvd_subtitle Stream #0:10[0x29]: Subtitle: dvd_subtitle Stream #0:11[0x2a]: Subtitle: dvd_subtitle Stream #0:12[0x2b]: Subtitle: dvd_subtitle Stream #0:13[0x2c]: Subtitle: dvd_subtitle Stream #0:14[0x2d]: Subtitle: dvd_subtitle Stream #0:15[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s Stream #0:16[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s Stream #0:17[0x82]: Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s Stream #0:18[0x83]: Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s Stream #0:19[0x84]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s File 'avengers.mp4' already exists. Overwrite ? [y/N] y using SAR=1280/1281 [libx264 @ 0x2a81c60] using cpu capabilities: MMX2 SSE2Slow SlowCTZ [libx264 @ 0x2a81c60] profile High, level 3.1 [libx264 @ 0x2a81c60] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'avengers.mp4': Metadata: encoder : Lavf54.29.104 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], q=10-51, 60k tbn, 59.94 tbc Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, s16, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (mpeg2video -> libx264) Stream #0:15 -> #0:1 (ac3 -> libfaac) Press [q] to stop, [?] for help Que input is backward in timeize= 513279kB time=01:16:35.96 bitrate= 914.9kbits/s dup=165292 drop=0 st:0 PTS: 220610501 DTS: 220610501 < 220610561 invalid, clippingrate= 914.9kbits/s dup=165300 drop=0 frame=514020 fps= 22 q=-1.0 Lsize= 1154384kB time=02:22:55.57 bitrate=1102.7kbits/s dup=308411 drop=0 video:940039kB audio:201428kB subtitle:0 global headers:0kB muxing overhead 1.131569% [libx264 @ 0x2a81c60] frame I:7065 Avg QP:20.12 size: 19497 [libx264 @ 0x2a81c60] frame P:227704 Avg QP:23.61 size: 3359 [libx264 @ 0x2a81c60] frame B:279251 Avg QP:24.96 size: 215 [libx264 @ 0x2a81c60] consecutive B-frames: 24.0% 9.5% 3.9% 62.6% [libx264 @ 0x2a81c60] mb I I16..4: 17.7% 70.4% 11.8% [libx264 @ 0x2a81c60] mb P I16..4: 1.2% 3.5% 0.3% P16..4: 28.9% 7.6% 4.9% 0.0% 0.0% skip:53.6% [libx264 @ 0x2a81c60] mb B I16..4: 0.5% 0.4% 0.0% B16..8: 7.1% 0.3% 0.0% direct: 0.3% skip:91.4% L0:46.9% L1:49.9% BI: 3.1% [libx264 @ 0x2a81c60] 8x8 transform intra:67.5% inter:64.6% [libx264 @ 0x2a81c60] coded y,uvDC,uvAC intra: 52.3% 54.3% 22.3% inter: 3.2% 4.6% 0.3% [libx264 @ 0x2a81c60] i16 v,h,dc,p: 33% 23% 12% 32% [libx264 @ 0x2a81c60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 20% 23% 5% 7% 7% 7% 6% 7% [libx264 @ 0x2a81c60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 22% 15% 5% 9% 8% 8% 5% 5% [libx264 @ 0x2a81c60] i8c dc,h,v,p: 57% 20% 17% 6% [libx264 @ 0x2a81c60] Weighted P-Frames: Y:2.0% UV:1.1% [libx264 @ 0x2a81c60] ref P L0: 70.2% 17.7% 12.0% 0.2% [libx264 @ 0x2a81c60] ref B L0: 87.2% 12.8% [libx264 @ 0x2a81c60] ref B L1: 97.5% 2.5% [libx264 @ 0x2a81c60] kb/s:897.99 -- Help us raise money for my kids' swim team! http://www.facebook.com/RiverRoadKids4Kids
Yan Seiner wrote:
Carl Eugen Hoyos wrote:
(Does the "Roku" only support h264 or also mpeg4? Testing without external libraries makes finding regressions much easier.)
The Roku is picky about the format. I think it only supports h264. The problem is finding the correct format.
Writing library : x264 core 114 Encoding settings : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=8 / psy=1 /
OK, replying to my self in hope of enlightenment. Here's the settings for the video that will not play as reported by mediainfo: < Writing library : x264 core 129 r2230 1cffe9f < Encoding settings : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 And here's one that will play: psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=abr / mbtree=1 / bitrate=1200 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00 -- Help us raise money for my kids' swim team! http://www.facebook.com/RiverRoadKids4Kids
Yan Seiner <yan <at> seiner.com> writes:
OK, replying to my self in hope of enlightenment. Here's the settings for the video that will not play as reported by mediainfo:
x264 core 129 r2230 1cffe9f x264 core 114
Did you already try the two x264 executables to find out if this is a x264 problem? Or simply compile new FFmpeg with the old x264?
rc_lookahead=30 rc_lookahead=50
This looks similar to an option.
crf=23.0 bitrate=1200
These implicate that you are testing two completely different things (files). Carl Eugen
Yan Seiner wrote:
Yan Seiner wrote:
Carl Eugen Hoyos wrote:
(Does the "Roku" only support h264 or also mpeg4? Testing without external libraries makes finding regressions much easier.)
The Roku is picky about the format. I think it only supports h264. The problem is finding the correct format.
One more time, lots of googling and this seems to be my problem. Is there any way to set the audio and video interleave? The Roku Box does not support playing content that does not interleave the audio and the video. Content that does not sufficiently interleave the audio and video will show symptoms of constant rebuffers after a certain amount of time into the stream (typically ~15-60 sec into the stream). The maximum amount of contiguous video that may appear without audio must not exceed 5 megabytes and ideally should not exceed 1.5 megabytes. The maximum amount of contiguous audio that may appear without video must not exceed 512 kilobytes. In order to meet these constraints, a good rule of thumb is that the audio / video interleave should be less than 5 seconds.
Yan Seiner <yan <at> seiner.com> writes:
One more time, lots of googling and this seems to be my problem. Is there any way to set the audio and video interleave?
The Roku Box does not support playing content that does not interleave the audio and the video.
I don't remember a bug report about bad mov interleaving and I don't think this changed lately so this sounds very unlikely to me. Given that the two files you posted information about were completely differently encoded (x264 options), I strongly suspect this is where the problem lies. Carl Eugen
Carl Eugen Hoyos wrote:
Yan Seiner <yan <at> seiner.com> writes:
One more time, lots of googling and this seems to be my problem. Is there any way to set the audio and video interleave?
The Roku Box does not support playing content that does not interleave the audio and the video.
I don't remember a bug report about bad mov interleaving and I don't think this changed lately so this sounds very unlikely to me.
Given that the two files you posted information about were completely differently encoded (x264 options), I strongly suspect this is where the problem lies.
Well, my latest effort is pretty close: ffmpeg 1.0, doesn't play *********************************************************** < Bits/(Pixel*Frame) : 0.152 < Stream size : 1.57 GiB (89%) < Writing library : x264 core 129 r2230 1cffe9f < Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=19.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 ffmpeg 0.8, plays ************************************************************
Bits/(Pixel*Frame) : 0.163 Stream size : 937 MiB (88%) Writing library : x264 core 114 Encoding settings : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=abr / mbtree=1 / bitrate=1200 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
The only difference is the me_method, which I have fixed in my current attempt, and the rc and ref, which I'm still trying to figure out.... do you know what options control those settings?
Yan Seiner <yan <at> seiner.com> writes:
Well, my latest effort is pretty close:
ffmpeg 1.0
< Bits/(Pixel*Frame) : 0.152 < Stream size : 1.57 GiB (89%) < Writing library : x264 core 129 r2230 1cffe9f crf=19.0
ffmpeg 0.8
Bits/(Pixel*Frame) : 0.163 Stream size : 937 MiB (88%) Writing library : x264 core 114 bitrate=1200
These are still *completely* different files. Did you already test 0.8 with a newer x264 or current FFmpeg with older x264? Carl Eugen
Carl Eugen Hoyos wrote:
Yan Seiner <yan <at> seiner.com> writes:
Well, my latest effort is pretty close:
ffmpeg 1.0
< Bits/(Pixel*Frame) : 0.152 < Stream size : 1.57 GiB (89%) < Writing library : x264 core 129 r2230 1cffe9f crf=19.0
ffmpeg 0.8
Bits/(Pixel*Frame) : 0.163 Stream size : 937 MiB (88%) Writing library : x264 core 114
bitrate=1200
These are still *completely* different files.
Did you already test 0.8 with a newer x264 or current FFmpeg with older x264?
ffmpeg 1.0 with older x264: Writing library : x264 core 118 Encoding settings : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 Same result; plays about 30 seconds then rebuffers. The ones that play are all variable bit rate; the ones that refuse to play are constant bit rate. How do I set vbr? (I know this is probably a dumb question but I've never had to set it explicitly.) --Yan
Yan Seiner wrote:
Carl Eugen Hoyos wrote:
Yan Seiner <yan <at> seiner.com> writes:
Well, my latest effort is pretty close:
ffmpeg 1.0
< Bits/(Pixel*Frame) : 0.152 < Stream size : 1.57 GiB (89%) < Writing library : x264 core 129 r2230 1cffe9f crf=19.0
ffmpeg 0.8
Bits/(Pixel*Frame) : 0.163 Stream size : 937 MiB (88%) Writing library : x264 core 114
bitrate=1200
These are still *completely* different files.
Did you already test 0.8 with a newer x264 or current FFmpeg with older x264?
ffmpeg 1.0 with older x264:
Writing library : x264 core 118 Encoding settings : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Same result; plays about 30 seconds then rebuffers.
The ones that play are all variable bit rate; the ones that refuse to play are constant bit rate. How do I set vbr? (I know this is probably a dumb question but I've never had to set it explicitly.)
--Yan _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
!DSPAM:50e87113327621804284693!
HAH! Some small measure of success..... On playback with mplayer, I got an error at the exact same spot that the Roku glitches: MPlayer SVN-r30390-4.3.3 (C) 2000-2009 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing avengers.mp4. libavformat file format detected. [lavf] Video stream found, -vid 0 [lavf] Audio stream found, -aid 1 VIDEO: [H264] 720x480 24bpp 59.940 fps 189.1 kbps (23.1 kbyte/s) Clip info: major_brand: isom minor_version: 512 compatible_brands: isomiso2avc1mp41 encoder: Lavf53.5.0 Xlib: extension "XFree86-VidModeExtension" missing on display ":2.0". ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== ========================================================================== Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding) AUDIO: 48000 Hz, 2 ch, s16le, 192.6 kbit/12.54% (ratio: 24075->192000) Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio)) ========================================================================== AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Movie-Aspect is 2.11:1 - prescaling to correct movie aspect. VO: [xv] 720x480 => 1010x480 Planar YV12 [h264 @ 0xd73d60]left block unavailable for requested intra4x4 mode -1 at 0 3 [h264 @ 0xd73d60]error while decoding MB 0 3 [h264 @ 0xd73d60]concealing 1264 DC, 1264 AC, 1264 MV errors [h264 @ 0xd73d60]out of range intra chroma pred mode at 13 16% 27 0 [h264 @ 0xd73d60]error while decoding MB 13 16 [h264 @ 0xd73d60]concealing 666 DC, 666 AC, 666 MV errors Is there any way to clean this up?
I think I've finally figured it out.... Looks like anything later than ffmpeg 0.5 can't transcode for the roku, or at least for my first generation roku. (?) Fingers crossed but so far 2 short tests and everything seems to be in order. Transcoding the first full length movie as I write this. yan@selene:~/vob$ ffmpeg -v FFmpeg version 0.5.10, Copyright (c) 2000-2012 Fabrice Bellard, et al. configuration: --enable-libx264 --enable-libfaac --enable-gpl --enable-nonfree libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 1 / 52.20. 1 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 built on Jan 6 2013 07:05:22, gcc: 4.3.3 This is the invocation line. I am running latest libx264.... ffmpeg -y -i $1.vob -acodec libfaac -ab 128k -vcodec libx264 -vpre normal -crf 22 -threads 0 -r 23.976 -f mp4 $1.mp4 qt-faststart $1.mp4 /data21/rtmovies/$1.mp4 Here's what mediainfo says: yan@selene:/data21/rtmovies$ mediainfo redwings.mp4 General Complete name : redwings.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 10.8 MiB Duration : 2mn 3s Overall bit rate mode : Variable Overall bit rate : 734 Kbps Writing application : Lavf52.31.0 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.0 Format settings, CABAC : Yes Format settings, ReFrames : 2 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 2mn 3s Bit rate : 601 Kbps Width : 720 pixels Height : 480 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 fps Standard : NTSC Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.073 Stream size : 8.85 MiB (82%) Writing library : x264 core 129 r2230 1cffe9f Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / 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=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
On Sun, 06 Jan 2013 07:22:05 -0800 Yan Seiner <yan@seiner.com> wrote:
I think I've finally figured it out.... Looks like anything later than ffmpeg 0.5 can't transcode for the roku, or at least for my first generation roku. (?) Fingers crossed but so far 2 short tests and everything seems to be in order. Transcoding the first full length movie as I write this.
yan@selene:~/vob$ ffmpeg -v FFmpeg version 0.5.10, Copyright (c) 2000-2012 Fabrice Bellard, et al. configuration: --enable-libx264 --enable-libfaac --enable-gpl --enable-nonfree libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 1 / 52.20. 1 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 built on Jan 6 2013 07:05:22, gcc: 4.3.3
This is the invocation line. I am running latest libx264....
ffmpeg -y -i $1.vob -acodec libfaac -ab 128k -vcodec libx264 -vpre normal -crf 22 -threads 0 -r 23.976 -f mp4 $1.mp4 qt-faststart $1.mp4 /data21/rtmovies/$1.mp4
Here's what mediainfo says:
yan@selene:/data21/rtmovies$ mediainfo redwings.mp4 General Complete name : redwings.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 10.8 MiB Duration : 2mn 3s Overall bit rate mode : Variable Overall bit rate : 734 Kbps Writing application : Lavf52.31.0
Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.0 Format settings, CABAC : Yes Format settings, ReFrames : 2 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 2mn 3s Bit rate : 601 Kbps Width : 720 pixels Height : 480 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 fps Standard : NTSC Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.073 Stream size : 8.85 MiB (82%) Writing library : x264 core 129 r2230 1cffe9f Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / 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=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
How about you copy the libx264 profile files in ffmpeg 0.5.10 into the latest ffmpeg profile files folder?
litt
How about you copy the libx264 profile files in ffmpeg 0.5.10 into the latest ffmpeg profile files folder?
No joy; the options are different for the latest ffmpeg. Also, the files won't play with older versions but newer than 0.5. Something's changed but I don't know what. The Roku is picky and apparently picky enough. HandBrake uses ffmpeg 0.7, so maybe they also ran into this. It's not libx264; I use the latest. It's something in ffmpeg that breaks the files for the Roku. (Not saying that ffmpeg is broken; it could be that the Roku hardware decoder is buggy.)
On Mon, 7 Jan 2013 08:31:21 +0800 littlebat <dashing.meng@gmail.com> wrote:
How about you copy the libx264 profile files in ffmpeg 0.5.10 into the latest ffmpeg profile files folder?
It is not recommended to use preset and profile files between ffmpeg versions, and as of 2011-05 libx264 presets and profiles are internal and do not rely on text files like the old method:
Yan Seiner <yan <at> seiner.com> writes:
I'm having trouble transcoding into h264 with recent (1.0) ffmpeg.
Older versions (0.8?) did fine using this command line:
ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -vpre normal -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4
the newer versions fail with:
Undefined constant or missing '(' in 'wpred' [NULL <at> 0x177ca80] Unable to parse option value "wpred+dct8x8+fastpskip+mbtree" [NULL <at> 0x177ca80] Error setting option flags2 to value +wpred+dct8x8+fastpskip+mbtree.
Based on the little bit of research I did, I should replace -vpre normal with something like
-vcodec libx264 -c:v libx264 -preset fast -profile:v baseline
which results in this command line:
ffmpeg -i input.vob -acodec libfaac -ab 128k -vcodec libx264 -c:v libx264 -preset fast -profile:v baseline -s 854x480 -crf 22 -threads 0 -f mp4 output.mp4
the video transcodes fine, but will not play on the Roku. It plays about 30 seconds, then stops and the Roku starts buffering indefinitely. It also shows lower quality connection, and my apache logs fill up with:
(104)Connection reset by peer: core_output_filter: writing data to the network
Indicating that the Roku is resetting the connection.
Anyone transcoding for the Roku? Any suggestions?
The Roku preset provided with the Roku 4.1 SDK is old and outdated. They really need to update the SDK Encoding Guide with better examples. Make a new ffpreset libx264-roku.ffpreset with this: coder=1 flags=+loop cmp=chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=umh subq=8 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 b_strategy=2 qcomp=0.6 qmin=10 qmax=51 qdiff=4 bf=4 refs=4 direct-pred=3 trellis=1 8x8dct=1 fast-pskip=1 mixed-refs=1 then save that preset here /usr/local/share/ffmpeg/ or to your local ffmpeg preset folder. Technically Roku can play video in other resolutions other than 480p 720p or 1080p but it doesn't like it. I would recommend using 720x480 instead of 854x480. Roku 1 doesn't like the new ffmpeg however it works fine for Roku 2 and Roku 3. It will still work on roku 1 but not as good. Try the encode with the latest version of ffmpeg and use the preset above like this for 16x9 vob files ffmpeg -i input.vob -f mp4 -aspect 16:9 -vf yadif=0:1 -vcodec libx264 -bufsize 2000k -profile:v high -level 4.0 -s 720x480 -vb 1000k -acodec libfaac -ab 128k -vpre roku -r 29.97 -adrift_threshold 0.01 -threads 0 output.mp4 for encoding avi,mpg,mp4 or mov files to roku you will need to remove the '-vf yadif=0:1' 2 pass looks better for lower bit rates. For variant stream playback using Apple ios HLS you would need to encode using the same preset like this ffmpeg -i input.vob -f mpegts -aspect 16:9 -vf yadif=0:1 -vcodec libx264 -bufsize 2000k -profile:v high -level 4.0 -s 720x480 -vb 1000k -acodec libfaac -ab 128k -vpre roku -r 29.97 -vbsf h264_mp4toannexb -adrift_threshold 0.01 -threads 0 output.1.ts This will work decently on Roku1 and perfectly on Roku2 and Roku3 Cheers!
participants (5)
-
Carl Eugen Hoyos -
littlebat -
Lou -
Roku Coder -
Yan Seiner