Opened 8 weeks ago
Closed 7 weeks ago
#11197 closed defect (invalid)
Video duration mismatch between macOS and Ubuntu when transcoding with libx264
Reported by: | Mahendran | Owned by: | |
---|---|---|---|
Priority: | important | Component: | ffmpeg |
Version: | unspecified | Keywords: | ffmpeg |
Cc: | Mahendran | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
- What you were trying to accomplish:
I am trying to transcode a video from mp4 format to mp4 with H.264 encoding (libx264) using the same FFmpeg command on both macOS and Ubuntu. I aim to keep the input video's original duration and apply some video filters such as frame rate control (fps=30) and resizing (scale=480:640).
Command:
Copy code
ffmpeg -i samplevideo.mp4 -vf "fps=30,scale=480:640" -c:v libx264 -profile:v baseline -pix_fmt yuvj420p -r 30 -b:v 4294k -an samplevideo_converted.mp4
- The problem you encountered:
On macOS: The converted video has the same duration (6 seconds) as the input video, which is the expected behavior.
On Ubuntu: The converted video has a duration of only 1 second, even though the input video is 6 seconds.
I am expecting both platforms to produce videos with consistent durations.
- The exact command lines you were using:
macOS Command:
ffmpeg -report -v 9 -loglevel 99 -i samplevideo.mp4 -vf "fps=30,scale=480:640" -c:v libx264 -profile:v baseline -pix_fmt yuvj420p -r 30 -b:v 4294k -an mac-samplevideo_converted.mp4
Ubuntu Command:
ffmpeg -v 9 -loglevel 99 -i /tmp/samplevideo.mp4 -vf "fps=30,scale=480:640" -c:v libx264 -profile:v baseline -pix_fmt yuvj420p -r 30 -b:v 4294k -an /tmp/ubuntu-samplevideo_converted.mp4
- Full console output:
The full, uncut console output from both platforms (macOS and Ubuntu) is attached as:
ubuntu-ffmpeg-20240918-190119.log
mac-ffmpeg-20240918-185939.log
- Input file:
Input file: samplevideo.mp4 (duration: 6 seconds)
- Additional Notes:
Is the use of yuvj420p causing issues on one platform but not the other? Should I switch to yuv420p?
Could the redundancy between -r 30 and fps=30 in the -vf filter be contributing to the discrepancy in video durations?
Is there any other platform-specific behavior I should be aware of that might cause this inconsistency?
- Files attached:
Ubuntu and macOS log files
Input video: samplevideo.mp4
Attachments (2)
Change History (5)
by , 8 weeks ago
Attachment: | ubuntu-ffmpeg-20240918-190947.log added |
---|
comment:1 by , 8 weeks ago
Hi.
Do not use ffmpeg 4.2 nowadays.
Test with the same version of FFmpeg and you will probably get the same results.
comment:2 by , 7 weeks ago
I upgraded to ffmpeg 7.x from tar.xz file inside my ubuntu docker. Its working good. Please close this ticket. Thanks very much for the support.
comment:3 by , 7 weeks ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
ffmpeg debug log on ubuntu