[FFmpeg-user] yuv420p vs yuv420p(tv)
Hi folks, I have two versions of the same video and I would like to only keep one. If one is higher quality, I'd obviously want to keep that one. I can't tell tell any difference through casual watching with VLC, so perhaps it does not matter. But anyway, when I run ffmpeg -i on the two, the difference is: < Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 4011 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default) --- > Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 4173 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default) I think I understand the difference between yuv420p(pc) and yuv420p(tv), but here I have yuv420p vs yuv420p(tv). Can someone offer suggestions as to which of these two videos might be the better encoding? Thanks, --George ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] yuv420p vs yuv420p(tv)
On 9/9/19 9:02 AM, Paul B Mahol wrote: On 9/9/19, George R. Welch wrote: Hi folks, I have two versions of the same video and I would like to only keep one. If one is higher quality, I'd obviously want to keep that one. I can't tell tell any difference through casual watching with VLC, so perhaps it does not matter. But anyway, when I run ffmpeg -i on the two, the difference is: < Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 4011 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default) --- > Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 4173 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default) I think I understand the difference between yuv420p(pc) and yuv420p(tv), but here I have yuv420p vs yuv420p(tv). Can someone offer suggestions as to which of these two videos might be the better encoding? You should not trust anyone giving you such answer by comparing only metadata and not actual data. Thank you. I should add that I do know that the only difference between the videos is the encoding scheme. Both were produced from the same master. It's just that I don't know what was done (and can't find out easily). My hope was that ffmpeg's output could offer me a clue about the encodings of the two, from which I could make an educated guess about which one might be better (if either). If one can't tell from this, I'm happy to flip a coin. But does anyone know the difference between yuv420p and yuv420p(tv). As opposed to yuv420p(pc) vs yuv420p(tv), I mean. Best, --George ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Problem concatenating segments
Greetings, I get video files from another division. It is my task to cut out a part of the video, and replace it with a part I create. The videos I receive are h264 with aac audio. It is very strongly hoped that this can be done without re-encoding the parts of the original which we keep. I have been using ffmpeg for cutting up the file I receive, and I've been using the concat demuxer to concatenate the pieces of the original with the part I make. This has worked well (over a dozen times) until recently. In order for concat to work correctly, I take care to make sure the video I make fits the one I am inserting it into (same frame rate, refs, etc). I also take care to only cut the original movie at I frames. I have run into trouble with the most recent job. When I concatenate the parts, there is a slight glitch when it transitions from the part I made to the other. As far as I can tell, the only thing that is different from the previous runs is that the file I am given is encoded with B frames, whereas that had never happened before. An oddity is that when I cut the original video, the timestamp does not begin at zero: $ ffmpeg -i input.mkv -ss [start-time] -t [duration] -c copy part1.mkv [seems to work] Now look at the result: $ ffprobe -hide_banner -show_frames -select_streams v part1.mkv Here is the first frame: [FRAME] media_type=video stream_index=0 key_frame=1 pkt_pts=1968 pkt_pts_time=1.968000 pkt_dts=1968 pkt_dts_time=1.968000 best_effort_timestamp=1968 best_effort_timestamp_time=1.968000 ... I don't understand why the first frame does not start at zero. I have tried adding "-seek_timestamp 1" but it has no effect. When I use concat to place this part after my video, then there is a glitch at the transition. However, if I change the flag to the input: $ ffmpeg -ss [start-time] -i input.mkv -t [duration] -c copy part1.mkv then ffmpeg generates some errors: [matroska @ 0x7ffadb028600] failed to avoid negative pts -58 in stream 1. Try -avoid_negative_ts 1 as a possible workaround. Repeating the command with -avoid -avoid_negative_ts 1 still generates the same message, and the output is the same. Now when I look at the first frame it does start at zero, but there is still a glitch at the transition after concatenating. Does anyone have any suggestions? Is it impossible to concat segments with B frames? Thank you in advance, --George ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Problem concatenating segments
Thank you for the suggestion. As I understand it, filtering and stream copy cannot be used together. Am I wrong? As I said, I must not transcode the pieces of the original video file I am using. If I could transcode the original, this process would be easy. --George On 1/25/20 1:10 PM, Yellow Penguin wrote: Try set-pts=0 as a filter On Fri, Jan 24, 2020 at 5:24 PM George R. Welch wrote: Greetings, I get video files from another division. It is my task to cut out a part of the video, and replace it with a part I create. The videos I receive are h264 with aac audio. It is very strongly hoped that this can be done without re-encoding the parts of the original which we keep. I have been using ffmpeg for cutting up the file I receive, and I've been using the concat demuxer to concatenate the pieces of the original with the part I make. This has worked well (over a dozen times) until recently. In order for concat to work correctly, I take care to make sure the video I make fits the one I am inserting it into (same frame rate, refs, etc). I also take care to only cut the original movie at I frames. I have run into trouble with the most recent job. When I concatenate the parts, there is a slight glitch when it transitions from the part I made to the other. As far as I can tell, the only thing that is different from the previous runs is that the file I am given is encoded with B frames, whereas that had never happened before. An oddity is that when I cut the original video, the timestamp does not begin at zero: $ ffmpeg -i input.mkv -ss [start-time] -t [duration] -c copy part1.mkv [seems to work] Now look at the result: $ ffprobe -hide_banner -show_frames -select_streams v part1.mkv Here is the first frame: [FRAME] media_type=video stream_index=0 key_frame=1 pkt_pts=1968 pkt_pts_time=1.968000 pkt_dts=1968 pkt_dts_time=1.968000 best_effort_timestamp=1968 best_effort_timestamp_time=1.968000 ... I don't understand why the first frame does not start at zero. I have tried adding "-seek_timestamp 1" but it has no effect. When I use concat to place this part after my video, then there is a glitch at the transition. However, if I change the flag to the input: $ ffmpeg -ss [start-time] -i input.mkv -t [duration] -c copy part1.mkv then ffmpeg generates some errors: [matroska @ 0x7ffadb028600] failed to avoid negative pts -58 in stream 1. Try -avoid_negative_ts 1 as a possible workaround. Repeating the command with -avoid -avoid_negative_ts 1 still generates the same message, and the output is the same. Now when I look at the first frame it does start at zero, but there is still a glitch at the transition after concatenating. Does anyone have any suggestions? Is it impossible to concat segments with B frames? Thank you in advance, --George ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Problem concatenating segments
Well, that's a cool suggestion. Will have to wait till tomorrow to try it out, though. My prediction is that it will just move the glitch from the end of my part to the beginning, but I'll find out. Thanks, --George On 1/25/20 1:53 PM, Yellow Penguin wrote: You are correct about that. What happens is that the timestamp is not zero when you cut at a non-keyframe when using stream copy, because the keyframe is at time 0. With B-frames this can lead to negative timestamps, because the keyframe can come after that. This should not be a problem when you only cut at I-frames, but in h264 B-frames can reference arbitrary frames that are outside the region you cut. If this is the case, concatenating after cutting doesn't seem possible without transcoding to me. One thing you could try, but this is really a wild hunch, is to alter the timestamps in the part that you create so they match the offset in the part you cut from the original. On Sat, Jan 25, 2020 at 8:23 PM George R. Welch wrote: Thank you for the suggestion. As I understand it, filtering and stream copy cannot be used together. Am I wrong? As I said, I must not transcode the pieces of the original video file I am using. If I could transcode the original, this process would be easy. --George On 1/25/20 1:10 PM, Yellow Penguin wrote: Try set-pts=0 as a filter On Fri, Jan 24, 2020 at 5:24 PM George R. Welch wrote: Greetings, I get video files from another division. It is my task to cut out a part of the video, and replace it with a part I create. The videos I receive are h264 with aac audio. It is very strongly hoped that this can be done without re-encoding the parts of the original which we keep. I have been using ffmpeg for cutting up the file I receive, and I've been using the concat demuxer to concatenate the pieces of the original with the part I make. This has worked well (over a dozen times) until recently. In order for concat to work correctly, I take care to make sure the video I make fits the one I am inserting it into (same frame rate, refs, etc). I also take care to only cut the original movie at I frames. I have run into trouble with the most recent job. When I concatenate the parts, there is a slight glitch when it transitions from the part I made to the other. As far as I can tell, the only thing that is different from the previous runs is that the file I am given is encoded with B frames, whereas that had never happened before. An oddity is that when I cut the original video, the timestamp does not begin at zero: $ ffmpeg -i input.mkv -ss [start-time] -t [duration] -c copy part1.mkv [seems to work] Now look at the result: $ ffprobe -hide_banner -show_frames -select_streams v part1.mkv Here is the first frame: [FRAME] media_type=video stream_index=0 key_frame=1 pkt_pts=1968 pkt_pts_time=1.968000 pkt_dts=1968 pkt_dts_time=1.968000 best_effort_timestamp=1968 best_effort_timestamp_time=1.968000 ... I don't understand why the first frame does not start at zero. I have tried adding "-seek_timestamp 1" but it has no effect. When I use concat to place this part after my video, then there is a glitch at the transition. However, if I change the flag to the input: $ ffmpeg -ss [start-time] -i input.mkv -t [duration] -c copy part1.mkv then ffmpeg generates some errors: [matroska @ 0x7ffadb028600] failed to avoid negative pts -58 in stream 1. Try -avoid_negative_ts 1 as a possible workaround. Repeating the command with -avoid -avoid_negative_ts 1 still generates the same message, and the output is the same. Now when I look at the first frame it does start at zero, but there is still a glitch at the transition after concatenating. Does anyone have any suggestions? Is it impossible to concat segments with B frames? Thank you in advance, --George ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ff