Forum Replies Created

Page 15 of 16
  • BTW, I think if you must use MP4, the MP4Box tool is probably better for that.

    https://gpac.wp.institut-telecom.fr/mp4box/

  • For streaming, you’re generally better off to stick it in an MPEG-TS rather than MP4. MP4 _can_ be streamed, but it’s not really made for that purpose.

  • Reuben Martin

    November 6, 2011 at 6:00 am in reply to: FFMPEG mp4 videos for Android

    https://dl.dropbox.com/u/38727164/jump247-1.mp4

    Plays fine on my Evo 4G. Please note: This does not mean it will play equally well on any android device!! This has much less to do with the OS on the device than it has to do with the chip used for hardware decoding of the h264 stream. Not all chips are the same.

    This results in a Main Profile encoding. Your device may only support Baseline Profile.

    For what it’s worth, I use MoboPlayer for playback.

    Your source is interlaced with 411 sampling. I used the following:

    ffmpeg -i jump247-1.avi -deinterlace -vcodec libx264 -pix_fmt yuv420p -crf 20 -trellis 2 -threads 8 -flags +loop+mv4+aic -deblockalpha 0 -deblockbeta 0 -cmp +chroma -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -refs 5 -bf 0 -flags2 +mixed_refs-fastpskip -coder 0 -me_method umh -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -vsync 2 -acodec libfaac -ab 160k -async 1 -f mp4 Test.mp4
    ffmpeg version 0.7.6, Copyright (c) 2000-2011 the FFmpeg developers
    built on Oct 20 2011 00:10:40 with gcc 4.5.3
    configuration: –prefix=/usr –libdir=/usr/lib64 –shlibdir=/usr/lib64 –mandir=/usr/share/man –enable-shared –cc=x86_64-pc-linux-gnu-gcc –disable-static –enable-gpl –enable-version3 –enable-postproc –enable-avfilter –disable-stripping –disable-debug –disable-doc –enable-libmp3lame –enable-libvo-aacenc –enable-libvo-amrwbenc –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libxvid –enable-libfaac –enable-nonfree –enable-libdc1394 –disable-indev=v4l –disable-indev=oss –enable-x11grab –disable-outdev=oss –enable-frei0r –enable-libfreetype –enable-pthreads –enable-libopencore-amrwb –enable-libopencore-amrnb –enable-libgsm –enable-libschroedinger –enable-libspeex –enable-libvpx –enable-libopenjpeg –disable-altivec –disable-avx –cpu=host –enable-hardcoded-tables
    libavutil 50. 43. 0 / 50. 43. 0
    libavcodec 52.122. 0 / 52.122. 0
    libavformat 52.110. 0 / 52.110. 0
    libavdevice 52. 5. 0 / 52. 5. 0
    libavfilter 1. 80. 0 / 1. 80. 0
    libswscale 0. 14. 1 / 0. 14. 1
    libpostproc 51. 2. 0 / 51. 2. 0
    Input #0, avi, from ‘jump247-1.avi’:
    Duration: 00:00:06.63, start: 0.000000, bitrate: 30318 kb/s
    Stream #0.0: Video: dvvideo, yuv411p, 720×480 [PAR 32:27 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
    [buffer @ 0xca7720] w:720 h:480 pixfmt:yuv411p tb:1/1000000 sar:32/27 sws_param:
    [buffersink @ 0xca7d50] auto-inserting filter ‘auto-inserted scaler 0’ between the filter ‘src’ and the filter ‘out’
    [scale @ 0xcaf7f0] w:720 h:480 fmt:yuv411p -> w:720 h:480 fmt:yuv420p flags:0x4
    [libx264 @ 0xca9560] using SAR=32/27
    [libx264 @ 0xca9560] using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
    [libx264 @ 0xca9560] profile Main, level 3.0
    [libx264 @ 0xca9560] 264 – core 118 – H.264/MPEG-4 AVC codec – Copyleft 2003-2011 – https://www.videolan.org/x264.html – options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=-2 threads=8 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
    Output #0, mp4, to ‘Test.mp4’:
    Metadata:
    encoder : Lavf52.110.0
    Stream #0.0: Video: libx264, yuv420p, 720×480 [PAR 32:27 DAR 16:9], q=10-51, 200 kb/s, 30k tbn, 29.97 tbc
    Stream #0.1: Audio: libfaac, 48000 Hz, 2 channels, s16, 160 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Press [q] to stop, [?] for help
    frame= 199 fps= 52 q=-1.0 Lsize= 1931kB time=00:00:06.63 bitrate=2382.0kbits/s
    video:1795kB audio:130kB global headers:0kB muxing overhead 0.269304%
    frame I:69 Avg QP:22.70 size: 9326
    [libx264 @ 0xca9560] frame P:130 Avg QP:24.15 size: 9187
    [libx264 @ 0xca9560] mb I I16..4: 74.7% 0.0% 25.3%
    [libx264 @ 0xca9560] mb P I16..4: 16.3% 0.0% 8.4% P16..4: 59.3% 14.4% 0.7% 0.1% 0.0% skip: 0.9%
    [libx264 @ 0xca9560] coded y,uvDC,uvAC intra: 27.9% 94.8% 35.1% inter: 17.3% 91.9% 2.8%
    [libx264 @ 0xca9560] i16 v,h,dc,p: 31% 12% 11% 47%
    [libx264 @ 0xca9560] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 11% 35% 6% 6% 6% 4% 5% 2%
    [libx264 @ 0xca9560] i8c dc,h,v,p: 53% 17% 22% 9%
    [libx264 @ 0xca9560] Weighted P-Frames: Y:10.8% UV:4.6%
    [libx264 @ 0xca9560] ref P L0: 65.1% 14.0% 11.7% 4.3% 2.8% 1.9% 0.1%
    [libx264 @ 0xca9560] kb/s:2214.23

  • Reuben Martin

    November 6, 2011 at 5:57 am in reply to: FFMPEG mp4 videos for Android

    https://dl.dropbox.com/u/38727164/jump247-1.mp4

    Plays fine on my Evo 4G. Please note: This does not mean it will play equally well on any android device!! This has much less to do with the OS on the device than it has to do with the chip used for hardware decoding of the h264 stream. Not all chips are the same.

    This results in a Main Profile encoding. Your device may only support Baseline Profile.

    For what it’s worth, I use MoboPlayer for playback.

    Your source is interlaced with 411 sampling. I used the following:

    ffmpeg -i jump247-1.avi -deinterlace -vcodec libx264 -pix_fmt yuv420p -crf 20 -trellis 2 -threads 8 -flags +loop+mv4+aic -deblockalpha 0 -deblockbeta 0 -cmp +chroma -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -refs 5 -bf 0 -flags2 +mixed_refs-fastpskip -coder 0 -me_method umh -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -vsync 2 -acodec libfaac -ab 160k -async 1 -f mp4 Test.mp4
    ffmpeg version 0.7.6, Copyright (c) 2000-2011 the FFmpeg developers
    built on Oct 20 2011 00:10:40 with gcc 4.5.3
    configuration: –prefix=/usr –libdir=/usr/lib64 –shlibdir=/usr/lib64 –mandir=/usr/share/man –enable-shared –cc=x86_64-pc-linux-gnu-gcc –disable-static –enable-gpl –enable-version3 –enable-postproc –enable-avfilter –disable-stripping –disable-debug –disable-doc –enable-libmp3lame –enable-libvo-aacenc –enable-libvo-amrwbenc –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libxvid –enable-libfaac –enable-nonfree –enable-libdc1394 –disable-indev=v4l –disable-indev=oss –enable-x11grab –disable-outdev=oss –enable-frei0r –enable-libfreetype –enable-pthreads –enable-libopencore-amrwb –enable-libopencore-amrnb –enable-libgsm –enable-libschroedinger –enable-libspeex –enable-libvpx –enable-libopenjpeg –disable-altivec –disable-avx –cpu=host –enable-hardcoded-tables
    libavutil 50. 43. 0 / 50. 43. 0
    libavcodec 52.122. 0 / 52.122. 0
    libavformat 52.110. 0 / 52.110. 0
    libavdevice 52. 5. 0 / 52. 5. 0
    libavfilter 1. 80. 0 / 1. 80. 0
    libswscale 0. 14. 1 / 0. 14. 1
    libpostproc 51. 2. 0 / 51. 2. 0
    Input #0, avi, from ‘jump247-1.avi’:
    Duration: 00:00:06.63, start: 0.000000, bitrate: 30318 kb/s
    Stream #0.0: Video: dvvideo, yuv411p, 720×480 [PAR 32:27 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
    [buffer @ 0xca7720] w:720 h:480 pixfmt:yuv411p tb:1/1000000 sar:32/27 sws_param:
    [buffersink @ 0xca7d50] auto-inserting filter ‘auto-inserted scaler 0’ between the filter ‘src’ and the filter ‘out’
    [scale @ 0xcaf7f0] w:720 h:480 fmt:yuv411p -> w:720 h:480 fmt:yuv420p flags:0x4
    [libx264 @ 0xca9560] using SAR=32/27
    [libx264 @ 0xca9560] using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
    [libx264 @ 0xca9560] profile Main, level 3.0
    [libx264 @ 0xca9560] 264 – core 118 – H.264/MPEG-4 AVC codec – Copyleft 2003-2011 – https://www.videolan.org/x264.html – options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=-2 threads=8 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
    Output #0, mp4, to ‘Test.mp4’:
    Metadata:
    encoder : Lavf52.110.0
    Stream #0.0: Video: libx264, yuv420p, 720×480 [PAR 32:27 DAR 16:9], q=10-51, 200 kb/s, 30k tbn, 29.97 tbc
    Stream #0.1: Audio: libfaac, 48000 Hz, 2 channels, s16, 160 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Press [q] to stop, [?] for help
    frame= 199 fps= 52 q=-1.0 Lsize= 1931kB time=00:00:06.63 bitrate=2382.0kbits/s
    video:1795kB audio:130kB global headers:0kB muxing overhead 0.269304%
    frame I:69 Avg QP:22.70 size: 9326
    [libx264 @ 0xca9560] frame P:130 Avg QP:24.15 size: 9187
    [libx264 @ 0xca9560] mb I I16..4: 74.7% 0.0% 25.3%
    [libx264 @ 0xca9560] mb P I16..4: 16.3% 0.0% 8.4% P16..4: 59.3% 14.4% 0.7% 0.1% 0.0% skip: 0.9%
    [libx264 @ 0xca9560] coded y,uvDC,uvAC intra: 27.9% 94.8% 35.1% inter: 17.3% 91.9% 2.8%
    [libx264 @ 0xca9560] i16 v,h,dc,p: 31% 12% 11% 47%
    [libx264 @ 0xca9560] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 11% 35% 6% 6% 6% 4% 5% 2%
    [libx264 @ 0xca9560] i8c dc,h,v,p: 53% 17% 22% 9%
    [libx264 @ 0xca9560] Weighted P-Frames: Y:10.8% UV:4.6%
    [libx264 @ 0xca9560] ref P L0: 65.1% 14.0% 11.7% 4.3% 2.8% 1.9% 0.1%
    [libx264 @ 0xca9560] kb/s:2214.23

  • On Linux, Media Express offers 8bit uncompressed AVI, 10bit uncompressed AVI, MJPEG AVI, and DPX.

    If you want to capture to a different format on linux, you can use something like bmdcapture (https://github.com/lu-zero/decklink-ffmpeg/network), where you can pipe it to ffmpeg and encode to anything ffmpeg supports encoding that your system is powerful enough to handle in real time.

    Kdenlive also supports decklink now if you prefer something with a GUI. (https://www.kdenlive.org/)

  • They are not optimizations, but rather work-arounds.

    From FFMPEG’s source code:

    #define X264_CPU_SLOW_CTZ 0x100000 /* BSR/BSF x86 instructions are really slow on some CPUs */
    #define X264_CPU_SLOW_ATOM 0x200000 /* The Atom just sucks */

    The problem may be more to do with the fact that an Atom is simply not designed with this type of processor intensive work load. If it cannon encode fast enough to keep up with the input from the pipe, that may be what forces it to close. You should probably benchmark ffmpeg encoding by itself from a source file of the same format, without all the streaming and pipes. That way you can get an idea of how fast it can encode with the settings you are using.

    The corruption from UDP sources may simply be due to the way UDP works. If a packet is lost, or arrives out of order it is simply discarded, which can corrupt video content when parts of the stream are missing. TCP forces packets to arrive in order, and requests lost packets to be re-transmitted.

    You might also look into using VLC from the command line. It has much more robust support for RTSP, and can probably take care of the http live streaming aspect as well. Doing all that within a single process eliminates a lot of overhead generated using pipes

  • I think you mis-understand the functionality of the “copy” option. It does not copy the codec type of the source video and re-encode it using the same codec. It takes the video stream as is, and dumps it to where ever your destination is. (e.g. the video stream in the output is bit-for-bit the same as it is in the source)

    The encoding parameters (in your case things such as frame rate / frame size) can not be changed without re-encoding the video stream.

    The FPS you are referring to is not the FPS of the video stream, but rather the speed that FFMPEG is encoding. (Which in this case means something elsewhere is probably screwed up)

    The fps of the incoming video stream is shown as 20 framerate, 1 framebase with the transport container showing 20 framerate, 2 framebase. (This would generally imply 10 fps interlaced)

    You have a lot of piping going on here. I would try starting from the source, and place a player at the end of each segment of the pipeline to make sure the output from each section is working as expected. (use something like ffplay, ffprobe can be informative too)

  • Reuben Martin

    November 1, 2011 at 4:49 am in reply to: FFMPEG mp4 videos for Android

    I use this for encoding mp4 for my HTC Evo 4G.(Set for high quality, so somewhat slow…)

    ffmpeg -i Source.avi -vcodec libx264 -crf 20 -trellis 2 -threads 8 -flags +loop+mv4+aic -deblockalpha 0 -deblockbeta 0 -cmp +chroma -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -refs 5 -bf 0 -flags2 +mixed_refs-fastpskip -coder 0 -me_method umh -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -vsync 2 -acodec libfaac -ab 160k -async 1 -f mp4 Output.mp4

  • Well, you described how to reproduce the problem, but never actually described what is going wrong.

    I’m assuming you are loosing sync? Remember that SDI is not always perfect. Frames get lost, time code has jitter or can jump around quite a bit. Especially when using crappy hardware in the signal chain. If your software does not have an effective way to deal with this, when it encounters errors or anomalies it may cut the sync loose between video and audio and let them run free, and in that mode the drift can get off very quickly. I had that happen to me and after about 2 hours the audio sync was off by almost 30 min! Your software has to be smart enough to insert black frames, or drop frames in order to keep sync. The guy developing the software I use added that functionality in and it fixed a whole mess of problems with poor SDI signals. But that was on a linux system. Not sure that helps or if that is even the issue you are encountering.

  • Reuben Martin

    July 21, 2011 at 1:59 am in reply to: DVI Extender 1080P support

    Can’t say. My company doesn’t use any Blackmagic devices for DVI extenders. I was just pointing out that “Video Mode” is only going to support something that is a standardized SDI format, and 1080p60/50 was not considered a standard until just very recently. (at least as far as the ATSC spec is concerned, the latest revision of SMPTE424m is dated sometime in ’06)

    I’m not involved with BM in any way, so I can’t say. It might be possible through a firmware update, but that feasibility depends on possible limitations within the chip itself.

    You never know, it might work fine with 1080p50/60 and just not be listed in the EDID. Try sticking an EDID emulator in front of it and see what happens: https://www.extron.com/product/product.aspx?id=edid101d

Page 15 of 16

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy