View Full Version : New tool to change SAR in H264 bitstream
roozhou
29th January 2010, 08:10
I write a bitstream filter for ffmpeg. It can modify sps in H264 bitstream. So far it can change sar, fps, crop information, level, ref frames, cfr/vfr flag, fullrange flag, colorprim, transfer and colormatrix. Since the length of bitstream may be changed, I cannot make an in-place modifier.
ffmpeg git 29946
Download from sf (http://sourceforge.net/projects/direct264/files/Related%20Programs/ffmpeg%20%28demuxer_muxer%20only%29/ffmpeg_git_31792.7z/download) (win32 only)
Patches can be found on svn (https://direct264.svn.sourceforge.net/svnroot/direct264/Patches).
Note this is a demuxer/muxer only ffmpeg build.
cmdline:
ffmpeg -i infile -vcodec copy -acodec copy -vbsf h264_changesps=arg1[/arg2[/arg3]] outfile
args can be:
sar=x:y ---- Set sar to x:y, 0:0 will remove sar info
fps=x:y ---- Set fps to x/y in cfr mode or set timebase to y/x in vfr mode
level=x ---- Set level to x. (e.g. 30 for L3.0, 41 for L4.1)
crop=x:y ---- Crop x pixels from right and y pixels from bottom (e.g. 1920x1080 should use crop=0:8)
ref=x ---- Set number of reference frames to x
cfr ---- Set fps mode to cfr
vfr ---- Set fps mode to vfr
fullrange ---- Use full range (0~255)
limitedrange ---- Use limited range (16~235)
colorprim=x ---- Set color primary to x (integer)
1="bt709", 2="undef", 4="bt470m", 5="bt470bg", 6="smpte170m", 7="smpte240m", 8="film"
transfer=x ---- Set transfer to x (integer)
1="bt709", 2="undef", 4="bt470m", 5="bt470bg", 6="smpte170m", 7="smpte240m", 8="linear", 9="log100", 10="log316"
colormatrix=x ---- Set color matrix to x (integer)
0="GBR", 1="bt709", 2="undef", 4="fcc", 5="bt470bg", 6="smpte170m", 7="smpte240m", 8="YCgCo"
removesei ---- Remove SEI from bitstream. This can be used to remove user data and HRD timing info.
removeaud ---- Remove access unit delimiters, which is useless outside BD player.
removedupheader ---- Remove duplicated sps/pps. In some AnnexB bitstreams sps/pps appear in every I frame. We can safely remove them.
multiple args should be separated by /
Output format is determined by extension.
Supported input and output containers:
ts,mp4,mkv,flv --> mp4,mkv,flv
ts,mp4,mkv,flv --> raw,avi(with -vbsf h264_mp4toannexb)
raw,avi --> raw,avi
It also supports remuxing aac from adts/rm/mp4/mkv/avi to adts/mp4/mkv/avi, and you don't need -absf aac_adts2asc.
Two optional args are added to h264_mp4toannexb:
norepeatheader ---- Write sps/pps only in the first frame
avihack ---- Hack on nal start code, saving ~1 byte per frame on avi. It has no effect on raw output. Avihack implies norepeatheader
A new option -muxerfps is added to ffmpeg. Use this to set container fps for avi or default duration for mkv. This is useful for vfr video (e.g. 120000/1001 for 24/30/60 fps mixed content) or mp4/mkv/flv -> avi muxing.
Example:
convert avc in mkv to raw:
ffmpeg -i input.mkv -vcodec copy -an -vbsf h264_mp4toannexb=norepeatheader output.h264
convert avc in mp4 to avi, set container fps to 29.97:
ffmpeg -i input.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb=avihack -muxerfps 30000/1001 -vtag H264 output.avi
Another new option -bom can be used to add BOM to extracted text files(e.g. ass subtitles).
Example:
extract ass subtitle from mkv
ffmpeg -i input.mkv -vn -an -scodec copy -bom utf-8 output.ass
Lam3rD
29th January 2010, 11:31
Great, thanks a lot for this. It makes things a lot simpler
edit: about crop - why 2 and not all 4 values - left/top/right/bottom ?
roozhou
29th January 2010, 16:10
Because ffmpeg does not support left & top crop.
Keiyakusha
29th January 2010, 16:49
Is there other restrictions for crop? For 1280x720 mkv it crashes for me with crop=640:360 or crop=16:16. And in some cases when it crashes after muxing, result is unplayable...
nurbs
29th January 2010, 17:08
Maybe it's only supposed to crop the padding in a non mod16 video. So when you have 1920x1080 it's actually 1920x1088 with 8 pixels cropped at the bottom.
elguaxo
29th January 2010, 17:25
Thanks.
b66pak
29th January 2010, 19:00
@roozhou thanks a lot...i was waiting for this...
_
Blue_MiSfit
29th January 2010, 20:16
Fantastic! I've had to use a hideously slow in-house developed perl script for tasks like this. Hopefully a real application will do this more quickly :)
~MiSfit
b66pak
29th January 2010, 20:28
some testing:
mkv input with wrong fps
ffmpeg -i sample.mkv -vcodec copy -an -vbsf h264_changesps=fps=24000:1001 -t 20 sample.mp4
the log
F:\1>ffmpeg -i sample.mkv -vcodec copy -an -vbsf h264_changesps=fps=24000:1001 -t 20 sample.mp4
FFmpeg version SVN-r21473, Copyright (c) 2000-2010 Fabrice Bellard, et al.
built on Jan 28 2010 00:30:17 with gcc 4.4.1
configuration:
libavutil 50. 7. 0 / 50. 7. 0
libavcodec 52.48. 0 / 52.48. 0
libavformat 52.47. 0 / 52.47. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 9. 0 / 0. 9. 0
[matroska @ 0x3ecd10]MAX_READ_SIZE:5000000 reached
[matroska @ 0x3ecd10]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (5000000/208542)
Input #0, matroska, from 'sample.mkv':
Duration: 01:24:02.51, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 47.62 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1: Audio: 0x0000, 48000 Hz, 6 channels
Output #0, mp4, to 'sample.mp4':
Stream #0.0(eng): Video: 0x0021, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 24k tbn, 23.98 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 480 fps= 0 q=-1.0 Lsize= 16803kB time=19.94 bitrate=6904.5kbps
video:16794kB audio:0kB global headers:0kB muxing overhead 0.056911%
the output mp4 is 24000/1001 fps and play OK...
raw input (previous mkv demuxed to raw) with wrong fps
ffmpeg -i sample.h264 -vcodec copy -an -vbsf h264_changesps=fps=24000:1001 -t 20 sample.mp4
the log
F:\1>ffmpeg -i sample.h264 -vcodec copy -an -vbsf h264_changesps=fps=24000:1001 -t 20 sample.mp4
FFmpeg version SVN-r21473, Copyright (c) 2000-2010 Fabrice Bellard, et al.
built on Jan 28 2010 00:30:17 with gcc 4.4.1
configuration:
libavutil 50. 7. 0 / 50. 7. 0
libavcodec 52.48. 0 / 52.48. 0
libavformat 52.47. 0 / 52.47. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 9. 0 / 0. 9. 0
[h264 @ 0x3ecd10]max_analyze_duration reached
[h264 @ 0x3ecd10]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (959/20) -> 23.98 (959/40)
Input #0, h264, from 'sample.h264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720, 23.98 fps, 23.98 tbr, 1200k tbn, 47.95 tbc
Output #0, mp4, to 'sample.mp4':
Stream #0.0: Video: 0x0021, yuv420p, 1280x720, q=2-31, 24k tbn, 23.98 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mp4 @ 0xa20050]pts has no value
frame= 480 fps= 0 q=-1.0 Lsize= 16802kB time=20.02 bitrate=6874.8kbps
video:16796kB audio:0kB global headers:0kB muxing overhead 0.031623%
the output mp4 is 24000/1001 fps but is not playing...
_
Blue_MiSfit
29th January 2010, 20:45
Can output to elementary stream be added? It doesn't look like this is supported yet..
~MiSfit
b66pak
4th February 2010, 19:16
also the .mp4 output no longer play in QT (is opened as audio only)...
_
roozhou
5th February 2010, 06:55
also the .mp4 output no longer play in QT (is opened as audio only)...
_
I set the display width/height of video track in mp4 to 0/0 and hope the player always ignore this and take width/height*sar in bitstream. Unfortunately QT fails to do so. I will revert this hack in next version.
So the width/height in mp4 container will remain unchanged until you specify "-aspect x" in ffmpeg cmdline, where x is the DAR of video in decimal.
J_Darnley
5th February 2010, 11:00
So the width/height in mp4 container will remain unchanged until you specify "-aspect x" in ffmpeg cmdline, where x is the DAR of video in decimal.
FYI, ffmpeg also supports a fraction or ratio as the argument for -aspect
roozhou
6th February 2010, 18:42
New build available.
@Keiyakusha
Crop values should fall between 0~15.
@b66pak
Currently ffmpeg does not support remuxing raw h264 stream.
@J_Darnley
"-aspect 16:9" is supported but "-aspect 16/9" will be recognized as "-aspect 16".
J_Darnley
6th February 2010, 19:03
@J_Darnley
"-aspect 16:9" is supported but "-aspect 16/9" will be recognized as "-aspect 16".
Oh yes, my bad. I didn't read the output too closely.
b66pak
7th February 2010, 18:00
@roozhou thanks a lot...
_
b66pak
8th February 2010, 17:45
ffmpeg -i sample.mkv -vcodec copy -an -t 20 sample.mp4
don't work anymore (infinite loop?)
_
roozhou
9th February 2010, 06:18
ffmpeg -i sample.mkv -vcodec copy -an -t 20 sample.mp4
don't work anymore (infinite loop?)
_
It's a regression in ffmpeg. -t and -ss seems not to work in recent build. See this thread (http://roundup.ffmpeg.org/roundup/ffmpeg/issue1728).
I will release a new build as soon as it is fixed.
popper
12th February 2010, 02:58
hi roozhou.
is there any chance you might also make it capable of changing the SPS to lower Refs ?
care of DS way back in 24th December 2007, http://forum.doom9.org/archive/index.php/t-133070.html
posted some Annex B data
"@0 SPS: profile_idc 01001101 ( 77)
@8 SPS: constrained_set0_flag 0 ( 0)
@9 SPS: constrained_set1_flag 1 ( 1)
@10 SPS: constrained_set2_flag 0 ( 0)
@11 SPS: constrained_set3_flag 0 ( 0)
@12 SPS: reserved_zero_4bits 0000 ( 0)
@16 SPS: level_idc 00101000 ( 40)
@24 SPS: seq_parameter_set_id 1 ( 0)
@25 SPS: log2_max_frame_num_minus4 0001001 ( 8)
@32 SPS: pic_order_cnt_type 1 ( 0)
@33 SPS: log2_max_pic_order_cnt_lsb_minus4 00110 ( 5)
@38 SPS: num_ref_frames 011 ( 2)
@41 SPS: gaps_in_frame_num_value_allowed_flag 0 ( 0)
@42 SPS: pic_width_in_mbs_minus1 0000001111000 (119)
@55 SPS: pic_height_in_map_units_minus1 00000100010 ( 33)
@66 SPS: frame_mbs_only_flag 0 ( 0)
@67 SPS: mb_adaptive_frame_field_flag 0 ( 0)
@68 SPS: direct_8x8_inference_flag 1 ( 1)
@69 SPS: frame_cropping_flag 0 ( 0)
@70 SPS: vui_parameters_present_flag 1 ( 1)"
im hoping "@38 SPS: num_ref_frames 011 ( 2)" is the ref values and its possible to change them to lower values in the bitstream copy without a full re-encode (or to much loss of quality playback if any ) through your ffmpeg extensions/patches if you can find a way to add that option sometime ? please.
it would be good for quick fixing streaming to the xbox360 and its limited ref 3 abilitys to play 1080AVC.Mp4 smoothly and perhaps other non (ref16) spec playback devices too.
roozhou
23rd February 2010, 16:13
New build available, now it should work on raw H264 streams.
@popper
Now ref frames can be modified.
popper
23rd February 2010, 18:17
roozhou thanks very much, cheers ;)
im sure that ref option will be very useful for many users devices.
b66pak
23rd February 2010, 18:48
thanks a lot...
Now ref frames can be modified.
i think this will lead to stream decoding corruption...
_
ExSport
23rd February 2010, 23:51
i think this will lead to stream decoding corruption...
Same opinion. Also I remember that same trick tried to use roman76r, main coder of tsMuxeR with same results=corruption when ref frames were changed to compatible l4.1
roozhou
24th February 2010, 02:02
i think this will lead to stream decoding corruption...
_
Yes. I changed a 16ref L5.1 stream to 8ref L4.1. DXVA can be used but shows a lot of artifacts.
popper
25th February 2010, 13:52
Yes. I changed a 16ref L5.1 stream to 8ref L4.1. DXVA can be used but shows a lot of artifacts.
ohh well thanks for trying it anyway, it's the same on the 360 as well, also putting the resulting ref=3 file through AVInaptic DRF analysis it goes so far through then says unknown format, and if i leave it streaming from ps3ms to the 360 it comes back 'unplayable content' after a little time, i assume as it hits the same problem part as AVInaptic gets to.
at least we now know for sure changing on the fly ref doesnt work, now how to stop average people using crazy refs and levels for the encoding general non PC hardware cases :) perhaps the tools they use need far better defaults and warnings to drum it into average end users heads, bigger numbers does not mean better quality in the average ref's and level's case.
it might be interesting to understand why changing ref to a lower Number in the sps H264 bitstream shows a lot of artifacts though,(and the unknown format so far into the file oc), after all your not adding any new ref's just using less of whats already there.
again, thanks for trying it anyway. :)
nm
25th February 2010, 14:29
it might be interesting to understand why changing ref to a lower Number shows a lot of artifacts though,(and the unknown format so far into the file oc), after all your not adding any new ref's just using less of whats already there.
If you change the number, you are telling one thing and doing another: the stream still uses the same number of references as before.
This is only helpful if the decoder is actually capable of buffering higher number of references but there is some kind of a gatekeeper that checks the stream properties and drops it if they exceed L4.1 limits. For example, Nvidia's hardware decoder can handle streams with 16 references, but most DXVA filters refuse to even try if the stream announces that it exceeds L4.1. In this case lying about the number of references will help, but usually it doesn't.
roozhou
25th February 2010, 14:41
now how to stop average people using crazy refs and levels for the encoding general non PC hardware cases :) perhaps the tools they use need far better defaults and warnings to drum it into average end users heads, bigger numbers does not mean better quality in the average ref's and level's case.
IMO this is perhaps doom9's fault. People are encouraged to buy expensive machines, use insane settings, encode at 0.xx fps and finally produce a file with "maximum" quality but cannot play on many devices. Well I would encourage people to increase bitrate by 5% and use default settings.
SomeJoe
27th February 2010, 01:45
This is a very nice tool, thanks.
Is there a chance that this tool could be extended to be able to modify or insert the full range, color primaries, transfer characteristics, and color matrix flags?
The reason I ask is that there are several consumer-level player devices on the market that have bugs with unflagged H.264 streams. The Western Digital TV, NMT Popcorn Hour A-100, A-110, and A-200 all will render H.264 streams with ITU601 color decoding when the H.264 stream is unflagged, regardless of the resolution. For HD streams, this is incorrect, as the rendering should be with ITU709 color decoding.
If the streams are flagged, then the incorrect color decoding does not occur.
I have several streams made from my own Blu-Rays that are unflagged. It would be most convenient/helpful if I could insert the correct color flags into these streams rather than either 1) reencode from the source, or 2) wait for Western Digital/NMT to issue firmware updates. The bugs have been raised to both companies for over a year, and they have not yet issued firmware updates.
b66pak
27th February 2010, 15:01
i second this request...
_
roozhou
5th March 2010, 02:07
New build available
Fixed bugs on flv demuxing
@SomeJoe & b66pak
Can you provide default settings for those VUI options?
SomeJoe
6th March 2010, 05:33
@roozhou:
I believe that the default within the H.264 stream would be that those values aren't present at all.
See this (http://www.networkedmediatank.com/showthread.php?tid=19366&pid=332936#pid332936) post over at the MNT Popcorn Hour forum. It shows a difference between what the flags look like when the color transfer information is present and when it's not:
-------- H264 Video BT.709 --------- -------- H264 Video no colour description --
video_signal_type_present_flag : 1 video_signal_type_present_flag : 1
video_format : 5 video_format : 5
video_full_range_flag : 1 video_full_range_flag : 1
colour_description_present_flag : 1 colour_description_present_flag : 0
colour_primaries : 1
transfer_characteristics : 1
matrix_coefficients : 1
chroma_loc_info_present_flag : 0 chroma_loc_info_present_flag : 0
timing_info_present_flag : 1 timing_info_present_flag : 1
I unfortunately am not familiar with the construction of an H.264 stream, so I don't know where in the stream these flags reside. I assume they're in one of the packet headers somewhere, but that's a wild guess.
You may also want to look at the whole thread (http://www.networkedmediatank.com/showthread.php?tid=19366) over there at the NMT forum, as there's a fair amount of analysis by a few of the developers.
In x264, the command line switches that would insert these flags are:
--colorprim [undef|bt709|bt470m|bt470bg|smpte170m|smpte240m|film]
--transfer [undef|bt709|bt470m|bt470bg|linear|log100|log316|smpte170m|smpte240m]
--colormatrix [undef|bt709|fcc|bt470bg|smpte170m|smpte240m|GBR|YCgCo]
roozhou
23rd March 2010, 09:26
New build available.
Is there a chance that this tool could be extended to be able to modify or insert the full range, color primaries, transfer characteristics, and color matrix flags?
They are supported now. Well if there is no VUI in sps I cannot generate a new one.
And muxing AVC and AAC to AVI is working. The non-monotone timestamps error in mkv->mp4 muxing is fixed as well.
b66pak
23rd March 2010, 17:58
thanks a lot...
_
HELLFISH
2nd April 2010, 00:54
Finally!!! This is tool is so awesome. Thank you so very much for releasing it.
THANK YOU!
roozhou
13th April 2010, 03:48
New build available.
A bug in avi index writing is fixed. There are no longer problems in seeking.
Also added a new option "-bom utf-8", which adds the EF BB BF startcode before extracted text. It seems many windows programs(including MPC-HC) cannot recognize utf-8 encoded text without BOM so this option will fix it.
b66pak
13th April 2010, 19:58
thanks a lot...
_
roozhou
8th May 2010, 17:41
New build available.
1) Compiled with GCC 4.4.4.
2) PTS/DTS error in audio streams will be ignored.
TheShadowRunner
16th May 2010, 11:25
Great app, thank you very much!
(I needed to set video_full_range_flag back to 0 in a .TS)
roozhou
29th July 2010, 08:29
New build 24573 available.
1) Fixed two bugs in bitstream modifier, which may produce bad extradata for mp4/mkv/flv
2) Added two new option to h264_changesps: removesei and removedupheader. removesei can be used to strip x264 user data and timing info from BD. removedupheader can be used to remove duplicated sps/pps in I frames. Both are designed to reduce overhead of bitstream.
b66pak
29th July 2010, 18:55
thanks a lot...
_
roozhou
10th August 2010, 03:18
New build 24750 available.
1) Fixed a bug in bitstream parser. Now streams with seq_scaling_matrix are supported.
2) Added new option to h264_changesps: remove aud
0028606
10th August 2010, 13:57
I have been trying to compile this on Mac OS X 10.6 for the last coulpe of hours but it keeps give errors. If someone could please explain the process as I'm at a loss I would be very grateful
roozhou
10th August 2010, 14:11
What error did you get?
Plz apply my latest patch before you start.
0028606
10th August 2010, 14:19
Yes I have applied patch with -
Cd ffmpeg
Patch p1 < ffmpeg_svn_r24573.patch
is this the correct way to do it?
When apply the patch I get FAIL for imx_dump_header_bsf.c
ffmpeg john$ patch -p1 < ffmpeg_svn_r24573.patch
missing header for unified diff at line 5 of patch
(Stripping trailing CRs from patch.)
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: ffmpeg.c
|===================================================================
|--- ffmpeg.c (revision 24573)
|+++ ffmpeg.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/ffmpeg.c
patching file /Developer/ffmpeg/ffmpeg.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 155
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/aac_adtstoasc_bsf.c
|===================================================================
|--- libavcodec/aac_adtstoasc_bsf.c (revision 24573)
|+++ libavcodec/aac_adtstoasc_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
patching file /Developer/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 177
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/allcodecs.c
|===================================================================
|--- libavcodec/allcodecs.c (revision 24573)
|+++ libavcodec/allcodecs.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/allcodecs.c
patching file /Developer/ffmpeg/libavcodec/allcodecs.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 206
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/avcodec.h
|===================================================================
|--- libavcodec/avcodec.h (revision 24573)
|+++ libavcodec/avcodec.h (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/avcodec.h
patching file /Developer/ffmpeg/libavcodec/avcodec.h
Hunk #8 succeeded at 3903 (offset -1 lines).
(Stripping trailing CRs from patch.)
can't find file to patch at input line 285
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/bitstream_filter.c
|===================================================================
|--- libavcodec/bitstream_filter.c (revision 24573)
|+++ libavcodec/bitstream_filter.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/bitstream_filter.c
patching file /Developer/ffmpeg/libavcodec/bitstream_filter.c
(Stripping trailing CRs from patch.)
patching file h264_changesps_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 890
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/h264_mp4toannexb_bsf.c
|===================================================================
|--- libavcodec/h264_mp4toannexb_bsf.c (revision 24573)
|+++ libavcodec/h264_mp4toannexb_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
patching file /Developer/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 986
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/h264_ps.c
|===================================================================
|--- libavcodec/h264_ps.c (revision 24573)
|+++ libavcodec/h264_ps.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/h264_ps.c
patching file /Developer/ffmpeg/libavcodec/h264_ps.c
Hunk #1 succeeded at 37 (offset 1 line).
(Stripping trailing CRs from patch.)
can't find file to patch at input line 999
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/imx_dump_header_bsf.c
|===================================================================
|--- libavcodec/imx_dump_header_bsf.c (revision 24573)
|+++ libavcodec/imx_dump_header_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/imx_dump_header_bsf.c
patching file /Developer/ffmpeg/libavcodec/imx_dump_header_bsf.c
(Stripping trailing CRs from patch.)
patching file Makefile
Hunk #1 FAILED at 285.
Hunk #2 FAILED at 595.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1032
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/mjpega_dump_header_bsf.c
|===================================================================
|--- libavcodec/mjpega_dump_header_bsf.c (revision 24573)
|+++ libavcodec/mjpega_dump_header_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/mjpega_dump_header_bsf.c
patching file /Developer/ffmpeg/libavcodec/mjpega_dump_header_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1045
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/mp3_header_compress_bsf.c
|===================================================================
|--- libavcodec/mp3_header_compress_bsf.c (revision 24573)
|+++ libavcodec/mp3_header_compress_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/mp3_header_compress_bsf.c
patching file /Developer/ffmpeg/libavcodec/mp3_header_compress_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1058
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/mp3_header_decompress_bsf.c
|===================================================================
|--- libavcodec/mp3_header_decompress_bsf.c (revision 24573)
|+++ libavcodec/mp3_header_decompress_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/mp3_header_decompress_bsf.c
patching file /Developer/ffmpeg/libavcodec/mp3_header_decompress_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1071
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/noise_bsf.c
|===================================================================
|--- libavcodec/noise_bsf.c (revision 24573)
|+++ libavcodec/noise_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/noise_bsf.c
patching file /Developer/ffmpeg/libavcodec/noise_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1084
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/options.c
|===================================================================
|--- libavcodec/options.c (revision 24573)
|+++ libavcodec/options.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/options.c
patching file /Developer/ffmpeg/libavcodec/options.c
(Stripping trailing CRs from patch.)
patching file r10kdec.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1254
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/r210dec.c
|===================================================================
|--- libavcodec/r210dec.c (revision 24573)
|+++ libavcodec/r210dec.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/r210dec.c
patching file /Developer/ffmpeg/libavcodec/r210dec.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1298
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavcodec/remove_extradata_bsf.c
|===================================================================
|--- libavcodec/remove_extradata_bsf.c (revision 24573)
|+++ libavcodec/remove_extradata_bsf.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavcodec/remove_extradata_bsf.c
patching file /Developer/ffmpeg/libavcodec/remove_extradata_bsf.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1314
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/assenc.c
|===================================================================
|--- libavformat/assenc.c (revision 24573)
|+++ libavformat/assenc.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/assenc.c
patching file /Developer/ffmpeg/libavformat/assenc.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1330
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/avienc.c
|===================================================================
|--- libavformat/avienc.c (revision 24573)
|+++ libavformat/avienc.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/avienc.c
patching file /Developer/ffmpeg/libavformat/avienc.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1534
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/flvenc.c
|===================================================================
|--- libavformat/flvenc.c (revision 24573)
|+++ libavformat/flvenc.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/flvenc.c
patching file /Developer/ffmpeg/libavformat/flvenc.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1577
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/isom.c
|===================================================================
|--- libavformat/isom.c (revision 24573)
|+++ libavformat/isom.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/isom.c
patching file /Developer/ffmpeg/libavformat/isom.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1589
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/matroskadec.c
|===================================================================
|--- libavformat/matroskadec.c (revision 24573)
|+++ libavformat/matroskadec.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/matroskadec.c
patching file /Developer/ffmpeg/libavformat/matroskadec.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1666
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/matroskaenc.c
|===================================================================
|--- libavformat/matroskaenc.c (revision 24573)
|+++ libavformat/matroskaenc.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/matroskaenc.c
patching file /Developer/ffmpeg/libavformat/matroskaenc.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1715
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/mov.c
|===================================================================
|--- libavformat/mov.c (revision 24573)
|+++ libavformat/mov.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/mov.c
patching file /Developer/ffmpeg/libavformat/mov.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1736
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/movenc.c
|===================================================================
|--- libavformat/movenc.c (revision 24573)
|+++ libavformat/movenc.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/movenc.c
patching file /Developer/ffmpeg/libavformat/movenc.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1782
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/raw.c
|===================================================================
|--- libavformat/raw.c (revision 24573)
|+++ libavformat/raw.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/raw.c
patching file /Developer/ffmpeg/libavformat/raw.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1849
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/riff.c
|===================================================================
|--- libavformat/riff.c (revision 24573)
|+++ libavformat/riff.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/riff.c
patching file /Developer/ffmpeg/libavformat/riff.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1894
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/rmdec.c
|===================================================================
|--- libavformat/rmdec.c (revision 24573)
|+++ libavformat/rmdec.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/rmdec.c
patching file /Developer/ffmpeg/libavformat/rmdec.c
(Stripping trailing CRs from patch.)
can't find file to patch at input line 1906
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: libavformat/utils.c
|===================================================================
|--- libavformat/utils.c (revision 24573)
|+++ libavformat/utils.c (working copy)
--------------------------
File to patch: /Developer/ffmpeg/libavformat/utils.c
patching file /Developer/ffmpeg/libavformat/utils.c
This is the Error I can't get past
CC libavcore/utils.o
LD libavcore/libavcore.0.dylib
ld: warning: -read_only_relocs cannot be used with x86_64
LD libavcodec/libavcodec.52.dylib
ld: warning: -read_only_relocs cannot be used with x86_64
Undefined symbols:
"_r10k_decoder", referenced from:
_avcodec_register_all in allcodecs.o
"_h264_changesps_bsf", referenced from:
_avcodec_register_all in allcodecs.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libavcodec/libavcodec.52.dylib] Error 1
J_Darnley
10th August 2010, 14:36
Yes I have applied patch with -
Cd ffmpeg
Patch p1 < ffmpeg_svn_r24573.patch
is this the correct way to do it?
No, you don't need to strip any levels from the paths (-p0)
roozhou
10th August 2010, 14:37
I have uploaded the new patch (ffmpeg_svn_r24750.patch). Update to svn 24750 and apply the patch.
P.S. why did you use "p1"?
0028606
10th August 2010, 14:46
I have uploaded the new patch (ffmpeg_svn_r24750.patch). Update to svn 24750 and apply the patch.
I do not see 24750 on the svn linked
P.S. why did you use "p1"?
The answer to that one is short,
No idea why....
EDIT.....
I see it on the SVN now thank you
b66pak
10th August 2010, 19:24
@roozhou thanks a lot...
_
J_Darnley
15th August 2010, 23:03
Hey all, I wanted to use this tool today so I decided to build it. It wouldn't apply on top of my other patches, and it wouldn't build on a clean source. So I decided to cut out the functional bits. You can get them here: http://users.telenet.be/darnley/ffmpeg/
These are from git format-patch and the ones from this thread start at 3. Not all the code is there yet
roozhou
16th August 2010, 08:07
@J_Darnley
The first version of ffmpeg_svn_r24750.patch contains debug code in h264_changesps_bsf.c. It will dump extra data to files before and after modification. Please check out the latest version from svn or just remove two fopen-fwrite-fclose sections in h264_changesps_filter function.
iwod
14th September 2010, 18:25
I just refer to my post here http://forum.doom9.org/showthread.php?p=1442894#post1442894
I know it may not be your tools problem. ( More likely itunes problem ), but any guess as to why only one of the file could be transferred to iPhone while others can not.
It is very frustrating.
P.S - You ffmpeg build is simply AWESOME!!!
b66pak
14th September 2010, 18:56
run this line on the source file that after conversion don't work on iPhone:
ffmpeg -i my_file.mkv
and post the output log here...
_
iwod
14th September 2010, 19:35
Well i manage to use MKVmerge to extract the Raw Stream and Audio, and then use MP4box to mux it back.
And it works perfectly fine using this method, with all my files.
So here is the log
FFmpeg version SVN-r24750, Copyright (c) 2000-2010 the FFmpeg developers
built on Aug 10 2010 00:58:46 with gcc 4.4.4
configuration:
libavutil 50.23. 0 / 50.23. 0
libavcore 0. 3. 0 / 0. 3. 0
libavcodec 52.84. 3 / 52.84. 3
libavformat 52.78. 1 / 52.78. 1
libavdevice 52. 2. 1 / 52. 2. 1
libswscale 0.11. 0 / 0.11. 0
[matroska,webm @ 00c69c30] max_analyze_duration reached
[matroska,webm @ 00c69c30] Estimating duration from bitrate, this may be inaccur
ate
Seems stream 0 codec frame rate differs from container frame rate: 49.98 (269908
51/540000) -> 500.00 (500/1)
Input #0, matroska,webm, from 'Ch33.mkv':
Duration: 00:49:59.17, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: h264, yuv420p, 848x480, PAR 213:212 DAR 71:40, 24.9
9 fps, 500 tbr, 1k tbn, 49.98 tbc
Stream #0.1: Audio: aac, 48000 Hz, stereo, s16
Stream #0.2(chi): Subtitle: [0][0][0][0] / 0x0000
Metadata:
title : Traditional Chinese
At least one output file must be specified
b66pak
14th September 2010, 20:05
this will do the job:
ffmpeg -y -i Ch33.mkv -vbsf h264_changesps=fps=25000:1000 -vcodec copy -acodec copy -sn Ch33.mp4
_
kla960
8th October 2010, 19:28
I have h.264 videos with mp3 audio as vfr in an avi container. But I need it as h.264 video with ac3 audio as cfr in a mkv or ts container.
Is it possible to add the ac3 codec to the patched ffmpeg version???
J_Darnley
8th October 2010, 21:13
Yes, if you apply the patches (my patches at least) then compile as normal you can use any features of ffmpeg that would normally be present.
0028606
19th December 2010, 13:06
can some please provide some advice i'm trying to build this on mac os x 10.6 with ffmpeg 0.6 source
I applied j_darnley patch
I keep getting this error -
CC libavcodec/h261.o
CC libavcodec/h261_parser.o
CC libavcodec/h261dec.o
CC libavcodec/h261enc.o
CC libavcodec/h263.o
CC libavcodec/h263_parser.o
CC libavcodec/h263dec.o
CC libavcodec/h264.o
libavcodec/h264.c: In function ‘fill_filter_caches’:
libavcodec/h264.c:2309: warning: initialization from incompatible pointer type
libavcodec/h264.c:2386: warning: initialization from incompatible pointer type
libavcodec/h264.c:2401: warning: initialization from incompatible pointer type
libavcodec/h264.c: At top level:
libavcodec/h264.h:1256: warning: ‘decode_mb_skip’ defined but not used
CC libavcodec/h264_cabac.o
CC libavcodec/h264_cavlc.o
libavcodec/h264_cavlc.c: In function ‘decode_residual’:
libavcodec/h264_cavlc.c:411: warning: suggest parentheses around comparison in operand of &
make: *** No rule to make target `libavcodec/h264_changesps_bsf.o', needed by `libavcodec/libavcodec.a'. Stop.
does anyone know where I'm going wrong
roozhou
20th December 2010, 15:31
New build 25887 is available.
MGSteve
23rd December 2010, 21:35
New build 25887 is available.
Suppose a Win32 binary is out of the question? I don't compile stuff on my PC :(
7ekno
24th December 2010, 01:32
I don't compile stuff on my PC :(
Nor follow links too well ... first post, the red writing under the SVN version is a direct link to the Win32 binary from SourgeForge ;)
Tek
coolalibaba
24th December 2010, 11:10
can this tool be used to "uncrop" h264 video in any way?
roozhou
24th December 2010, 16:14
can this tool be used to "uncrop" h264 video in any way?
Do you mean to remove crop information? Use -vbsf h264_changesps=crop=0:0.
b66pak
24th December 2010, 20:15
thanks a lot for the new version...
r25887 can't recognize 1 channel aac-lc adts, so the muxing is failing!!!
here is a bug report:
ffmpeg24750:
ffmpeg -i 1channel.aac
FFmpeg version SVN-r24750, Copyright (c) 2000-2010 the FFmpeg developers
built on Aug 10 2010 00:58:46 with gcc 4.4.4
configuration:
libavutil 50.23. 0 / 50.23. 0
libavcore 0. 3. 0 / 0. 3. 0
libavcodec 52.84. 3 / 52.84. 3
libavformat 52.78. 1 / 52.78. 1
libavdevice 52. 2. 1 / 52. 2. 1
libswscale 0.11. 0 / 0.11. 0
[aac @ 003eb270] max_analyze_duration reached
[aac @ 003eb270] Estimating duration from bitrate, this may be inaccurate
[COLOR="Blue"]Input #0, aac, from '1channel.aac':
Duration: 00:01:06.19, bitrate: 65 kb/s
Stream #0.0: Audio: aac, 48000 Hz, mono, s16, 66kb/s
ffmpeg25887:
ffmpeg -i 1channel.aac
FFmpeg version SVN-r25887, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 20 2010 23:16:22 with gcc 4.4.5
configuration:
libavutil 50.34. 0 / 50.34. 0
libavcore 0.15. 0 / 0.15. 0
libavcodec 52.98. 0 / 52.98. 0
libavformat 52.87. 1 / 52.87. 1
libavdevice 52. 2. 2 / 52. 2. 2
libswscale 0.12. 0 / 0.12. 0
[aac @ 003ec540] invalid sampling rate index 13
Last message repeated 3027 times
[aac @ 003eb3b0] Could not find codec parameters (Audio: aac, 0 channels, 37 kb/s)
[aac @ 003eb3b0] Estimating duration from bitrate, this may be inaccurate
Assertion failed: c > 0, file libavutil/mathematics.c, line 79
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
mediainfo on aac:
General
Complete name : 1channel.aac
Format : ADTS
Format/Info : Audio Data Transport Stream
File size : 533 KiB
Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Bit rate mode : Variable
Channel(s) : 1 channel
best regards...
_
coolalibaba
26th December 2010, 07:29
Do you mean to remove crop information? Use -vbsf h264_changesps=crop=0:0.
for example, I have a cropped video with size 1280X544. I meant to make it uncropped to original size 1280X720.
roozhou
26th December 2010, 10:23
for example, I have a cropped video with size 1280X544. I meant to make it uncropped to original size 1280X720.
No. And why do you need to pad to 1280x720 in the bitstream. Can't you do this during playback?
coolalibaba
27th December 2010, 05:20
No. And why do you need to pad to 1280x720 in the bitstream. Can't you do this during playback?
no, actually my player is PS3 and it is not able to pad during playback.
roozhou
27th December 2010, 05:24
no, actually my player is PS3 and it is not able to pad during playback.
What a pity. I think you have to reencode.
coolalibaba
28th December 2010, 06:22
yes, thx. that's what i can find by now...
reinen
12th January 2011, 11:30
hello to all,
I've already tried to compile the patched ffmpeg/x264 sources on my linux machine (ubuntu lucid lynx 10.04) for a few times.
./configure of ffmpeg goes through without any problems, but the 'make'-process stops at libavcodec: ac3enc.c with an error (sorry, I can't remember the exact message).
I have no problem with compiling the unpatched ffmpeg sources (with x264), so I think the dependencies are o.k.
I've used the recent patch of roozhous svn (r25887) to patch the latest ffmpeg sources downloaded from 'svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg' with the following command: patch -p0 < ffmpeg_svn_r25887.patch
Could it be possible that this is only working if I patch the r25887-subversion of the ffmpeg sources with the ffmpeg_svn_r25887.patch? If this is true, where can I get the ffmpeg-svn-r25887 sources from?
If not, perhaps there is someone, who can help me anyway.
Thanks,
reinen
roozhou
12th January 2011, 12:08
In my configuration all encoders are disabled. Add --disable-encoders after your ./configure and try again.
Ghitulescu
12th January 2011, 12:21
can this tool be used to "uncrop" h264 video in any way?
for example, I have a cropped video with size 1280X544. I meant to make it uncropped to original size 1280X720.
There's no legal source for 1280x544 files, use the originals you have, they must be PS3 compatible (apart from format/container - use a remuxer to make them compatible to PS3).
roozhou
12th January 2011, 14:23
There's no legal source for 1280x544 files.
You can find 1280x544 Diablo 3 trailers on Blizzard's website, though they are not H.264 but MPEG4 ASP. You can also download sintel 1280x544 H.264 movie. All of them are legal.
Ghitulescu
12th January 2011, 16:55
Sorry I'm not into games and I don't watch movies on my PC. But I still wonder why they put trailers in this non-standard resolution since the game is not 1280x544 and no other game trailer in this resolution exists (according to google, except those in metacafe, youtube and co.).
However the internet is full of "BRRip x264-HDLiTE | 1.77 GB | 1h 43mins | 1280 x 544 | H264 - 2017kbps | AC3" ;) because this resolution is the best compromise for both the uploader and the downloader, reported to video quality and used player.
PS: pay attention to the words original size of 1280x720 vs. I have a cropped source of 1280x544.
b66pak
12th January 2011, 20:06
please, lets keep this topic clean...
_
reinen
12th January 2011, 21:30
In my configuration all encoders are disabled. Add --disable-encoders after your ./configure and try again.
thanks roozhou, your advice helped me to complete the compilation of the patched ffmpeg.
But unfortunately i'm still not able to change the level of an .mkv file with the following command:
ffmpeg -i infile -vcodec copy -acodec copy -vbsf h264_changesps=level=41 outfile.mkv
ffmpeg is giving me the following error message:
FFmpeg version SVN-r26322, Copyright (c) 2000-2011 the FFmpeg developers
built on Jan 12 2011 20:12:12 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoders
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.92. 0 / 52.92. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1.73. 0 / 1.73. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
[matroska,webm @ 0x92123d0] max_analyze_duration reached
[matroska,webm @ 0x92123d0] Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (5000000/208542)
Input #0, matroska,webm, from 'input.mkv':
Duration: 00:49:56.80, start: 0.000000, bitrate: 448 kb/s
Stream #0.0: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Metadata:
title : English (AC3)
Stream #0.2(eng): Subtitle: ass
Output #0, matroska, to 'output.mkv':
Stream #0.0: Video: [0][0][0][0] / 0x0000, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=0-0, 90k tbn, 23.98 tbc
Stream #0.1(eng): Audio: [0][0][0][0] / 0x0000, 48000 Hz, 5.1, 448 kb/s
Metadata:
title : English (AC3)
Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Stream #0.2 -> #0.2
Encoder (codec id 94210) not found for output stream #0.2
does anybody have an idea, what i'm doing wrong?
b66pak
12th January 2011, 22:42
add:
-scodec copy
or if the error remains:
-sn
_
reinen
13th January 2011, 21:58
add:
-scodec copy
or if the error remains:
-sn
_
thanks a lot b66pak, you were right the subtitle stream was the problem. now the re-encoding of my mkv files is working.
I'm sorry to say, but the whole procedure didn't solve my problem of playing mkv's from external device via the media player of my samsung led tv.
I thought changing the h264-level from 5.1 to 4.1 would fix it. I also tried to lower the reference frames from 16 to 4, but without any success.
Is there anybody facing a similar problem?
cheers
reinen
b66pak
13th January 2011, 23:20
do you search the producer site for the latest firmware?...did you contact the support for detalied info on what the firmware can play?...this is going offtopic...i suggest to make a topic in hardware players category...
_
roozhou
18th January 2011, 11:50
New build available.
ADTS parsing is fixed.
b66pak
18th January 2011, 12:49
thanks a lot...
_
7ekno
19th January 2011, 04:54
I also tried to lower the reference frames from 16 to 4
Only way of doing that is via transcoding, changing a number in the header won't affect how many reference frames appear in the physical video stream ....
7ek
LRN
22nd February 2011, 11:12
There's a problem with this fork. At http colon slash slash lrn.no-ip.info/other/wb_100/wb_100.tar.xz you can grab:
ffmpeg.exe - the remuxer i've used.
wb_100.264 - original sequence encoded with x264 without any SAR changes. Recognized as valid h.264 stream.
wb_100_x264_sar.264 - original sequence encoded with x264 with --sar 64:45 option. Recognized as valid h.264 stream.
wb_100_fixed.264 - a result of running `ffmpeg.exe -i wb_100.264 -vcodec copy -vbsf h264_changesps=sar=64:45 wb_100_fixed.264' . It is not regognized as valid h.264 stream
With a hex editor i was able to fix wb_100_fixed.264 by changing 3rd byte from 0x1D to 0x01 (so that it matches wb_100_x264_sar.264 and wb_100.264). I have not bothered to debug the fork to find why this byte changes suddenly.
b66pak
22nd February 2011, 18:49
@LRN have you tested for other arguments too? (fps, level, crop, etc)...
_
LRN
24th February 2011, 13:19
No, i did not.
I did test it with different combinations of sar. For example, it produces valid file when invoked with sar=4:3 (or was it 5:4? i don't remember).
roozhou
24th February 2011, 15:25
My bad. Because 64:45 is not in H264's pre-defined SAR list(while 4:3 is), setting to such SAR value will change the length of SPS. For MP4 style bitstream, there is a 4-byte field before each nal telling the size of the nal. The filter tries to modify it even if the bitstream is AnnexB which has no such bytes.
This bug will be fixed in next release.
P.S. mplayer/ffmpeg's svn server is blocking all IPs from China mainland and Hong Kong. It is now difficult for me to sync to the latest ffmpeg code.
Further worse, sf.net has reset passwords for all users by email and unfortunately my email address registered on sf.net is no longer available. I can neither upload code nor release files.
nm
24th February 2011, 15:47
P.S. mplayer/ffmpeg's svn server is blocking all IPs from China mainland and Hong Kong. It is now difficult for me to sync to the latest ffmpeg code.
Does the same happen with the git repository?
roozhou
24th February 2011, 16:20
Does the same happen with the git repository?
git is OK
bernd_b
24th February 2011, 22:42
I wanted a h264-video being 23.976 fps becoming 24fps:
ffmpeg.exe -i Monk.S07E01_conv.mkv -vcodec copy -acodec copy -vbsf h264_changesps=fps=24000:1000 Monk.S07E01_video.mkv
But mediainfo still indicates me, that only the container has turned into 24 fps, there is still the information of the h264-stream to be 23,976 fps - or am I on the wrong track here:
mediainfo Monk.S07E01_video.mkv
General
Unique ID : 302061734355895109743642512766325178364 (0xE33EF953255B3DC619A6ADC0A4D33FFC)
Complete name : Monk.S07E01_video.mkv
Format : Matroska
File size : 1.34 GiB
Duration : 43mn 7s
Overall bit rate : 4 456 Kbps
Writing application : Lavf52.92.0
Writing library : Lavf52.92.0
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 43mn 7s
Bit rate mode : Variable
Bit rate : 3 919 Kbps
Maximum bit rate : 2 097 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 24.000 fps
Original frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.177
Stream size : 1.18 GiB (88%)
Language : English
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : A_AC3
Duration : 43mn 7s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 138 MiB (10%)
Language : English
roozhou
25th February 2011, 01:40
@bernd_b
Add -muxerfps 24000/1001 to ffmpeg's parameters.
bernd_b
26th February 2011, 20:40
Thanks for your reply - but I am still stuck.
ffmpeg.exe -i Monk.S07E01_conv.mkv -muxerfps 24000/1001 -vcodec copy -acodec copy -vbsf h264_changesps=fps=24000:1000 Monk.S07E01_video.mkv
...
mediainfo Monk.S07E01_video.mkv
...
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
...
Is it a problem that I actually use the windows version with wine under Linux?
Even If I try to transform the video alone I get the input and the output to be 23.976fps:
mediainfo Monk.S07E01_conv.h264
General
Complete name : Monk.S07E01_conv.h264
Format : AVC
Format/Info : Advanced Video Codec
File size : 1.21 GiB
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
...
wine ffmpeg.exe -i Monk.S07E01_conv.h264 -vcodec copy -acodec copy -vbsf h264_changesps=fps=24000:1000 Monk.S07E01_video.h264
...
FFmpeg version SVN-r26292, Copyright (c) 2000-2011 the FFmpeg developers
built on Jan 24 2011 20:49:50 with gcc 4.4.5
configuration:
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.92. 0 / 52.92. 0
libavdevice 52. 2. 3 / 52. 2. 3
libswscale 0.12. 0 / 0.12. 0
[h264 @ 00120470] max_analyze_duration reached
[h264 @ 00120470] Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (48000/2002)
Input #0, h264, from 'Monk.S07E01_conv.h264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1200k tbn, 47.95 tbc
fixme:msvcrt:MSVCRT__sopen_s : pmode 0x01b6 ignored
Output #0, h264, to 'Monk.S07E01_video.h264':
Metadata:
encoder : Lavf52.92.0
Stream #0.0: Video: [0][0][0][0] / 0x0000, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=0-0, 90k tbn, 23.98 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=62102 fps=971 q=-1.0 Lsize= 1264842kB time=2590.11 bitrate=4000.4kbps
video:1264842kB audio:0kB global headers:0kB muxing overhead 0.000000%
mediainfo Monk.S07E01_video.h264
General
Complete name : Monk.S07E01_video.h264
Format : AVC
Format/Info : Advanced Video Codec
File size : 1.21 GiB
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Bit rate mode : Variable
Maximum bit rate : 2 097 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
...
chompy
2nd March 2011, 17:45
Could this tool be used to "repair" DTS of a h264 stream (DTS of AU is not greater than DTS of previous AU), that is, is there a way to remove all DTS, and then correctly regenerate them again?
Greetings
EDIT:
MKV contains only PTS while MP4/FLV require both PTS and DTS. FFmpeg currently lacks the ability to generate DTS based on PTS. I have done some hack on the MKV demuxer so my ffmpeg generates correct DTS from MKV. That's why only my ffmpeg works on MKV.
I've tried H264 -> mkv -> H264 but the resulting file doesn't work, what should I do? Maybe H264 -> mkv -> mp4 -> H264? Or this DTS generation only works on containers but not on raw streams?
roozhou
11th March 2011, 18:35
Could this tool be used to "repair" DTS of a h264 stream (DTS of AU is not greater than DTS of previous AU), that is, is there a way to remove all DTS, and then correctly regenerate them again?
Greetings
EDIT:
I've tried H264 -> mkv -> H264 but the resulting file doesn't work, what should I do? Maybe H264 -> mkv -> mp4 -> H264? Or this DTS generation only works on containers but not on raw streams?
Sorry, my tool only modifies SPS and nothing else in H264 bitstream.
roozhou
11th March 2011, 18:36
New build available.
@LRN
bug fixed.
b66pak
11th March 2011, 19:31
thanks a lot...
_
L.E. is not working for me...a line like this is a deadlock!
ffmpeg -i sample.mkv -vcodec copy -an -sn sample.mp4
_
roozhou
12th March 2011, 08:35
thanks a lot...
_
L.E. is not working for me...a line like this is a deadlock!
ffmpeg -i sample.mkv -vcodec copy -an -sn sample.mp4
_
I have no idea where does this problem come. I was using git branch from videolan. Plz download the new build which I build from the official git branch.
b66pak
12th March 2011, 19:58
now its ok...thanks a lot...
_
sneaker_ger
2nd May 2011, 21:32
How to correctly crop 1088 to 1080?
I tried:
ffmpeg -i 1088.h264 -vcodec copy -an -vbsf h264_changesps=crop=0:8 1080.h264
But mkvmerge still detects 1088 lines and mediainfo says the following about the output:
Width : 1 920 pixels
Height : 1 088 pixels
Original height : 1 080 pixels
Audionut
3rd May 2011, 03:45
You cannot crop without recoding.
sneaker_ger
3rd May 2011, 04:34
You cannot crop without recoding.
I'm certainly not sure, but I don't think it is true for all cases - at least 1088 to 1080 should be possible, because H.264 works with mod16 resolutions internally anyways. I think that there may also be a SPS for the resolution which also needs to be changed and this feature might be missing at the moment. :confused:
Audionut
3rd May 2011, 04:42
at least 1088 to 1080 should be possible, because H.264 works with mod16 resolutions internally anyways.
Blu-ray 1088 is cropped to 1080 by the decoder.
When x264 adds lines to bring content to mod16 for encoding, the decoder crops that information at playback.
If you want to actually remove (crop) lines of resolution from the source. You will have to re-encode.
sneaker_ger
3rd May 2011, 04:49
That's exactly what I want to do: put in the information so that the decoder crops it away at playback.
roozhou
3rd May 2011, 04:56
Blu-ray 1088 is cropped to 1080 by the decoder.
When x264 adds lines to bring content to mod16 for encoding, the decoder crops that information at playback.
If you want to actually remove (crop) lines of resolution from the source. You will have to re-encode.
You are wrong. mod16 is required for all AVC streams internally. All non-mod16 frames are padded to mod16 before reaching the encoder. The SPS contains the cropping information so the decoder can correctly crop the padded lines after the frame is decoded.
@sneaker_ger
Do not trust MediaInfo. All field names starting with "Original" are invented by MediaInfo's author. They actually mean information stored in the bitstream and are only shown when it differs from those in the container.
sneaker_ger
3rd May 2011, 05:03
@sneaker_ger
Do not trust MediaInfo. All field names starting with "Original" are invented by MediaInfo's author. They actually mean information stored in the bitstream and are only shown when it differs from those in the container.
The problem is that I'm already outputting to ES. The information is still in there and the decoders also detect and output 1088 lines. There must be some value for the height (or another value the decoders use to calculate the height with) that we also need to change.
roozhou
3rd May 2011, 05:08
Can you provide a sample? And the full information from MediaInfo?
I tested a few ES files and I have never seen "Original height" after conversion.
sneaker_ger
3rd May 2011, 05:26
Ok, I made a test with a freshly encoded file and it does work on that one. Don't know why the other one doesn't work (old x264 and mkvmerge).
I've put both here - maybe you can figure it out:
https://rapidshare.com/files/460343247/ffmpeg_crop_sample.7z
sneaker_ger
3rd May 2011, 06:14
Update:
It seems to apply to all ES once muxed and later extracted again with mkvtoolnix. ffmpeg changes something, otherwise the "original height" line wouldn't show up in Media Info, but the decoders and mkvmerge continue to assume 1088 lines.
Audionut
3rd May 2011, 07:57
You are wrong.
Really!
mod16 is required for all AVC streams internally.
Where did I say otherwise?
All non-mod16 frames are padded to mod16 before reaching the encoder. The SPS contains the cropping information so the decoder can correctly crop the padded lines after the frame is decoded.
Which is another way of saying, "adds lines to bring content to mod16 for encoding, the decoder crops that information at playback."
Which leads us directly back to the fact that if you want to crop the source file itself, it has to be re-encoded.
Seriously :eek:
sneaker_ger
3rd May 2011, 08:05
Which leads us directly back to the fact that if you want to crop the source file itself, it has to be re-encoded.
Which by your logic leads back to step one because the encoder will pad the video right away yet again. ;)
Audionut
3rd May 2011, 08:25
Which by your logic leads back to step one because the encoder will pad the video right away yet again. ;)
Yeah, if you are cropping to a non-mod16 resolution and using a AVC based encoder :thanks:
Either way, run a search. There are cases where cropping and having the encoder pad the source for encoding can be beneficial.
I'll try one last time, regardless of what you are doing with the source afterwards, if you want to crop (remove information) from the source, it has to be re-encoded. :search::readfaq:
sneaker_ger
3rd May 2011, 08:48
Yeah, if you are cropping to a non-mod16 resolution and using a AVC based encoder :thanks:
cropping to non-mod16: check (1088 to 1080)
AVC: check
What was your point again?
Either way, run a search. There are cases where cropping and having the encoder pad the source for encoding can be beneficial.
The only reason to use this tool in the first place is to not do any re-encoding at all. If I wanted to re-encode I could set everything correctly in x264.
I'll try one last time, regardless of what you are doing with the source afterwards, if you want to crop (remove information) from the source, it has to be re-encoded. :search::readfaq:
I never said or implied I wanted to remove information in a way that makes it impossible to recover nor is there a mutual agreement on the definition of the word "cropping" meaning exactly that.
roozhou
16th May 2011, 07:01
New build available.
1) Fixed crash in ADTS->MKV muxing
2) Fixed removedupheader in h264_chagnesps filter
@sneaker_ger
Your problem can be solved by adding removedupheader to h264_changesps with the latest build.
sneaker_ger
16th May 2011, 07:25
@sneaker_ger
Your problem can be solved by adding removedupheader to h264_changesps with the latest build.
Great, thank you for all your effort!
It worked in a short test, though XhmikosR's ffdshow 3850 ICL build decided to crash when I used removedupheader. But updating to 3853 fixed it.
b66pak
16th May 2011, 19:50
thanks a lot...
_
b66pak
30th May 2011, 20:35
remuxing mkv to m4v return an error on some files...
[ipod @ 016201b0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 1
[ipod @ 016201b0] pts < dts in stream 0
av_interleaved_write_frame(): Invalid argument
_
roozhou
15th August 2011, 12:33
New version available. Fixed a bug on modifying color matrix information.
b66pak
15th August 2011, 18:41
thanks a lot...
_
XMEN3
19th August 2011, 16:22
ffmpeg.exe -i input.mkv -vcodec copy -an -vbsf h264_changesps=cfr/fps=24000:1001 new.mkv
ffmpeg version N-31792-g51fb933, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 11 2011 23:13:25 with gcc 4.5.2
configuration:
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libswscale 2. 0. 0 / 2. 0. 0
[matroska,webm @ 003587c0] max_analyze_duration 5000000 reached at 5024000
[matroska,webm @ 003587c0] Estimating duration from bitrate, this may be inaccur
ate
Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (18
0000/1) -> 1000.00 (1000/1)
Input #0, matroska,webm, from x.mkv
':
Metadata:
title : x Duration: 02:50:07.04, start: 0.000000, bitrate: 448 kb/s
Stream #0.0(ita): Video: h264 (High), yuv420p, 1024x432, SAR 1:1 DAR 64:27,
23.98 fps, 1k tbr, 1k tbn, 180k tbc (default)
Metadata:
title : x
Stream #0.1(ita): Audio: [0][0][0][0] / 0x0000, 48000 Hz, 5.1, 448 kb/s (def
ault)
Metadata:
title : x
Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000
Metadata:
title : x
File 'D:\x_fix.mkv' already exists.
Overwrite ? [y/N] y
Output #0, matroska, to 'D:\x_fix.mkv':
Stream #0.0(ita): Video: [0][0][0][0] / 0x0000, yuv420p, 1024x432 [SAR 1:1 D
AR 64:27], q=0-0, 90k tbn, 1k tbc (default)
Metadata:
title : x
Stream #0.1(eng): Subtitle: [0][0][0][0] / 0x0000
Metadata:
title : x
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.2 -> #0.1
Encoder (codec id 94212) not found for output stream #0.1
roozhou
20th August 2011, 12:56
@XMEN3
Is srt subtitle supported in official ffmpeg build?
b66pak
20th August 2011, 20:31
@XMEN3 add "-scodec copy" to your line...
_
N.B. when you post a report error you MUST provide the line you use it...
_
XMEN3
20th August 2011, 23:04
@XMEN3 add "-scodec copy" to your line...
_
N.B. when you post a report error you MUST provide the line you use it...
_
adding -scodec copy works
ffmpeg.exe -i input.mkv -vcodec copy -scodec copy -an -vbsf h264_changesps=cfr/fps=24000:1001 new.mkv
Why the audio stream is not copied and doesnt give me error msg.
I mean why it doesn't skeep srt like ac3 stream...
tnx
nm
21st August 2011, 10:24
Why the audio stream is not copied and doesnt give me error msg.
Because you used option -an, which makes ffmpeg skip all audio streams.
I mean why it doesn't skeep srt like ac3 stream...
Because you didn't use option -sn
andre2
21st August 2011, 17:06
Thanks roozhou,
is there any chance to crop pixels from left too in a future update?
vmrsss
4th September 2011, 05:39
Thanks for this.
I think I might have bumped into a bug of the tool. Pls look at the screenshots below, taken on fileIN and fileOUT after just running
wine ffmpeg -i fileIN.mkv -an -vcodec copy -vbsf h264_changesps=fps=24:1 fileOUT.mkv
http://localhostr.com/file/hajG22v/orig-1-48-15.png
http://localhostr.com/file/8AxJQ0X/encoded-1-48-15.png
you will notice a blurry stripe at the bottom from the centre to the right border. I have verified this with VLC, mplayer and ffplay.
Cheers.
b66pak
4th September 2011, 17:09
could you test with this line too?
wine ffmpeg -i fileIN.mkv -an -vcodec copy -vbsf h264_changesps=fps=24000:1000 fileOUT.mkv
vmrsss
4th September 2011, 22:43
could you test with this line too?
Travelling for the week. Will do it as soon as i can.
roozhou
5th September 2011, 16:11
@vmrsss
Did mplayer or ffplay show any error messages?
djesteban
5th September 2011, 17:28
Hey roozhou, thanks for this tool, it's a very practical one ;P
I have a question though, but first let me explain what I'm trying to achieve:
I have a h264 file that's running at 25fps and was tagged as interlaced in order to be blu-ray compliant (but in reality, the file is progressive). At 25fps, the file as a 4% PAL speed-up, so with your tool, I was able to change the fps to 23.976.
ffmpeg -i input.h264 -vcodec copy -an -vbsf h264_changesps=fps=24000:1001 output.h264
Now, if I look at my output file in tsMuxeR and in MediaInfo, it is indeed running at 23.976, but it still displays the interlaced and PAL flag (tsMuxeR says resolution (1920:1080i) and MediaInfo says AVC (PAL)).
Is there a way with your tool to change those two flags? So I can change them to the correct progressive and NTSC value?
Thanks in advance,
Cheers
roozhou
6th September 2011, 03:06
@djesteban
Sorry, you cannot change interlaced to progressive. The decoder may not work correctly if you manually change it. Since there is no native 23.976i content, MediaInfo may recognize it as PAL.
djesteban
6th September 2011, 04:04
@djesteban
Sorry, you cannot change interlaced to progressive. The decoder may not work correctly if you manually change it. Since there is no native 23.976i content, MediaInfo may recognize it as PAL.
You can't modify that flag even if it's faked interlaced? Cause like I said, it was originally flagged as interlaced to be Blu-Ray compliant with a fps of 25.
J_Darnley
6th September 2011, 10:04
x264's --fake-interlaced option encodes every frame as progressive using PAFF so that decoders and displays don't try to deinterlace it.
djesteban
6th September 2011, 20:11
x264's --fake-interlaced option encodes every frame as progressive using PAFF so that decoders and displays don't try to deinterlace it.
So technically, in my case if my h264 file was 25 fps fake interlaced, and I change the fps to 23.976, there should be no problem changing the interlaced flag to progressive? Or am I completely wrong?
b66pak
6th September 2011, 20:19
it can't be changed...mux it to mkv 24000/1001fps and it will play progressive (you can do this with the original h264 - no need to change from 25fps to 24000/1001fps - just mux the 25fps as 24000/1001fps!!!)...
_
vmrsss
12th September 2011, 11:17
could you test with this line too?
Back to this, it looks as though this line works. I couldn't check the entire stream, but certainly the blurred stripe on the frame I posted has gone.
edit: let me know if I can be of more help.
bernd_b
12th September 2011, 12:20
it can't be changed...mux it to mkv 24000/1001fps and it will play progressive
I tried this. Yes, mplayer, vlc & Co will play such a file with 23.976fps.
But my LG stand alone BluRay device, e.g., ignores the frame rate given by the mkv-container and treat it like PAL again (meaning the player uses the frame rate given by the video stream itself).
Mediainfo, applied to such files, shows both frame rates: the one of the container and the one of the video stream itself.
TsMuxerR can change the frame rate flag of the video stream using the demux option (so it can be changed without reencoding).
I would appreciate to be able to change the frame rate of the h264-stream with the tool discussed here too.
nm
12th September 2011, 12:40
I would appreciate to be able to change the frame rate of the h264-stream with the tool discussed here too.
roozhou's tool is quite capable of doing what you ask for. Just do it.
bernd_b
12th September 2011, 12:51
O.K, I'll give it a try. So I must have misunderstood the previous discussions ....
nm
12th September 2011, 12:57
O.K, I'll give it a try. So I must have misunderstood the previous discussions ....
Yep. They were about progressive video encoded as interlaced (or "fake-interlaced") and changing the type of coding used, which is not possible without re-encoding. Anyway, changing the framerate should be enough for most players.
bernd_b
17th September 2011, 20:18
Still don't get it.
I have
mediainfo /media/Trek2GB/Case_Histories_25fps/Case_Histories_01.mkv
General
Unique ID : 149330324381653275972509458345966668574 (0x7057F96DE60647CCF7FCF3CE45C38B1E)
Complete name : /media/Trek2GB/Case_Histories_25fps/Case_Histories_01.mkv
Format : Matroska
Format version : Version 2
File size : 2.58 GiB
Duration : 59mn 4s
Overall bit rate : 6 250 Kbps
Encoded date : UTC 2011-08-21 14:24:20
Writing application : mkvmerge v4.9.1 ('Ich will') built on Jul 17 2011 13:09:54
Writing library : Lavf53.4.0
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=12
Codec ID : V_MPEG4/ISO/AVC
Duration : 59mn 4s
Bit rate : 5 742 Kbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Bits/(Pixel*Frame) : 0.148
Stream size : 2.37 GiB (92%)
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : A_AC3
Duration : 59mn 4s
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -1s 360ms
Stream size : 162 MiB (6%)
Language : English
Now I do
wine ffmpeg.exe -i /media/Trek2GB/Case_Histories_25fps/Case_Histories_01.mkv -an -vcodec copy -vbsf h264_changesps=fps=24000:1000 CH_01_23976fps.h264
fixme:ntoskrnl:KeInitializeSpinLock stub: 0x5477a4
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a060, {485e7de8-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a068,): stub
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a080, {485e7de9-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a088,): stub
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a0a0, {485e7dea-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a0a8,): stub
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a0c0, {485e7deb-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a0c8,): stub
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a0e0, {485e7dec-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a0e8,): stub
fixme:advapi:RegisterTraceGuidsW (0x100778a, 0x100a100, {485e7ded-0a80-11d8-ad15-505054503030}, 1, 0x33fe00, (null), (null), 0x100a108,): stub
fixme:win:RegisterDeviceNotificationW (hwnd=0x12de68, filter=0x54e93c,flags=0x00000001) returns a fake device notification handle!
ffmpeg version N-31792-g51fb933, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 11 2011 23:13:25 with gcc 4.5.2
configuration:
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libswscale 2. 0. 0 / 2. 0. 0
[matroska,webm @ 0013eed0] max_analyze_duration 5000000 reached at 5024000
[matroska,webm @ 0013eed0] Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
Input #0, matroska,webm, from '/media/Trek2GB/Case_Histories_25fps/Case_Histories_01.mkv':
Metadata:
ENCODER : Lavf53.4.0
Duration: 00:59:04.92, start: 0.000000, bitrate: 192 kb/s
Stream #0.0: Video: h264 (High), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Stream #0.1(eng): Audio: [0][0][0][0] / 0x0000, 48000 Hz, stereo, 192 kb/s (default)
fixme:msvcrt:MSVCRT__wsopen_s : pmode 0x01b6 ignored
Output #0, h264, to 'CH_01_23976fps_2.h264':
Metadata:
ENCODER : Lavf53.4.0
Stream #0.0: Video: [0][0][0][0] / 0x0000, yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], q=0-0, 90k tbn, 24 tbc (default)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
[h264 @ 00141450] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 122400 >= 37260
[h264 @ 00141450] pts < dts in stream 0
[h264 @ 00141450] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 122400 >= 74430
[h264 @ 00141450] pts < dts in stream 0
[h264 @ 00141450] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 122400 >= 111600
[h264 @ 00141450] pts < dts in stream 0
[h264 @ 00141450] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 122400 >= 115200
[h264 @ 00141450] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 122401 >= 118800
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37560, dts=37621, size=8045
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37580, dts=37622, size=8597
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37720, dts=37781, size=15405
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37740, dts=37782, size=15405
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37880, dts=37941, size=20556
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=37900, dts=37942, size=20364
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=39480, dts=39541, size=12292
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=39500, dts=39542, size=11908
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=39640, dts=39701, size=22204
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=39660, dts=39702, size=22220
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41440, dts=41501, size=33253
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41460, dts=41502, size=29398
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41600, dts=41661, size=27916
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41620, dts=41662, size=27732
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41760, dts=41821, size=20740
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=41780, dts=41822, size=17980
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=42720, dts=42781, size=34172
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=42740, dts=42782, size=34541
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=42880, dts=42921, size=31228
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=42900, dts=42922, size=31228
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=61400, dts=61441, size=62685
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=61560, dts=61621, size=29020
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=61580, dts=61622, size=27916
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=61720, dts=61781, size=29205
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=61740, dts=61782, size=29389
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=88920, dts=88961, size=5837
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89080, dts=89141, size=9148
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89100, dts=89142, size=11356
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89240, dts=89301, size=9702
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89260, dts=89302, size=11724
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89400, dts=89441, size=10437
[h264 @ 00141450] pts < dts in stream 0
[matroska,webm @ 0013eed0] Invalid timestamps stream=0, pts=89420, dts=89442, size=12645
[h264 @ 00141450] pts < dts in stream 0
....
and so on.
The resulting file looks like this:
mediainfo CH_01_23976fps.h264
General
Complete name : CH_01_23976fps.h264
File size : 2.50 GiB
and it is not playable by mplayer or xine.
roozhou
18th September 2011, 09:06
@bernd_b
you need h264_mp4toannexb
bernd_b
19th September 2011, 16:30
I guess I'm too stupid for this?!:
Do I have to make two runs then?
At least:
wine ffmpeg.exe -i Case_Histories_01.mkv -vcodec copy -an -vbsf h264_mp4toannexb CH_01.h264
gives some output:
mediainfo CH_01.h264
General
Complete name : CH_01.h264
Format : AVC
Format/Info : Advanced Video Codec
File size : 2.50 GiB
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=12
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
But the second pass
wine ffmpeg.exe -i CH_01.h264 -vcodec copy -an -vbsf h264_changesps=fps=24000:1000 CH_01_23976.h264
leads to
mediainfo CH_01_23976.h264
General
Complete name : CH_01_23976.h264
File size : 2.50 GiB
again. Or can (and do!) I set two -vbsf option in one run?
b66pak
19th September 2011, 16:51
this is what you need:
ffmpeg -i input.mkv -vbsf h264_changesps=fps=24000:1000 -vcodec copy -an -sn -vbsf h264_mp4toannexb=norepeatheader output.h264
_
bernd_b
19th September 2011, 17:39
Thanks for your reply.
I did
wine /extern08/ffmpeg_sar_x264/ffmpeg.exe -i /media/Trek2GB/Case_Histories_25fps/Case_Histories_01.mkv -vbsf h264_changesps=fps=24000:1000 -vcodec copy -an -sn -vbsf h264_mp4toannexb=norepeatheader Ch_01_23976.h264
But the result is the same.
b66pak
19th September 2011, 18:57
indeed is looks like -vbsf h264_changesps is not working with MBAFF...
_
roozhou
19th September 2011, 19:32
@bernd_b
AFAIK mkv->mkv and then mkv->h264 will work. Of course you can use , to secify filter chain like -vbsf h264_changesps=fps=24000:1000,h264_mp4toannexb, but it will produce broken file as well. I will try to fix this in the following days.
vmrsss
19th September 2011, 20:57
could you test with this line too?
@vmrsss
Did mplayer or ffplay show any error messages?
Sorry to get back to this, but I am not clear about its resolution.
So fps=24:1 does not work, whilst fps=24000:1000 does. What's the general rule? Should I use four digits at the denominator?
bernd_b
10th October 2011, 21:59
@bernd_b
AFAIK mkv->mkv and then mkv->h264 will work.
I did some further tries with other source files. And indeed, basically it works.
E.G. doing
1. ffmpeg.exe -i 25fps.mkv -an -vbsf h264_changesps=fps=24000:1001 -vcodec copy 23976.mkv
2. ffmpeg.exe -i 25fps.mkv -vn -acodec copy 25fps.ac3
3. Converting the audio like discussed here (http://forum.doom9.org/showthread.php?t=155031) to, e.g., 23976.ac3
4. Remuxing: mkvmerge --compression -1:none --default-duration 0:23.976fps 23976.mkv --compression -1:none 23976.ac3 -o 23976fps_ready.mkv
So it seems to me you have to keep the video stream in a mkv-container or do a further run using as proposed here the "-vbsf h264_mp4toannexb=norepeatheader" option.
But with or without this further run: The resulting files will play fine with mplayer, vlc or xine and mediainfo shows the frame rate of the video stream not(!) to be different to the one of the mkv-container.
Still, playing these files with my hardware-players (LG BD350 or xoro 8600CI) I get every few minutes a disturbed picture. I looks like a frame is not loaded completely and then all further frames depending on this one are disturbed too. After some seconds the picture gets clear again and the movie runs fine for some minutes until the next error.
Strangely, demuxing the same source files with TSMuxerR and doing the same steps afterwards leads to error free movies on both - the software players and the hardware players.
SeeMoreDigital
11th October 2011, 21:25
Is there a GUI for this software?
XMEN3
24th October 2011, 17:48
ffmpeg.exe -i input.mkv -vcodec copy -sn -an -vbsf h264_changesps=cfr/fps=24000:1001/sar=1037:1024 output.mkv
I need to revert from square pixel to anamorphic to fix a wrong DAR from 2.37 PAR 1:1 to 2.35
with PAR 1037:1024.
Won't work with sar=1037:1024.
Only custom pixel shape is changed.
Resulting file is still PAR 1:1.
Edit:
Anyway I've tested the resulting stream on Ps3 with ts container and a mark on the display
and works the custom pixel shape even if still square pixel.
The testing video 848x368 (DAR error 2%) with custom pixel shape changed from 1:1
to 1081:1060 appears about 1cm flattened compared to the original with square pixel.
Pixel aspect ratio is still 1:1.
So it works but i don't understand why the pixel aspect ratio is changed to 1:1 starting from anamorphic, when not specified, and is not changed to anamorphic starting from 1:1, when specified.
It changes anamorphic input to square pixel even without specifing sar and keeps only pixel shape.
Why?
D:\>ffmpeg.exe -i input.mkv -vcodec copy -sn -an -vbsf h264_changesps=cfr/fps=24000:1001 out.mkv
ffmpeg version N-31792-g51fb933, Copyright (c) 2000-2011 the FFmpeg developers
...
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/
1001) -> 23.98 (48000/2002)
Input #0, matroska,webm, from 'input.mkv':
Duration: 00:01:00.93, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (High), yuv420p, 848x352 [SAR 264:265 DAR 12:5], SAR 254:255 DAR 6731:2805, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Output #0, matroska, to 'out.mkv':
Stream #0.0: Video: H264 / 0x34363248, yuv420p, 848x352 [SAR 254:255 DAR 6731:2805], q=0-0, 1k tbn, 23.98 tbc (default)
input.mkv:
Codec ID V_MPEG4/ISO/AVC
Resolution 848 x 352
Display resolution 848 x 353 (pixels)
Frame aspect ratio 53:22 = 2.409
Pixel aspect ratio 352:353 = 0.997
Display aspect ratio 848:353 = 2.402
Framerate 23.976 fps
Video bitstream
Bitstream type MPEG-4 Part 10
User data x264 | core 116 r2074 2641b9e
...
User data aq=1:1.00
SPS id 0
Aspect ratio Custom pixel shape (264:265 = 0.996)
PPS id 0 (SPS: 0)
out.mkv:
Anamorphic pixel lost?
The output stream is now square pixel but the custom pixel shape is still there...
Codec ID V_MPEG4/ISO/AVC
Resolution 848 x 352
Frame aspect ratio 53:22 = 2.409
Pixel aspect ratio 1:1 = 1
Display aspect ratio 53:22 = 2.409
Framerate 23.976 fps
Video bitstream
Bitstream type MPEG-4 Part 10
User data x264 | core 116 r2074 2641b9e
...
User data aq=1:1.00
SPS id 0
Aspect ratio Custom pixel shape (264:265 = 0.996)
PPS id 0 (SPS: 0)
Pix
31st October 2011, 22:08
what would be the command line if I wanted to keep everything the same except sar value?
I tried using the default template provided in the OP but I got a 1000fps file, with really weird specs...
ffmpeg -i infile.mkv -vcodec copy -acodec copy -vbsf h264_changesps=sar=x:y outfile.mkv
There's audio, video, subtitle stream in the infile.mkv... I just wanted to change the sar on the video :D
roozhou
3rd November 2011, 02:03
@Pix,
There is a bug in the mkv muxer. Add -muxerfps 24000/1001 to your commandline to set the fps in mkv header.
WCVanHorne
18th December 2011, 02:23
So I must be doing something really dumb. "muxerfps" does not seem to work. My command:
ffmpeg -i title01.mkv -vcodec copy -acodec copy -vbsf h264_changesps=sar=x:y -muxerfps (24000/1001) fix.mkv
Gives the error:
[Eval @ 0022fcf8] Undefined constant or missing '(' in 'muxerfps'
sneaker_ger
18th December 2011, 09:10
Don't use brackets.
WCVanHorne
18th December 2011, 16:12
Whoops, I actually wasn't initially using brackets. I accidentally cut 'n pasted the line where I had tried them due to the error. This command gives the same error:
ffmpeg -i title01.mkv -vcodec copy -acodec copy -vbsf h264_changesps=sar=x:y -muxerfps 24000/1001 fix.mkv
sneaker_ger
18th December 2011, 16:56
My bad, I jumped the gun, that error message is about a missing "(", not an unknown char. I downloaded the newest build and I have the same problem with that.
WCVanHorne
23rd December 2011, 00:41
So is there any way to get this working to correct the SAR in an mkv file? When I run without this flag it creates a file but with a completely wacky frame rate.
wOxxOm
23rd December 2011, 08:19
I second WCVanHorne - I've had to extract timecodes from original mkv with mkvextract and then mux them in using mkvmerge.
sneaker_ger
23rd December 2011, 10:30
Yes, download an older build or work on the raw stream, then mux with mkvmerg, as suggested by wOxxOm.
We'll have to wait for roozhou to take a look at it.
WCVanHorne
23rd December 2011, 14:19
Yes, download an older build ...
Ah.. It was working at some point then. Any particularly recommended build or just work my way back until it starts working?
D9JK
19th January 2012, 19:04
I've been looking for a tool to change only the frame rate setting in my video files, without a time-consuming re-encoding process, and it seems this one could be what I've been looking for. After reading this thread twice and making tests, I'm still having trouble though.
If I've understood correctly, it's not enough to change the "container frame rate" setting: I would also need to change the "video stream frame rate" setting. And if I've also understood correctly, to assign a new value for "video stream frame rate", I would need to use the muxerfps option? But I've been trying various ways, and I can't get it to work (it seems a few others are having the same issue).
Examples:
1) ffmpeg.exe -i Input.mkv -vcodec copy -an -vbsf h264_changesps=fps=4000:1000 Test.mkv
This outputs "Test.mkv", which VLC Player reports to have a frame rate of 4 fps, but which still seems to play at the original 20 fps.
2) ffmpeg.exe -i Input.mkv -vcodec copy -an -vbsf h264_changesps=fps=4000:1000 -muxerfps 4000:1000 Test.mkv
This never finishes, except with an error message stating:
Undefined constant or missing '(' in 'muxerfps'
Incorrect value for muxerfps: muxerfps
Any ideas? Or is there simply a bug that needs to be fixed first? Thanks for any help!
b66pak
19th January 2012, 19:20
for the 1st problem: this line change the fps in the stream BUT the timecodes in the container are preserved...if you want new timecodes use this line to demux to raw and then remux with the fps you want:
ffmpeg -i input.mkv -vcodec copy -an -vbsf h264_changesps=fps=4000:1000 -vbsf h264_mp4toannexb=norepeatheader output.h264
you will get output.h264 at 4fps...
for the 2nd problem: -muxerfps is broken
_
D9JK
19th January 2012, 20:39
Hmm, would the -muxerfps option be of any use for what I'm trying to accomplish here, after all? What is it used for exactly?
sneaker_ger
19th January 2012, 23:04
You're probably better off changing the framerate with mkvmerge (GUI).
D9JK
20th January 2012, 08:53
I use mkvmerge a lot for merging and splitting videos, but I wasn't aware that it can modify the frame rate as well. Thanks for the tip - I'll take a look.
bernd_b
20th January 2012, 12:42
To my knowledge, mkvmerge only changes the given frame rate information of the container, the h.264-Stream itself keeps its frame rate.
At least that's what I see when I examine the files using the tool mediainfo.
And some (software)player use the framerate of the container (hopefully the audio fits then), my hardwareplayer don't.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.