jsmpeg
jsmpeg copied to clipboard
Mpeg1 Video bad quality
Dear ... I'm so intersting with this project. I tryed encode video from mp4 - h264 format to Mpeg1-TS by guide. And my video output's quality is very bad. plz helpme, the best way to encode video with better quality?
My file source.zip
My output out.zip
And my ffmpeg command: ffmpeg -i source.mp4 -f mpegts -codec:v mpeg1video -codec:a mp2 -b 0 out.ts
Thank you so much!
There is a -q
option to use fixed quality scale. And if I remember right 1
is the best quality, and 31
the worst.
ffmpeg -i source.mp4 -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 1 out.ts
@WebMaestroFr
Thank you so much!
We tryed your method, it's realy good.
Thank you!
@WebMaestroFr Can you help me once again 👍 !!!!!
-
I download video from youtube with bellow infomation: size: 44MB resolution = 1920x1080 , bitrate = 125k, audio sample rate = 44khz
-
Then i resize video to 640x360 by adobe video encoder. Output: size: 86MB resolution: 640x360 bitrate: 157k audio: 48khz
-
Then in transcode 360p to MPG1-TS by command: ffmpeg -i source.mp4 -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 1 out.ts
Ouput: Size: 62MB resolution: 640x360 bitrate: 384k audio: 48khz
So i think the reason which output size 360P MPEG1-TS larger than Youtube 1080P is bitrate. (It's only my think :) ).
Can you help me the way to reduce video size for MPEG1-TS output but video quality still good?
Thank you so much!
Can you help me the way to reduce video size for MPEG1-TS output but video quality still good?
No. the size of MPEG1 will be much larger for the same quality of other formats like h264.
You're setting -q 1
, which is the best possible quality. Try setting it to 4
or 8
instead. Or set a fixed bitrate for the video instead (eg.: -b:v 1m
for 1mbit/s).
@zz85 is of course right: you can't get the same quality and resolution as H264 or other modern codecs at the same size with MPEG1.
Also, ffmpeg can resize video files, so there's no need to go through adobe video encoder or any other programs:
ffmpeg -i source.mp4 -s 640x360 -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 4 out.ts
There is a
-q
option to use fixed quality scale. And if I remember right1
is the best quality, and31
the worst.ffmpeg -i source.mp4 -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 1 out.ts
Thanks, It's worked!
I just want to add that sometimes i am experiencing a better quality ( less visible blocking artifacts ) with a two pass encoding, for example :
ffmpeg -y -i test.webm -c:v mpeg1video -b:v 1000k -pass 1 -an -f null /dev/null &&
ffmpeg -i test.webm -c:v mpeg1video -b:v 1000k -pass 2 -c:a mp2 -b:a 128k twopass.ts
Frames from Spring ( https://www.blender.org/press/spring-open-movie/ ) I encoded with low 1000k bitrate to underline the difference ( not all scenes or files/bitrate have this improvement ). Upper frame 1 pass, bottom frame 2 pass :