Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
29th May 2017, 14:01 | #201 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
It has to be in numerator and denominator (x:y) format. ie for 23.976fps it'd be:
-vbsf h264_changesps=fps=24000:1001 or for 25fps fps=25:1 etc I'm also pretty sure it only changes the frame rate written to the video stream. To also change it at the container level you'd need to remux it again with an MP4 muxer while setting the same frame rate. If you don't do that, you'll probably find MediaInfo will display two frames rates. Something like this after changing the frame rate from 25fps to 23.976fps: Frame rate : 25.000 FPS Original frame rate : 23.976 (24000/1001) FPS I'm not sure if ffmpeg will change the frame rate with the -r option if it's only copying the video stream. I don't use it much and almost never work with MP4. Someone else will probably know. Last edited by hello_hello; 29th May 2017 at 15:12. |
29th May 2017, 15:15 | #202 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
For example: mkvmerge.exe -o "temp.mkv" --default-duration 0:24000/1001p --fix-bitstream-timing-information 0:1 "input.mp4" ffmpeg -i "temp.mkv" -map 0 -c copy "output.mp4" (using latest ffmpeg and latest mkvtoolnix) If you only want to manipulate H.264 elementary streams you can also try videofan3d's new "h264Modify" tool. (mux and demux using e.g. mp4box) Last edited by sneaker_ger; 29th May 2017 at 15:17. |
|
29th May 2017, 21:36 | #203 | Link | ||
Registered User
Join Date: Oct 2014
Posts: 5
|
Quote:
Quote:
Something strange I noticed, when I play the .mkv in VLC, it says the frame rate is 24.000384 (I used a frame rate of 24). When playing the .mp4, it says the frame rate is 24. |
||
30th May 2017, 03:04 | #204 | Link | ||
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Quote:
Cheers. Quote:
The MKV timecodes are in milliseconds but for 24fps each frame would have a 41.6666667ms duration. If you extract the timecodes from a 24fps MKV they should look like this, with a pattern of 41ms and 42ms durations. 0 42 83 125 167 208 250 292 333 375 I don't know where VLC gets the frame rate from, but I tried the same thing myself and VLC reported 24.000384fps for the MKV, whereas MPC-HC says it's 24fps. sneaker_ger probably understand the intricacies of it all far more than I do, but it wouldn't be anything to worry about. |
||
30th May 2017, 08:01 | #205 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Yes, that should be correct. But if ffmpeg reads/writes from mkv to mp4 there will probably also be jitter. If you want 100% perfect mp4 timestamps you need to remux differently, e.g for an mp4 file with 1 video and 1 audio track:
mkvmerge.exe -o "temp.mkv" --default-duration 0:24000/1001p --fix-bitstream-timing-information 0:1 --no-audio "input.mp4" mkvextract tracks "temp.mkv" "0:temp.264" mp4box -add "temp.264"#fps=24 -add "input.mp4"#audio -new "output.mp4" But as you see it gets complicated quickly. Easiest would probably be to use the mkv. |
29th September 2019, 15:09 | #208 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Probably not with roozhou's tool (old), but ffmpeg has bitstream filters now for HEVC and AVC https://www.ffmpeg.org/ffmpeg-bitstr...c_005fmetadata https://www.ffmpeg.org/ffmpeg-bitstr...4_005fmetadata |
|
3rd October 2020, 12:13 | #209 | Link |
Registered User
Join Date: Jul 2004
Location: Germany
Posts: 53
|
Usage in .bat files?
Hello,
highly appreciated tool! Have used it for quite some time now. I am looking at demuxed .h624 files in a folder I want to change the AR for. I use a .bat file with the following lines: Code:
For %%a in (*.h246) do ffmpeg -i "%%a.h264" -vcodec copy -acodec copy -vbsf h264_changesps=sar=178:125 "new\%%~na.h264" pause But when I start the .bat file, nothing happens. The result displays this only: Code:
E:\path\test>For %%a in (*.h246) do ffmpeg -i "%%a.h264" -vcodec copy -acodec copy -vbsf h264_changesps=sar=178:125 "new\%%~na.h264" %%a was unexpected at this time. E:\path\test>pause Would someone help, please? Thank you!
__________________
"There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy." Shakespeare, Hamlet |
3rd October 2020, 14:44 | #210 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Typos ? You have .h624, .h246, .h264 (*.h246) is probably supposed to be *.h264 Also, the -i entry shouldn't have the extension -i "%%a" Code:
for %%a in (*.h264) do ffmpeg -i "%%a" -vcodec copy -acodec copy -vbsf h264_changesps=sar=178:125 "new\%%~na.h264" pause |
|
15th July 2021, 10:49 | #211 | Link |
Registered User
Join Date: Aug 2019
Posts: 63
|
Hi, everyone! I fed Handbrake with one H264 video (m2ts, 1920x1080) and this open-source transcoder automatically cropped the black bars:
Top: 130 Bottom: 132 How can I get a new m2ts file with identical black bars (132 top and bottom) without re-encoding? What arg should I use? I suppose I have to use "crop" to crop just 2 pixels. Or do I have to modify SAR, DAR or PAR? |
16th July 2021, 11:19 | #212 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
The 'black bars' are hard encoded and form part of the overall 1920x1080 [1.77:1] image.
If you want to remove them and create an 1920x818 (816 would be preferable [2.35:1]) 'image only' video file, or re-centre the image within the black bars, you will need to re-encode...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 16th July 2021 at 11:23. |
7th September 2022, 05:40 | #214 | Link |
Registered User
Join Date: Jan 2009
Posts: 88
|
How to change profile flag from main to high in bitstream (without transcoding)
4d4028 (AVC Constrained Main Level 4.0) or 4d0028 (AVC Main Level 4.0) to 640028 (AVC High Level 4.0) update: I have tried to do this with hex editor, and result file is not valid h264, it looks like this is not possible from specification stand point. Last edited by zn; 7th September 2022 at 18:42. |
16th February 2023, 09:54 | #216 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Nope... Cropping requires re-encoding!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
|
|