EzDevInfo.com

h.264 interview questions

Top h.264 frequently asked interview questions

Convert from MOV to MP4 Container format

I have a digital camera that records nice 1080p H.264 format but unfortunately it uses the MOV container format. Basically I have nothing but the camera and VLC that play this format natively.

Is there a tool out there to convert the video to a format by just replacing the container format? That'd be a lot faster as the encoding is perfectly fine.

It'd be nice to select the folder and convert everything over to a more respectable container format like MP4.

I don't want to touch the actual quality of the video I want the conversion to be as fast as possible.


Source: (StackOverflow)

FFMPEG encoding settings for 1080/60fps/h264 - framedrops

I want to use latest ffmpeg to encode set of JPG frames to 1920x1080 60fps h.264 movie. I'm looking for set of parameters that will allow smooth playback of encoded video on fairly strong PC machines like I5-3570@3.4GHZ+Intel HD Graphics.

I tried various profiles (main, high) and levels (2.1, 3.1, 4) and bitrates (6mbps, 8mbps, 10mbps) for example:

ffmpeg -framerate 60 -start_number 1 -i frame-%05d.jpg -vcodec libx264 -preset slow -b:v 8M -profile:v high -level:v 3.1 -y output.mp4

But when I play output.mp4 in latest VLC or WMP I got framedrops (not many, but noticeable).

I played random youtube 60fps/1080 material on the same machine and the playback was smooth, so I assume that the machine is capable of smooth playback but the video has to be encoded with appropriate parameters.

What parameters could be used to make the decoding less processing power demanding? I would like to maintain full hd quality and 60fps, but the file size is not relevant.

Output of ffmpeg command:

ffmpeg -framerate 60 -start_numb
er 1 -i d:\tmp\demo-60\test-%05d.jpg -vcodec libx264 -preset slow -b:v 8M -profi
le:v high -level:v 3.1 -y d:\tmp\insys-demo-60-noaudio.mp4
ffmpeg version N-67742-g3f07dd6 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 16 2014 22:10:05 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      54. 13.100 / 54. 13.100
  libavcodec     56. 12.101 / 56. 12.101
  libavformat    56. 13.100 / 56. 13.100
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from 'd:\tmp\demo-60\test-%05d.jpg':
  Duration: 00:07:01.67, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080
[SAR 96:96 DAR 16:9], 60 fps, 60 tbr, 60 tbn, 60 tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0000000002c47d60] using SAR=1/1
[libx264 @ 0000000002c47d60] frame MB size (120x68) > level limit (3600)
[libx264 @ 0000000002c47d60] DPB size (4 frames, 32640 mbs) > level limit (2 fra
mes, 18000 mbs)
[libx264 @ 0000000002c47d60] MB rate (489600) > level limit (108000)
[libx264 @ 0000000002c47d60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX
[libx264 @ 0000000002c47d60] profile High, level 3.1
[libx264 @ 0000000002c47d60] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=2 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=8000 ratet
ol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'd:\tmp\insys-demo-60-noaudio.mp4':
  Metadata:
    encoder         : Lavf56.13.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 1
920x1080 [SAR 96:96 DAR 16:9], q=-1--1, 8000 kb/s, 60 fps, 15360 tbn, 60 tbc
    Metadata:
      encoder         : Lavc56.12.101 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=   68 fps= 31 q=33.0 size=     252kB time=00:00:00.10 bitrate=20638.7kbits
frame=   87 fps= 32 q=27.0 size=     273kB time=00:00:00.41 bitrate=5358.4kbits/
frame=  102 fps= 31 q=24.0 size=     422kB time=00:00:00.66 bitrate=5191.4kbits/
frame=  119 fps= 31 q=22.0 size=     601kB time=00:00:00.95 bitrate=5183.7kbits/
frame=  136 fps= 31 q=21.0 size=     814kB time=00:00:01.23 bitrate=5409.1kbits/
frame=  150 fps= 31 q=21.0 size=    1047kB time=00:00:01.46 bitrate=5846.0kbits/
frame=  163 fps= 30 q=22.0 size=    1375kB time=00:00:01.68 bitrate=6690.5kbits/
frame=  177 fps= 30 q=22.0 size=    1598kB time=00:00:01.91 bitrate=6829.8kbits/
frame=  178 fps= 27 q=21.0 size=    1618kB time=00:00:01.93 bitrate=6854.9kbits/
frame=  193 fps= 27 q=21.0 size=    1810kB time=00:00:02.18 bitrate=6789.8kbits/
frame=  206 fps= 27 q=21.0 size=    2070kB time=00:00:02.40 bitrate=7065.7kbits/
frame=  220 fps= 27 q=22.0 size=    2313kB time=00:00:02.63 bitrate=7196.7kbits/
frame=  234 fps= 27 q=22.0 size=    2615kB time=00:00:02.86 bitrate=7474.0kbits/
frame=  247 fps= 27 q=22.0 size=    2793kB time=00:00:03.08 bitrate=7420.5kbits/
frame=  263 fps= 27 q=21.0 size=    2947kB time=00:00:03.35 bitrate=7205.6kbits/
frame=  279 fps= 28 q=21.0 size=    3119kB time=00:00:03.61 bitrate=7064.4kbits/
frame=  297 fps= 28 q=20.0 size=    3257kB time=00:00:03.91 bitrate=6811.5kbits/
frame=  312 fps= 28 q=20.0 size=    4109kB time=00:00:04.16 bitrate=8078.8kbits/
frame=  328 fps= 28 q=22.0 size=    4272kB time=00:00:04.43 bitrate=7893.5kbits/
frame=  345 fps= 28 q=21.0 size=    4391kB time=00:00:04.71 bitrate=7626.7kbits/
frame=  361 fps= 28 q=21.0 size=    4650kB time=00:00:04.98 bitrate=7644.7kbits/
...

At the end of processing ffmpeg prints:

frame=25193 fps= 17 q=33.0 size=  395561kB time=00:06:58.85 bitrate=7736.5kbits/
frame=25211 fps= 17 q=33.0 size=  395617kB time=00:06:59.15 bitrate=7732.1kbits/
frame=25232 fps= 17 q=32.0 size=  395672kB time=00:06:59.50 bitrate=7726.7kbits/
frame=25250 fps= 17 q=32.0 size=  395735kB time=00:06:59.80 bitrate=7722.4kbits/
frame=25267 fps= 17 q=32.0 size=  395776kB time=00:07:00.08 bitrate=7718.0kbits/
frame=25285 fps= 17 q=32.0 size=  395811kB time=00:07:00.38 bitrate=7713.2kbits/
frame=25300 fps= 17 q=-1.0 Lsize=  396340kB time=00:07:01.63 bitrate=7700.6kbits
/s
video:396048kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxin
g overhead: 0.073937%
[libx264 @ 00000000003675c0] frame I:104   Avg QP:26.69  size:182027
[libx264 @ 00000000003675c0] frame P:8999  Avg QP:31.82  size: 28039
[libx264 @ 00000000003675c0] frame B:16197 Avg QP:36.70  size:  8291
[libx264 @ 00000000003675c0] consecutive B-frames:  8.4% 12.1% 19.4% 60.0%
[libx264 @ 00000000003675c0] mb I  I16..4: 17.2% 51.0% 31.8%
[libx264 @ 00000000003675c0] mb P  I16..4:  2.2%  4.8%  1.5%  P16..4: 17.9%  9.6
%  5.9%  0.0%  0.0%    skip:58.0%
[libx264 @ 00000000003675c0] mb B  I16..4:  0.3%  0.5%  0.1%  B16..8: 22.8%  4.8
%  1.4%  direct: 0.9%  skip:69.2%  L0:43.6% L1:50.3% BI: 6.0%
[libx264 @ 00000000003675c0] final ratefactor: 27.73
[libx264 @ 00000000003675c0] 8x8 transform intra:55.0% inter:51.7%
[libx264 @ 00000000003675c0] direct mvs  spatial:97.7% temporal:2.3%
[libx264 @ 00000000003675c0] coded y,uvDC,uvAC intra: 27.2% 19.8% 10.7% inter: 5
.8% 3.5% 1.3%
[libx264 @ 00000000003675c0] i16 v,h,dc,p: 44% 45%  5%  6%
[libx264 @ 00000000003675c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 10% 45%  3%  4%
 4%  4%  3%  4%
[libx264 @ 00000000003675c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 17% 18%  6%  8%
 7%  8%  6% 10%
[libx264 @ 00000000003675c0] i8c dc,h,v,p: 72% 16% 11%  2%
[libx264 @ 00000000003675c0] Weighted P-Frames: Y:2.0% UV:1.5%
[libx264 @ 00000000003675c0] ref P L0: 71.7% 14.6% 13.6%  0.1%
[libx264 @ 00000000003675c0] ref B L0: 87.9% 12.1%
[libx264 @ 00000000003675c0] ref B L1: 94.2%  5.8%
[libx264 @ 00000000003675c0] kb/s:7694.27

VLC Player preferences:

enter image description here

Update

After testing various options of GOP (-g), reference frames (-refs), buffer sizes (-bufsize), bframes (-bf), disabling cabac (-coder 0), profiles (main, high, high10, high422, high444), levels (3.0 - 5.0) and testing various players enabling/disabling hardware acceleration I come to conclusion that it is probably not possible to encode sharp H.264 1920x1080@60fps with game-like dynamics so it would be playable on typical PC flawlesly. I tested various machines including Mac Book Pro. The only machine that was able to play the material smoothly was the latest Samsung TV model (UHD series).


Source: (StackOverflow)

Advertisements

Can a GPU be used to Encode h264?

I am wondering if I get a better graphics card could it speed up h264 encoding on my machine using handbrake?

If so how can I tell what graphics card will support this?

I am aware that the GPU can do hardware decoding of h264, but am not sure about encoding.


Source: (StackOverflow)

FFmpeg extract clip - stream frame rate differs from container frame rate (x264, aac)

Summary
H.264 video seems to have a really high frame rate that requires a scaling factor to the applied to the duration of video that I'm trying to extract (900x lower).

Body
I'm trying to extract a clip from a movie that I have in MP4 format (created using Handbrake). After trying mencoder and VLC, I decided to give FFmpeg a shot since it was the least troublesome when it came to copying the codecs. That is, compared to mencoder and VLC, the resulting file was still playable in QuickTime (I know about Perian, etc, I'm just trying to learn how all this works).

Anyway, my command was as follows:

ffmpeg -ss 01:15:51 -t 00:05:59 -i outofsight.mp4 \ 
-acodec copy -vcodec copy clip.mp4

During the copy, The following comes up:

Seems stream 0 codec frame rate differs from container frame rate: 45000.00 (45000/1) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from outofsight.mp4':
  Duration: 01:57:42.10, start: 0.000000, bitrate: 830 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 720x384, 25 tbr, 22500 tbn, 45k tbc
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16
Output #0, mp4, to 'out.mp4':
    Stream #0.0(und): Video: libx264, yuv420p, 720x384, q=2-31, 90k tbn, 22500 tbc
    Stream #0.1(eng): Audio: libfaac, 48000 Hz, stereo, s16
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2591 fps=2349 q=-1.0 size=    8144kB time=101.60 bitrate= 656.7kbits/s
…

Instead of a 5:59 duration clip, I get the entire rest of the movie. So, to test this, I ran the ffmpeg command with -t 00:00:01. What I got was exactly a 15:00 minute clip. So I did some black box engineering and decided to scale my -t option by calculating what value to enter given that 1 second was interpreted as 900 s. For my desired 359 s clip, I calculated 0.399 s and so my ffmpeg command became:

ffmpeg -ss 01:15.51 -t 00:00:00.399 -i outofsight.mp4 \ 
-acodec copy -vcodec copy clip.mp4

This works, but I have no idea why the duration is scaled by 900. Investigating further, each ffmpeg run has the line:

Seems stream 0 codec frame rate differs from container frame rate: 45000.00 (45000/1) -> 25.00 (25/1)

45000/25 = 1800. Must be a relation somewhere. Somehow, the obscenely high frame rate is causing issues with the timing. How is that frame rate so high? The best part about this is that the resulting clip.mp4 has the exact same feature (due to the copied video codec), and taking further clips from this needs the same scaling for the -t duration option. Therefore, I've made it available for anyone willing to check this out.

Appendix
The preamble for ffmpeg on my system (built using MacPorts ffmpeg port):

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    1. 4. 0 /  1. 4. 0
  libswscale     1. 7. 1 /  1. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jan  4 2010 21:51:51, gcc: 4.2.1 (Apple Inc. build 5646) (dot 1)

EDIT
Not sure whether it was a bug or not, but it seems to be fixed now in my current version of ffmpeg, at least for this video (version 0.6.1 from MacPorts).


Source: (StackOverflow)

Best Intel Quick Sync software for h.264 transcoding

I would like to know the best (fast) software for video encoding and transcoding video into h.264 that makes use of Intel Quick Sync.

I looked at Media Espresso by Cyberlink but it does not have many features. I can't even put a logo on the video using this. Just that one feature would really help.

But nothing else even comes close to the speed of encoding with my i7 2600k.


Source: (StackOverflow)

Using FFmpeg to locate moov atom

I have a library of videos, all of which should have been adjusted for web-streaming by putting the moov atom ahead of the rest of the video. This allows playback to begin before the client has completely downloaded the video.

Is there a reliable way to check if a certain video has been adjusted by locating how many bytes in the moov atom occurs? This is for debugging purposes only.

Thanks in advance.


Source: (StackOverflow)

How do I check if a h264 video contains b-frames?

I'm using ffprobe right now but I don't if it supports showing whether the video contains b-frames and what could be the syntax. Can I do this with ffprobe and so, how, or is there any other free alternative that could do this?


Source: (StackOverflow)

Convert AVI to MP4 keeping the same quality

I want to compress an AVI file to MP4 using an h.264 codec. I could not get the same quality. How can I compress it?

Original Video:

Original Video Screen:

FFmpeg console output (ffmpeg -i input.avi):

FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 28 2012 10:03:40 with gcc 4.4.6 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-shared --enable-gpl --enable-version3 --enable-nonfree                                                                                         --enable-pthreads --enable-x11grab --enable-libopencore-amrnb --enable-libopenc                                                                                        ore-amrwb --enable-libdc1394 --enable-libfaac --enable-libmp3lame --enable-libop                                                                                        enjpeg --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264                                                                                         --enable-libxvid --enable-zlib --enable-filter=drawtext
  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
[mpeg4 @ 0x626b50] Invalid and inefficient vfw-avi packed B frames detected
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2542/release)
  Duration: 01:32:38.13, start: 0.000000, bitrate: 2094 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 720x304 [PAR 1:1 DAR 45:19], 23.98 tbr,                                                                                         23.98 tbn, 23.98 tbc
    Stream #0.1: Audio: ac3, 44100 Hz, 5.1, s16, 384 kb/s
At least one output file must be specified

Test 1

FFmpeg command:

ffmpeg -i input.avi -vcodec libx264 -vpre lossless_slow -crf 25 -acodec libfaac -threads 0 -t 60 1.mp4

Test 1 Screen:

FFmpeg console output (ffmpeg -i 1.mp4)

    FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 28 2012 10:03:40 with gcc 4.4.6 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdc1394 --enable-libfaac --enable-libmp3lame --enable-libopenjpeg --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-filter=drawtext
  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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.93.0
  Duration: 00:01:00.01, start: 0.000000, bitrate: 618 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 720x304 [PAR 1:1 DAR 45:19], 437 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: aac, 44100 Hz, 5.1, s16, 176 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
At least one output file must be specified

Test 2

FFmpeg command:

ffmpeg -y -i input.avi -pass 1 -vcodec libx264 -vpre slow -b 2000k -threads 0 -t 60 -f mp4 -an -y /dev/null
ffmpeg -y -i input.avi -pass 2 -vcodec libx264 -vpre slow -b 2000k -threads 0 -t 60 -acodec libfaac -ab 128k -ac 2 2.mp4

Test 2 Screen:

FFmpeg console output (ffmpeg -i 2.mp4)

FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 28 2012 10:03:40 with gcc 4.4.6 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdc1394 --enable-libfaac --enable-libmp3lame --enable-libopenjpeg --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-filter=drawtext
  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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.93.0
  Duration: 00:01:00.01, start: 0.000000, bitrate: 1097 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 720x304 [PAR 1:1 DAR 45:19], 1028 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 63 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
At least one output file must be specified

Source: (StackOverflow)

Convert AVI into H.264 that works inside an HTML5 Video tag

I would like to convert an existing black and white AVI into an H.264 video that works inside an HTML5 video tag.

I'm currently using this ffmpeg command:

ffmpeg -i file.avi -y -c:v libx264 file.h264

This command does not work for me. It does produce the H.264 file, but it does not play anywhere else other than VLC player.


Source: (StackOverflow)

how do I convert .iso to .mp4 without mounting with ffmpeg

The problem is - I want to convert .iso with dvd to .mp4 (h264/ac3), but I cannot mount it via mount -o loop, because I'm on a virtual machine that doesn't allow to do that.

Googling doesn't help.

For now I'm trying to use mencoder for the task, but it's hard for me to convert all the parameters from ffmpeg-style to mencoder style.


Source: (StackOverflow)

What are the differences between H.264 Profiles?

I was rendering a video in After Effects CS5 and when I was formatting it I chose the H.264 codec and in that format, it had a profile with Baseline, Main and High.

So I did a little test – rendering both files with Baseline and High. The only thing I noticed was that the video size was smaller, High delivering the smaller file size.

I just wanted to know what the difference is as in which would be best for quality and best for file size.


Source: (StackOverflow)

VLC (Server) re-stream Security Camera Feed

I purchased a Swann Home Security DVR system and was hoping for some help on how to duplicate the streaming video on my server.

In order to get their web view (streaming video in the browser) to work, I had to install the following plugins:

HiDvrPlugin.dmg for mac.
Hidvrocx.cab for Windows.

I was originally thinking it was a sign of some form of DRM? Maybe. Maybe not.

HTML wise, the following code is in the source of the safari version of the web view:

<embed pluginspage="SurveilClient.dmg" width="10px" height="10px" type="application/x-scplugin" id="MacDiv" style="height: 592px; width: 720px; left: 278px; top: 61px; ">

It seems to be the main display area.

Using wireshark, I am able to see that the video stream is on port 9000. However, I have no idea what type of stream it is. I've tried opening it in VLC with no such luck.

http://dvr_ip:9000
tcp://dvr_ip:9000

My hope was to do the following to redistribute the feed

vlc dvr_ip:9000 --sout h264-version-on-localhost:3000

TLDR; Trying to re-distribute a stream from a security camera (can't tell the format) using vlc (re-distribute via h.264 / HTML5). Not sure how to accomplish this. Is it possible that the software has some type of DRM that only the plugins can decode?


Source: (StackOverflow)

mix audio with h264 mp4 video with ffmpeg

I have 2 files :

Input #0, wav, from '105426_1.wav':
  Duration: 00:00:09.98, bitrate: 1312 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 41000 Hz, stereo, s16, 1312 kb/s

and:

Duration: 00:00:41.29, start: 0.000000, bitrate: 1313 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1211 kb/s, 24.42 fps, 25 tbr, 90k tbn, 48 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 99 kb/s
    Metadata:
      handler_name    : SoundHandler

I want to insert first audio file into video in special place (for example in 10 secunde of video) and mix it with audio stream of video file.

I try to

 /usr/local/bin/ffmpeg  -i 105426_1.wav -i 105426.mp4 -map 0:0 -map 1:1 -map 1:0  video_finale.mp4

but result is :

  Duration: 00:00:41.31, start: 0.046440, bitrate: 755 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 588 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler

I need only one audio stream and first stream play not from beginig but from 10 sec


Source: (StackOverflow)

ffmpeg minimal requirements configuration for encoding and decoding h264 files

I'm trying to compile ffmpeg with minimal requirements in order to encode/decode with h264.

So far my command line configuration is :

./configure --disable-yasm --disable-everything --enable-encoder=libx264 --enable-encoder=libfaac --enable-decoder=h264 --enable-muxer=h264 --enable-demuxer=h264 --enable-parser=h264 --enable-protocol=file

once compiled, I try this :

./ffmpeg -i ~/Dropbox/TestFile.mov -vcodec libx264 test.mp4

but I get an error :

ffmpeg version N-58081-g2925571 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 14 2013 15:49:58 with Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
  configuration: --disable-yasm --disable-everything --enable-encoder=libx264 --enable-encoder=libfaac --enable-decoder=h264 --enable-muxer=h264 --enable-demuxer=h264 --enable-parser=h264 --enable-protocol=file
  libavutil      52. 52.100 / 52. 52.100
  libavcodec     55. 43.100 / 55. 43.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/mGs/Dropbox/TestFile.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2013-06-23 14:33:09
    model           : iPhone 4S
    model-fra       : iPhone 4S
    encoder         : 6.0
    encoder-fra     : 6.0
    date            : 2013-06-23T16:33:09+0200
    date-fra        : 2013-06-23T16:33:09+0200
    make            : Apple
    make-fra        : Apple
  Duration: 00:00:42.09, start: 0.000000, bitrate: 20960 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 20880 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      rotate          : 180
      creation_time   : 2013-06-23 14:33:09
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, 63 kb/s (default)
    Metadata:
      creation_time   : 2013-06-23 14:33:09
      handler_name    : Core Media Data Handler
[NULL @ 0x7fd999802e00] Unable to find a suitable output format for 'test.mp4'
test.mp4: Invalid argument

This is probably coming from the fact that I have forgot something to enable on the ffmpeg configuration... But I can't found out what.

The test file is a video got from iPhone 4S Camera.

EDIT :

Enabled decoders:
h264

Enabled encoders:

Enabled hwaccels:

Enabled parsers:
h264

Enabled demuxers:
asf         mov         rm
h264            mpegts          rtsp

Enabled muxers:
ffm         h264

Enabled protocols:
file            rtp         udp
http            tcp

Enabled filters:
aformat         format          trim
anull           null
atrim           setpts

Apparently it does not activate the encoder libx264 although I have specified it in my command line...


Source: (StackOverflow)

Join two h.264 movie files, merging chapters?

I have two h.264 encoded .m4v files, generated with Handbrake 0.9.3. They used the same Handbrake preset. How can I merge the two files into one movie, and do I need to do anything special to preserve chapter marks?

In case anyone is wondering, they are "An Evening with Kevin Smith", discs 1 and 2. I also own an older copy of "Se7en" which has the movie split between two sides, so I'll run into this issue eventually when I rip/encode that movie.


Source: (StackOverflow)